Just a small question to SetFilePointer:

I'm loading a small data block from the begin of a file (CreateFile, ReadFile).
The block contains a offset, where another block is located. Is it faster to do:

SetFilePointer(hfFont, dwOffset, NULL, FILE_BEGIN)


calc difference dwDelta = dwOffset - dwCurrent
SetFilePointer(hfFont, dwDelta, NULL, FILE_CURRENT)

maybe windows is as smart to do the second step alone?
Posted on 2002-05-02 04:03:55 by beaster

I would be surprised if you could clock the difference between either approach, it is finally only a simple integer calculation and I doubt the the internal code in the API could mess it up that bad that you would notice the difference.


Posted on 2002-05-02 07:20:28 by hutch--