Bugcheck 10d: KMDF miniport calling WdfDeviceSetAlignmentRequirement for WdfDmaEmablerCreate

In my KMDF miniport driver, I need to set the alignment requirements for common buffer allocation for WdfDmaEnablerCreate().

According to the documentation (and as verified), I can call WdfDmaEnablerCreate() for the KMDF miniport. However, if I call WdfDeviceSetAlignmentRequirement() with the miniport WDFDEVICE object, the system generates a bugcheck 0x10d.

Is there a way to set the alignment requirement for a DMA enabler outside of calling WdfDeviceSetAlignmentRequirement()?

*******************************************************************************
* *
* 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: 76a47080, The handle value passed in.
Arg3: 00001002, Reserved.
Arg4: 895b6ed8, Reserved.

STACK_TEXT:
81f3136c 8126c099 00000003 9f509a09 00000065 nt!RtlpBreakWithStatusInstruction
81f313c0 8126cdc0 813aa138 81f317bc 81f317f0 nt!KiBugCheckDebugBreak+0x1f
81f31790 81374286 0000010d 00000005 76a47080 nt!KeBugCheck2+0x6e6
81f317b4 813741bd 0000010d 00000005 76a47080 nt!KiBugCheck2+0xc6
81f317d4 84536746 0000010d 00000005 76a47080 nt!KeBugCheckEx+0x19
81f317f0 84533681 76a47080 00001002 00000000 Wdf01000!FxVerifierBugCheck+0x1f
81f31814 8a992ee2 00000000 00000000 00000003 Wdf01000!imp_WdfDeviceSetAlignmentRequirement+0x28
81f31828 8a9c7500 76a47080 00000003 895a79d8 xxxx!WdfDeviceSetAlignmentRequirement+0x22 [e:\xxxx.…\wdf\kmdf\1.13\wdfdevice.h @ 2711]
81f31870 8a9c7d27 8a9a9678 00000000 895a79d8 xxx!xxxx::AllocateDmaEnabler+0x20

STACK_COMMAND: kb

FAULTING_SOURCE_CODE:
2707: ULONG AlignmentRequirement
2708: )
2709: {
2710: ((PFN_WDFDEVICESETALIGNMENTREQUIREMENT) WdfFunctions[WdfDeviceSetAlignmentRequirementTableIndex])(WdfDriverGlobals, Device, AlignmentRequirement);

2711: }
2712:

All the API does is set DeviceObject->AlignmentRequirement = AlignmentValue. It bugchecks b/c in miniport mode KMDF doesn’t own the WDM device object. You can set the value yourself and see the same results

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Bryan Woodruff
Sent: Tuesday, September 16, 2014 11:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Bugcheck 10d: KMDF miniport calling WdfDeviceSetAlignmentRequirement for WdfDmaEmablerCreate

In my KMDF miniport driver, I need to set the alignment requirements for common buffer allocation for WdfDmaEnablerCreate().

According to the documentation (and as verified), I can call WdfDmaEnablerCreate() for the KMDF miniport. However, if I call WdfDeviceSetAlignmentRequirement() with the miniport WDFDEVICE object, the system generates a bugcheck 0x10d.

Is there a way to set the alignment requirement for a DMA enabler outside of calling WdfDeviceSetAlignmentRequirement()?

*******************************************************************************
* *
* 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: 76a47080, The handle value passed in.
Arg3: 00001002, Reserved.
Arg4: 895b6ed8, Reserved.

