[PATCH v5 1/2] mshtml: for res:// URLs, numeric resource type ids don't need a leading '#'

Damjan Jovanovic damjan.jov at gmail.com
Thu Apr 23 12:44:50 CDT 2020


Numeric resource type ids are either specified as the number
with MAKEINTRESOURCEW(), or as a string prefixed by '#'.
But mshtml's res:// protocol also allows the resource type
id to be a numeric string without the '#' prefix.

Try 5 reuses res_type to store the numeric res_type_id.

Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
---
 dlls/mshtml/protocol.c       | 5 +++++
 dlls/mshtml/tests/protocol.c | 7 +++++++
 2 files changed, 12 insertions(+)
-------------- next part --------------
diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c
index 0f06896c49..6f5b6be866 100644
--- a/dlls/mshtml/protocol.c
+++ b/dlls/mshtml/protocol.c
@@ -585,7 +585,12 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
 
     *res_type++ = 0;
     if ((url_file = wcschr(res_type, '/'))) {
+        LPWSTR endpoint = NULL;
+        DWORD res_type_id;
         *url_file++ = 0;
+        res_type_id = wcstol(res_type, &endpoint, 10);
+        if(!*endpoint)
+            res_type = (LPWSTR)res_type_id;
     }else {
         url_file = res_type;
         res_type = (LPWSTR)RT_HTML;
diff --git a/dlls/mshtml/tests/protocol.c b/dlls/mshtml/tests/protocol.c
index ba767d21c6..75063f5ecf 100644
--- a/dlls/mshtml/tests/protocol.c
+++ b/dlls/mshtml/tests/protocol.c
@@ -596,6 +596,13 @@ static void test_res_protocol(void)
 
     IUnknown_Release(unk);
 
+    test_res_url("/blank.html");
+    test_res_url("/123");
+    test_res_url("/#23/blank.html");
+    test_res_url("/#23/123");
+    test_res_url("/23/blank.html");
+    test_res_url("/23/123");
+
     test_res_url("/jstest.html");
     test_res_url("/Test/res.html");
     test_res_url("/test/dir/dir2/res.html");


More information about the wine-devel mailing list