Jacek Caban : atl100: Fixed NULL catmap handling in AtlRegisterClassCategoriesHelper.

Alexandre Julliard julliard at winehq.org
Wed Jan 2 14:18:38 CST 2013


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Dec 31 14:29:23 2012 +0100

atl100: Fixed NULL catmap handling in AtlRegisterClassCategoriesHelper.

---

 dlls/atl100/atl.c       |    3 +++
 dlls/atl100/tests/atl.c |    7 +++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/atl100/atl.c b/dlls/atl100/atl.c
index accc88c..1033952 100644
--- a/dlls/atl100/atl.c
+++ b/dlls/atl100/atl.c
@@ -429,6 +429,9 @@ HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID clsid, const struct _AT
 
     TRACE("(%s %p %x)\n", debugstr_guid(clsid), catmap, reg);
 
+    if(!catmap)
+        return S_OK;
+
     if(!catreg) {
         ICatRegister *new_catreg;
 
diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c
index 35ef34b..c640003 100644
--- a/dlls/atl100/tests/atl.c
+++ b/dlls/atl100/tests/atl.c
@@ -154,6 +154,13 @@ static void test_regcat(void)
     test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories");
     test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories");
     test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}");
+
+    ok(RegDeleteKeyA(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}") == ERROR_SUCCESS, "Could not delete key\n");
+
+    hres = AtlRegisterClassCategoriesHelper(&CLSID_Test, NULL, TRUE);
+    ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
+
+    test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}");
 }
 
 static void test_typelib(void)




More information about the wine-cvs mailing list