Hello,
I wrote a virtual modem driver that uses Walter Oney’s Generic driver to manage PnP/Power events. The problem is that the driver sometimes bugchecks while calling GenericUncacheControlRequest at DISPATCH_LEVEL.
Here’s the stack trace:
WARNING: Stack unwind information not available. Following frames may be wrong.
b8e87b8c f8aa1262 badb0d00 00000000 8238d998 nt!Kei386EoiHelper+0x2883
b8e87c00 f8a9f971 00000001 82372a88 82372978 bmmodem!GenericUncacheControlRequest+0x8 [h:\baracodapencil\vcom\vmodem_event\control.cpp @ 160]
b8e87c1c f8a9fa27 00372950 8238dba8 82d2d268 bmmodem!ProcessConnectionStateChange+0x5d [h:\baracodapencil\vcom\vmodem_event\ioctl.cpp @ 720]
b8e87c40 804e13d9 82372898 8237dc20 806ff410 bmmodem!BMModemIoControl+0x81 [h:\baracodapencil\vcom\vmodem_event\ioctl.cpp @ 57]
b8e87c64 80580fb1 82372898 8237dc20 823bc9d8 nt!IofCallDriver+0x32
b8e87d00 8058709e 000008f8 00000000 00000000 nt!RtlUnicodeStringToAnsiString+0x4c4
b8e87d34 804dd99f 000008f8 00000000 00000000 nt!NtDeviceIoControlFile+0x2a
b8e87d64 7c90eb94 badb0d00 0388f2c8 00000000 nt!KiDeliverApc+0xb9e
b8e87d68 badb0d00 0388f2c8 00000000 00000000 0x7c90eb94
b8e87d6c 0388f2c8 00000000 00000000 00000000 0xbadb0d00
b8e87d70 00000000 00000000 00000000 00000000 0x388f2c8
STACK_COMMAND: kb
FOLLOWUP_IP:
bmmodem!GenericUncacheControlRequest+8 [h:\baracodapencil\vcom\vmodem_event\control.cpp @ 160]
f8aa1262 f680d400000010 test byte ptr [eax+0D4h],10h
FAULTING_SOURCE_CODE:
156: GENERICAPI PIRP GENERIC_EXPORT GenericUncacheControlRequest(PGENERIC_EXTENSION pdx, PIRP* pIrp)
157: { // GenericUncacheControlRequest
158: ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
159:
160: if (!(pdx->Flags & GENERIC_PENDING_IOCTLS))
161: return NULL;
162:
163: KIRQL oldirql;
164: KeAcquireSpinLock(&pdx->IoctlListLock, &oldirql);
165:
Windbg says that the Flags field of the GENERIC_EXTENSION structure seems to be in paged memory. I don’t understand how this can happen as the structure is part of my device’s DEVICE_EXTENSION which is allocated in non-paged memory. Any ideas of what’s going on here?