SetFilePointer PROC   (MS-Windows)

   Moves the file pointer of an open file.
   Returns the new value of the 64-bit file position in ( pDistanceHi : EAX ).
   If (pDistanceHi is null and EAX = -1), the function failed; but if (pDistanceHi is not null and EAX = -1), you must invoke GetLastError and see if it returns a value other than NO_ERROR since a (non-null pDistanceHi : EAX=-1) may be a valid file position value.


SetFilePointer PROTO,
    fileHandle:DWORD,       ; file handle
    nDistanceLo:SDWORD,     ; bytes to move pointer
    pDistanceHi:PTR SDWORD, ; ptr to bytes to move, high
    moveMethod:DWORD        ; starting point

Returns: (SDWORD) EAX = Signed low 32 bits of the new file pointer.
                        If pDistanceHi is not null, it contains
                        the high 32 bits of the 64-bit new position.

                        If EAX=-1, check for failure, see above.

Argument Win Type MASM Type Description
fileHandle HANDLE DWORD  Handle to the file whose file pointer is to be moved.
 The handle must have GENERIC_READ or GENERIC_WRITE access.
nDistanceLo LONG SDWORD  Low order 32-bits of a signed value that specifies the number of bytes to move the file pointer (positive for forward, negative for backward).
pDistanceHi PLONG PTR SDWORD  Pointer to the high-order 32 bits of the signed 64-bit distance to move.
 NULL if you do not need the high-order 32 bits.

 Also receives the high-order SDWORD of the new value of the file pointer.
moveMethod DWORD DWORD  Starting point for the move:
· FILE_BEGIN - zero (beginning of file).
· FILE_CURRENT - from current position.
· FILE_END - from current end-of-file.

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)