none
IOGetDMAAdapter call fails with 0xFFFFFFFFC0000005 Access Violation RRS feed

  • Question

  • My driver for a PCIe Bus-Master Device without Scatter/Gather capability calls IoGetDmaAdapter(), but fails with 0xFFFFFFFFC0000005 Access Violation. This causes a BSOD.

    It runs perfectly fine on all legacy operating systems including Server 2012. But starting with Server 2016 i am now seeing this crash.

    Here's how I set it up:

    RtlZeroMemory(&deviceDescription, sizeof(DEVICE_DESCRIPTION)); deviceDescription.Master = TRUE; // this is a bus-master device without scatter/gather ability deviceDescription.Dma32BitAddresses = TRUE; // this device is unable to perform 64-bit addressing deviceDescription.InterfaceType = InterfaceTypeUndefined;

    deviceDescription.Version = DEVICE_DESCRIPTION_VERSION;

    IOGetDmaAdapter(deviceObject, &deviceDescription, &fakeRegs);cription, &fakeRegs);

    Here's my Windows kernel debugging session:

    MyDriver!AllocateHardWareResource+0x313:
    fffff803`319626a3 488b8424e8000000 mov     rax,qword ptr [rsp+0E8h]
    MyDriver!AllocateHardWareResource+0x324:
    fffff803`319626b4 488d442478      lea     rax,[rsp+78h]
    MyDriver!AllocateHardWareResource+0x34d:
    fffff803`319626dd 8b442450        mov     eax,dword ptr [rsp+50h]
    MyDriver!AllocateHardWareResource+0x358:
    fffff803`319626e8 c684248900000001 mov     byte ptr [rsp+89h],1
    MyDriver!AllocateHardWareResource+0x360:
    fffff803`319626f0 c784248000000002000000 mov dword ptr [rsp+80h],2
    MyDriver!AllocateHardWareResource+0x36b:
    fffff803`319626fb 4c8d44244c      lea     r8,[rsp+4Ch]
    KDTARGET: Refreshing KD connection
    KDTARGET: Refreshing KD connection
    
    *** Fatal System Error: 0x0000007e
                           (0xFFFFFFFFC0000005,0x0000000000000000,0xFFFF9400DE25D4B8,0xFFFF9400DE25CCF0)
    
    WARNING: This break is not a step/trace completion.
    The last command has been cleared to prevent
    accidental continuation of this unrelated event.
    Check the event, location and thread before resuming.
    Break instruction exception - code 80000003 (first chance)
    
    A fatal system error has occurred.

    Before the crash at Guard_Dispatch_iCall_NOP, I see the following call-stack:

    HalpGetCacheCoherency + 6D
    HalGetAdapterV2 + A8
    IoGetDmaAdapter + C0
    IoGetDmaAdapter + C0
    IoGetDmaAdapter + C0
    My Call-Site

    Could anyone please offer some tips or what things i should try to get this to work?







    • Edited by gchernis Tuesday, December 12, 2017 4:53 PM
    Tuesday, December 12, 2017 4:51 PM

All replies

  • Actually the debugger says it is a breakpoint or assertion (80000003), possibly detected by HalpGetCacheCoherency.

    Check the properties of your dma adapter, parameters etc. Win10 is more picky on validation than previous versions.

    -- pa

    Tuesday, December 12, 2017 6:08 PM
  • are you passing your device object or your PDO to IOGetDmaAdapter? it must be the PDO. if you turn on driver verifier, does it report anything?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, December 13, 2017 7:20 AM