Jeff Latimer <lats(a)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(a)winehq.org