Robert Reif reif@earthlink.net writes:
/************************************************************
ADVAPI_GetComputerNameW
- Gets the local computer name.
- */
+LPCWSTR ADVAPI_GetComputerNameW() +{
- static WCHAR buf[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD dwSize = sizeof(buf);
- if (!GetComputerNameW(buf, &dwSize))
buf[0] = 0;
- return buf;
You don't want to use a static buffer, that's not thread-safe.