Group: System Information - Library: kernel32
The GetComputerNameEx function retrieves a NetBIOS or DNS name associated with the local computer. The names are established at system startup, when the system reads them from the registry.
Retrieving local computer and user names
BOOL GetComputerNameEx(
COMPUTER_NAME_FORMAT NameType,
LPTSTR lpBuffer,
LPDWORD lpnSize
);
DECLARE INTEGER GetComputerNameEx IN kernel32;
INTEGER NameType,;
STRING @ lpBuffer,;
INTEGER @ lpnSize
NameType [in] Type of name to retrieve. This parameter is a value from the COMPUTER_NAME_FORMAT enumeration type.
lpBuffer [out] Pointer to a buffer that receives a null-terminated string containing the computer name or the cluster virtual server name.
lpnSize [in, out] On input, specifies the size of the buffer.
If the function succeeds, the return value is a nonzero value.