473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

WLANAPI and OpCodes

How can I convert the following code (from MSDN) to work in VB.NET
(the opcodes are raising errors):

Public Enum WLAN_INTF_OPCODE
wlan_intf_opcode_autoconf_start = 0x000000000
wlan_intf_opcode_autoconf_enabled = 0x0fffffff
wlan_intf_opcode_background_scan_enabled = 0x0fffffff
wlan_intf_opcode_media_streaming_mode = 0x0fffffff
wlan_intf_opcode_radio_state = 0x0fffffff
wlan_intf_opcode_bss_type = 0x0fffffff
wlan_intf_opcode_interface_state = 0x0fffffff
wlan_intf_opcode_current_connection = 0x0fffffff
wlan_intf_opcode_channel_number = 0x0fffffff
wlan_intf_opcode_supported_infrastructure_auth_cip her_pairs =
0x0fffffff
wlan_intf_opcode_supported_adhoc_auth_cipher_pairs =
0x0fffffff
wlan_intf_opcode_supported_country_or_region_strin g_list =
0x0fffffff
wlan_intf_opcode_current_operation_mode = 0x0fffffff
wlan_intf_opcode_supported_safe_mode = 0x0fffffff
wlan_intf_opcode_certified_safe_mode = 0x0fffffff
wlan_intf_opcode_autoconf_end = 0x0fffffff
wlan_intf_opcode_msm_start = 0x10000100
wlan_intf_opcode_statistics = 0x1fffffff
wlan_intf_opcode_rssi = 0x1fffffff
wlan_intf_opcode_msm_end = 0x1fffffff
wlan_intf_opcode_security_start = 0x20010000
wlan_intf_opcode_security_end = 0x2fffffff
wlan_intf_opcode_ihv_start = 0x30000000
wlan_intf_opcode_ihv_end = 0x3fffffff
End Enum
Thanks in advance,

Toby.
Sep 15 '08 #1
5 4306
Replace all "0x" with "&H" should do the trick, at least as far as I can
tell.
"Toby Webb" <to*********@googlemail.comwrote in message
news:89**********************************@t54g2000 hsg.googlegroups.com...
How can I convert the following code (from MSDN) to work in VB.NET
(the opcodes are raising errors):

Public Enum WLAN_INTF_OPCODE
wlan_intf_opcode_autoconf_start = 0x000000000
wlan_intf_opcode_autoconf_enabled = 0x0fffffff
wlan_intf_opcode_background_scan_enabled = 0x0fffffff
wlan_intf_opcode_media_streaming_mode = 0x0fffffff
wlan_intf_opcode_radio_state = 0x0fffffff
wlan_intf_opcode_bss_type = 0x0fffffff
wlan_intf_opcode_interface_state = 0x0fffffff
wlan_intf_opcode_current_connection = 0x0fffffff
wlan_intf_opcode_channel_number = 0x0fffffff
wlan_intf_opcode_supported_infrastructure_auth_cip her_pairs =
0x0fffffff
wlan_intf_opcode_supported_adhoc_auth_cipher_pairs =
0x0fffffff
wlan_intf_opcode_supported_country_or_region_strin g_list =
0x0fffffff
wlan_intf_opcode_current_operation_mode = 0x0fffffff
wlan_intf_opcode_supported_safe_mode = 0x0fffffff
wlan_intf_opcode_certified_safe_mode = 0x0fffffff
wlan_intf_opcode_autoconf_end = 0x0fffffff
wlan_intf_opcode_msm_start = 0x10000100
wlan_intf_opcode_statistics = 0x1fffffff
wlan_intf_opcode_rssi = 0x1fffffff
wlan_intf_opcode_msm_end = 0x1fffffff
wlan_intf_opcode_security_start = 0x20010000
wlan_intf_opcode_security_end = 0x2fffffff
wlan_intf_opcode_ihv_start = 0x30000000
wlan_intf_opcode_ihv_end = 0x3fffffff
End Enum
Thanks in advance,

Toby.

