This function provides the kernel with a generic I/O control for carrying out I/O operations.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
该函数为内核提供执行IO操作的通用IO控制
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> Syntax
BOOL KernelIoControl(
DWORD dwIoControlCode,
LPVOID lpInBuf,
DWORD nInBufSize,
LPVOID lpOutBuf,
DWORD nOutBufSize,
LPDWORD lpBytesReturned
);
Parameters
参数
[in] I/O control code, which should support the OAL I/O controls
【输入】IO控制代码,支持OAL级的IO控制
lpInBuf
[in] Pointer to a buffer that contains the data required to perform the operation.
Set to NULL if the dwIoControlCode parameter specifies an operation that does not require input data.
【输入】指向一个缓冲区,其包含执行操作所必须的数据。设置dwIOControlCode参数为NULL指定操作为不需要输入数据。
nInBufSize
[in] Size, in bytes, of the buffer pointed to by lpInBuf.
【输入】lpInBuf参数指定的缓冲区的大小,以字节为单位。
lpOutBuf
[out] Pointer to a buffer that receives the output data for the operation.
Set to NULL if the dwIoControlCode parameter specifies an operation that does not produce output data.
【输出】指向输出缓冲区,用来接收操作数据
如果指定操作没有输出数据,则设置该参数为NULL
nOutBufSize
[in] Size, in bytes, of the buffer pointed to by lpOutBuf.
【输入】lpOutBuf参数指定输出缓冲区的大小,以字节为单位。
lpBytesReturned
[in] Long pointer to a variable that receives the size, in bytes, of the data stored in the buffer pointed to by lpOutBuf. Even when an operation produces no output data, and lpOutBuf is NULL, the KernelIoControl function uses the variable pointed to by lpBytesReturned. After such an operation, the value of the variable has no meaning.
【输入】指向一个变量,该变量用于存储由lpOutBuf指向的缓冲区存储数据的大小,已字节为单位。即使一个操作没有产生输出数据,lpOutBuf是NULL,kerneliocontrol函数使用lpBytesReturned参数指向的这个变量。这中操作后,这个变量的值没有任何意义。
Return Value
TRUE indicates success. FALSE indicates failure.
TRUE表示成功,FALSE表示失败。
Remarks
备注
An IOCTL call has this prototype:
BOOL KernelIOControl(UINT32 code, VOID* pInpBuffer, UINT32 inpSize, VOID* pOutBuffer, UINT32 outSize, UINT32 *pOutSize);
Assuming the caller passes a valid pOutSize pointer:
1. If an IOCTL will never return data in *pOutBuffer, then set *pOutSize = 0 regardless of success or failure.
如果IOCTL不返回数据,无论成功或者失败将pOutSize设为0.
2. If an IOCTL caller passes in otherwise correct parameters with a buffer that is too small (as determined by examining nOutSize), we will fail with ERROR_INSUFFICIENT_BUFFER and return *pOutSize = minimum buffer size necessary for success.
不太好翻译
3. If an IOCTL caller passes in correct parameters with a sufficient buffer (nOutSize >= necessary size), we will return *pOutSize = # of bytes in the buffer that we actually filled upon completion (regardless of success or failure).
Requirements
pkfuncs.h | |
Library | coredll.lib |
Windows Embedded CE | Windows CE 2.10 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
文章评论(0条评论)
登录后参与讨论