ERROR_PARAM on IOCTL_WAIT_ON_DEVICE_EVENT code

Hi all,

I am trying to get USB interrupt event by using
IOCTL_WAIT_ON_DEVICE_EVENT code. The flow is like below.

// open the “overlapped” device handle - used for button monitoring
hDevice = CreateFile( “\\.\Usbscan0”, // device name
GENERIC_READ | GENERIC_WRITE, // open for read & write
0, // no sharing
NULL, // default security
OPEN_EXISTING, // must exist
FILE_FLAG_OVERLAPPED, // overlapped mode
NULL ); // no template
if( hDevice == INVALID_HANDLE_VALUE ){
return;
}
memset( &bd, 0, sizeof(ButtonData) );
bd.ol.hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
bRet = DeviceIoControl( hDevice, // dev handle
IOCTL_WAIT_ON_DEVICE_EVENT, // IOCTL code
NULL, // no input data
0, // input data size
bd.bIntData, // output data
8, // output data size
&lpBytesReturned, // bytes returned
&(bd.ol) ); // overlapped struct

result = GetLastError();
// result is ERROR_PARAM(87)

But at last I get ERROR_PARAM(87) on DeviceIoControl of
IOCTL_WAIT_ON_DEVICE_EVENT. I don’t know why.
What is wrong ?

Thanks,
Yasushi Inaba,
1/19/2001


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com