none
KDMF Debugger Extensions failing RRS feed

  • Question

  • I have built a KDMF driver using VS2012, installed it with devcon and am able to set breakpoints but am unable to get any of the KDMF driver extensions to dump anything of value (mostly they say that "Not a valid WDFUSBDEVICE handle"). The only extension command that seems to return anything is !wdfdriverinfo.

    oregonduckman

    Monday, May 27, 2013 11:35 PM

Answers

  • are you passing "Device" as the parameter or the underlying hex value? the underlying hex value is what is expected. Does the output of !wdfhandle match your expecations? did you really create a WDFDEVICE that doesn't have any contexts associated with it? of all handles, a WDFDEVICE is by far the most likely to have a context hanging off of it.

    given the output you posted, the values are inverted, 0x0000077ffd2ad778 is a much more likely handle value and 0xfffff88002d52880 is more likely the underlying object pointer value.  what does !wdfdevice say for the same value?


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

    • Marked as answer by oregonduckman Wednesday, May 29, 2013 11:31 PM
    Wednesday, May 29, 2013 5:05 PM

All replies

  • The handle that is being queried in the same one passed to EvtDevicePrepareHardware and after a successful call to WdfUsbTargetDeviceCreate

    oregonduckman

    Tuesday, May 28, 2013 12:14 AM
  • post your debug sessions.  does !wdfkd.wdfhandle report it is a valid handle? are you sure kmdf symbols are properly loaded?

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

    Tuesday, May 28, 2013 5:05 AM
  • !wdfkd.wdfhandle returns

    Refcount: 0
    Contexts:
        <no associated contexts or attribute callbacks>

    also getting <Memory Access Error> when trying to view the contents of any structure...


    oregonduckman

    Tuesday, May 28, 2013 11:20 PM
  • I would like to see the actual command you executed, including the handle value. Did you verify wdf01000 and wdfldr symbols are properly loaded with !lmi ?

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

    Wednesday, May 29, 2013 3:26 AM
  • From a breakpoint in EvtDevicePrepareHardware just before the return status; The following commands were issued: It appears that I can now use the KDMF extensions but still cannot get the <memory access error> when trying to view the fields of any structs...

    .load C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\winext\wdfkd.dll

    !sym noisy

    .reload /f wdfldr.sys

    .reload /f Wdf01000.sys

    !lmi mydriver

    Loaded Module Info: [mydriver] 
             Module: mydriver
       Base Address: fffff880161e8000
         Image Name: mydriver.sys
       Machine Type: 34404 (X64)
         Time Stamp: 51a531f6 Tue May 28 15:38:46 2013
               Size: b000
           CheckSum: 11857
    Characteristics: 22  
    Debug Data Dirs: Type  Size     VA  Pointer
                 CODEVIEW    3b,  3180,    1b80 RSDS - GUID: {696993C6-A0C0-4404-866E-2F081AF0F032}
                   Age: 1, Pdb: C:\mydriver\x64\Win8Debug\mydriverpdb
                       ??    10,  31bc,    1bbc [Data not mapped]
         Image Type: MEMORY   - Image read successfully from loaded memory.
        Symbol Type: PDB      - Symbols loaded successfully from symbol search path.
                     c:\mydriver\x64\win8debug\mydriver.pdb
           Compiler: C - front end [17.0 bld 60315] - back end [17.0 bld 60315]
        Load Report: private symbols & lines, not source indexed 
                     c:\mydriver\x64\win8debug\mydriver.pdb

    !wdfhandle Device (where Device is the incoming WDFDEVICE)

    Dumping WDFHANDLE 0xfffff88002d52880
    =============================
    Refcount: 0
    Contexts:
        <no associated contexts or attribute callbacks>

    !wdfobject 0x0000077ffd2ad778



    oregonduckman

    Wednesday, May 29, 2013 3:38 PM
  • are you passing "Device" as the parameter or the underlying hex value? the underlying hex value is what is expected. Does the output of !wdfhandle match your expecations? did you really create a WDFDEVICE that doesn't have any contexts associated with it? of all handles, a WDFDEVICE is by far the most likely to have a context hanging off of it.

    given the output you posted, the values are inverted, 0x0000077ffd2ad778 is a much more likely handle value and 0xfffff88002d52880 is more likely the underlying object pointer value.  what does !wdfdevice say for the same value?


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

    • Marked as answer by oregonduckman Wednesday, May 29, 2013 11:31 PM
    Wednesday, May 29, 2013 5:05 PM