Very few have a getparent DDI
C:\WinDDK\6001.18002\inc\wdf\kmdf\1.7>findstr GetParent *.h | findstr /v return | findstr /v = | findstr /v Function
wdfdpc.h:WdfDpcGetParentObject(
wdfpdo.h:WdfPdoGetParent(
wdftimer.h:WdfTimerGetParentObject(
wdfworkitem.h:WdfWorkItemGetParentObject(
the PDO has a getparent b/c it has a parent WDFDEVICE. That leaves dpc, timer, work item. Why do they have a getparent DDI? Well, that is steeped in history and the original dev who implemented these objects had a strong idea about the parent/child relationship and it leaked into the public DDIs a bit.
The recommended pattern is that if you need to know about the parent from a given child WDF handle, store it in the context
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Jones
Sent: Wednesday, February 25, 2009 9:07 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] GetParent functions
Unless I’m blind or missing the boat (both afflictions I frequently
suffer from), there are no “get parent” functions for WDFCOLLECTION or
WDFOBJECT objects. It’s not a big deal, since I can use the context
area, but I’m curious why some WDF objects have “get parent” methods,
and some do not.
Cheers,
– mkj
//
// Michael K. Jones
// Stone Hill Consulting, LLC
// http://www.stonehill.com
//_______________________________________________
NTDEV is sponsored by OSR
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