Hello could you look at my code, and say me, why it chrashs ?


.data
log DB "C:\tmep.txt", 0
File DWORD 0

.code
INVOKE CreateFile, ADDR log, GENERIC_WRITE, NULL, CREATE_NEW, NULL, FILE_ATTRIBUTE_NORMAL, NULL
.IF EAX != INVALID_HANDLE_VALUE MOV File, EAX
INVOKE CloseHandle, File
.ENDIF

Regard FF

Red,

I just formatted your code to make it easier to read. Get used to the tags to set you code as a block.

yourcode


Use CODE in place of "tagname" inside the square brackets.

Regards,

hutch@movsd.com
Posted on 2003-04-21 08:52:40 by Forginforcer
Afternoon, Forginforcer.



invoke CreateFile, ADDR log, GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL

?

Cheers,
Scronty
Posted on 2003-04-21 09:01:47 by Scronty
alright ?
Posted on 2003-04-21 09:04:13 by Forginforcer
i had similar problem, the function crashed due to direction flag was set, If you use a descending rep command or call function in nonstandard library try to put additional CLD befor call
Posted on 2003-04-23 13:20:17 by _Servil_
The problem is that you're passing 1 for the security attributes (which should be 0 or a pointer to a SECURITY_ATTRIBUTES structure), and 0 for the creation disposition (which should be in the range 1-5)
Posted on 2003-04-23 13:34:20 by Sephiroth3
Should be :
INVOKE CreateFile, ADDR log, GENERIC_WRITE, NULL,  NULL, CREATE_NEW, \

FILE_ATTRIBUTE_NORMAL, NULL
Posted on 2003-04-23 13:42:20 by donkey
All right ! Thanks !
Posted on 2003-04-23 13:55:33 by Forginforcer