UsbPm_Register function (usbpmapi.h)

Registers the client driver with the Policy Manager to report hub arrival/removal and connector state changes.

Syntax

NTSTATUS UsbPm_Register(
  [In]  PUSBPM_CLIENT_CONFIG ClientConfig,
  [Out] USBPM_CLIENT         *ClientHandle
);

Parameters

[In] ClientConfig

The pointer to a caller-supplied USBPM_CLIENT_CONFIG structure. Initialize the structure by calling macro USBPM_CLIENT_CONFIG_INIT.

[Out] ClientHandle

A pointer to a location that receives a handle to the registration operation.

Return value

Returns STATUS_SUCCESS if the operation succeeds. Otherwise, returns an appropriate NTSTATUS value.

Remarks

The client driver's callback functions might start getting invoked before UsbPm_Register returns. The ClientHandle value is set to a valid value before callback functions are invoked.

The driver typically calls UsbPm_Register in the driver's EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT and unregisters in EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP by calling UsbPm_Deregister.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1809
Minimum KMDF version 1.27
Minimum UMDF version 2.27
Header usbpmapi.h
Library UsbPmApi.lib
IRQL PASSIVE_LEVEL