WdfWorkItemGetParentObject method

[Applies to KMDF and UMDF]

The WdfWorkItemGetParentObject method returns the framework object that a specified work item is associated with.

Syntax


WDFOBJECT WdfWorkItemGetParentObject(
  [in]  WDFWORKITEM WorkItem
);

Parameters

WorkItem [in]

A handle to a framework work-item object that is obtained from a previous call to WdfWorkItemCreate.

Return value

WdfWorkItemGetParentObject returns a handle to the framework object that the driver specified as the ParentObject member of the driver's WDF_OBJECT_ATTRIBUTES structure when the driver previously called WdfWorkItemCreate.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

For more information about work items, see Using Framework Work Items.

Examples

The following code example is an EvtWorkItem callback function from the 1394 sample driver. The example obtains a work item's parent device object, calls a driver-defined routine to process the work item, and then deletes the work item object.


VOID
t1394_BusResetRoutineWorkItem(
    IN WDFWORKITEM  WorkItem
)
{
    WDFDEVICE  Device = WdfWorkItemGetParentObject(WorkItem);

    t1394_UpdateGenerationCount(Device);

    WdfObjectDelete(WorkItem);
}

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfworkitem.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WDF_OBJECT_ATTRIBUTES
WdfWorkItemCreate

 

 

Send comments about this topic to Microsoft

Mostrar:
© 2014 Microsoft