Paul Vriens : mshtml/tests: Fix timeouts on Win9x/ WinMe by using more A-functions.

Alexandre Julliard julliard at winehq.org
Wed Jan 6 13:00:56 CST 2010


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Jan  6 11:37:28 2010 +0100

mshtml/tests: Fix timeouts on Win9x/WinMe by using more A-functions.

---

 dlls/mshtml/tests/script.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index 5cf1d28..fae49c8 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -2221,14 +2221,14 @@ static void test_simple_script(void)
 static void run_js_script(const char *test_name)
 {
     WCHAR url[INTERNET_MAX_URL_LENGTH];
+    char urlA[INTERNET_MAX_URL_LENGTH];
     IPersistMoniker *persist;
     IHTMLDocument2 *doc;
     IMoniker *mon;
-    WCHAR *ptr;
     MSG msg;
     HRESULT hres;
 
-    static const WCHAR resW[] = {'r','e','s',':','/','/'};
+    static const char res[] = "res://";
 
     trace("running %s...\n", test_name);
 
@@ -2239,12 +2239,11 @@ static void run_js_script(const char *test_name)
     set_client_site(doc, TRUE);
     do_advise(doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink);
 
-    memcpy(url, resW, sizeof(resW));
-    ptr = url + sizeof(resW)/sizeof(WCHAR);
-    GetModuleFileNameW(NULL, ptr, sizeof(url)/sizeof(WCHAR) - (ptr-url));
-    ptr += lstrlenW(ptr);
-    *ptr++ = '/';
-    MultiByteToWideChar(CP_ACP, 0, test_name, -1, ptr, sizeof(url)/sizeof(WCHAR) - (ptr-url));
+    lstrcpyA(urlA, res);
+    GetModuleFileNameA(NULL, urlA + lstrlenA(res), sizeof(urlA) - lstrlenA(res));
+    lstrcatA(urlA, "/");
+    lstrcatA(urlA, test_name);
+    MultiByteToWideChar(CP_ACP, 0, urlA, -1, url, sizeof(url)/sizeof(WCHAR));
 
     hres = CreateURLMoniker(NULL, url, &mon);
     ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);




More information about the wine-cvs mailing list