Nikolay Sivov : ole32: Support activation context in CLSIDFromProgID().

Alexandre Julliard julliard at winehq.org
Fri Oct 25 10:57:55 CDT 2013


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Oct 24 22:49:20 2013 +0400

ole32: Support activation context in CLSIDFromProgID().

---

 dlls/ole32/compobj.c       |   19 +++++++++++++++++++
 dlls/ole32/tests/compobj.c |   10 +++-------
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 4d791f4..8f3f303 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -135,6 +135,13 @@ struct ifacepsredirect_data
     ULONG name_offset;
 };
 
+struct progidredirect_data
+{
+    ULONG size;
+    DWORD reserved;
+    ULONG clsid_offset;
+};
+
 struct class_reg_data
 {
     union
@@ -2331,12 +2338,24 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
  */
 HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
 {
+    ACTCTX_SECTION_KEYED_DATA data;
+
     if (!progid || !clsid)
     {
         ERR("neither progid (%p) nor clsid (%p) are optional\n", progid, clsid);
         return E_INVALIDARG;
     }
 
+    data.cbSize = sizeof(data);
+    if (FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION,
+                                 progid, &data))
+    {
+        struct progidredirect_data *progiddata = (struct progidredirect_data*)data.lpData;
+        CLSID *alias = (CLSID*)((BYTE*)data.lpSectionBase + progiddata->clsid_offset);
+        *clsid = *alias;
+        return S_OK;
+    }
+
     return clsid_from_string_reg(progid, clsid);
 }
 
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 81f099c..3deedf3 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -379,12 +379,9 @@ static void test_CLSIDFromProgID(void)
 
         clsid = CLSID_NULL;
         hr = CLSIDFromProgID(progidW, &clsid);
-todo_wine
-        ok(hr == S_OK, "got 0x%08x\n", hr);
-        if (hr == S_OK)
-            /* it returns generated CLSID here */
-            ok(!IsEqualCLSID(&clsid, &CLSID_non_existent) && !IsEqualCLSID(&clsid, &CLSID_NULL),
-                "got wrong clsid %s\n", debugstr_guid(&clsid));
+        /* it returns generated CLSID here */
+        ok(!IsEqualCLSID(&clsid, &CLSID_non_existent) && !IsEqualCLSID(&clsid, &CLSID_NULL),
+                 "got wrong clsid %s\n", debugstr_guid(&clsid));
 
         /* duplicate progid present in context - returns generated guid here too */
         clsid = CLSID_NULL;
@@ -393,7 +390,6 @@ todo_wine
         clsid1 = CLSID_StdFont;
         /* that's where it differs from StdFont */
         clsid1.Data4[7] = 0x52;
-todo_wine
         ok(!IsEqualCLSID(&clsid, &CLSID_StdFont) && !IsEqualCLSID(&clsid, &CLSID_NULL) && !IsEqualCLSID(&clsid, &clsid1),
             "got %s\n", debugstr_guid(&clsid));
 




More information about the wine-cvs mailing list