Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/combase/combase.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 3ffd08ab635..fb8f453661f 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -315,7 +315,7 @@ HRESULT open_key_for_clsid(REFCLSID clsid, const WCHAR *keyname, REGSAM access,
lstrcpyW(path, clsidW); StringFromGUID2(clsid, path + lstrlenW(clsidW), CHARS_IN_GUID); - res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key); + res = open_classes_key(HKEY_CLASSES_ROOT, path, access, &key); if (res == ERROR_FILE_NOT_FOUND) return REGDB_E_CLASSNOTREG; else if (res != ERROR_SUCCESS) @@ -1249,6 +1249,8 @@ HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *progi ACTCTX_SECTION_KEYED_DATA data; LONG progidlen = 0; HKEY hkey; + REGSAM opposite = (sizeof(void *) > sizeof(int)) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY; + BOOL is_wow64; HRESULT hr;
if (!progid) @@ -1277,8 +1279,12 @@ HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *progi }
hr = open_key_for_clsid(clsid, L"ProgID", KEY_READ, &hkey); - if (FAILED(hr)) - return hr; + if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64))) + { + hr = open_key_for_clsid(clsid, L"ProgID", opposite | KEY_READ, &hkey); + if (FAILED(hr)) + return hr; + }
if (RegQueryValueW(hkey, NULL, NULL, &progidlen)) hr = REGDB_E_CLASSNOTREG; @@ -2322,7 +2328,7 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
hr = get_ps_clsid_from_registry(path, 0, pclsid); if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64))) - hr = get_ps_clsid_from_registry(path, opposite, pclsid); + hr = get_ps_clsid_from_registry(path, opposite | KEY_READ, pclsid);
if (hr == S_OK) TRACE("() Returning CLSID %s\n", debugstr_guid(pclsid));
On Wed, Mar 09, 2022 at 10:45:58AM +0300, Dmitry Timoshkov wrote:
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/combase/combase.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
Hi Dmitry,
These next two patches are still "in play", I'd just like a little more time to look at them. I thought I'd get the dllhost ones out of the queue first.
Huw.
Hi Huw,
Huw Davies huw@codeweavers.com wrote:
On Wed, Mar 09, 2022 at 10:45:58AM +0300, Dmitry Timoshkov wrote:
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/combase/combase.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
Hi Dmitry,
These next two patches are still "in play", I'd just like a little more time to look at them. I thought I'd get the dllhost ones out of the queue first.
Sure, wow64 patches is a next stage, so taking longer time for the review is fine, and perfectly acceptable.
Thanks!
On Wed, Mar 09, 2022 at 10:45:58AM +0300, Dmitry Timoshkov wrote:
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/combase/combase.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 3ffd08ab635..fb8f453661f 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -315,7 +315,7 @@ HRESULT open_key_for_clsid(REFCLSID clsid, const WCHAR *keyname, REGSAM access,
lstrcpyW(path, clsidW); StringFromGUID2(clsid, path + lstrlenW(clsidW), CHARS_IN_GUID);
- res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key);
- res = open_classes_key(HKEY_CLASSES_ROOT, path, access, &key); if (res == ERROR_FILE_NOT_FOUND) return REGDB_E_CLASSNOTREG; else if (res != ERROR_SUCCESS)
While I think this and the following patch are fine, it would be better if this change and the one in the last hunk were a separate patch.
@@ -2322,7 +2328,7 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
hr = get_ps_clsid_from_registry(path, 0, pclsid);
As you're adding KEY_READ below, shouldn't it also be passed here?
if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64)))
hr = get_ps_clsid_from_registry(path, opposite, pclsid);
hr = get_ps_clsid_from_registry(path, opposite | KEY_READ, pclsid);
if (hr == S_OK) TRACE("() Returning CLSID %s\n", debugstr_guid(pclsid));
Huw.
Hi Huw,
Huw Davies huw@codeweavers.com wrote:
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 3ffd08ab635..fb8f453661f 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -315,7 +315,7 @@ HRESULT open_key_for_clsid(REFCLSID clsid, const WCHAR *keyname, REGSAM access,
lstrcpyW(path, clsidW); StringFromGUID2(clsid, path + lstrlenW(clsidW), CHARS_IN_GUID);
- res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key);
- res = open_classes_key(HKEY_CLASSES_ROOT, path, access, &key); if (res == ERROR_FILE_NOT_FOUND) return REGDB_E_CLASSNOTREG; else if (res != ERROR_SUCCESS)
While I think this and the following patch are fine, it would be better if this change and the one in the last hunk were a separate patch.
Sure.
@@ -2322,7 +2328,7 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
hr = get_ps_clsid_from_registry(path, 0, pclsid);
As you're adding KEY_READ below, shouldn't it also be passed here?
Yes, thanks for spotting this.