In my practice(moving IoFreeIrp to completion routine), it seems that lower device object sends request to upper device object is ok, and it work well.
So I’m look for the theory to support this kind of method. It’d better from Microsoft.
For causes of the BSOD, I have different opinion, and I think that where to put the “IoFreeIrp” does matter.
Following is the original DUMP analysis:
Myfsd and My_volume is the fsd and volume driver I mentioned above.
The OsrOnline web is not so kind for X64 system dump to display, for the 64 bits pointer alway get displayed in 2 lines.
IRQL_NOT_LESS_OR_EQUAL (a)
An attempt was made to access a pageable (or completely invalid) address at an
interrupt request level (IRQL) that is too high. This is usually
caused by drivers using improper addresses.
If a kernel debugger is available get the stack backtrace.
Arguments:
Arg1: 0000000000000088, memory referenced
Arg2: 0000000000000002, IRQL
Arg3: 0000000000000001, bitfield :
bit 0 : value 0 = read operation, 1 = write operation
bit 3 : value 0 = not an execute operation, 1 = execute operation (only on chips which support this level of status)
Arg4: fffff80003a5312e, address which referenced memory
Debugging Details:
MODULE_NAME: MyFsd
FAULTING_MODULE: fffff80003a04000 nt
DEBUG_FLR_IMAGE_TIMESTAMP: 51a6cb63
WRITE_ADDRESS: unable to get nt!MmSpecialPoolStart
unable to get nt!MmSpecialPoolEnd
unable to get nt!MmPoolCodeStart
unable to get nt!MmPoolCodeEnd
0000000000000088
CURRENT_IRQL: 0
FAULTING_IP:
nt!KeInsertQueueApc+42
fffff800`03a5312e f0480fbaab8800000000 lock bts qword ptr [rbx+88h],0
DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT
BUGCHECK_STR: 0xA
LAST_CONTROL_TRANSFER: from fffff80003b6a672 to fffff80003a6b8e1
STACK_TEXT:
fffff880061f37a8 fffff800
03b6a672 : 0000000000000088 fffffa80
06576760 0000000000000065 fffff800
03ab1910 : nt!DbgBreakPointWithStatus+0x1
fffff880061f37b0 fffff800
03b6b45e : 0000000000000003 00000000
00000000 fffff80003aae4d0 00000000
0000000a : nt!HeadlessDispatch+0x192
fffff880061f3810 fffff800
03a73984 : 0000000000000000 fffff880
00000000 0000000000000000 fffff800
03af1b52 : nt!KeEnterKernelDebugger+0x76e
fffff880061f3ee0 fffff800
03a72de9 : 000000000000000a 00000000
00000088 0000000000000002 00000000
00000001 : nt!KeBugCheckEx+0x104
fffff880061f3f20 fffff800
03a71a60 : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000001 : nt!KeSynchronizeExecution+0x3d59
fffff880061f4060 fffff800
03a5312e : 0000000000000000 00000000
00000000 fffffa80043aff2b fffff880
02e896dd : nt!KeSynchronizeExecution+0x29d0
fffff880061f41f0 fffff800
03a76709 : 0000000000000000 00000000
a000000c 0000000000000000 00000000
00000000 : nt!KeInsertQueueApc+0x42
fffff880061f4250 fffff880
01d97bba : fffffa80051c7870 fffff880
01d97a01 0000000000000010 00000000
00000000 : nt!memset+0xc79
fffff880061f4340 fffff880
01d94652 : 0000000000000000 fffffa80
043afe10 fffffa8000000000 fffff880
061f43c0 : MyFsd!MyCompleteRequest_Real+0xea
fffff880061f4380 fffff880
01d93468 : fffffa80051c7870 fffffa80
043afe10 0000000000000000 00000000
00000000 : MyFsd!MyLockVolume+0x572
fffff880061f4410 fffff880
01d8f7e4 : fffffa80051c7870 fffffa80
043afe10 fffffa80043afe10 fffff800
03c02888 : MyFsd!MyUserFsCtrl+0x288
fffff880061f4480 fffff880
01d8f435 : fffffa80051c7870 fffffa80
043afe10 fffffa80043afe10 fffffa80
00000001 : MyFsd!MyCommonFileSystemControl+0x2b4
fffff880061f44f0 fffff880
02e89a32 : fffffa8006eef040 fffffa80
043afe10 fffffa80043480d0 00000000
00000701 : MyFsd!MyFsdFileSystemControl+0x1b5
fffff880061f4550 fffff880
02e8abea : fffffa8006dbd1a0 fffffa80
06eef040 0000000000060006 fffff8a0
04362240 : My_volume!DismountVolume+0x342
fffff880061f4680 fffff880
02e82beb : fffffa8005eeb060 fffffa80
065b3260 fffff8a00003dea0 fffff8a0
0a1d7d24 : My_volume!Volmgr_DeviceControl+0xd6a
fffff880061f4890 fffff800
03cdb068 : fffffa8005eeb060 fffffa80
065b3260 0000000000000001 00000000
20206f49 : My_volume!LDiskDeviceControl+0x7b
fffff880061f48d0 fffff800
03cd9c81 : 0000000000000000 fffff880
061f4c60 fffffa80065b3260 fffff880
01446a01 : nt!IoBuildSynchronousFsdRequest+0x168
fffff880061f4910 fffff880
014226af : fffffa8006ee2c90 fffffa80
06ede070 fffffa80065b3260 00000000
00000000 : nt!PsRevertToSelf+0x6b1
fffff880061f4970 fffff800
03d8a8f7 : fffffa8006ede070 fffff880
061f4c60 fffffa80065b3408 fffffa80
065b3260 : fltmgr+0x16af
fffff880061f49d0 fffff800
03d8b156 : 0000000000000401 00000000
00000000 0000000000000001 00000000
00000000 : nt!NtMapViewOfSection+0x25a7
fffff880061f4b00 fffff800
03a72ad3 : 0000000000000401 fffff960
001029aa 0000000000000000 00000000
00000000 : nt!NtDeviceIoControlFile+0x56
fffff880061f4b70 00000000
72db2dd9 : 0000000072db2932 00000000
74e672af 0000000072e20023 00000000
00000401 : nt!KeSynchronizeExecution+0x3a43
000000000008ebf8 00000000
72db2932 : 0000000074e672af 00000000
72e20023 0000000000000401 00000000
001880f8 : wow64cpu!TurboDispatchJumpAddressEnd+0x690
000000000008ec00 00000000
74e672af : 0000000072e20023 00000000
00000401 00000000001880f8 00000000
0008ec50 : wow64cpu!TurboDispatchJumpAddressEnd+0x1e9
000000000008ec08 00000000
72e20023 : 0000000000000401 00000000
001880f8 000000000008ec50 00000000
00073018 : KERNELBASE!IsNLSDefinedString+0x7db
000000000008ec10 00000000
00000401 : 00000000001880f8 00000000
0008ec50 0000000000073018 00000000
02266f48 : wow64+0x23
000000000008ec18 00000000
001880f8 : 000000000008ec50 00000000
00073018 0000000002266f48 00000000
000000a0 : 0x401
000000000008ec20 00000000
0008ec50 : 0000000000073018 00000000
02266f48 00000000000000a0 00000000
00000000 : 0x1880f8
000000000008ec28 00000000
00073018 : 0000000002266f48 00000000
000000a0 0000000000000000 00000000
00000000 : 0x8ec50
000000000008ec30 00000000
02266f48 : 00000000000000a0 00000000
00000000 0000000000000000 00000000
0018888c : 0x73018
000000000008ec38 00000000
000000a0 : 0000000000000000 00000000
00000000 000000000018888c 00000000
00a4f928 : 0x2266f48
000000000008ec40 00000000
00000000 : 0000000000000000 00000000
0018888c 0000000000a4f928 00000000
0018888c : 0xa0
STACK_COMMAND: kb
FOLLOWUP_IP:
MyFsd!MyCompleteRequest_Real+ea [\My_fsd\Mydata.c @ 709]
fffff880`01d97bba 4883c438 add rsp,38h
FAULTING_SOURCE_CODE:
705: IoCompleteRequest( Irp, IO_DISK_INCREMENT );
706: }
707:
708: return;
709: }
710:
711: BOOLEAN
712: MyIsIrpTopLevel (
713: IN PIRP Irp
714: )
SYMBOL_STACK_INDEX: 8
SYMBOL_NAME: MyFsd!MyCompleteRequest_Real+ea
FOLLOWUP_NAME: MachineOwner
IMAGE_NAME: MyFsd.sys
BUCKET_ID: WRONG_SYMBOLS
Followup: MachineOwner