Sep 16 '08 #2
On 16 Sep, 02:32, "Alex Clark" <qua...@noemail.noemailwrote:
Replace all "0x" with "&H" should do the trick, at least as far as I can
tell.

"Toby Webb" <toby.k.w...@googlemail.comwrote in message

news:89**********************************@t54g2000 hsg.googlegroups.com...
How can I convert the following code (from MSDN) to work in VB.NET
(the opcodes are raising errors):
Public Enum WLAN_INTF_OPCODE
* * * *wlan_intf_opcode_autoconf_start = 0x000000000
* * * *wlan_intf_opcode_autoconf_enabled = 0x0fffffff
* * * *wlan_intf_opcode_background_scan_enabled = 0x0fffffff
* * * *wlan_intf_opcode_media_streaming_mode = 0x0fffffff
* * * *wlan_intf_opcode_radio_state = 0x0fffffff
* * * *wlan_intf_opcode_bss_type = 0x0fffffff
* * * *wlan_intf_opcode_interface_state = 0x0fffffff
* * * *wlan_intf_opcode_current_connection = 0x0fffffff
* * * *wlan_intf_opcode_channel_number = 0x0fffffff
* * * *wlan_intf_opcode_supported_infrastructure_auth_ci pher_pairs =
0x0fffffff
* * * *wlan_intf_opcode_supported_adhoc_auth_cipher_pair s =
0x0fffffff
* * * *wlan_intf_opcode_supported_country_or_region_stri ng_list=
0x0fffffff
* * * *wlan_intf_opcode_current_operation_mode = 0x0fffffff
* * * *wlan_intf_opcode_supported_safe_mode = 0x0fffffff
* * * *wlan_intf_opcode_certified_safe_mode = 0x0fffffff
* * * *wlan_intf_opcode_autoconf_end = 0x0fffffff
* * * *wlan_intf_opcode_msm_start = 0x10000100
* * * *wlan_intf_opcode_statistics = 0x1fffffff
* * * *wlan_intf_opcode_rssi = 0x1fffffff
* * * *wlan_intf_opcode_msm_end = 0x1fffffff
* * * *wlan_intf_opcode_security_start = 0x20010000
* * * *wlan_intf_opcode_security_end = 0x2fffffff
* * * *wlan_intf_opcode_ihv_start = 0x30000000
* * * *wlan_intf_opcode_ihv_end = 0x3fffffff
* *End Enum
Thanks in advance,
Toby.- Hide quoted text -

- Show quoted text -
Ah, thanks for that, works a charm.

I don't suppose anyone has the code for using WlanQueryInterface
(WLANAPI) in VB.NET??
Sep 16 '08 #3
Hi Tony,

Those values you have there are wrong I beleive. I would make the values as
:

Enum WLAN_INTF_OPCODE
autoconf_start = &H0
autoconf_enabled
background_scan_enabled
media_streaming_mode
radio_state
bss_type
interface_state
current_connection
channel_number
supported_infrastructure_auth_cipher_pairs
supported_adhoc_auth_cipher_pairs
supported_country_or_region_string_list
current_operation_mode
autoconf_end = &HFFFFFFF
msm_start = &H10000100
statistics
rssi
msm_end = &H1FFFFFFF
security_start = &H20010000
security_end = &H2FFFFFFF
ihv_start = &H30000000
ihv_end = &H3FFFFFFF
End Enum


"Toby Webb" <to*********@googlemail.comwrote in message
news:89**********************************@t54g2000 hsg.googlegroups.com...
How can I convert the following code (from MSDN) to work in VB.NET
(the opcodes are raising errors):

Public Enum WLAN_INTF_OPCODE
wlan_intf_opcode_autoconf_start = 0x000000000
wlan_intf_opcode_autoconf_enabled = 0x0fffffff
wlan_intf_opcode_background_scan_enabled = 0x0fffffff
wlan_intf_opcode_media_streaming_mode = 0x0fffffff
wlan_intf_opcode_radio_state = 0x0fffffff
wlan_intf_opcode_bss_type = 0x0fffffff
wlan_intf_opcode_interface_state = 0x0fffffff
wlan_intf_opcode_current_connection = 0x0fffffff
wlan_intf_opcode_channel_number = 0x0fffffff
wlan_intf_opcode_supported_infrastructure_auth_cip her_pairs =
0x0fffffff
wlan_intf_opcode_supported_adhoc_auth_cipher_pairs =
0x0fffffff
wlan_intf_opcode_supported_country_or_region_strin g_list =
0x0fffffff
wlan_intf_opcode_current_operation_mode = 0x0fffffff
wlan_intf_opcode_supported_safe_mode = 0x0fffffff
wlan_intf_opcode_certified_safe_mode = 0x0fffffff
wlan_intf_opcode_autoconf_end = 0x0fffffff
wlan_intf_opcode_msm_start = 0x10000100
wlan_intf_opcode_statistics = 0x1fffffff
wlan_intf_opcode_rssi = 0x1fffffff
wlan_intf_opcode_msm_end = 0x1fffffff
wlan_intf_opcode_security_start = 0x20010000
wlan_intf_opcode_security_end = 0x2fffffff
wlan_intf_opcode_ihv_start = 0x30000000
wlan_intf_opcode_ihv_end = 0x3fffffff
End Enum
Thanks in advance,

Toby.
Sep 16 '08 #4
On 16 Sep, 14:20, "Bill McCarthy" <B...@localhost.comwrote:
Hi Tony,

Those values you have there are wrong I beleive. *I would make the values as
:

Enum WLAN_INTF_OPCODE
* *autoconf_start = &H0
* *autoconf_enabled
* *background_scan_enabled
* *media_streaming_mode
* *radio_state
* *bss_type
* *interface_state
* *current_connection
* *channel_number
* *supported_infrastructure_auth_cipher_pairs
* *supported_adhoc_auth_cipher_pairs
* *supported_country_or_region_string_list
* *current_operation_mode
* *autoconf_end = &HFFFFFFF
* *msm_start = &H10000100
* *statistics
* *rssi
* *msm_end = &H1FFFFFFF
* *security_start = &H20010000
* *security_end = &H2FFFFFFF
* *ihv_start = &H30000000
* *ihv_end = &H3FFFFFFF
End Enum

"Toby Webb" <toby.k.w...@googlemail.comwrote in message

news:89**********************************@t54g2000 hsg.googlegroups.com...
How can I convert the following code (from MSDN) to work in VB.NET
(the opcodes are raising errors):
Public Enum WLAN_INTF_OPCODE
* * * *wlan_intf_opcode_autoconf_start = 0x000000000
* * * *wlan_intf_opcode_autoconf_enabled = 0x0fffffff
* * * *wlan_intf_opcode_background_scan_enabled = 0x0fffffff
* * * *wlan_intf_opcode_media_streaming_mode = 0x0fffffff
* * * *wlan_intf_opcode_radio_state = 0x0fffffff
* * * *wlan_intf_opcode_bss_type = 0x0fffffff
* * * *wlan_intf_opcode_interface_state = 0x0fffffff
* * * *wlan_intf_opcode_current_connection = 0x0fffffff
* * * *wlan_intf_opcode_channel_number = 0x0fffffff
* * * *wlan_intf_opcode_supported_infrastructure_auth_ci pher_pairs =
0x0fffffff
* * * *wlan_intf_opcode_supported_adhoc_auth_cipher_pair s =
0x0fffffff
* * * *wlan_intf_opcode_supported_country_or_region_stri ng_list=
0x0fffffff
* * * *wlan_intf_opcode_current_operation_mode = 0x0fffffff
* * * *wlan_intf_opcode_supported_safe_mode = 0x0fffffff
* * * *wlan_intf_opcode_certified_safe_mode = 0x0fffffff
* * * *wlan_intf_opcode_autoconf_end = 0x0fffffff
* * * *wlan_intf_opcode_msm_start = 0x10000100
* * * *wlan_intf_opcode_statistics = 0x1fffffff
* * * *wlan_intf_opcode_rssi = 0x1fffffff
* * * *wlan_intf_opcode_msm_end = 0x1fffffff
* * * *wlan_intf_opcode_security_start = 0x20010000
* * * *wlan_intf_opcode_security_end = 0x2fffffff
* * * *wlan_intf_opcode_ihv_start = 0x30000000
* * * *wlan_intf_opcode_ihv_end = 0x3fffffff
* *End Enum
Thanks in advance,
Toby.- Hide quoted text -

- Show quoted text -
Thanks Bill, do you know how the import code should read? I currently
have:

<DllImport("wlanapi", setlasterror:=True)>_
Public Shared Function WlanQueryInterface(_
ByVal clientHandle As IntPtr,_
ByVal pInterfaceGuid As Guid,_
ByVal OpCode As WLAN_INTF_OPCODE,_
ByVal pReserved As IntPtr,_
ByRef pdwDataSize As IntPtr,_
ByRef ppData As IntPtr)_
As UInteger
End Function
Sep 17 '08 #5

"Toby Webb" <to*********@googlemail.comwrote in message
news:84**********************************@34g2000h sh.googlegroups.com...
>
Thanks Bill, do you know how the import code should read? I currently
have:

I make it as :
' DWORD WINAPI
' WlanQueryInterface(
' __in HANDLE hClientHandle,
' __in CONST GUID *pInterfaceGuid,
' __in WLAN_INTF_OPCODE OpCode,
' __reserved PVOID pReserved,
' __out PDWORD pdwDataSize,
' __deref_out_bcount(*pdwDataSize) PVOID *ppData,
' __out_opt PWLAN_OPCODE_VALUE_TYPE pWlanOpcodeValueType
');

Declare Function WlanQueryInterface Lib "wlanapi" ( _
ByVal clientHandle As IntPtr, _
ByRef pInterfaceGuid As Guid, _
ByVal OpCode As WLAN_INTF_OPCODE, _
ByVal pReserved As IntPtr, _
ByRef pdwDataSize As Int32, _
ByRef ppData As IntPtr, _
ByRef pWlanOpcodeValueType As Int32) _
As UInt32
Note the second parameter pInterfaceGuid I think needs to be a pointer to
the GUID, hence I changed it to ByRef, and you didn't have the last
parameter, pWlanOpcodeValueType

Sep 17 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nigel Sampson | last post by:
ey all, I'm in the process of creating a method of tracking whenever an objects properties are changed. Since its not possible to alter existing types I decided to used a proxy generated using...
0
by: john | last post by:
Hi,All Gurus: It is kind of complicated, please bear with me and let me know if you have any questions. Thanks a lot in advance. John I have a csharp method, using emit to dynamically generate...
0
by: john | last post by:
Hi,All MS Tech Gurus: I need your help!!! It is the second time I post this message, I need get some feedback ASAP, Please Help!! Thanks a lot in advance. John I have a csharp method, using...
2
by: Striped | last post by:
Is there any tool to convert source code, e.g. of a C# method, to opcodes being used in System.Reflection.Emit? It's a real pain to do that manually, especially for big pieces of code. public...
4
by: Gianluca | last post by:
This is the simplified code I'm trying to generate: ilg.DeclareLocal(typeof(int)); // define local integer Label exit = ilg.DefineLabel(); // define "exit" label ...
2
by: Luis Arvayo | last post by:
Hi, In c#, I need to dynamically create types at runtime that will consist of the following: - inherits from a given interface - will have a constructor with an int argument
2
by: Fabiano Sidler | last post by:
Hi folks! Studying python byte code I encountered an interesting issue: there is no matter, which one of the following function calls I compile: 1: func('foo','bar',foo='bar') 2:...
0
by: =?Utf-8?B?TU1B?= | last post by:
Hi All, Need help with writing a wrapper around wlanapi.dll. I am able to successfully call WlanOpenHandle and get a handler back; but when I call WlanEnumInterfaces or WlanGetAvailableNetworkList...
2
by: Nelson Guerrero | last post by:
Hi, I'm trying to obtain the profile list using the wlanapi.dll but I'm receveing errors. The following code is what I've done so far. I took the structures and functions definition from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.