Bewerken

Delen via


WdfPdoMarkMissing function (wdfpdo.h)

[Applies to KMDF only]

The WdfPdoMarkMissing method informs the framework that a device is no longer accessible.

Syntax

NTSTATUS WdfPdoMarkMissing(
  [in] WDFDEVICE Device
);

Parameters

[in] Device

A handle to a framework device object that represents the device's physical device object (PDO).

Return value

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

Return code Description
STATUS_INVALID_PARAMETER
The Device handle does not represent a PDO.
STATUS_NO_SUCH_DEVICE
The device object could not be found.
 

The method might also return other NTSTATUS values.

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

Remarks

For more information about WdfPdoMarkMissing, see Static Enumeration.

Examples

The following code example searches a list of child devices to find one that matches a specified serial number. When the example finds the correct child, it calls WdfPdoMarkMissing to indicate that the child is not accessible. This example was taken from the Toaster sample bus driver and simplified.

WDFDEVICE  hChild = NULL;
NTSTATUS  status = STATUS_INVALID_PARAMETER;
BOOLEAN  found = FALSE;
PPDO_DEVICE_DATA  pdoData;

WdfFdoLockStaticChildListForIteration(Device);

while ((hChild = WdfFdoRetrieveNextStaticChild(
                                               Device, 
                                               hChild,
                                               WdfRetrieveAddedChildren
                                               )) != NULL) {
    pdoData = PdoGetData(hChild);  // Device object context space
    if (SerialNo == pdoData->SerialNo) {
        status = WdfPdoMarkMissing(hChild);
        if(!NT_SUCCESS(status)) {
            KdPrint(("WdfPdoMarkMissing failed 0x%x\n", status));
            break;
        }
        found = TRUE;
        break;
    }
}
WdfFdoUnlockStaticChildListFromIteration(Device);

Requirements

Requirement Value
Target Platform Universal
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(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf)

See also

WdfFdoLockStaticChildListForIteration

WdfFdoRetrieveNextStaticChild

WdfFdoUnlockStaticChildListFromIteration