Offset is bigger than the size of data to read in ReadFile #336
-
Hello, i have a new problem with my dokan-dotnet based software. I have no idea how this is possible but when opening files, rarely, my offset will end up being bigger than the data i have to read, leaving me with a negative value affected to bytesRead, and of course, throwing an error on my call to Array.copy. Here is a gist with my readFile function, i have no idea if any other parts of my code would help so don't hesitate to ask me for more : https://gist.github.com/Thomas-Giaroli/6c1553cce846ff2c5c43b2a4a7b1d026 Thanks already :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The offset is the start where to read and the length is how much data from this offset to read. You cannot end up with a negative value. Please look at the native memfs implementation. |
Beta Was this translation helpful? Give feedback.
Oh I see. In this case, there is a specific error code. You should be able to find it in the memfs sample code.