Hi all:
I am trying to forward the I/O Request from the PDO to the PDO root in the next driver herarchy:
usbser
|
PDO created by FDO
|
FDO
|
PDO Root
But it crashes when i implement the code:
Fisrt I add the next function before I create the PDO child created by FDO:
- WdfPdoInitAllowForwardingRequestToParent()
And later, after I create the child PDO, i create a queue where i add a IRP_MJ_INTERNAL_DEIVCE_CONTROL event handler with next sintax to forward the IRP:
VOID
EvtIoInternalDeviceControlEntry(
IN WDFQUEUE Queue,
IN WDFREQUEST Request,
IN size_t OutputBufferLength,
IN size_t InputBufferLength,
IN ULONG IoControlCode
)
{
WDFDEVICE device, parentDevice;
WDF_REQUEST_FORWARD_OPTIONS forwardOptions;
NTSTATUS status;
KdPrint( ("EvtIoInternalDeviceControlEntry Entered"));
device = WdfIoQueueGetDevice(WdfRequestGetIoQueue(Request));
parentDevice = WdfPdoGetParent(device);
WDF_REQUEST_FORWARD_OPTIONS_INIT(&forwardOptions);
status = WdfRequestForwardToParentDeviceIoQueue(
Request,
WdfDeviceGetDefaultQueue(parentDevice),
&forwardOptions
);
if (!NT_SUCCESS(status)) {
WdfRequestComplete(
Request,
status
);
}
UNREFERENCED_PARAMETER(OutputBufferLength);
UNREFERENCED_PARAMETER(InputBufferLength);
UNREFERENCED_PARAMETER(IoControlCode);
}
Everything goes right with the compilation and when i install the driver, but
when i attach the device and it ask for the usbser.sys it crashes with the next analyze:
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
WDF_VIOLATION (10d)
The Kernel-Mode Driver Framework was notified that Windows detected an error
in a framework-based driver. In general, the dump file will yield additional
information about the driver that caused this bug check.
Arguments:
Arg1: 00000005, A framework object handle of the incorrect type was passed to
a framework object method.
Arg2: 00000000, The handle value passed in.
Arg3: 00001003, Reserved.
Arg4: 8a8b4950, Reserved.
Debugging Details:
BUGCHECK_STR: 0x10D_5
CUSTOMER_CRASH_COUNT: 1
DEFAULT_BUCKET_ID: DRIVER_FAULT
LOCK_ADDRESS: 805614e0 -- (!locks 805614e0)
Resource @ nt!PiEngineLock (0x805614e0) Available
WARNING: SystemResourcesList->Flink chain invalid. Resource may be corrupted, or already deleted.
WARNING: SystemResourcesList->Blink chain invalid. Resource may be corrupted, or already deleted.
1 total locks
PNP_TRIAGE:
Lock address : 0x805614e0
Thread Count : 0
Thread address: 0x00000000
Thread wait : 0x0
LAST_CONTROL_TRANSFER: from f1be8f9e to 80537672
STACK_TEXT:
f79065b4 f1be8f9e 0000010d 00000005 00000000 nt!KeBugCheckEx+0x1b
f79065d0 f1bbcf0f 8a8b4950 00000005 00000000 Wdf01000!FxVerifierBugCheck+0x24
f79065f8 9dd7d71d 8a8b4a18 765d4470 00000000 Wdf01000!imp_WdfRequestForwardToParentDeviceIoQueue+0x26
WARNING: Stack unwind information not available. Following frames may be wrong.
f7906610 9dd7d633 765d4470 00000000 f790662c dynambus+0x171d
f7906638 f1bd7072 78eb1fe8 765d4470 8821860c dynambus+0x1633
f790665c f1bd8432 78eb1fe8 765d4470 8821860c Wdf01000!FxIoQueueIoInternalDeviceControl::Invoke+0x30
f790668c f1bda9ac 765d4470 89a2bb88 8714e010 Wdf01000!FxIoQueue::DispatchRequestToDriver+0x37f
f79066a8 f1bdba36 8714e000 00000000 874cd010 Wdf01000!FxIoQueue::DispatchEvents+0x3be
f79066c8 f1bdd824 89a2bb88 86b90b68 0000003c Wdf01000!FxIoQueue::QueueRequest+0x1ec
f79066ec f1bcca3f 86b90b68 f7906714 f1c8665e Wdf01000!FxPkgIo::Dispatch+0x27d
f79066f8 f1c8665e 8714ab48 86b90b68 79471ea0 Wdf01000!FxDevice::Dispatch+0x7f
f7906714 804e13c9 8714ab48 880c6368 f7906794 USBlyzer+0x165e
f7906724 f1bbe0da 8709d2d8 8709d3cc 00000000 nt!IopfCallDriver+0x31
f790673c 9f4a8d5d 8709e7e0 89cb1db8 86b8e158 Wdf01000!imp_WdfRequestSend+0x254
f7906754 9f4a8c7b 7634e240 79471ea0 f7906794 low_usb+0xd5d
f79067c4 f1bd7072 78f62d20 7634e240 8821860c low_usb+0xc7b
f79067e8 f1bd8432 78f62d20 7634e240 8821860c Wdf01000!FxIoQueueIoInternalDeviceControl::Invoke+0x30
f7906818 f1bda9ac 7634e240 89cb1db8 8709d2d8 Wdf01000!FxIoQueue::DispatchRequestToDriver+0x37f
f7906834 f1bdba36 8709d200 00000000 86c4ca68 Wdf01000!FxIoQueue::DispatchEvents+0x3be
f7906854 f1bdd824 89cb1db8 87275470 8814b950 Wdf01000!FxIoQueue::QueueRequest+0x1ec
f7906878 f1bcca3f 86b90b68 f79068c0 804e13c9 Wdf01000!FxPkgIo::Dispatch+0x27d
f7906884 804e13c9 86b8a480 86b90b68 86b90b68 Wdf01000!FxDevice::Dispatch+0x7f
f7906894 a6957d71 87275470 8821860c 88c926d4 nt!IopfCallDriver+0x31
f79068c0 a695432f 872753b8 8821860c 87275470 usbser!CallUSBD+0x77
f79068e4 a6958333 872753b8 86bb11f0 872753b8 usbser!GetDeviceDescriptor+0x63
f7906910 a6957410 872753b8 86bb11f0 00000000 usbser!StartDevice+0x111
f7906930 804e13c9 872753b8 86bb11f0 f1bf5a08 usbser!UsbSer_PnP+0x1ec
f7906940 f1bf5ebe 00000008 870acd30 00000106 nt!IopfCallDriver+0x31
f7906960 f1bf6517 f7906990 f1bf6484 870acd30 Wdf01000!FxPkgFdo::PnpSendStartDeviceDownTheStackOverload+0x258
f7906968 f1bf6484 870acd30 870acdd8 870acd30 Wdf01000!FxPkgPnp::PnpEventInitStarting+0xd
f7906990 f1bf6db2 00000106 870acdd8 870acd30 Wdf01000!FxPkgPnp::PnpEnterNewState+0x104
f79069b4 f1bf747a f79069cc 883dc470 870acd30 Wdf01000!FxPkgPnp::PnpProcessEventInner+0x149
f79069d8 f1bf040b 00000002 00000000 f7906a08 Wdf01000!FxPkgPnp::PnpProcessEvent+0x13e
f79069e8 f1befe02 870acd30 f7906a10 86bb11f0 Wdf01000!FxPkgPnp::_PnpStartDevice+0x1e
f7906a08 f1bcca3f 86bb11f0 f7906a30 f1bccc63 Wdf01000!FxPkgPnp::Dispatch+0x207
f7906a14 f1bccc63 870f1170 86bb11f0 86bb13a4 Wdf01000!FxDevice::Dispatch+0x7f
f7906a30 804e13c9 870f1170 86bb11f0 f7906aac Wdf01000!FxDevice::DispatchWithLock+0x7b
f7906a40 8059716a f7906aac 8714ab48 00000000 nt!IopfCallDriver+0x31
f7906a6c 805a18de 870f1170 f7906a88 00000000 nt!IopSynchronousCall+0xb7
f7906ab0 80506bf2 8714ab48 87557928 00000001 nt!IopStartDevice+0x4d
f7906acc 8059fced 8714ab48 8714ab01 87557928 nt!PipProcessStartPhase1+0x4e
f7906d24 80626233 86c04ee8 00000001 00000000 nt!PipProcessDevNodeTree+0x1db
f7906d54 80506090 00000003 805615c0 8056a5fc nt!PiRestartDevice+0x80
f7906d7c 804e23a5 00000000 00000000 8a98c020 nt!PipDeviceActionWorker+0x168
f7906dac 8057572b 00000000 00000000 00000000 nt!ExpWorkerThread+0xef
f7906ddc 804ec6c9 804e22e1 00000001 00000000 nt!PspSystemThreadStartup+0x34
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
STACK_COMMAND: kb
FOLLOWUP_IP:
dynambus+171d
9dd7d71d ?? ???
SYMBOL_STACK_INDEX: 3
SYMBOL_NAME: dynambus+171d
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: dynambus
IMAGE_NAME: dynambus.sys
DEBUG_FLR_IMAGE_TIMESTAMP: 0
FAILURE_BUCKET_ID: 0x10D_5_dynambus+171d
BUCKET_ID: 0x10D_5_dynambus+171d