[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: advapi32: add more helper functions
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2006-07-31 9:01:25
Message-ID: 87hd0y9mhm.fsf () wine ! dyndns ! org
[Download RAW message or body]

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.

-- 
Alexandre Julliard
julliard@winehq.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic