Marcus Meissner : mshtml: Call install_cab_file() with name directly on non-Wine.

Alexandre Julliard julliard at winehq.org
Thu Feb 5 09:21:23 CST 2009


Module: wine
Branch: master
Commit: 6af99937b61ff66422d2d8cdeb84eac951bf1f95
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6af99937b61ff66422d2d8cdeb84eac951bf1f95

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Wed Feb  4 19:11:10 2009 +0100

mshtml: Call install_cab_file() with name directly on non-Wine.

---

 dlls/mshtml/install.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/dlls/mshtml/install.c b/dlls/mshtml/install.c
index 9bff0e6..df8c8be 100644
--- a/dlls/mshtml/install.c
+++ b/dlls/mshtml/install.c
@@ -193,18 +193,21 @@ static BOOL install_from_unix_file(const char *file_name)
 
     close(fd);
 
-    if(!wine_get_dos_file_name) {
+    if(!wine_get_dos_file_name)
         wine_get_dos_file_name = (void*)GetProcAddress(GetModuleHandleW(kernel32W), "wine_get_dos_file_name");
-        if(!wine_get_dos_file_name) {
-            ERR("Could not get wine_get_dos_file_name function.\n");
-            return FALSE;
-        }
-    }
 
-    dos_file_name = wine_get_dos_file_name(file_name);
-    if(!dos_file_name) {
-        ERR("Could not get dos file name of %s\n", debugstr_a(file_name));
-        return FALSE;
+    if(wine_get_dos_file_name) { /* Wine UNIX mode */
+	dos_file_name = wine_get_dos_file_name(file_name);
+	if(!dos_file_name) {
+	    ERR("Could not get dos file name of %s\n", debugstr_a(file_name));
+	    return FALSE;
+	}
+    } else { /* Windows mode */
+	UINT res;
+	WARN("Could not get wine_get_dos_file_name function, calling install_cab directly.\n");
+	res = MultiByteToWideChar( CP_ACP, 0, file_name, -1, 0, 0);
+	dos_file_name = heap_alloc (res*sizeof(WCHAR));
+	MultiByteToWideChar( CP_ACP, 0, file_name, -1, dos_file_name, res);
     }
 
     ret = install_cab(dos_file_name);




More information about the wine-cvs mailing list