KernelLibIoControl函数学习

本文介绍了微软16650驱动中KernelLibIoControl函数的作用及参数说明,该函数用于从驱动程序与中断处理器进行通信。文章详细解释了各参数的意义,并指出成功执行返回TRUE,失败则返回FALSE。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在微软自带的16650驱动中出现了如下函数。

if (!KernelLibIoControl(m_hIsrHandler, IOCTL_ISR16550_INFO, pIsrAddress, dwBlockSize, NULL, 0, NULL)) {
                DEBUGMSG(ZONE_ERROR,(TEXT("SL_InstallSoftwareISR: KernelLibIoControl call failed./r/n")));
                KernelLibIoControl(m_hIsrHandler, IOCTL_ISR16550_UNLOAD, (LPVOID)&m_pIsrInfoVirt, sizeof(ISR16550_INFO), NULL, 0, NULL);
                return FALSE;
            }

 

现在来看看PB帮助吧。

 

This function is called from a driver to communicate with an interrupt handler.

BOOL KernelLibIoControl(
  HANDLE hModule,
  DWORD dwIoControlCode,
  LPVOID lpInBuf,
  DWORD nInBufSize,
  LPVOID lpOutBuf,
  DWORD nOutBufSize,
  LPDWORD lpBytesReturned
);
Parameters
hModule
[in] Handle returned from the LoadIntChainHandler function.
dwIoControlCode
[in] OEM or ISV specified IOCTL.
lpInBuf
[in] Long pointer to a buffer that contains the data required to perform the operation. This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not require input data.
nInBufSize
[in] Size, in bytes, of the buffer pointed to by lpInBuffer.
lpOutBuf
[out] Long pointer to a buffer that receives the operation's output data. This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not produce output data.
nOutBufSize
[in] Size, in bytes, of the buffer pointed to by lpOutBuffer.
lpBytesReturned
[out] Long pointer to a variable that receives the size, in bytes, of the data stored in the buffer pointed to by lpOutBuffer. The lpBytesReturned parameter cannot be NULL.
Return Values

If the function succeeds, then TRUE is returned; otherwise, FALSE is returned.

To get extended error information, call the GetLastError function.

Remarks

KernelLibIoControl calls the IOControl function that is implemented in the ISR handler.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值