[Wine-devel] winebrowser: fix bug 2001.

Ivan Sinitsin =?iso-8859-1?q?ivan_=CE=C1_etersoft=2Eru?=
Пн Июн 30 11:00:30 MSD 2008


Патч так же будет отправлен в основную ветку wine.
Исправляет ошибку 2001.
-- 
Best regards,
Sinitsin Ivan
----------- следующая часть -----------
From b96fd1b67730f3f3309df492c6e8af404978da2b Mon Sep 17 00:00:00 2001
From: Sinitsin Ivan <ivan на etersoft.ru>
Date: Mon, 30 Jun 2008 10:50:06 +0400
Subject: [PATCH] winebrowser: Fix problem with command `wine start http://<something>` when version of windows > NT

---
 programs/winebrowser/main.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c
index 3ad24ae..82bb3b2 100644
--- a/programs/winebrowser/main.c
+++ b/programs/winebrowser/main.c
@@ -201,11 +201,18 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv,
                 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);
+                if (GetVersion() & 0x80000000) {
+                    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);
+                } else {
+                    if (!(ddeString = HeapAlloc(GetProcessHeap(), 0, size)))
+                        WINE_ERR("Out of memory\n");
+                    else
+                       memcpy(ddeString, (LPBYTE)buffer, size);
+                }
             }
             HeapFree(GetProcessHeap(), 0, buffer);
             DdeFreeDataHandle(hData);
-- 
1.5.4.5.GIT



Подробная информация о списке рассылки Wine-devel