31 Jul
2006
31 Jul
'06
12:01 p.m.
Robert Reif <reif(a)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. -- Alexandre Julliard julliard(a)winehq.org