Yeah, I’m saying that memory reference at address 0x10 is probably just a
field offset from a structure pointer whose value is zero, which was most
likely the value of Irp->MdlAddress.
If you look at the Win32 definition of DeviceControl:
BOOL DeviceIoControl(
HANDLE hDevice, // handle to device
DWORD dwIoControlCode, // operation control code
LPVOID lpInBuffer, // input data buffer
DWORD nInBufferSize, // size of input data buffer
LPVOID lpOutBuffer, // output data buffer
DWORD nOutBufferSize, // size of output data buffer
LPDWORD lpBytesReturned, // byte count
LPOVERLAPPED lpOverlapped // overlapped information
);
My guess is that your application is specifying a zero length nOutBufferSize
and a NULL lpOutBuffer for your write operation. This is the logical thing
to do, but in your case it is wrong! The data is in
Irp->AssociatedIrp.SystemBuffer, as that is where the IoManager puts the
buffer for lpInBuffer for your IOCTL (and it isn’t an MDL).
Consequently, the Irp->MdlAddress is going to be zero. If your application
simply uses lpOutBuffer rather than lpInBuffer for the write operation, and
if you fix up METHOD_IN_DIRECT to be METHOD_OUT_DIRECT (or perhaps its ok,
who knows, it probably doesn’t matter,) Irp->MdlAddress will be non zero.
At any rate, in your write processing if Irp->MdlAddress is zero, return an
error! Don’t just blindly walk off the edge of the universe
IRQL_NOT_LESS_OR_EQUAL is generally a bad pointer reference at raised IRQL,
like with a spinlock held.
-----Original Message-----
From: Prekupec Boris [mailto:boris.prekupec@vz.tel.hr]
Sent: Tuesday, May 02, 2000 9:47 AM
To: NT Developers Interest List
Subject: [ntdev] RE: METHOD_DIRECT_IO or METHOD_BUFFERED?
Mark,
IOCTL code is METHOD_IN_DIRECT, and as I previously said
system crush with
ble-screen error IRQL_NOT_LESS_OR_EQUAL, and 4 codes
displayed are mem. ref.
0x10, IRQL 0x2, Read op. code 0x0 and address.
Are you saying that if I make IOCTL code for writing as
METHOD_OUT_DIRECT
and use Irp->MdlAddress buffer as input it might work OK?
Although I don’t
see how type of ICTL code could affect on IRQL.
As read and write op. are almost equal (they both call the
same procedures
but checking Parameters.Read/Write.Length) untill the point where I
read/write to serial port.
Regards,
Neno
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)