|
关于WaitForSingleObject的问题,求教!
[复制链接]
困扰了整整一天的问题,请各位大大帮帮忙!
各位大大,小弟新人,今天因为这个问题困扰了一个了,请各位大大帮帮忙!
驱动程序中明明已经调用了
IoCompleteRequest(Irp, IO_NO_INCREMENT);
为什么在应用程序中还是等不到信号??
----------------------------------应用程序中--------------------------------------
OVERLAPPED DeviceIoOverlapped;
.........
DeviceIoOverlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
.........
DriverHandle = CreateFile("\\\\.\\wall",
GENERIC_READ|GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
0);
........
if (!DeviceIoControl(DriverHandle,
(DWORD)IOCTL_OSR_SETSHAREMEM,
0,
0,
&ShareBuffer,
sizeof(ShareBuffer),
&index,
&DeviceIoOverlapped) )
{
if(WaitForSingleObject(DeviceIoOverlapped.hEvent,10000)==WAIT_TIMEOUT){
printf("time out\n"); //为什么总返回time out??
}else{
printf("success....!!\n");
}
..............
----------------------------------应用程序中--------------------------------------
|
|