KernelIoControl

This function provides the kernel with a generic I/O control for carrying out I/O operations.

该函数为内核提供执行IO操作的通用IO控制

 Syntax

 

BOOL KernelIoControl(

  DWORD dwIoControlCode,

  LPVOID lpInBuf,

  DWORD nInBufSize,

  LPVOID lpOutBuf,

  DWORD nOutBufSize,

  LPDWORD lpBytesReturned

);

 Parameters

参数

dwIoControlCode

[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

Header

pkfuncs.h

Library

coredll.lib

Windows Embedded CE

Windows CE 2.10 and later

Windows Mobile

Windows Mobile Version 5.0 and later

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值