WlanRegisterNotification (Compact 7)

3/12/2014

This function is used to register and unregister notifications on all wireless interfaces.

Syntax

DWORD WINAPI WlanRegisterNotification(
  __in        HANDLE hClientHandle,
  __in        DWORD dwNotifSource,
  __in        BOOL bIgnoreDuplicate,
  __in_opt    WLAN_NOTIFICATION_CALLBACK  funcCallback,
  __in_opt    PVOID pCallbackContext,
  __reserved  PVOID pReserved,
  __out_opt   PDWORD pdwPrevNotifSource
);

Parameters

  • hClientHandle
    The client's session handle, obtained by a previous call to the WlanOpenHandle function.
  • dwNotifSource
    The notification sources to be registered. These flags can be combined. When this parameter is set to WLAN_NOTIFICATION_SOURCE_NONE, WlanRegisterNotification unregisters notifications on all wireless interfaces.

    The following table shows possible values:

    Value Meaning

    WLAN_NOTIFICATION_SOURCE_NONE

    Unregisters notifications

    WLAN_NOTIFICATION_SOURCE_ALL

    Registers for all notifications, including those generated by the 802.1X module

    WLAN_NOTIFICATION_SOURCE_ACM

    Registers for notifications generated by the auto configuration module

    WLAN_NOTIFICATION_SOURCE_MSM

    Registers for notifications generated by MSM

    WLAN_NOTIFICATION_SOURCE_SECURITY

    Registers for notifications generated by the security module

    WLAN_NOTIFICATION_SOURCE_IHV

    Registers for notifications generated by independent hardware vendors (IHV)

  • bIgnoreDuplicate
    Specifies whether duplicate notifications will be ignored. If set to TRUE, a notification is not sent to the client if the notification is identical to the previous one.
  • pReserved
    Reserved; set to NULL.
  • pdwPrevNotifSource
    Pointer to the previously registered notification sources.

Return Values

Value Description

ERROR_SUCCESS

The function succeeds.

ERROR_INVALID_PARAMETER

hClientHandle is NULL or invalid or pReserved is not NULL.

ERROR_INVALID_HANDLE

The handle hClientHandle was not found in the handle table.

RPC_STATUS

Various error codes.

ERROR_NOT_ENOUGH_MEMORY

Could not allocate memory for the query results.

Remarks

The API returns an error if dwNotifSource is a value other than WLAN_NOTIFICATION_SOURCE_NONE and the client does not provide a callback function.

As soon as it is registered, the callback function will be called whenever a notification is available until the client unregisters or closes the handle.

If the client is in the middle of a notification callback when WlanRegisterNotification is called by using dwNotifSource set to WLAN_NOTIFICATION_SOURCE_NONE (that is, when the client is unregistering from notifications), WlanRegisterNotification will wait for the callback to finish before it returns a value. Calling this function inside a callback function will result in the call never completing. If both the callback function and the thread that unregisters from notifications try to obtain the same lock, a deadlock may occur.

An application can time-out and query the current interface state instead of waiting for a notification.

See Also

Reference

Native Wi-Fi Functions
WlanOpenHandle
WLAN_NOTIFICATION_CALLBACK
Native Wi-Fi Reference