Hi
what make this save this the offset from the end of file?
.data
ovrOffset OVERLAPPED <>
.code
mov ovrOffset.loffset,FUNC(filesize,esi)
can anywhere help me in normal syntax without macro?
thanks in forward
ragdog
most likely:
invoke filesize,esi
mov ovrOffset.loffset,eax
Thanks for you reply
but what exactly makes this function
invoke filesize,esi
mov ovrOffset.loffset,eax
I need this for my writefile function
For overlapped-IO, you provide an OVERLAPPED struct..
within that struct, the 'offset' indicates where the data should be read-from or written-to.
So, in the case of writing, if you set it to the current file-size, the data will be written to the end of the file (appended.)
I'm guessing setting offset to -1 will also cause it to append (so you shouldn't need to get filesize), but you'll have to test to see if it actually does.
But, since you're the one saving the file, I presume you'll already know how much you've written, so you'll already know the offset without getting the filesize each time.
ok thanks for this info :U
You can do this...
invoke SetFilePointer, SomeiHandle, 86, NULL, FILE_BEGIN
Which would cause the write to be done 86 bytes from the start of the file.
Also, if you intend to append data to the end of a file, you can use :
invoke SetFilePointer, SomeHandle, 0, NULL, FILE_END
-- Paul