none
WdfDriverCreate()'s DriverConfig parameter DriverPoolTag question RRS feed

  • Question

  • The MSDN man pages say "A driver-defined pool tag that the framework will assign to all of the driver's pool allocations."

    I am using this tag only in the call to WdfDriverCreate().

    Question: poolmon is showing a steady uptick in allocations attributed to this tag.  I would say this shows a "leak" of objects, but if I "end of life" my device object (and driver object), the allocations are recaptured. (so I think "parent objects" free up all child objects?) 

    HOW do I determine what pool allocations the framework has made on my driver's behalf?  HOW can I fine-tune the life-cycle of these allocations such that poolmon doesn't show them growing forever?

    0: kd> !wdfkd.wdfpoolusage <mydriver> 0 0
    -----------------------------------
    FxDriverGlobals ffffb0061299fde0 pool stats
    -----------------------------------
    Driver Tag: '<mytag>'
    166802 NonPaged Bytes, 362 Paged Bytes
    749 NonPaged Allocations, 6 Paged Allocations
    184098 PeakNonPaged Bytes, 634 PeakPaged Bytes
    799 PeakNonPaged Allocations, 10 PeakPaged Allocations

    pool ffffb00618e666f0, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f3045d0, Size 48 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061fa037c0, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f304150, Size   48 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061fa028c0, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f304270, Size   48 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061fa02230, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061ce045c0, Size   48 Tag <mytag>, NonPagedPoolNx
    ...
    pool ffffb0061fa0c910, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f310f30, Size   48 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f809580, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f310fc0, Size   48 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f8091c0, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f312910, Size   48 Tag <mytag>, NonPagedPoolNx
    pool ffffb00613363d40, Size  136 Tag <mytag>, NonPagedPoolNx
    pool ffffb0061f312be0, Size   48 Tag <mytag>, NonPagedPoolNx

    HOW do I determine what all those 136- and 48-byte allocations/objects are?

    0: kd> !wdfkd.wdfdriverinfo <mydriver> 0xfff

    shows (annotated):

    ----------------------------------
    No objects in a state where they could have been leaked.
    (An object must not be in the created state to be detected.)
    ----------------------------------

    WDF Verifier settings for silabser.sys is ON
      Enhanced verifier: function table hooking is ON
      Pool tracking is ON
      Handle verification is ON
      IO verification is ON
      Lock verification is ON
      Power reference tracking is ON (stack capture is ON)
      Handle reference tracking is ON for the following types:
        WDFDRIVER WDFDEVICE WDFQUEUE WDFWMIPROVIDER WDFKEY WDFSTRING WDFREQUEST
        WDFLOOKASIDE WDFMEMORY WDFOBJECT WDFCOLLECTION WDFDPC WDFFILEOBJECT
        WDFWAITLOCK WDFSPINLOCK WDFWORKITEM WDFINTERRUPT WDFTIMER WDFCHILDLIST
        WDFWMIINSTANCE WDFIORESLIST WDFCMRESLIST WDFIORESREQLIST WDFCOMPANIONTARGET
        WDFIOTARGET WDFUSBDEVICE WDFUSBPIPE WDFUSBINTERFACE WDFIOTARGET
        WDFDMAENABLER WDFDMATRANSACTION WDFCOMMONBUFFER
    ----------------------------------

    Tuesday, June 25, 2019 8:13 PM

Answers