阅读:1284回复:3
错误返回码
我用NT 驱动加载模式启动一个驱动,
但当我用CONTROLSERVICE()停止它的时候, 返回错误代码997, 查MSDN是ERROR_IO_PENDING. 但.. 我的哪个驱动是什么也没做呀. 看名字估计是IO 访问未完成, 谁知道引起这种错误是什么? |
|
|
沙发#
发布于:2002-12-01 10:59
可能没有写Unload例程吧。再有就是可能还有程序正打开设备句柄或没调IoCompleteRequest.
|
|
|
板凳#
发布于:2002-12-01 16:12
UNLOAD() 已经DISPATCH.
IRP 已经完成请求. |
|
|
地板#
发布于:2002-12-02 09:14
具体错误可能需要你去确定,这段CODE参考一下:
HANDLE IntDeviceHdle = INVALID_HANDLE_VALUE; DWORD dwError; UINT uStatus = 0; DWORD dwByteCount; DWORD dwIndex = 0; BOOL bRet = TRUE; GetArrayInteruptEvent(ArrayHdleEvent, &nbEventHdl); // Initialize interrupt register with the current value. while(TRUE) { if (IntDeviceHdle != INVALID_HANDLE_VALUE) { bRet = DeviceIoControl( (HANDLE)IntDeviceHdle, (DWORD) IOCTL_WAIT_ON_DEVICE_EVENT, NULL, 0, interInfo[dwIndex].byInterruptData, sizeof(BYTE)*PACKET_SIZE, &dwError, &interInfo[dwIndex].overlapped); } ////////////////////////////// if ((bRet) || (!bRet && GetLastError()==ERROR_IO_PENDING)) { dwIndex = WaitForMultipleObjects(nbEventHdl, ArrayHdleEvent, FALSE, INFINITE); // the event came from a device if ((dwIndex >= 0) & (dwIndex < nbEventHdl-1)) { IntDeviceHdle = GetInterruptDeviceHdle(ArrayHdleEvent[dwIndex]); if (IntDeviceHdle != INVALID_HANDLE_VALUE) { GetOverlappedResult(IntDeviceHdle, &interInfo[dwIndex].overlapped, &dwByteCount, FALSE); Debugs(temp, \"We received an interrupt from 0x%lX\", IntDeviceHdle); ExecuteActionOnInterrupt(IntDeviceHdle, interInfo[dwIndex].byInterruptData); } |
|
|