STACK_TEXT:
81f3136c 8126c099 00000003 9f509a09 00000065 nt!RtlpBreakWithStatusInstruction
81f313c0 8126cdc0 813aa138 81f317bc 81f317f0 nt!KiBugCheckDebugBreak+0x1f
81f31790 81374286 0000010d 00000005 76a47080 nt!KeBugCheck2+0x6e6
81f317b4 813741bd 0000010d 00000005 76a47080 nt!KiBugCheck2+0xc6
81f317d4 84536746 0000010d 00000005 76a47080 nt!KeBugCheckEx+0x19
81f317f0 84533681 76a47080 00001002 00000000 Wdf01000!FxVerifierBugCheck+0x1f
81f31814 8a992ee2 00000000 00000000 00000003 Wdf01000!imp_WdfDeviceSetAlignmentRequirement+0x28
81f31828 8a9c7500 76a47080 00000003 895a79d8 xxxx!WdfDeviceSetAlignmentRequirement+0x22 [e:\xxxx.…\wdf\kmdf\1.13\wdfdevice.h @ 2711]
81f31870 8a9c7d27 8a9a9678 00000000 895a79d8 xxx!xxxx::AllocateDmaEnabler+0x20

STACK_COMMAND: kb

FAULTING_SOURCE_CODE:
2707: ULONG AlignmentRequirement
2708: )
2709: {
2710: ((PFN_WDFDEVICESETALIGNMENTREQUIREMENT) WdfFunctions[WdfDeviceSetAlignmentRequirementTableIndex])(WdfDriverGlobals, Device, AlignmentRequirement);

2711: }
2712:


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Excellent.

Thanks Doron

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Tuesday, September 16, 2014 12:11 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Bugcheck 10d: KMDF miniport calling WdfDeviceSetAlignmentRequirement for WdfDmaEmablerCreate

All the API does is set DeviceObject->AlignmentRequirement = AlignmentValue. It bugchecks b/c in miniport mode KMDF doesn’t own the WDM device object. You can set the value yourself and see the same results

d

From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.com] On Behalf Of Bryan Woodruff
Sent: Tuesday, September 16, 2014 11:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Bugcheck 10d: KMDF miniport calling WdfDeviceSetAlignmentRequirement for WdfDmaEmablerCreate

In my KMDF miniport driver, I need to set the alignment requirements for common buffer allocation for WdfDmaEnablerCreate().

According to the documentation (and as verified), I can call WdfDmaEnablerCreate() for the KMDF miniport. However, if I call WdfDeviceSetAlignmentRequirement() with the miniport WDFDEVICE object, the system generates a bugcheck 0x10d.

Is there a way to set the alignment requirement for a DMA enabler outside of calling WdfDeviceSetAlignmentRequirement()?



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: 76a47080, The handle value passed in.
Arg3: 00001002, Reserved.
Arg4: 895b6ed8, Reserved.

STACK_TEXT:
81f3136c 8126c099 00000003 9f509a09 00000065 nt!RtlpBreakWithStatusInstruction
81f313c0 8126cdc0 813aa138 81f317bc 81f317f0 nt!KiBugCheckDebugBreak+0x1f
81f31790 81374286 0000010d 00000005 76a47080 nt!KeBugCheck2+0x6e6
81f317b4 813741bd 0000010d 00000005 76a47080 nt!KiBugCheck2+0xc6
81f317d4 84536746 0000010d 00000005 76a47080 nt!KeBugCheckEx+0x19
81f317f0 84533681 76a47080 00001002 00000000 Wdf01000!FxVerifierBugCheck+0x1f
81f31814 8a992ee2 00000000 00000000 00000003 Wdf01000!imp_WdfDeviceSetAlignmentRequirement+0x28
81f31828 8a9c7500 76a47080 00000003 895a79d8 xxxx!WdfDeviceSetAlignmentRequirement+0x22 [e:\xxxx.…\wdf\kmdf\1.13\wdfdevice.h @ 2711]
81f31870 8a9c7d27 8a9a9678 00000000 895a79d8 xxx!xxxx::AllocateDmaEnabler+0x20

STACK_COMMAND: kb

FAULTING_SOURCE_CODE:
2707: ULONG AlignmentRequirement
2708: )
2709: {
2710: ((PFN_WDFDEVICESETALIGNMENTREQUIREMENT) WdfFunctions[WdfDeviceSetAlignmentRequirementTableIndex])(WdfDriverGlobals, Device, AlignmentRequirement);
> 2711: }
2712:


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx>