Module: wine Branch: master Commit: c22d776e7425ae8466f88bdbb56572c8a4f08859 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c22d776e7425ae8466f88bdbb5...
Author: Andrew Eikum aeikum@codeweavers.com Date: Fri Apr 30 18:03:05 2010 -0500
ole32: Only fail on missing Implemented Categories key if we actually have categories to check.
---
dlls/ole32/comcat.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/dlls/ole32/comcat.c b/dlls/ole32/comcat.c index b8060bd..fe0f7e5 100644 --- a/dlls/ole32/comcat.c +++ b/dlls/ole32/comcat.c @@ -232,18 +232,20 @@ static HRESULT COMCAT_IsClassOfCategories( LPCWSTR string;
/* Check that every given category is implemented by class. */ - res = RegOpenKeyExW(key, impl_keyname, 0, KEY_READ, &subkey); - if (res != ERROR_SUCCESS) return S_FALSE; - for (string = categories->impl_strings; *string; string += 39) { - HKEY catkey; - res = RegOpenKeyExW(subkey, string, 0, 0, &catkey); - if (res != ERROR_SUCCESS) { - RegCloseKey(subkey); - return S_FALSE; + if (*categories->impl_strings) { + res = RegOpenKeyExW(key, impl_keyname, 0, KEY_READ, &subkey); + if (res != ERROR_SUCCESS) return S_FALSE; + for (string = categories->impl_strings; *string; string += 39) { + HKEY catkey; + res = RegOpenKeyExW(subkey, string, 0, 0, &catkey); + if (res != ERROR_SUCCESS) { + RegCloseKey(subkey); + return S_FALSE; + } + RegCloseKey(catkey); } - RegCloseKey(catkey); + RegCloseKey(subkey); } - RegCloseKey(subkey);
/* Check that all categories required by class are given. */ res = RegOpenKeyExW(key, req_keyname, 0, KEY_READ, &subkey);