winebrowser: Convert URL obtained through DdeGetData to Unicode.
This commit is contained in:
parent
bcdfb88e53
commit
3dcf22e03f
|
@ -190,15 +190,27 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv,
|
||||||
return (HDDEDATA)FALSE;
|
return (HDDEDATA)FALSE;
|
||||||
|
|
||||||
case XTYP_EXECUTE:
|
case XTYP_EXECUTE:
|
||||||
|
{
|
||||||
|
char *buffer = NULL;
|
||||||
|
|
||||||
if (!(size = DdeGetData(hData, NULL, 0, 0)))
|
if (!(size = DdeGetData(hData, NULL, 0, 0)))
|
||||||
WINE_ERR("DdeGetData returned zero size of execute string\n");
|
WINE_ERR("DdeGetData returned zero size of execute string\n");
|
||||||
else if (!(ddeString = HeapAlloc(GetProcessHeap(), 0, size)))
|
else if (!(buffer = HeapAlloc(GetProcessHeap(), 0, size)))
|
||||||
WINE_ERR("Out of memory\n");
|
WINE_ERR("Out of memory\n");
|
||||||
else if (DdeGetData(hData, (LPBYTE)ddeString, size, 0) != size)
|
else if (DdeGetData(hData, (LPBYTE)buffer, size, 0) != size)
|
||||||
WINE_WARN("DdeGetData did not return %d bytes\n", size);
|
WINE_WARN("DdeGetData did not return %d bytes\n", size);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int len = MultiByteToWideChar(CP_ACP, 0, buffer, -1, NULL, 0);
|
||||||
|
if (!(ddeString = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
|
||||||
|
WINE_ERR("Out of memory\n");
|
||||||
|
else
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, buffer, -1, ddeString, len);
|
||||||
|
}
|
||||||
|
HeapFree(GetProcessHeap(), 0, buffer);
|
||||||
DdeFreeDataHandle(hData);
|
DdeFreeDataHandle(hData);
|
||||||
return (HDDEDATA)DDE_FACK;
|
return (HDDEDATA)DDE_FACK;
|
||||||
|
}
|
||||||
case XTYP_REQUEST:
|
case XTYP_REQUEST:
|
||||||
ret = -3; /* error */
|
ret = -3; /* error */
|
||||||
if (!(size = DdeQueryStringW(ddeInst, hsz2, NULL, 0, CP_WINUNICODE)))
|
if (!(size = DdeQueryStringW(ddeInst, hsz2, NULL, 0, CP_WINUNICODE)))
|
||||||
|
|
Loading…
Reference in New Issue