[5/5] user32: Move character conversion logic to dde_server.d & remove todo's

Alexandre Julliard julliard at winehq.org
Fri Sep 5 03:50:36 CDT 2008


Jeff Latimer <lats at yless4u.com.au> writes:

> @@ -772,12 +774,51 @@ static	WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX
>  
>  	if (ptr)
>  	{
> -	    hDdeData = DdeCreateDataHandle(0, ptr, GlobalSize(pXAct->hMem),
> +            DWORD memSize, ptrSize = GlobalSize(pXAct->hMem);
> +
> +            TRACE("Client is %s, Server is %s, Text is %s\n",
> +                  IsWindowUnicode(pConv->hwndClient) ? "Unicode" : "ANSI",
> +                  IsWindowUnicode(pConv->hwndServer) ? "Unicode" : "ANSI",
> +                  IsTextUnicode(ptr, ptrSize, NULL) ? "Unicode" : "ANSI");
> +
> +            if (!(IsWindowUnicode(pConv->hwndClient)) && !(IsWindowUnicode(pConv->hwndServer)) && IsTextUnicode(ptr, ptrSize, NULL))
> +                memSize = WideCharToMultiByte( CP_ACP, 0, ptr, ptrSize / sizeof(WCHAR), NULL, 0, NULL, NULL);
> +
> +            else if (IsWindowUnicode(pConv->hwndServer) && !IsTextUnicode(ptr, ptrSize, NULL))
> +                memSize = MultiByteToWideChar( CP_ACP, 0, ptr, ptrSize, NULL, 0) * sizeof(WCHAR);

Using IsTextUnicode doesn't look right, you shouldn't need to guess.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list