Hello,
I have some weird problems with SetFilePointer.
Let's there is file with this data at the beginning of the file
{ 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A};
hSomeObject = CreateFileA(chSomeFile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
SetFilePointer(hSomeObject, 2, 0, FILE_BEGIN);
ReadFile(hSomeObject, chSomeBuffer, 0xA0, &dwBytesRead, 0);
So the values in chSomeBuffer should be like {0x3A, 0x4A, 0x5A ...}
But the pointer is set to 4 instead of 2. So it looks like {0x5A, 0x6A, 0x7A ...}
I checked the call in the debugger. And yes it's called with 2 as lDistanceToMove.
So my questions is: What the heck?
Not forget to mention the SetFilePointer(hSomeObject, 0, 0, FILE_BEGIN); gives me requested output (But that's also strange as there are still 2 bytes skipped at the beginning).