Home
Company
Developer Tools
WinI2C/DDC
WiFi-Manager
Advanced PDF Viewer
N-Manager
Overview
Download
Order
Online Help
License Agreement
Utilities
Order
Articles
Contacts
Press
Site map
Member zone


Latest news:
September 2, 2010

Advanced WiFi-Manager v4.6 released!


June 18, 2010

Advanced WiFi-Manager v4.5 released!


June 9, 2010

WinI2C/DDC v3.71 released!









 N-Manager: Developer's Guide


N-Manager API Reference


EnumerateAdapters
GetAdapterName
GetAdapterGUID
 
IsAdapterEnabled
EnableAdapter
DisableAdapter
RestartAdapter
RepairAdapter
OpenAdapterProperties
 
GetAdapterCurrentIPInfo
GetAdapterIPInfo
SetAdapterIPInfo
GetAdapterDNS
SetAdapterDNS
GetAdapterMac
GetAdapterDefaultMac
SetAdapterMac
SetAdapterDefaultMac
Ping
 
GetAdapterFirewallState
EnableAdapterFirewall
DisableAdapterFirewall
RepairAdapter
 
GetAdapterFirewallState
EnableAdapterFirewall
DisableAdapterFirewall
GetWindowsFirewallStatus
EnableWindowsFirewall
DisableWindowsFirewall
 
EnableLog
DisableLog
WriteLog
 
GetNManagerVersion
FreeAllResources





DWORD EnumerateAdapters()

Enumerates available network 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 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 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 IsAdapterEnabled(int AdapterInd)

Receives state of network adapter enumerated by EnumerateAdapters function.

Parameters:

AdapterInd [IN] - Network adapter index.


Return value: 0 - network adapter is disabled, 1 - network adapter is enabled, otherwise error code.

VB declaration: Function IsAdapterEnabled (ByVal AdapterInd As Long) As Long

Delphi declaration: function IsAdapterEnabled(AdapterInd:integer):dword; stdcall;


Top

DWORD EnableAdapter(int AdapterInd)

Enables network adapter enumerated by EnumerateAdapters function.

Parameters:

AdapterInd [IN] - Network adapter index.


Return value: Zero if success, otherwise error code.

VB declaration: Function EnableAdapter (ByVal AdapterInd As Long) As Long

Delphi declaration: function EnableAdapter(AdapterInd:integer):dword; stdcall;


Top

DWORD DisableAdapter(int AdapterInd)

Disables network adapter enumerated by EnumerateAdapters function.

Parameters:

AdapterInd [IN] - Network adapter index.


Return value: Zero if success, otherwise error code.

VB declaration: Function DisableAdapter (ByVal AdapterInd As Long) As Long

Delphi declaration: function DisableAdapter(AdapterInd:integer):dword; stdcall;


Top

DWORD RestartAdapter(int AdapterInd)

Restarts network adapter enumerated by EnumerateAdapters function.

Parameters:

AdapterInd [IN] - Network adapter index.


Return value: Zero if success, otherwise error code.

VB declaration: Function RestartAdapter (ByVal AdapterInd As Long) As Long

Delphi declaration: function RestartAdapter(AdapterInd:integer):dword; stdcall;


Top

DWORD RepairAdapter(int AdapterInd)

Calls Windows "Repair" dialog for the specified network adapter.

Parameters:

AdapterInd [IN] - an adapter index.


Return value: Zero if success, otherwise error code.

VB declaration: Function RepairAdapter (ByVal AdapterInd As Long) As Long

Delphi declaration: function RepairAdapter(AdapterInd:integer):DWORD; stdcall;


Top

DWORD OpenAdapterProperties(int AdapterInd)

Opens network adapter properties Windows dialog.

Parameters:

AdapterInd [IN] - an adapter index.


Return value: Zero if success, otherwise error code.

VB declaration: Function OpenAdapterProperties (ByVal AdapterInd As Long) As Long

Delphi declaration: function OpenAdapterProperties(AdapterInd:integer):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 network 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 network 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 network 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 GetAdapterDNS(int AdapterInd, char * DNS, int MaxCount)

Receives DNS address string of network adapter.

Parameters:

AdapterInd [IN] - an adapter index.
DNS [OUT] - Pointer to a buffer that receives the DNS address of the adapter. You must allocate memory for the buffer before calling this function.
MaxCount [IN] - Length of buffer for DNS string, including the terminating null character.


