The GetPhysicalAddress method returns the media access
control (MAC) address for the primary network adapter. This is a 48
bit or 64 bit address that is assigned to each network interface and
is used for identification and access control. All network devices on
the same subnet must be assigned their own unique MAC address. Unlike
IP addresses which may be assigned dynamically and can be frequently
changed, MAC addresses are considered to be more permanent because
they are usually assigned by the device manufacturer and stored in
firmware. Note that in some cases it is possible to change the address
assigned to a device, and virtual network interfaces may have
configurable MAC addresses.
This method returns the MAC address as a printable string,
with each byte of the address as a two-digit hexadecimal value
separated by a colon. The string buffer passed to the method should
be at least 20 characters long to accommodate the address and
terminating null character. An example of a 48 bit address would be
"01:23:45:67:89:AB". If the local system is multi-homed (having more
than one network adapter) then this method will return the MAC
address for the primary network adapter.
This method is provided for backwards compatibility with previous
versions of the library and it is recommended that new applications
use the GetAdapterAddress method.