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: