Share via


GetWirelessDevices (Compact 2013)

3/26/2014

This function retrieves the linked list of the wireless devices in the system.

Syntax

HRESULT GetWirelessDevices(
  RDD **pDevices,
  DWORD dwFlags
);

Parameters

  • pDevices
    [out] Address of a pointer to receive a linked list of devices. On success, the list will be populated with devices stored in RDD type nodes.
  • dwFlags
    [in] Options that specify which devices to retrieve and whether or not to retrieve the desired state.

    The following table shows the possible flag values.

    Flag

    Value

    Description

    WIRELESS_GET_DESIRED

    1

    This flag returns the desired state of the device in the dwDesired member of the RDD structure. This is the user's preferred state when wireless signals are on. For example, if the user has set the phone checkbox in the Power section of Control Panel, but turned all wireless devices off, this member would be 1, but the actual state, dwState, would be 0. If you are only interested in the current state of devices, do not pass this flag and do not expect a meaningful value to be returned in the dwDesired member.

    WIRELESS_NO_POWER_MAN

    2

    This flag causes GetWirelessDevices to exclude any power managed wireless LAN adapters from the returned list.

    WIRELESS_NO_PHONE

    4

    Passing this flag causes GetWirelessDevices to exclude any phone radios from the returned list of devices.

Return Value

The following table shows the return values for this function.

Value

Description

S_OK

Successfully retrieved the list of wireless devices.

E_FAIL

Unspecified failure.

E_OUTOFMEMORY

Insufficient memory

Other error messages maybe returned depending on the device.

Remarks

To retrieve only the wireless devices in the system and their current states, pass 0 in dwFlags. The current state will be returned in the dwState member of the RDD structure.

The application that calls GetWirelessDevices is responsible for releasing the link list when it is no longer needed. To release the list, call FreeDeviceList function and pass the pointer to the list. This function traverses the list and releases all RDD nodes that contain wireless device information.

Requirements

Header

wrlspwr.h

Library

ossvcs.lib

See Also

Reference

Wireless Device Power Management Functions