Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

WLAN_RADIO_STATE (wlanapi)
 
.
Summary
TODO - a short description

C# Signature:

private struct WLAN_RADIO_STATE

{

    public UInt32 dwNumberOfPhys;

    public WLAN_PHY_RADIO_STATE[] PhyRadioState;
    public WLAN_RADIO_STATE(IntPtr ppData)
    {
        // The first 4 bytes are the number of WLAN_PHY_RADIO_STATE structures.
        dwNumberOfPhys = Marshal.ReadInt32(ppData, 0);

        // Construct the array of WLAN_PHY_RADIO_STATE structures.
        PhyRadioState = new WLAN_PHY_RADIO_STATE[dwNumberOfPhys];

        for (int i = 0; i <= dwNumberOfPhys - 1; i++) {
            // The offset of the array of structures is 4 bytes past the beginning.
            // Then, take the index and multiply it by the number of bytes in the
            // structure. The length of the WLAN_PHY_RADIO_STATE structure is 12 bytes
            IntPtr pPhyList = new IntPtr(ppData.ToInt64() + (i * 12) + 4);

            // Construct the WLAN_PHY_RADIO_STATE structure, marshal the unmanaged
            // structure into it, then copy it to the array of structures.
            PhyRadioState[i] = (WLAN_PHY_RADIO_STATE)Marshal.PtrToStructure(pPhyList, typeof(WLAN_PHY_RADIO_STATE));
        }
    }

}

VB Signature:

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _

    Private Structure WLAN_RADIO_STATE
    Public dwNumberOfPhys As UInt32
    Public PhyRadioState As WLAN_PHY_RADIO_STATE()

    Public Sub New(ppData As IntPtr)
        ' The first 4 bytes are the number of WLAN_PHY_RADIO_STATE structures.
        dwNumberOfPhys = Marshal.ReadInt32(ppData, 0)

        ' Construct the array of WLAN_PHY_RADIO_STATE structures.
        PhyRadioState = New WLAN_PHY_RADIO_STATE(dwNumberOfPhys - 1) {}

        For i As Integer = 0 To dwNumberOfPhys - 1
        ' The offset of the array of structures is 4 bytes past the beginning.
        ' Then, take the index and multiply it by the number of bytes in the
        ' structure. The length of the WLAN_PHY_RADIO_STATE structure is 12 bytes
        Dim pPhyList As New IntPtr(ppData.ToInt64() + (i * 12) + 4)

        ' Construct the WLAN_PHY_RADIO_STATE structure, marshal the unmanaged
        ' structure into it, then copy it to the array of structures.
        PhyRadioState(i) = DirectCast(Marshal.PtrToStructure(pPhyList, GetType(WLAN_PHY_RADIO_STATE)), WLAN_PHY_RADIO_STATE)
        Next
    End Sub
    End Structure

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions