[advapi32] QueryServiceConfig2 (resend)

Alexandre Julliard julliard at winehq.org
Thu Jan 10 05:09:02 CST 2008


Stefan Leichter <Stefan.Leichter at camline.com> writes:

> +#define MAP_STR(str) \
> +    do { \
> +        if (configW->str) \
> +        { \
> +            DWORD sz = WideCharToMultiByte( CP_ACP, 0, configW->str, -1, p, n, NULL, NULL ); \
> +            if (!sz) { \
> +                FIXME("WideCharToMultiByte failed for configW->%s\n", #str ); \
> +                ret = FALSE; \
> +                goto cleanup; \
> +            } \
> +            configA->str = p; \
> +            p += sz; \
> +            n -= sz; \
> +        } \
> +        else configA->str = NULL; \
> +    } while (0)
> +
> +    switch(dwLevel) {
> +        case SERVICE_CONFIG_DESCRIPTION:
> +            {   LPSERVICE_DESCRIPTIONA configA = (LPSERVICE_DESCRIPTIONA) buffer;
> +                LPSERVICE_DESCRIPTIONW configW = (LPSERVICE_DESCRIPTIONW) bufferW;
> +                p = (LPSTR)(configA + 1);
> +                n = size - sizeof(SERVICE_DESCRIPTIONA);
> +                MAP_STR(lpDescription);
> +            }

That's ugly, please get rid of that macro.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list