Expand Minimize

WdfPdoAddEjectionRelationsPhysicalDevice method

[Applies to KMDF only]

The WdfPdoAddEjectionRelationsPhysicalDevice method indicates that a specified device is ejected when another specified device is ejected.

Syntax


NTSTATUS WdfPdoAddEjectionRelationsPhysicalDevice(
  [in]  WDFDEVICE Device,
  [in]  PDEVICE_OBJECT PhysicalDevice
);

Parameters

Device [in]

A handle to a framework device object.

PhysicalDevice [in]

A pointer to a caller-supplied DEVICE_OBJECT structure that represents a physical device object (PDO).

Return value

If the operation succeeds, the method returns STATUS_SUCCESS. Additional return values include:

Return codeDescription
STATUS_INVALID_PARAMETER

An input parameter is NULL.

STATUS_INSUFFICIENT_RESOURCES

A memory allocation failed.

 

The method might also return other NTSTATUS values.

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

Remarks

The PhysicalDevice parameter points to a PDO of a device that is ejected when the device that is identified by Device is ejected. Typically, both devices are controlled by the calling driver. Do not report the child devices of Device because when the PnP manager ejects a parent device, it also ejects the device's children.

For more information, see Supporting Ejectable Devices.

Examples

The following code example adds a device that the pPhysicalDeviceObject structure represents to the list of devices that are ejected when the device that device specifies is ejected.


PDEVICE_OBJECT  pPhysicalDeviceObject;
NTSTATUS  status;
...
status = WdfPdoAddEjectionRelationsPhysicalDevice(
 device,
 pPhysicalDeviceObject
                                                  );

Requirements

Minimum KMDF version

1.0

Header

Wdfpdo.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WdfPdoRemoveEjectionRelationsPhysicalDevice
WdfPdoClearEjectionRelationsDevices

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft