Maximum, computer name?

Todd Chester 646 Reputation points
2022-11-29T11:33:47.3+00:00

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?

Windows API - Win32
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
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 40,771 Reputation points
    2022-11-29T11:36:25.923+00:00

    The maximum number of characters for a Netbios computer name is 15. The buffer passed to GetComputerName should be at least 16 characters.


0 additional answers

Sort by: Most helpful