On input, specifies the size of the buffer, in TCHARs. On output, the number of TCHARs copied to the destination buffer, not including the terminating null character.
On input it should be buffer size, on output it is number of characters.
Hi,
Modern Windows OS allow computer name with more than 15 characteres,
So I propose to update SystemStats::getComputerName() in juce_win32_SystemStats.cpp of Juce 5.4.1, by replacing GetComputerName with GetComputerNameEx like this:
Looking at the docs for GetComputerName() and GetComputerNameEx() it looks like we should be using ComputerNameNetBIOS for the NameType argument for backwards compatibility - GetComputerName() says that it retrieves the “computer name or the cluster virtual server name” which is the same as ComputerNameNetBIOS whereas ComputerNamePhysicalDnsHostname says:
The DNS host name of the local computer. If the local computer is a node in a cluster, lpBuffer receives the DNS host name of the local computer, not the name of the cluster virtual server.
What do you think? Is there a particular reason that you have used ComputerNamePhysicalDnsHostname?
Using ComputerNameNetBIOS and ComputerNamePhysicalNetBIOS with GetComputerNameEx() return the 15 charactere max cropped version ( like GetComputerName old behaviour).
I promote “Physical” NameType to be local and avoid GetComputerNameEx perform slow network query that could timeout when domain is not reachable.
That is why I choose ComputerNamePhysicalDnsHostname