Hello,

what does the file handle do ?

; Create file and get file handle
INVOKE CreateFile,
ADDR filename, GENERIC_WRITE, DO_NOT_SHARE, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0
mov fileHandle,eax ; save file handle

-flip
Posted on 2010-08-11 18:11:06 by l flipboi l
You use it in subsequent calls to refer to the file you opened or created. Take it as a key to your file.
Posted on 2010-08-11 18:32:21 by JimmyClif
Once apon a time the handles provided by the OS were in fact memory pointers to internal data structures, now they are for all intents and purposes just a number which has special meaning to the OS.

The file handle is an identifier which the operating system has associated with, in this case, an open file on disk - it must be provided in subsequent calls to , say, ReadFile or WriteFile, and when you're ready to close the file, you will call CloseHandle, passing it the filehandle once more. After that, your handle is no longer valid.

Posted on 2010-08-11 18:36:20 by Homer
Thanks for the info guys!
Posted on 2010-08-11 22:25:55 by l flipboi l