首页
社区
课程
招聘
[求助]WriteFile的参数问题?
发表于: 2007-9-12 18:33 8872

[求助]WriteFile的参数问题?

2007-9-12 18:33
8872
BOOL WriteFile(

    HANDLE hFile,        // handle to file to write to
    LPCVOID lpBuffer,        // pointer to data to write to file
    DWORD nNumberOfBytesToWrite,        // number of bytes to write
    LPDWORD lpNumberOfBytesWritten,        // pointer to number of bytes written
    LPOVERLAPPED lpOverlapped         // pointer to structure needed for overlapped I/O
   );
参数:lpNumberOfBytesWritten的MSDN解释:
lpNumberOfBytesWritten
Pointer to the number of bytes written by this function call. WriteFile sets this value to zero before doing any work or error checking.
Windows NT: If lpOverlapped is NULL, lpNumberOfBytesWritten cannot be NULL.

Windows NT: If lpOverlapped is not NULL, lpNumberOfBytesWritten can be NULL. If this is an overlapped write operation, you can get the number of bytes written by calling GetOverlappedResult. If hFile is associated with an I/O completion port, you can get the number of bytes written by calling GetQueuedCompletionStatus.

Windows 95 and Windows 98: This parameter cannot be NULL
是不是如果lpOverlapped 参数为0,lpNumberOfBytesWritten就不可以为0,但是为什么又说WriteFile sets this value to zero before doing any work or error checking?(汗,估计我的外语有问题)

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 193
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
搞错了,一个是指针所指的值,一个是指针本身!
2007-9-12 18:52
0
游客
登录 | 注册 方可回帖
返回
//