热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

KernelLibIoControl函数学习

在微软自带的16650驱动中出现了如下函数。if(!KernelLibIoControl(m_hIsrHandler,IOCTL_ISR16550_INFO,pIsrAddres

在微软自带的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.


推荐阅读
author-avatar
Echocc07
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有