Commit 0af3bd83 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Support activation context in CLSIDFromProgID().

parent f96631e1
...@@ -135,6 +135,13 @@ struct ifacepsredirect_data ...@@ -135,6 +135,13 @@ struct ifacepsredirect_data
ULONG name_offset; ULONG name_offset;
}; };
struct progidredirect_data
{
ULONG size;
DWORD reserved;
ULONG clsid_offset;
};
struct class_reg_data struct class_reg_data
{ {
union union
...@@ -2331,12 +2338,24 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID) ...@@ -2331,12 +2338,24 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
*/ */
HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid) HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
{ {
ACTCTX_SECTION_KEYED_DATA data;
if (!progid || !clsid) if (!progid || !clsid)
{ {
ERR("neither progid (%p) nor clsid (%p) are optional\n", progid, clsid); ERR("neither progid (%p) nor clsid (%p) are optional\n", progid, clsid);
return E_INVALIDARG; 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); return clsid_from_string_reg(progid, clsid);
} }
......
...@@ -379,12 +379,9 @@ static void test_CLSIDFromProgID(void) ...@@ -379,12 +379,9 @@ static void test_CLSIDFromProgID(void)
clsid = CLSID_NULL; clsid = CLSID_NULL;
hr = CLSIDFromProgID(progidW, &clsid); hr = CLSIDFromProgID(progidW, &clsid);
todo_wine /* it returns generated CLSID here */
ok(hr == S_OK, "got 0x%08x\n", hr); ok(!IsEqualCLSID(&clsid, &CLSID_non_existent) && !IsEqualCLSID(&clsid, &CLSID_NULL),
if (hr == S_OK) "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 */ /* duplicate progid present in context - returns generated guid here too */
clsid = CLSID_NULL; clsid = CLSID_NULL;
...@@ -393,7 +390,6 @@ todo_wine ...@@ -393,7 +390,6 @@ todo_wine
clsid1 = CLSID_StdFont; clsid1 = CLSID_StdFont;
/* that's where it differs from StdFont */ /* that's where it differs from StdFont */
clsid1.Data4[7] = 0x52; clsid1.Data4[7] = 0x52;
todo_wine
ok(!IsEqualCLSID(&clsid, &CLSID_StdFont) && !IsEqualCLSID(&clsid, &CLSID_NULL) && !IsEqualCLSID(&clsid, &clsid1), ok(!IsEqualCLSID(&clsid, &CLSID_StdFont) && !IsEqualCLSID(&clsid, &CLSID_NULL) && !IsEqualCLSID(&clsid, &clsid1),
"got %s\n", debugstr_guid(&clsid)); "got %s\n", debugstr_guid(&clsid));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment