Latest news: November 14, 2008
Advanced WiFi-Manager v3.2 released!
October 21, 2008
WinI2C/DDC Lite v3.22 released!
October 20, 2008
Advanced WiFi-Manager v3.1 released!
October 17, 2008
WinI2C/DDC v3.22 released!
| | |
|
WiFi-Manager: Developer's Guide
|
WiFi-Manager API Reference
* - Available for Advanced WiFi-Manager only.
DWORD EnableLog(char *path, int removeold)
For debug purposes. This function enables the log file for WiFi-Manager library.
Parameters:
| path [IN] - Path to the log file. |
| removeold [IN] - Parameter that specifies whether to remove old log file or not. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function EnableLog (ByVal path As String, removeold As Long) As Long
Delphi declaration:
function EnableLog(path:pchar; removeold:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: EnableLogW
Top
DWORD DisableLog()
For debug purposes. This function disables the log file for WiFi-Manager library.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DisableLog () As Long
Delphi declaration:
function DisableLog():DWORD; stdcall;
Top
DWORD WriteLog(char *Str)
For debug purposes. This function appends string to the log file for WiFi-Manager library.
Parameters:
| Str [IN] - String to append. |
Return value: Zero if success, otherwise
error code.
VB declaration:
VB declaration: Function WriteLog (ByVal str As String) As Long
Delphi declaration:
function WriteLog(str:pchar):DWORD; stdcall;
Unicode support: Unicode version of this function: WriteLogW
Top
DWORD EnumerateAdapters()
Enumerates available wireless adapters.
Parameters: None
Return value: Number of adapters found if success, otherwise
error code.
VB declaration:
Function EnumerateAdapters () As Long
Delphi declaration:
function EnumerateAdapters():DWORD; stdcall;
Top
DWORD GetAdapterGUID(int AdapterInd, LPTSTR Guid, int MaxCount)
Receives GUID string of the adapter.
Parameters:
| AdapterInd [IN] - Adapter index. |
| Guid [OUT] - Pointer to a buffer that receives the adapter's GUID string.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of Guid string if success, otherwise
error code.
VB declaration:
Function GetAdapterGUID (ByVal AdapterInd As Long, ByVal Guid As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetAdapterGUID(AdapterInd:integer; Guid:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetAdapterGUIDW
Top
DWORD GetAdapterName(int AdapterInd, LPTSTR Name, int MaxCount)
Receives name of the adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
| Name [OUT] - Pointer to a buffer that receives the adapter's name.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of the name if success, otherwise
error code.
VB declaration:
Function GetAdapterName (ByVal AdapterInd As Long, ByVal Name As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetAdapterName(AdapterInd:integer; Name:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetAdapterNameW
Top
DWORD CheckAdapterBusyStatus(int AdapterInd, int Timeout)
Checks the status of the adapter and waits if the adapter is busy. It is necessary to check the adapter's state before calling any functions because
if the adapter is busy they will return ERROR_ADAPTERBUSY error.
Parameters:
| AdapterInd [IN] - an adapter index. |
| Timeout [IN] - max time to wait, in milliseconds.
|
Return value: Zero if success, otherwise
error code.
VB declaration:
Function CheckAdapterBusyStatus (ByVal AdapterInd As Long, ByVal Timeout As Long) As Long
Delphi declaration:
function CheckAdapterBusyStatus(AdapterInd:integer; Timeout:integer):dword; stdcall;
Top
DWORD GetAdapterOption(int AdapterInd, int OptionCode)
Retrieves an option value (or values of several options) from the adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
| OptionCode [IN] - an option code, (please refer to constants ).
|
Return value: An option value if success, otherwise
error code.
VB declaration:
Function GetAdapterOption (ByVal AdapterInd As Long, ByVal OptionCode As Long) As Long
Delphi declaration:
function GetAdapterOption(AdapterInd:integer; OptionCode:integer):dword; stdcall;
Top
DWORD SetAdapterOption(int AdapterInd, int OptionCode, int Value)
Sets an option value (or values of several options) to the adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
| OptionCode [IN] - an option code, (please refer to constants ).
| | Value [IN] - new value of the option.
|
Return value: Zero if success, otherwise
error code.
VB declaration:
Function SetAdapterOption (ByVal AdapterInd As Long, ByVal OptionCode As Long, ByVal Value As Long) As Long
Delphi declaration:
function SetAdapterOption(AdapterInd:integer; OptionCode:integer; Value:integer):dword; stdcall;
Top
DWORD CheckNdisAvailable(int AdapterInd)
Checks if Advanced WiFi-Manager can use NDIS to manage specified WiFi adapter. Only one software can manage WiFi adapter,
if Windows WiFi service (WZC or NativeWiFi) or some third-party software already manages specified adapter, this function will return ERROR_NDISBUSY error.
This function is available for Advanced WiFi-Manager only.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Zero if NDIS is available, otherwise
error code.
VB declaration:
Public Declare Function CheckNdisAvailable (ByVal AdapterInd As Long) As Long
Delphi declaration:
function CheckNdisAvailable(AdapterInd:integer):dword; stdcall;
Top
DWORD IsAdapterNativeWIFI(int AdapterInd)
Checks if WiFi adapter uses NativeWiFi driver. Windows Vista has support of drivers that were designed for
Windows 2000/2003/XP and it also supports new type of wireless drivers called NativeWiFi. This function detects
what driver type is used.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: 0 if general WiFi driver model is used, 1 if NativeWiFi driver is used, otherwise
error code.
VB declaration:
Public Declare Function IsAdapterNativeWIFI (ByVal AdapterInd As Long) As Long
Delphi declaration:
function IsAdapterNativeWIFI(AdapterInd:integer):dword; stdcall;
Top
DWORD FreeAllResources()
Frees all memory resources allocated by WiFi-Manager library. You should call this function after using WiFi-Manager library.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function FreeAllResources () As Long
Delphi declaration:
function FreeAllResources():DWORD; stdcall;
Top
DWORD IsNativeWIFI()
Detects if NativeWiFi API is used by Windows to manage WiFi adapters.
Parameters: None
Return value: 1 if NativeWiFi API is used (Windows Vista), otherwise 0.
VB declaration:
Function IsNativeWIFI () As Long
Delphi declaration:
function IsNativeWIFI():DWORD; stdcall;
Top
DWORD IsDirectWIFI()
Checks if direct NDIS calls are used by Advanced WiFi-Manager to manage WiFi adapters. Advanced WiFi-Manager can use two approaches for WiFi
adapters management: Windows WiFi service (WZC or NativeWiFi) or direct NDIS calls. Selected approach depends on Windows version and
current mode (refer to SetLibraryOption function with OPT_MODE parameter).
This function is available for Advanced WiFi-Manager only, for WiFi-Manager it always returns 0.
Parameters: None
Return value: 1 if NDIS calls are used, otherwise 0.
VB declaration:
Function IsDirectWIFI () As Long
Delphi declaration:
function IsDirectWIFI():DWORD; stdcall;
Top
DWORD GetLibraryOption(DWORD OptionIndex)
Retrieves current value of WiFi-Manager library option.
Parameters:
| OptionIndex [IN] - option index, see OPT_xxx constants for possible values. |
Return value: Option value if success, otherwise error code.
VB declaration:
Public Declare Function GetLibraryOption (ByVal OptionIndex As Long) As Long
Delphi declaration:
function GetLibraryOption(OptionIndex:integer):dword; stdcall;
Top
DWORD SetLibraryOption(DWORD OptionIndex, DWORD Value)
Sets new value of WiFi-Manager library option.
Parameters:
| OptionIndex [IN] - option index, see OPT_xxx constants for possible values. |
| Value [IN] - new option value. |
Return value: Zero if success, otherwise error code.
VB declaration:
Public Declare Function SetLibraryOption (ByVal OptionIndex As Long, ByVal Value As Long) As Long
Delphi declaration:
function SetLibraryOption(OptionIndex:integer, Value:integer):dword; stdcall;
Top
DWORD GetWIFIManagerVersion()
Retrieves the version of WiFi-Manager library.
Parameters: None
Return value: Version number if success, otherwise
error code.
VB declaration:
Function GetWIFIManagerVersion () As Long
Delphi declaration:
function GetWIFIManagerVersion():DWORD; stdcall;
Top
DWORD GetWIFIServiceStatus()
Retrieves the status of Windows WiFi service (WZC for Windows XP, WLan for Windows Vista).
Parameters: None
Return value: Service status (0 - service is stopped, 1 - service is running) if success, otherwise
error code.
Note: When Windows WiFi service is stopped, Windows cannot manage wireless networks and WiFi-Manager API will not work.
VB declaration:
Function GetWIFIServiceStatus () As Long
Delphi declaration:
function GetWIFIServiceStatus():DWORD; stdcall;
Top
DWORD SetWIFIServiceStatus(int StartService)
Sets the status of Windows WiFi service (WZC for Windows XP, WLan for Windows Vista).
Parameters:
| StartService [IN] - Status flag. Specify 1 to start the sevice or 0 not stop it. |
Return value: Zero if success, otherwise
error code.
Note: When Windows WiFi service is stopped, Windows cannot manage wireless networks and WiFi-Manager API will not work.
VB declaration:
Function SetWIFIServiceStatus (ByVal StartService As Long) As Long
Delphi declaration:
function SetWIFIServiceStatus(StartService:integer):DWORD; stdcall;
Top
DWORD SetStorageOptions(char * FileName, int Flags)
Sets Advanced WiFi-Manager storage options. When Advanced WiFi-manager uses NDIS calls to manage WiFi adapters instead of WCZ or NativeWIFI
it must store some settings (network profiles, adapter options, etc). Default mode is (STORAGE_FILE option) when all settings are stored in
<COMMON_APPDATA>\WiFi-Manager Data\Storage.dat file (COMMON_APPDATA is the file system directory containing application data for all users,
refer to CSIDL_COMMON_APPDATA in MSDN for details) or in any other file you can specify. The second mode is set by STORAGE_MEMORY option,
all settings will be stored in memory and GetStorageData and GetStorageData functions must be used to save/load the data from some permanent storage
(refer to GetStorageData and GetStorageData functions for details). The second mode allows you to encrypt Advanced WiFi-manager settings before saving.
This function is available for Advanced WiFi-Manager only.
Parameters:
| FileName [IN] - Full path and name of the file that will be used for settings, or empty string if you want
to use default file. You must use STORAGE_FILE option to set this parameter. |
| Flags [IN] - Storage flags, see STORAGE_xxx constants for possible values. |
Return value: Zero if success, otherwise
error code.
Note: You should use this function only once and before using adapter-related function (EnumerateAdapters, EnumerateProfiles, etc).
VB declaration:
Function SetStorageOptions (ByVal FileName As String, ByVal Flags As Long) As Long
Delphi declaration:
function SetStorageOptions(FileName:pchar; Flags:integer):DWORD; stdcall;
Top
DWORD SetStorageData(char * Data, int Length)
When all settings are stored in memory (this mode is set by STORAGE_MEMORY option, refer to SetStorageOptions function),
this function must be called to set storage data. In general, application that uses Advanced WiFi-Manager must call SetStorageOptions function with
STORAGE_MEMORY option, then load data with settings from some storage and call SetStorageData function to give this data to Advanced WiFi-Manager.
Then all other functions can be called. Before closing, GetStorageData function must be called to obtain
updated settings from the library and an application must save it in some permanent storage.This function is available for Advanced WiFi-Manager only.
Parameters:
| Data [IN] - Data with Advanced WiFi-Manager settings. An application must get this data via previous call of SetStorageData function. |
| Length [IN] - Length of the data. |
Return value: Zero if success, otherwise
error code.
Note: You should use this function only once and before using adapter-related function (EnumerateAdapters, EnumerateProfiles, etc).
VB declaration:
Function SetStorageData (ByVal Data As String, ByVal Length As Long) As Long
Delphi declaration:
function SetStorageData(Data:pchar; Length:integer):DWORD; stdcall;
Top
DWORD GetStorageData(char * Data, int MaxLength)
When all settings are stored in memory (this mode is set by STORAGE_MEMORY option, refer to SetStorageOptions function),
this function must be called to get Advanced WiFi-Manager settings to save it in some permanent storage.
In general, application that uses Advanced WiFi-Manager must call SetStorageOptions function with
STORAGE_MEMORY option, then load data with settings from some storage and call SetStorageData function to give this data to Advanced WiFi-Manager.
Then all other functions can be called. Before closing, GetStorageData function must be called to obtain
updated settings from the library and an application must save it in some permanent storage.
This function is available for Advanced WiFi-Manager only.
Parameters:
| Data [IN] - Pointer to buffer that will obtain Advanced WiFi-Manager settings. |
| MaxLength [IN] - Size of given buffer. Specify 0 if you want to get the size of settings. |
Return value: Zero if success, if MaxLength is 0 then the size of data, otherwise
error code.
Note: It's necessary to call this function twice. At first calling specify MaxLength to get the size of data buffer,
then reserve necessary memory and call this function again:
DWORD Len = GetStorageData(NULL, 0);
char * Data = (char*) malloc(Len);
GetStorageData(Data, Len);
VB declaration:
Function GetStorageData (ByVal Data As String, ByVal MaxLength As Long) As Long
Delphi declaration:
function GetStorageData(Data:pchar; MaxLength:integer):DWORD; stdcall;
Top
DWORD InstallDriver(char *path)
Installs Advanced WiFi-Manager network driver that allows it to use NDIS. This function is available for Advanced WiFi-Manager only.
| path [IN] - Path to folder that contains the driver (wifimanio.sys). For example, "c:\Driver".
If NULL, "<windows>\system32\drivers" path will be used (recommended). You can also specify driver description that will be displayed
in connection properties, for example: "c:\Driver?My Driver" or "?My Driver" to use "<windows>\system32\drivers" path for the driver.
Note: You cannot set driver description in Trial version. |
Return value: Zero if success, otherwise
error code.
Note: Administration privileges are required to call this function. In Windows Vista a warning message will appear about installing unknown driver.
VB declaration:
Function InstallDriver (ByVal path As String) As Long
Delphi declaration:
function InstallDriver(path:pchar):DWORD; stdcall;
Top
DWORD UninstallDriver()
Uninstalls Advanced WiFi-Manager network driver that allows it to use NDIS. This function is available for Advanced WiFi-Manager only.
Parameters: None
Return value: Zero if success, otherwise
error code.
Note: Administration privileges are required to call this function.
VB declaration:
Function UninstallDriver () As Long
Delphi declaration:
function UninstallDriver():DWORD; stdcall;
Top
DWORD IsInstalledDriver()
Checks if Advanced WiFi-Manager network driver is installed. This function is available for Advanced WiFi-Manager only.
Parameters: None
Return value: 0 if the driver is not installed, 1 if the driver is installed, or
error code.
Note: Administration privileges are required to call this function.
VB declaration:
Function IsInstalledDriver () As Long
Delphi declaration:
function IsInstalledDriver():DWORD; stdcall;
Top
DWORD GetAdapterCurrentIPInfo(int AdapterInd, char * IP, char * Mask, char * Gateway, int MaxCount)
Retrieves current IP, network mask, default gateway and DHCP flag of the specified wireless adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
| IP [OUT] - Pointer to a buffer that receives the IP address of the adapter. You must allocate memory for the buffer before calling this function. |
| Mask [OUT] - Pointer to a buffer that receives the network mask of the adapter. You must allocate memory for the buffer before calling this function. |
| Gateway [OUT] - Pointer to a buffer that receives the default gateway of the adapter. You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffers, including the terminating null character. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetAdapterCurrentIPInfo (ByVal AdapterInd As Long, ByVal IP As String, ByVal Mask As String, ByVal Gateway As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetAdapterCurrentIPInfo(AdapterInd:integer; IP:pchar; Mask:pchar; Gateway:pchar; MaxCount:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: GetAdapterCurrentIPInfoW
Top
DWORD GetAdapterIPInfo(int AdapterInd, char * IP, char * Mask, char * Gateway, int * DHCPEnabled, int MaxCount)
Retrieves IP, network mask, default gateway and DHCP flag of the specified wireless adapter. You can see these settings
in adapter's setting dialog in Network Connections window from Windows Control Panel.
Parameters:
| AdapterInd [IN] - an adapter index. |
| IP [OUT] - Pointer to a buffer that receives the IP address of the adapter. You must allocate memory for the buffer before calling this function. |
| Mask [OUT] - Pointer to a buffer that receives the network mask of the adapter. You must allocate memory for the buffer before calling this function. |
| Gateway [OUT] - Pointer to a buffer that receives the default gateway of the adapter. You must allocate memory for the buffer before calling this function. |
| DHCPEnabled [OUT] - DHCP flag: 0 - DHCP is disabled for this adapter, 1 - DHCP is enabled. |
| MaxCount [IN] - Length of the buffers, including the terminating null character. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetAdapterIPInfo (ByVal AdapterInd As Long, ByVal IP As String, ByVal Mask As String, ByVal Gateway As String, ByRef DHCPEnabled As Long, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetAdapterIPInfo(AdapterInd:integer; IP:pchar; Mask:pchar; Gateway:pchar; var DHCPEnabled:integer; MaxCount:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: GetAdapterIPInfoW
Top
DWORD SetAdapterIPInfo(int AdapterInd, char * IP, char * Mask, char * Gateway, int DHCPEnabled)
Sets IP, network mask, default gateway and DHCP flag for the specified wireless adapter. You can see these settings
in adapter's setting dialog in Network Connections window from Windows Control Panel.
Parameters:
| AdapterInd [IN] - an adapter index. |
| IP [IN] - New IP address of the adapter. |
| Mask [IN] - New network mask of the adapter. |
| Gateway [IN] - New default gateway of the adapter. |
| DHCPEnabled [IN] - DHCP flag: 0 - DHCP will be disabled for this adapter, 1 - DHCP will be enabled. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function SetAdapterIPInfo (ByVal AdapterInd As Long, ByVal IP As String, ByVal Mask As String, ByVal Gateway As String, ByVal DHCPEnabled As Long) As Long
Delphi declaration:
function SetAdapterIPInfo(AdapterInd:integer; IP:pchar; Mask:pchar; Gateway:pchar; DHCPEnabled:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: SetAdapterIPInfoW
Top
DWORD GetAdapterMac(int AdapterInd, BYTE * d1, BYTE * d2, BYTE * d3, BYTE * d4, BYTE * d5, BYTE * d6)
Receives MAC address of wireless adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
| d1..d6 [OUT] - MAC address of the network. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetAdapterMac (ByVal AdapterInd As Long, ByRef d1 As Byte, ByRef d2 As Byte, ByRef d3 As Byte, ByRef d4 As Byte, ByRef d5 As Byte, ByRef d6 As Byte) As Long
Delphi declaration:
function GetAdapterMac(AdapterInd:integer; var d1, d2, d3, d4, d5, d6:byte):dword; stdcall;
Top
DWORD GetAdapterFirewallState(int AdapterInd)
Retrieves current state of Windows firewall of the specified wireless adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: 0 - if Windows firewall is turned off for the adapter, 1 - if Windows firewall is turned on for the adapter, or
error code.
Note: The return value does not depend on global firewall state. Use GetWindowsFirewallStatus function to detect if
Windows firewall is enabled on entire system.
VB declaration:
Function GetAdapterFirewallState (ByVal AdapterInd As Long) As Long
Delphi declaration:
function GetAdapterFirewallState(AdapterInd:integer):DWORD; stdcall;
Top
DWORD EnableAdapterFirewall(int AdapterInd)
Enables Windows firewall on the specified wireless adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
Note: This function does not change global firewall state. Use EnableWindowsFirewall function to enable
Windows firewall on entire system.
VB declaration:
Function EnableAdapterFirewall (ByVal AdapterInd As Long) As Long
Delphi declaration:
function EnableAdapterFirewall(AdapterInd:integer):DWORD; stdcall;
Top
DWORD DisableAdapterFirewall(int AdapterInd)
Disables Windows firewall on the specified wireless adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
Note: This function does not change global firewall state. Use DisableWindowsFirewall function to disable
Windows firewall on entire system.
VB declaration:
Function DisableAdapterFirewall (ByVal AdapterInd As Long) As Long
Delphi declaration:
function DisableAdapterFirewall(AdapterInd:integer):DWORD; stdcall;
Top
DWORD RepairAdapter(int AdapterInd)
Calls Windows "Repair" dialog for the specified wireless adapter.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
Note: This function does not work when NDIS calls mode is used.
VB declaration:
Function RepairAdapter (ByVal AdapterInd As Long) As Long
Delphi declaration:
function RepairAdapter(AdapterInd:integer):DWORD; stdcall;
Top
DWORD Ping(char * Host, int Timeout)
Ping specified host name or IP address.
Parameters:
| Host [IN] - a host name or IP address to ping. Some examples: "localhost", "192.168.0.1", "google.com". |
| Timeout [IN] - ping timeout, in milliseconds. |
Return value: Ping time (in milliseconds) if success, otherwise
error code.
VB declaration:
Function Ping (ByVal Host As String, ByVal Timeout As Long) As Long
Delphi declaration:
function Ping(Host:pchar; Timeout:integer):dword; stdcall;
Unicode support: Unicode version of this function: PingW
Top
DWORD EnumerateAvailableNetworks(int AdapterInd, int Search)
Enumerates available wireless networks.
Parameters:
| AdapterInd [IN] - an adapter index. |
| Search [IN] - Discovering flag. Specify 1 to discover available networks, 0 for getting current list of networks. |
Return value: Number of available networks if success, otherwise
error code.
VB declaration:
Function EnumerateAvailableNetworks (ByVal AdapterInd As Long, ByVal Search As Long) As Long
Delphi declaration:
function function EnumerateAvailableNetworks(AdapterInd:integer; Search:integer):dword; stdcall;
Top
DWORD GetAvailableNetworkName(int AdapterInd, int NetworkInd, LPTSTR Name, int MaxCount)
Receives name (SSID) of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
| Name [OUT] - Pointer to a buffer that receives the network's name.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of the name if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkName (ByVal AdapterInd As Long, ByVal NetworkInd As Long, ByVal Name As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetAvailableNetworkName(AdapterInd:integer; NetworkInd:integer; Name:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetAvailableNetworkNameW
Top
DWORD GetAvailableNetworkIndex(int AdapterInd, char * NetName)
Receives network index in the list of available networks.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetName [IN] - name of the network for searching in the list. |
Return value: Network index in the list of available networks if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkIndex (ByVal AdapterInd As Long, ByVal NetName As String) As Long
Delphi declaration:
function GetAvailableNetworkIndex(AdapterInd:integer; NetName:pchar):dword; stdcall;
Unicode support: Unicode version of this function: GetAvailableNetworkIndexW
Top
DWORD GetAvailableNetworkSignalQuality(int AdapterInd, int NetworkInd)
Receives signal quality value of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: Signal quality value (0..100%) if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkSignalQuality (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function GetAvailableNetworkSignalQuality(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD GetAvailableNetworkRSSI(int AdapterInd, int NetworkInd)
Receives RSSI value of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: RSSI value (in dB) if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkRSSI (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function GetAvailableNetworkRSSI(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD GetAvailableNetworkType(int AdapterInd, int NetworkInd)
Receives the type of the available network (infrastructure or adhoc).
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: Network type (see constants ) if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkType (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function GetAvailableNetworkType(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD IsAvailableNetworkSecure(int AdapterInd, int NetworkInd)
Returns whether available network is secure or not.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: Security flag (0 - nonsecure network, 1 - secure network) if success, otherwise
error code.
VB declaration:
Function IsAvailableNetworkSecure (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function IsAvailableNetworkSecure(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD GetAvailableNetworkAuthMode(int AdapterInd, int NetworkInd)
Receives authentication mode of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: Authentication mode (see constants ) if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkAuthMode (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function GetAvailableNetworkAuthMode(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD GetAvailableNetworkCipherMode(int AdapterInd, int NetworkInd)
Receives cipher mode of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: Cipher mode (see constants ) if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkCipherMode (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function GetAvailableNetworkCipherMode(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD GetAvailableNetworkMac(int AdapterInd, int NetworkInd, BYTE * d1, BYTE * d2, BYTE * d3, BYTE * d4, BYTE * d5, BYTE * d6)
Receives MAC address of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
| d1..d6 [OUT] - MAC address of the network. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkMac (ByVal AdapterInd As Long, ByVal NetworkInd As Long, ByRef d1 As Byte, ByRef d2 As Byte, ByRef d3 As Byte, ByRef d4 As Byte, ByRef d5 As Byte, ByRef d6 As Byte) As Long
Delphi declaration:
function GetAvailableNetworkMac(AdapterInd:integer; NetworkInd:integer; var d1, d2, d3, d4, d5, d6:byte):dword; stdcall;
Top
DWORD GetAvailableNetworkChannel(int AdapterInd, int NetworkInd)
Receives channel number of the available network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetworkInd [IN] - an index of available network. |
Return value: Channel number if success, otherwise
error code.
VB declaration:
Function GetAvailableNetworkChannel (ByVal AdapterInd As Long, ByVal NetworkInd As Long) As Long
Delphi declaration:
function GetAvailableNetworkChannel(AdapterInd:integer; NetworkInd:integer):dword; stdcall;
Top
DWORD EnumerateProfiles(int AdapterInd)
Enumerates preferred networks (profiles).
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Number of profiles if success, otherwise
error code.
VB declaration:
Function EnumerateProfiles (ByVal AdapterInd As Long) As Long
Delphi declaration:
function EnumerateProfiles(AdapterInd:integer):dword; stdcall;
Top
DWORD GetProfileName(int AdapterInd, int ProfileInd, LPTSTR Name, int MaxCount)
Receives name of the profile.
Parameters:
| AdapterInd [IN] - an adapter index. |
| ProfileInd [IN] - an index of profile. |
| Name [OUT] - Pointer to a buffer that receives the profile's name.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of the name if success, otherwise
error code.
VB declaration:
Function GetProfileName (ByVal AdapterInd As Long, ByVal ProfileInd As Long, ByVal Name As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetProfileName(AdapterInd:integer; ProfileInd:integer; Name:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetProfileNameW
Top
DWORD GetProfileNetworkIndex(int AdapterInd, char * NetName)
Receives network profile index in the list of profiles.
Parameters:
| AdapterInd [IN] - an adapter index. |
| NetName [IN] - name of the profile for searching in the list. |
Return value: Network profile index in the list of profiles if success, otherwise
error code.
VB declaration:
Function GetProfileNetworkIndex (ByVal AdapterInd As Long, ByVal NetName As String) As Long
Delphi declaration:
function GetProfileNetworkIndex(AdapterInd:integer; NetName:pchar):dword; stdcall;
Unicode support: Unicode version of this function: GetProfileNetworkIndexW
Top
DWORD GetCurrentNetworkName(int AdapterInd, LPTSTR Name, int MaxCount)
Receives name (SSID) of current network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| Name [OUT] - Pointer to a buffer that receives the network's name.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of the name if success, otherwise
error code.
VB declaration:
Function GetCurrentNetworkName (ByVal AdapterInd As Long, ByVal Name As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetCurrentNetworkName(AdapterInd:integer; Name:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetCurrentNetworkNameW
Top
DWORD GetCurrentNetworkChannel(int AdapterInd)
Receives channel number of current network.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Channel number if success, otherwise
error code.
VB declaration:
Function GetCurrentNetworkChannel (ByVal AdapterInd) As Long
Delphi declaration:
function GetCurrentNetworkChannel(AdapterInd:integer):dword; stdcall;
Top
DWORD GetCurrentNetworkSpeed(int AdapterInd)
Receives connection speed of current network.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Connection speed (bits per second) if success, otherwise
error code.
VB declaration:
Function GetCurrentNetworkSpeed (ByVal AdapterInd) As Long
Delphi declaration:
function GetCurrentNetworkSpeed(AdapterInd:integer):dword; stdcall;
Top
DWORD GetCurrentNetworkMac(int AdapterInd, BYTE * d1, BYTE * d2, BYTE * d3, BYTE * d4, BYTE * d5, BYTE * d6)
Receives MAC address of current network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| d1..d6 [OUT] - MAC address of the network. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetCurrentNetworkMac (ByVal AdapterInd As Long, ByRef d1 As Byte, ByRef d2 As Byte, ByRef d3 As Byte, ByRef d4 As Byte, ByRef d5 As Byte, ByRef d6 As Byte) As Long
Delphi declaration:
function GetCurrentNetworkMac(AdapterInd:integer; var d1, d2, d3, d4, d5, d6:byte):dword; stdcall;
Top
DWORD ConnectToNetwork(int AdapterInd, LPTSTR Name)
Connects to specified wireless network.
Parameters:
| AdapterInd [IN] - an adapter index. |
| Name [IN] - Pointer to network's name to connect. |
Return value: Zero if success, otherwise
error code.
Note: The network to connect must have a profile.
VB declaration:
Function ConnectToNetwork (ByVal AdapterInd As Long, ByVal Name As String) As Long
Delphi declaration:
function ConnectToNetwork(AdapterInd:integer; Name:pchar):dword; stdcall;
Unicode support: Unicode version of this function: ConnectToNetworkW
Top
DWORD ConnectToNetworkByMAC(int AdapterInd, BYTE d1, BYTE d2, BYTE d3, BYTE d4, BYTE d5, BYTE d6)
Connects to specified wireless network by its MAC address.
Parameters:
| AdapterInd [IN] - an adapter index. |
| d1..d6 [IN] - MAC address of network to connect. |
Return value: Zero if success, otherwise
error code.
Note: The network to connect must have a profile.
VB declaration:
Function ConnectToNetworkByMAC (ByVal AdapterInd As Long, ByVal d1, ByVal d2, ByVal d3, ByVal d4, ByVal d5, ByVal d6) As Long
Delphi declaration:
function ConnectToNetworkByMAC(AdapterInd:integer; d1, d2, d3, d4, d5, d6:byte):dword; stdcall;
Top
DWORD DisconnectFromNetwork(int AdapterInd)
Disconnects from current wireless network.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DisconnectFromNetwork (ByVal AdapterInd As Long) As Long
Delphi declaration:
function DisconnectFromNetwork(AdapterInd:integer):dword; stdcall;
Top
DWORD MoveProfile(int AdapterInd, int ProfileInd, int NewIndex)
Changes profile's index in the profiles list.
Parameters:
| AdapterInd [IN] - an adapter index. |
| ProfileInd [IN] - an index of the profile that will be moved. |
| NewIndex [IN] - new index of the profile. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function MoveProfile (ByVal AdapterInd As Long, ByVal ProfileInd As Long, ByVal NewIndex As Long) As Long
Delphi declaration:
function MoveProfile(AdapterInd:integer; ProfileInd:integer; NewIndex:integer):dword; stdcall;
Top
DWORD DeleteProfile(int AdapterInd, int ProfileInd, int NewIndex)
Removes profile from the profiles list.
Parameters:
| AdapterInd [IN] - an adapter index. |
| ProfileInd [IN] - an index of the profile. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DeleteProfile (ByVal AdapterInd As Long, ByVal ProfileInd As Long) As Long
Delphi declaration:
function DeleteProfile(AdapterInd:integer; ProfileInd:integer):dword; stdcall;
Top
DWORD OpenProfilesUI(int AdapterInd)
Opens 'Wireless Networks' Windows dialog.
Parameters:
| AdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function OpenProfilesUI (ByVal AdapterInd As Long) As Long
Delphi declaration:
function OpenProfilesUI(AdapterInd:integer):dword; stdcall;
Top
DWORD CreateTmpProfile(int Template)
Creates a temporary profile for wireless network. After temporary profile creation you can change its settings, save it to XML file or
copy it to some wireless adapter's profiles list. You must call FreeTmpProfile function when the temporary profile is not necessary anymore.
Parameters:
| Template [IN] - a profile template index (see constants ). |
Return value: A temporary profile handle if success, otherwise
error code. The temporary profile handle is valid only for functions which works with temporary
profiles, you cannot use it as "ProfileInd" parameter for the functions which works with "real" adapter's profiles (for example, "MoveProfile" or
"DeleteProfile").
VB declaration:
Function CreateTmpProfile (ByVal Template)
Delphi declaration:
function CreateTmpProfile(Template:integer):dword; stdcall;
Top
DWORD FreeTmpProfile(int ProfileHandle)
Frees the temporary profile.
Parameters:
| ProfileHandle [IN] - the temporary profile handle. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function FreeTmpProfile (ByVal ProfileHandle) As Long
Delphi declaration:
function FreeTmpProfile(ProfileHandle:integer):dword; stdcall;
Top
DWORD CloneTmpProfile(int ProfileHandle)
Creates a temporary profile that has same settings that the profile described by ProfileHandle parameter has.
You must call FreeTmpProfile function when the temporary profile is not necessary anymore.
Parameters:
| ProfileHandle [IN] - the temporary profile handle.
New temporary profile will have same settings as this profile has. |
Return value: A temporary profile handle if success, otherwise
error code.
VB declaration:
Function CloneTmpProfile (ByVal ProfileHandle) As Long
Delphi declaration:
function CloneTmpProfile(ProfileHandle:integer):dword; stdcall;
Top
DWORD LoadTmpProfile(char * FileName)
Creates a temporary profile from XML file. The XML file must have a valid format that describes a wireless network profile.
Please refer to the "Native WiFi" section of MSDN to obtain the detailed information about XML format:
http://msdn2.microsoft.com/en-us/library/ms707341.aspx
You must call FreeTmpProfile function when the temporary profile is not necessary anymore.
Parameters:
| FileName [IN] - the file name of XML file. |
Return value: A temporary profile handle if success, otherwise
error code.
VB declaration:
Function LoadTmpProfile (ByVal FileName As String) As Long
Delphi declaration:
function LoadTmpProfile(FileName:pchar):dword; stdcall;
Unicode support: Unicode version of this function: LoadTmpProfileW
Top
DWORD LoadTmpProfileFromString(char * Str)
Creates a temporary profile from XML string. The XML string must have a valid format that describes a wireless network profile.
Please refer to the "Native WiFi" section of MSDN to obtain the detailed information about XML format:
http://msdn2.microsoft.com/en-us/library/ms707341.aspx
You must call FreeTmpProfile function when the temporary profile is not necessary anymore.
Parameters:
| Str [IN] - a string that contains profile in XML format. |
Return value: A temporary profile handle if success, otherwise
error code.
VB declaration:
Function LoadTmpProfileFromString (ByVal Str As String) As Long
Delphi declaration:
function LoadTmpProfileFromString(Str:pchar):dword; stdcall;
Unicode support: Unicode version of this function: LoadTmpProfileFromStringW
Top
DWORD GetTmpProfileFromAdapter(int AdapterInd, int ProfileInd)
Creates a temporary profile from the "real" adapter's profile. New temporary profile will have same settings that the adapter's profile has.
You must call FreeTmpProfile function when the temporary profile is not necessary anymore.
Parameters:
| AdapterInd [IN] - an adapter index. |
| ProfileInd [IN] - an index of the adapter's profile. New temporary profile will have same settings as this "real" profile has. |
Return value: A temporary profile handle if success, otherwise
error code.
VB declaration:
Function GetTmpProfileFromAdapter (ByVal AdapterInd, ByVal ProfileInd) As Long
Delphi declaration:
function GetTmpProfileFromAdapter(AdapterInd:integer; ProfileInd:integer):dword; stdcall;
Top
DWORD SetTmpProfileToAdapter(int ProfileHandle, int AdapterInd)
Applies temporary profile to the adapter. If the adapter's profiles list has a profile with same SSID then this profile will be replaced with the temporary
profile, otherwise a new profile will be added to the adapter's profiles list.
Parameters:
| ProfileHandle [IN] - a temporary profile handle. |
| AdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
Example:
The code snippet below adds new profile to the first adapter:
EnumerateAdapters(); //enumerate adapters
EnumerateProfiles(0); //enumerate profiles for the first adapter
DWORD ProfHandle = CreateTmpProfile(TEMPLATE_UNSECURE_OPEN); //create new tmp profile
SetTmpProfileOption(ProfHandle, ".name", "samplessid"); //you always should set the profile's name same as SSID
SetTmpProfileOption(ProfHandle, ".ssid", "samplessid"); //set SSID
SetTmpProfileToAdapter(ProfHandle, 0); //apply tmp profile to the first adapter
FreeTmpProfile(ProfHandle); //free tmp profile
VB declaration:
Function SetTmpProfileToAdapter (ByVal ProfileHandle, ByVal AdapterInd) As Long
Delphi declaration:
function SetTmpProfileToAdapter(ProfileHandle:integer; AdapterInd:integer):dword; stdcall;
Top
DWORD SetTmpProfileOption(int ProfileHandle, char * OptionName, char * Value)
Sets an option in a temporary profile. Temporary profile options are stored as XML document, if an option is exists it will be modified, otherwise this
option will be created.
Please refer to the "Native WiFi" section of MSDN to obtain the detailed information about XML format:
http://msdn2.microsoft.com/en-us/library/ms707341.aspx
Parameters:
| ProfileHandle [IN] - a temporary profile handle. |
| OptionName [IN] - full path that describes the XML option. Here are some examples: |
|
| name | The profile name |
| SSIDConfig/SSID/name | SSID |
| MSM/security/authEncryption/authentication | "authentication" element (open, shared, WPA, WPAPSK, WPA2, WPA2PSK) |
| MSM/security/authEncryption/encryption | "encryption" element (none, WEP, TKIP, AES) |
| MSM/security/sharedKey/keyMaterial | The network key |
|
| |
| You also can use the following short names (aliases):
| Alias | Full Path |
| .Name | name |
| .SSID | SSIDConfig/SSID/name |
| .nonBroadcast | SSIDConfig/nonBroadcast |
| .ConnectionType | connectionType |
| .ConnectionMode | connectionMode |
| .Authentication | MSM/security/authEncryption/authentication |
| .Encryption | MSM/security/authEncryption/encryption |
| .KeyType | MSM/security/sharedKey/keyType |
| .IsKeyProtected | MSM/security/sharedKey/protected |
| .KeyMaterial | MSM/security/sharedKey/keyMaterial |
| .KeyIndex | MSM/security/keyIndex |
| .useOneX | MSM/security/authEncryption/useOneX |
| .PeapUseWindowsCredentials |
MSM/security/OneX/EAPConfig/EapHostConfig/ Config/baseEap:Eap/msPeap:EapType/baseEap:Eap/ msChapV2:EapType/msChapV2:UseWinLogonCredentials |
|
| All aliases have "." as the first character. |
| |
| Advanced WiFi-Manager 802.1X support when own 802.1X supplicator is used (i.e. when NDIS calls mode is used):
| Alias | Full Path |
| .EapLogin | MSM/security/OneX/EapLogin |
| .EapPsw | MSM/security/OneX/EapPsw |
| .EapCertFile | MSM/security/OneX/EapCertFile |
|
| |
| Value [IN] - New value for the XML option. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function SetTmpProfileOption (ByVal ProfileHandle, ByVal OptionName As String, ByVal Value As String) As Long
Delphi declaration:
function SetTmpProfileOption(ProfileHandle:integer; OptionName:pchar; Value:pchar):dword; stdcall;
Unicode support: Unicode version of this function: SetTmpProfileOptionW
Top
DWORD GetTmpProfileOption(int ProfileHandle, char * OptionName, char * Value, int MaxCount)
Retrieves an option from a temporary profile. Temporary profile options are stored as XML document, if an option does not exist then
ERROR_OPTIONNOTFOUND error code will be returned.
Please refer to the "Native WiFi" section of MSDN to obtain the detailed information about XML format:
http://msdn2.microsoft.com/en-us/library/ms707341.aspx
Parameters:
| ProfileHandle [IN] - a temporary profile handle. |
| OptionName [IN] - full path that describes the XML option.
Refer to SetTmpProfileOption function description for details. |
| Value [OUT] - Pointer to a buffer that receives the option's value.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetTmpProfileOption (ByVal ProfileHandle, ByVal OptionName As String, ByVal Value As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetTmpProfileOption(ProfileHandle:integer; OptionName:pchar; Value:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetTmpProfileOptionW
Top
DWORD SetDefaultEapConfig(int ProfileHandle, int EapEnabled, int UseWindowsCredentials)
This function is used for configuring networks with Radius server.
Sets default 802.1X configuration for a temporary profile if Windows 802.1X supplicator is used, don't use this function if you
use built-in 802.1X supplicator of Advanced WiFi-Manager (i.e. when NDIS calls mode is used).
Default EAP configuration is Protected-EAP (PEAP) and EAP-MSCHAP v2 authentication method,
server certificate checking is disabled. Temporary profile options are stored as XML document, if an option is exists it will be modified, otherwise this
option will be created. For Windows XP SP2/SP3 server certificate checking is not supported, for Windows Vista you can use all features of
NariveWiFi API, please refer to the "Native WiFi" section of MSDN to obtain the detailed information about XML format:
http://msdn2.microsoft.com/en-us/library/ms707341.aspx
Parameters:
| ProfileHandle [IN] - a temporary profile handle. |
| EapEnabled [IN] - specify 0 to disable using 802.1x authentication, 1 to enable 802.1x authentication. |
| UseWindowsCredentials [IN] - specify 0 if you want to type login and password every time at connection, or
specify 1 if you want to use logon name and password of current Windows user automatically.
|
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetTmpProfileOption (ByVal ProfileHandle, ByVal EapEnabled As Long, ByVal UseWindowsCredentials As Long) As Long
Delphi declaration:
function SetDefaultEapConfig(ProfileHandle:integer; EapEnabled:integer; UseWindowsCredentials:integer):dword; stdcall;
Top
DWORD DeleteTmpProfileOption(int ProfileHandle, char * OptionName)
Removes an option from temporary profile. Temporary profile options are stored as XML document, if an option is exists it will be modified, otherwise this
option will be created. Please refer to the "Native WiFi" section of MSDN to obtain the detailed information about XML format:
http://msdn2.microsoft.com/en-us/library/ms707341.aspx
Parameters:
| ProfileHandle [IN] - a temporary profile handle. |
| OptionName [IN] - full path that describes the XML option.
Refer to SetTmpProfileOption function description for details. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DeleteTmpProfileOption (ByVal ProfileHandle, ByVal OptionName As String) As Long
Delphi declaration:
function DeleteTmpProfileOption(ProfileHandle:integer; OptionName:pchar):dword; stdcall;
Unicode support: Unicode version of this function: DeleteTmpProfileOptionW
Top
DWORD SaveTmpProfile(int ProfileHandle, char * FileName)
Saves settings of the temporary profile to XML file.
Parameters:
| ProfileHandle [IN] - the temporary profile handle. |
| FileName [IN] - file name for XML file. |
Return value: Zero if success, otherwise
error code.
Example:
The code snippet below saves TEMPLATE_UNSECURE_OPEN profile template to "c:\SampleProfile.xml" file:
DWORD ProfHandle = CreateTmpProfile(TEMPLATE_UNSECURE_OPEN); //create new tmp profile
SaveTmpProfile(ProfHandle, "c:\\SampleProfile.xml"); //save tmp profile
FreeTmpProfile(ProfHandle); //free tmp profile
VB declaration:
Function SaveTmpProfile (ByVal ProfileHandle, ByVal FileName As String) As Long
Delphi declaration:
function SaveTmpProfile(ProfileHandle:integer; FileName:pchar):dword; stdcall;
Unicode support: Unicode version of this function: SaveTmpProfileW
Top
DWORD GetWindowsFirewallStatus(int * ExceptionsNotAllowed, int * NotificationsDisabled)
Retrieves global (for entire system) settings of Windows firewall.
Parameters:
| ExceptionsNotAllowed [OUT] - 0 - if some adapters can be excluded from the firewall even if it is enabled on entire system,
1 - exceptions are not allowed, i.e. the firewall will be enabled for all adapters even if you use DisableAdapterFirewall function. |
| NotificationsDisabled [OUT] - 0 - allow Windows to display firewall's notifications, 1 - disable these notifications. |
Return value: 0 - if Windows firewall is disabled on entire system, 1 - if Windows firewall is enabled on entire system, or
error code.
VB declaration:
Function GetWindowsFirewallStatus (ByRef ExceptionsNotAllowed As Long, ByRef NotificationsDisabled As Long) As Long
Delphi declaration:
function GetWindowsFirewallStatus(var ExceptionsNotAllowed:integer; var NotificationsDisabled:integer):dword; stdcall;
Top
DWORD EnableWindowsFirewall(int ExceptionsNotAllowed, int NotificationsDisabled)
Enables Windows firewall on entire system.
Parameters:
| ExceptionsNotAllowed [IN] - 0 - if some adapters can be excluded from the firewall even if it is enabled on entire system,
1 - exceptions are not allowed, i.e. the firewall will be enabled for all adapters even if you use DisableAdapterFirewall function,
2 - leave this setting unchanged. |
| NotificationsDisabled [IN] - 0 - allow Windows to display firewall's notifications, 1 - disable these notifications,
2 - leave this setting unchanged. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function EnableWindowsFirewall (ByVal ExceptionsNotAllowed As Long, ByVal NotificationsDisabled As Long) As Long
Delphi declaration:
function EnableWindowsFirewall(ExceptionsNotAllowed:integer; NotificationsDisabled:integer):dword; stdcall;
Top
DWORD DisableWindowsFirewall()
Disables Windows firewall on entire system.
Parameters: None
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DisableWindowsFirewall () As Long
Delphi declaration:
function DisableWindowsFirewall():dword; stdcall;
Top
DWORD EnumerateAllNetAdapters()
Enumerates all available network adapters. This function enumerates both WiFi and LAN adapters. After enumeration you can use
NetAdapter functions (GetNetAdapterName, GetNetAdapterState, EnableNetAdapter, etc).
Parameters: None
Return value: Number of network adapters found if success, otherwise
error code.
VB declaration:
Function EnumerateAllNetAdapters () As Long
Delphi declaration:
function EnumerateAllNetAdapters():DWORD; stdcall;
Top
DWORD GetNetAdapterGUID(int NetAdapterInd, LPTSTR Guid, int MaxCount)
Receives GUID string of network adapter enumerated by EnumerateAllNetAdapters function.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
| Guid [OUT] - Pointer to a buffer that receives network adapter's GUID string.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of Guid string if success, otherwise
error code.
VB declaration:
Function GetNetAdapterGUID (ByVal NetAdapterInd As Long, ByVal Guid As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetNetAdapterGUID(NetAdapterInd:integer; Guid:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetNetAdapterGUIDW
Top
DWORD IsNetAdapterWiFi(int NetAdapterInd)
Checks if network adapter is WiFi adapter.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
Return value: 1 if network adapter is WiFi adapter, 0 if not, otherwise
error code.
VB declaration:
Function IsNetAdapterWiFi Lib "WiFiMan.dll" (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function IsNetAdapterWiFi(NetAdapterInd:integer):dword; stdcall;
Top
DWORD GetNetAdapterName(int NetAdapterInd, LPTSTR Name, int MaxCount)
Receives name of network adapter enumerated by EnumerateAllNetAdapters function.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
| Name [OUT] - Pointer to a buffer that receives network adapter's name.
You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffer, including the terminating null character. |
Return value: Length of the name if success, otherwise
error code.
VB declaration:
Function GetNetAdapterName (ByVal NetAdapterInd As Long, ByVal Name As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetNetAdapterName(NetAdapterInd:integer; Name:pchar; MaxCount:integer):dword; stdcall;
Unicode support: Unicode version of this function: GetNetAdapterNameW
Top
DWORD GetNetAdapterState(int NetAdapterInd)
Receives state of network adapter enumerated by EnumerateAllNetAdapters function.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
Return value: 0 - network adapter is disabled, 1 - network adapter is enabled, otherwise
error code.
VB declaration:
Function GetNetAdapterState (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function GetNetAdapterState(NetAdapterInd:integer):dword; stdcall;
Top
DWORD EnableNetAdapter(int NetAdapterInd)
Enables network adapter enumerated by EnumerateAllNetAdapters function.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function EnableNetAdapter (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function EnableNetAdapter(NetAdapterInd:integer):dword; stdcall;
Top
DWORD DisableNetAdapter(int NetAdapterInd)
Disables network adapter enumerated by EnumerateAllNetAdapters function.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function DisableNetAdapter (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function DisableNetAdapter(NetAdapterInd:integer):dword; stdcall;
Top
DWORD RestartNetAdapter(int NetAdapterInd)
Restarts network adapter enumerated by EnumerateAllNetAdapters function.
Parameters:
| NetAdapterInd [IN] - Network adapter index. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function RestartNetAdapter (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function RestartNetAdapter(NetAdapterInd:integer):dword; stdcall;
Top
DWORD GetNetAdapterCurrentIPInfo(int NetAdapterInd, char * IP, char * Mask, char * Gateway, int MaxCount)
Retrieves current IP, network mask, default gateway and DHCP flag of the specified network adapter.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
| IP [OUT] - Pointer to a buffer that receives the IP address of the adapter. You must allocate memory for the buffer before calling this function. |
| Mask [OUT] - Pointer to a buffer that receives the network mask of the adapter. You must allocate memory for the buffer before calling this function. |
| Gateway [OUT] - Pointer to a buffer that receives the default gateway of the adapter. You must allocate memory for the buffer before calling this function. |
| MaxCount [IN] - Length of the buffers, including the terminating null character. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetNetAdapterCurrentIPInfo (ByVal NetAdapterInd As Long, ByVal IP As String, ByVal Mask As String, ByVal Gateway As String, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetNetAdapterCurrentIPInfo(NetAdapterInd:integer; IP:pchar; Mask:pchar; Gateway:pchar; MaxCount:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: GetNetAdapterCurrentIPInfoW
Top
DWORD GetNetAdapterIPInfo(int NetAdapterInd, char * IP, char * Mask, char * Gateway, int * DHCPEnabled, int MaxCount)
Retrieves IP, network mask, default gateway and DHCP flag of the specified network adapter. You can see these settings
in adapter's setting dialog in Network Connections window from Windows Control Panel.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
| IP [OUT] - Pointer to a buffer that receives the IP address of the adapter. You must allocate memory for the buffer before calling this function. |
| Mask [OUT] - Pointer to a buffer that receives the network mask of the adapter. You must allocate memory for the buffer before calling this function. |
| Gateway [OUT] - Pointer to a buffer that receives the default gateway of the adapter. You must allocate memory for the buffer before calling this function. |
| DHCPEnabled [OUT] - DHCP flag: 0 - DHCP is disabled for this adapter, 1 - DHCP is enabled. |
| MaxCount [IN] - Length of the buffers, including the terminating null character. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function GetNetAdapterIPInfo (ByVal NetAdapterInd As Long, ByVal IP As String, ByVal Mask As String, ByVal Gateway As String, ByRef DHCPEnabled As Long, ByVal MaxCount As Long) As Long
Delphi declaration:
function GetNetAdapterIPInfo(NetAdapterInd:integer; IP:pchar; Mask:pchar; Gateway:pchar; var DHCPEnabled:integer; MaxCount:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: GetNetAdapterIPInfoW
Top
DWORD SetNetAdapterIPInfo(int NetAdapterInd, char * IP, char * Mask, char * Gateway, int DHCPEnabled)
Sets IP, network mask, default gateway and DHCP flag for the specified network adapter. You can see these settings
in adapter's setting dialog in Network Connections window from Windows Control Panel.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
| IP [IN] - New IP address of the adapter. |
| Mask [IN] - New network mask of the adapter. |
| Gateway [IN] - New default gateway of the adapter. |
| DHCPEnabled [IN] - DHCP flag: 0 - DHCP will be disabled for this adapter, 1 - DHCP will be enabled. |
Return value: Zero if success, otherwise
error code.
VB declaration:
Function SetNetAdapterIPInfo (ByVal NetAdapterInd As Long, ByVal IP As String, ByVal Mask As String, ByVal Gateway As String, ByVal DHCPEnabled As Long) As Long
Delphi declaration:
function SetNetAdapterIPInfo(NetAdapterInd:integer; IP:pchar; Mask:pchar; Gateway:pchar; DHCPEnabled:integer):DWORD; stdcall;
Unicode support: Unicode version of this function: SetNetAdapterIPInfoW
Top
DWORD GetNetAdapterMac(int NetAdapterInd, BYTE * d1, BYTE * d2, BYTE * d3, BYTE * d4, BYTE * d5, BYTE * d6)
Receives MAC address of network adapter.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
| d1..d6 [OUT] - MAC address of the network. |
Return value: Zero if success, otherwise
error code.
Note: Network adapter must be enabled before calling this function, otherwise it will return ERROR_FAIL error code.
VB declaration:
Function GetNetAdapterMac (ByVal NetAdapterInd As Long, ByRef d1 As Byte, ByRef d2 As Byte, ByRef d3 As Byte, ByRef d4 As Byte, ByRef d5 As Byte, ByRef d6 As Byte) As Long
Delphi declaration:
function GetNetAdapterMac(NetAdapterInd:integer; var d1, d2, d3, d4, d5, d6:byte):dword; stdcall;
Top
DWORD GetNetAdapterFirewallState(int NetAdapterInd)
Retrieves current state of Windows firewall of the specified network adapter.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
Return value: 0 - if Windows firewall is turned off for the adapter, 1 - if Windows firewall is turned on for the adapter, or
error code.
Note: The return value does not depend on global firewall state. Use GetWindowsFirewallStatus function to detect if
Windows firewall is enabled on entire system.
VB declaration:
Function GetNetAdapterFirewallState (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function GetNetAdapterFirewallState(NetAdapterInd:integer):DWORD; stdcall;
Top
DWORD EnableNetAdapterFirewall(int NetAdapterInd)
Enables Windows firewall on the specified network adapter.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
Note: This function does not change global firewall state. Use EnableWindowsFirewall function to enable
Windows firewall on entire system.
VB declaration:
Function EnableNetAdapterFirewall (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function EnableNetAdapterFirewall(NetAdapterInd:integer):DWORD; stdcall;
Top
DWORD DisableNetAdapterFirewall(int NetAdapterInd)
Disables Windows firewall on the specified network adapter.
Parameters:
| NetAdapterInd [IN] - an adapter index. |
Return value: Zero if success, otherwise
error code.
Note: This function does not change global firewall state. Use DisableWindowsFirewall function to disable
Windows firewall on entire system.
VB declaration:
Function DisableNetAdapterFirewall (ByVal NetAdapterInd As Long) As Long
Delphi declaration:
function DisableNetAdapterFirewall(NetAdapterInd:integer):DWORD; stdcall;
Top
|
|