[PATCH 1/5] mstask: Implement ITaskScheduler_GetTargetComputer
Alexandre Julliard
julliard at winehq.org
Mon Nov 5 04:38:00 CST 2012
Detlef Riekenberg <wine.dev at web.de> writes:
> @@ -28,6 +28,22 @@ typedef struct
> LONG ref;
> } TaskSchedulerImpl;
>
> +static LPWSTR get_unc_computername(void)
> +{
> + static WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 3]; /* extra space for two '\' and a zero */
> + DWORD len = MAX_COMPUTERNAME_LENGTH + 1; /* extra space for the zero */
> +
> + if (*buffer)
> + return buffer;
> +
> + if (!GetComputerNameW(buffer + 2, &len))
> + return NULL;
> +
> + buffer[1] = '\\';
> + buffer[0] = '\\';
> + return buffer;
> +}
You don't need a static buffer.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list