CreateFile参数不对,应改为
invoke CreateFile,addr szLogFile,GENERIC_WRITE,FILE_SHARE_READ,\
0,[COLOR=red]OPEN_EXISTING[/color],FILE_ATTRIBUTE_NORMAL,0;打开文件
参见下面的说明
dwCreationDisposition
Specifies which action to take on files that exist, and which action to take when files do not exist.
For more information about this parameter, see the remarks section. This parameter must be one of the
following values
指定当文件存在或者不存在时如何动作。关于这个参数更多的信息,参考批注部分。这个参数必须是一个或多个
下列值。
VALUE(值) Neaning(含义)
CREATE_NEW Creates a new file. The function fails if the specified file already exists
创建一个新文件. 如果该文件已经存在函数则会失败.
CREATE_ALWAYS Creates a new file. If the file exsts, the function overwrites the file and
clears the existing attributes.
创建一个新文件.如果该文件已经存在,函数将覆盖已存在的文件并清除已存在的文件属性
OPEN_EXISTING Opens the file. The function fails if the file does not exist.
See the Remarks section for a discussion of why you should use the
OPEN_EXISTING flag if you are using the CreateFile function for devices,
including the console.
打开一个文件,如果文件不存在函数将会失败.
如查你使用CreateFile函数为设备装载控制台.请查看批注中的"为什么使用
OPEN_EXISTING标志"的部分.
OPEN_ALWAYS Opens the file, if it exsts. If the file does not exist, the function creates
the file as if dwCreationDisposition were CREATE_NEW.
如果文件存在,打开文件. 如果文件不存在,并且参数中有CREATE_NEW标志,则创建文件.
TRUNCATE_EXISTING Opens the file. Once opened, the file is truncated so that its size is zero
bytes The calling process must open the file with at least GENERIC_WRITE access.
The function fails if the file does not exist.
打开一个文件,每次打开,文件将被截至0字节.调用进程必须用GENERIC_WRITE访问模式打
开文件.如果文件不存在则函数就会失败.