PFN_REGISTER_DATARATE_NOTIFICATIONS callback function (netdispumdddi.h)

Called by the user-mode driver to register with the operating system to receive network quality of service (QoS) notifications and the current network bandwidth of the Miracast connection.The data type of this function is PFN_REGISTER_DATARATE_NOTIFICATIONS.

Syntax

PFN_REGISTER_DATARATE_NOTIFICATIONS PfnRegisterDatarateNotifications;

NTSTATUS PfnRegisterDatarateNotifications(
  [in]           HANDLE hMiracastDeviceHandle,
  [in, optional] PVOID pNotificationContext,
  [in, optional] PFN_DATARATE_NOTIFICATION pfnDataRateNotify
)
{...}

Parameters

[in] hMiracastDeviceHandle

A handle that represents a Miracast device. The Miracast user-mode driver previously obtained this handle as the hMiracastDeviceHandle parameter in a call to the CreateMiracastContext function.

[in, optional] pNotificationContext

The context that will be passed to the pfnDataRateNotify function when the Miracast data rate changes.

[in, optional] pfnDataRateNotify

A pointer to the driver routine that will be called when the bit rate of the Miracast network link has changed. See Remarks for more info.

The driver can supply a NULL value to unregister for notifications.

Return value

If the operating system successfully registers or unregisters the driver for notifications, it returns STATUS_SUCCESS.

Otherwise, these error codes can be returned:

Return code Description
STATUS_INVALID_PARAMETER One or more parameters are invalid.
STATUS_NOT_SUPPORTED The operating system cannot support quality of service (QoS) notifications, or the call to the function is made outside of the calling thread in which the operating system called StartMiracastSession or StopMiracastSession functions.

Remarks

The user-mode driver can optionally call this function to register for automatic calls to data rate notification callback functions once a second.

To unregister from notifications, the driver should supply a value of NULL for the pfnDataRateNotify parameter and for the CurrentBitRate member of the MIRACAST_WFD_CONNECTION_STATS structure pointed to by the pWfdConnectionStats parameter when it calls the StartMiracastSession function. When the operating system receives NULL for both pfnDataRateNotify and CurrentBitRate, it will no longer provide notifications.

Also, if the operating system can no longer provide QoS data, it sets the pDataRateStats parameter to NULL when the pfnDataRateNotify function is called.

The function fails if the driver attempts to register while it is already registered, or if it attempts to unregister if it has already unregistered. The function fails if the call is made outside of the calling thread in which the operating system called StartMiracastSession or StopMiracastSession functions.

Requirements

Requirement Value
Minimum supported client Windows 8.1
Minimum supported server Windows Server 2012 R2
Target Platform Desktop
Header netdispumdddi.h (include Netdispumdddi.h)

See also

CreateMiracastContext

MIRACAST_WFD_CONNECTION_STATS

StartMiracastSession

pfnDataRateNotify