[PATCH] mshtml: fixed 2 character vs byte mismatches

Marcus Meissner marcus at jet.franken.de
Thu Aug 1 00:37:09 CDT 2013


GetModuleFileNameW and MultiByteToWideChar get both characters
not bytes as arguments.
---
 dlls/mshtml/tests/protocol.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/tests/protocol.c b/dlls/mshtml/tests/protocol.c
index 04c4714..b4a6fc7 100644
--- a/dlls/mshtml/tests/protocol.c
+++ b/dlls/mshtml/tests/protocol.c
@@ -281,7 +281,7 @@ static void test_res_url(const char *url_suffix)
     HRESULT hres;
 
     memcpy(url, res_url_base, res_url_base_len*sizeof(WCHAR));
-    MultiByteToWideChar(CP_ACP, 0, url_suffix, -1, url+res_url_base_len, sizeof(url)-res_url_base_len);
+    MultiByteToWideChar(CP_ACP, 0, url_suffix, -1, url+res_url_base_len, sizeof(url)/sizeof(WCHAR)-res_url_base_len);
 
     hres = CoCreateInstance(&CLSID_ResProtocol, NULL, CLSCTX_INPROC_SERVER, &IID_IInternetProtocol, (void**)&protocol);
     ok(hres == S_OK, "Could not create ResProtocol instance: %08x\n", hres);
@@ -943,7 +943,7 @@ static void test_javascript_protocol(void)
 
 START_TEST(protocol)
 {
-    res_url_base_len = 6 + GetModuleFileNameW(NULL, res_url_base + 6 /* strlen("res://") */, sizeof(res_url_base)-6);
+    res_url_base_len = 6 + GetModuleFileNameW(NULL, res_url_base + 6 /* strlen("res://") */, sizeof(res_url_base)/sizeof(WCHAR)-6);
 
     OleInitialize(NULL);
 
-- 
1.7.10.4




More information about the wine-patches mailing list