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_CONNECTION_PARAMETERS (Structures)
 
.
Summary
TODO - a short description

C# Definition:

[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]
public struct WLAN_CONNECTION_PARAMETERS
    {
        public WLAN_CONNECTION_MODE wlanConnectionMode;
        public string strProfile;
        public DOT11_SSID[] pDot11Ssid;
        public DOT11_BSSID_LIST[] pDesiredBssidList;
        public DOT11_BSS_TYPE dot11BssType;
        public uint dwFlags;
     }

VB Definition:

Structure WLAN_CONNECTION_PARAMETERS
   Public TODO
End Structure

User-Defined Field Types:

WLAN_CONNECTION_MODE

DOT11_SSID

DOT11_BSSID_LIST

DOT11_BSS_TYPE

Notes:

None.

More Info Required:

To people who just run into this page :

The history of this shows that IntPtrs for pDot11Ssid and pDesiredBssidList were changed to DOT11_SSID[] and DOT11_LIST[]. Then it should have some kind of explanation about the reason.

I think whether to use IntPtr or DOT11_SSID[] etc should be determined by which one you want, "Marshal" or "UnMarshal".

The rationale behind the change in the history for this is because is that he/she wanted to "unmarshal". However, in functions like WlanConnect(), it is used as an "input". So, it needs to be marshaled. Then I believe they should be IntPtr.

Also, DOT11_SSID[] looks to be wrong. It is to point one "SSID" not a series of SSID.

Also, it would be great if it explains how to marshal ucSSID in DOT11, because the ucSSID is just ANSI string ( without the terminating '\0'. )

>>Here is a simple way to marshal the DOT11_SSID structure. This uses Marshal.AllocHGlobal but you could also use Marshal.StructureToPtr.

    int ssidSize = 4 + 32;
    int ssidSize = 4 + DOT11_SSID_MAX_LENGTH;
    IntPtr ssidSpace = Marshal.AllocHGlobal(ssidSize);

    byte[] ssidTextBytes = Encoding.ASCII.GetBytes("My SSID");

    Marshal.WriteInt32(ssidSpace, ssidTextBytes.Length);

    for (int i = 0; i < ssidTextBytes.Length; i++)
    Marshal.WriteByte(ssidSpace, 4 + i, ssidTextBytes[i]);

    wcp.pDot11Ssid = ssidSpace;

    ...

    Marshal.FreeHGlobal(ssidSpace);

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

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