Can anybody tell me why this won't create/write to a new/existing file:


stdcall [CreateFile], DB_File, GENERIC_WRITE, 0, 0, OPEN_ALWAYS, 0
mov [DB_Handle], eax
stdcall [WriteFile], [DB_Handle], Add, Add._size, Bytes.Tx, 0
stdcall [CloseHandle], [DB_Handle]




GENERIC_WRITE = 40000000h
OPEN_ALWAYS = 4

Thanks
Posted on 2001-10-31 00:13:25 by eet_1024
I use this:

call CreateFileA, offset FileName, GENERIC_READ or GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0

maybe your problem is you're not using OFFSET or addr FileName

lety me know bye.
Posted on 2001-10-31 00:49:31 by Bit7
Looking better, seems you're missing the last parameter (0) or the attribute param.

bye
Posted on 2001-10-31 00:52:03 by Bit7
Well I be a SOB. I ment to put a 0 in for FILE_ATTRIBUTE_NORMAL. I'm using FAsm, so var names equate to addresses / offsets. Thanks a bunch! ;)
Posted on 2001-10-31 01:06:26 by eet_1024