-
March 1st, 2005, 03:10 PM
#1
Please help with assembling parameters for SetFilePointer
Hi all,
I'm trying to write my own function setFilePtr():
Code:
__int64 setFilePtr(HANDLE hFile, __int64 lDistanceToMove, DWORD dwMoveMethod)
{
LONG highOrder = ...
LONG lowOrder = ...
lowOrder = SetFilePointer (hFile, lowOrder, &highOrder, dwMoveMethod);
if (lowOrder == 0xFFFFFFFF && GetLastError() != NO_ERROR)
{
highOrder = -1;
}
return highOrder;
}
As you may have guessed, it's just wrapper for SetFilePointer() made in order to be able to simply pass 64bit offset to it. But I don't know how to make low-order and high-order values from the given 64bit integer. I tried some byte shifting, but it didn't seem to work...
Thank you
The sun is the same in the relative way, but you're older
Shorter of breath and one day closer to death
- Roger Waters, 1973
-
March 1st, 2005, 03:19 PM
#2
Re: Please help with assembling parameters for SetFilePointer
I'd assume you could just adapt the LOWORD and HIWORD macros
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|