Return value: Zero if success, otherwise error code.

VB declaration: Function GetAdapterDNS (ByVal AdapterInd As Long, ByVal DNS As String, ByVal MaxCount As Long) As Long

Delphi declaration: function GetAdapterDNS(AdapterInd:integer; DNS:pchar; MaxCount:integer):dword; stdcall;

Unicode support: Unicode version of this function: GetAdapterDNSW


Top

DWORD SetAdapterDNS(int AdapterInd, char * DNS)

Sets new DNS address string of network adapter.

Parameters:

AdapterInd [IN] - an adapter index.
DNS [IN] - New DNS address of the adapter.


Return value: Zero if success, otherwise error code.

VB declaration: Function SetAdapterDNS (ByVal AdapterInd As Long, ByVal DNS As String) As Long

Delphi declaration: function SetAdapterDNS(AdapterInd:integer; DNS:pchar):dword; stdcall;

Unicode support: Unicode version of this function: SetAdapterDNSW


Top

DWORD GetAdapterMac(int AdapterInd, BYTE * d1, BYTE * d2, BYTE * d3, BYTE * d4, BYTE * d5, BYTE * d6)

Receives MAC address of network adapter.

Parameters:

AdapterInd [IN] - an adapter index.
d1..d6 [OUT] - MAC address of network adapter.


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 GetAdapterDefaultMac(int AdapterInd, BYTE * d1, BYTE * d2, BYTE * d3, BYTE * d4, BYTE * d5, BYTE * d6)

Receives default MAC address of network adapter. Default MAC is the MAC address that was set by manufacturer.

Parameters:

AdapterInd [IN] - an adapter index.
d1..d6 [OUT] - Default MAC address of network adapter.


Return value: Zero if success, otherwise error code.

VB declaration: Function GetAdapterDefaultMac (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 GetAdapterDefaultMac(AdapterInd:integer; var d1, d2, d3, d4, d5, d6:byte):dword; stdcall;


Top

DWORD SetAdapterMac(int AdapterInd, BYTE d1, BYTE d2, BYTE d3, BYTE d4, BYTE d5, BYTE d6)

Sets new MAC address of network adapter.

Parameters:

AdapterInd [IN] - an adapter index.
d1..d6 [IN] - New MAC address of network adapter.


Return value: Zero if success, otherwise error code.

VB declaration: Function SetAdapterMac (ByVal AdapterInd As Long, ByVal d1 As Byte, ByVal d2 As Byte, ByVal d3 As Byte, ByVal d4 As Byte, ByVal d5 As Byte, ByVal d6 As Byte) As Long

Delphi declaration: function SetAdapterMac(AdapterInd:integer; d1, d2, d3, d4, d5, d6:byte):dword; stdcall;


Top

DWORD SetAdapterDefaultMac(int AdapterInd, BYTE d1, BYTE d2, BYTE d3, BYTE d4, BYTE d5, BYTE d6)

Restores default MAC address of network adapter. Default MAC is the MAC address that was set by manufacturer.

Parameters:

AdapterInd [IN] - an adapter index.
d1..d6 [IN] - New MAC address of network adapter.


Return value: Zero if success, otherwise error code.

VB declaration: Function SetAdapterDefaultMac (ByVal AdapterInd As Long, ByVal d1 As Byte, ByVal d2 As Byte, ByVal d3 As Byte, ByVal d4 As Byte, ByVal d5 As Byte, ByVal d6 As Byte) As Long

Delphi declaration: function SetAdapterDefaultMac(AdapterInd:integer; d1, d2, d3, d4, d5, d6:byte):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 GetAdapterFirewallState(int AdapterInd)

Retrieves current state of Windows firewall of the specified network 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 network 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 network 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 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 EnableLog(char *path, int removeold)

For debug purposes. This function enables the log file for N-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 N-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 N-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 GetNManagerVersion()

Retrieves the version of N-Manager library.

Parameters: None

Return value: Version number if success, otherwise error code.

VB declaration: Function GetNManagerVersion () As Long

Delphi declaration: function GetNManagerVersion():DWORD; stdcall;


Top

DWORD FreeAllResources()

Frees all memory resources allocated by N-Manager library. You should call this function after using N-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




   Copyright ©2002-2010, Nicomsoft Ltd. All Right Reserved.  Privacy Policy  |  Terms of Use