阅读:1026回复:0
KEvent的菜问题
使用KEvent和应用程序通信,创建KEvent一个实例后,不管在哪里delete,驱动程序就是卸载不了,请教这是什么问题?
谢谢 程序和ds的help的代码一样的 // sample class declaration class MyDevice : public KDevice { public: MyDevice(); VOID EventHandler(void); KEvent * m_pEventToSignal; }; // Handler for Device Control requests NTSTATUS MyDevice::DeviceControl(KIrp I) { switch (I.IoctlCode()) { case MYDEVICE_IOCTL_SETUP_SIGNAL: // app passes event handle in input buffer HANDLE hEvent = *(HANDLE*)I.IoctlBuffer(); m_pEventToSignal = new(NonPagedPool) KEvent(hEvent); NTSTATUS status = (m_pEventToSignal != NULL) : STATUS_SUCCESS ? STATUS_INSUFFICIENT_RESOURCES; return I.Complete(status); break; . . . } } |
|