[PATCH] mshtml: call install_cab_file() with name directly on non-Wine

Marcus Meissner marcus at jet.franken.de
Wed Feb 4 12:11:10 CST 2009


Hi,

A ReactOS developer told me that if the wine_get_dos_file_name() does
not return a function, we should just pass in the current filename
to install_cab_file.

So I coded it, but the non-UNIX path is untested.

Wonder why he does not send a patch himself.

Ciao, Marcus
---
 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 932c6c5..911254a 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 { /* ReactOS 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);
-- 
1.5.6



More information about the wine-patches mailing list