Packet Sniffer SDK DLL Edition

HNAdapterConfig :: Methods :: AdpCfgGetMACAddress

 Previous Next

Returns the MAC address of the network adapter.

Syntax:

DWORD __stdcall AdpCfgGetMACAddress(HANDLE hCfg, LPVOID pMACAddr, DWORD BufferSize);

Parameters:

hCfg

[in] HNAdapterConfig object handle.

pMACAddr

[in, out] The pointer to the MAC address buffer.

BufferSize

[in] The MAC address buffer size.

Return values:

HNERR_OKNo errors.
HNERR_SIZE_ERRThe buffer size is too small. To allocate enough memory for this buffer, use AdpCfgGetMACAddrSize property before calling the AdpCfgGetMACAddress function.
HNERR_ADDR_ERRpMACAddr has the wrong value (a memory write error).
HNERR_INVALID_HANDLEHNAdapterConfig handle has been created with an error.

Description:

Use AdpCfgGetMACAddress function to obtain the MAC address of the network adapter. MAC address may be necessary for generating a packet, which your application is going to send, or for analysis of the packet received by the network adapter.

See also:HNAdapterConfig, AdpCfgGetMACAddrSize