Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,429 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcomputernamea
C++
BOOL GetComputerNameA(
[out] LPSTR lpBuffer,
[in, out] LPDWORD nSize
);
Is there a maximum length allowed from a computer name, so I can size my lpBuffer?
The maximum number of characters for a Netbios computer name is 15. The buffer passed to GetComputerName should be at least 16 characters.