From f9e2914ed6780ec88b64c7f00d2a10ae41f7068b Mon Sep 17 00:00:00 2001 From: Alexander Dorofeyev Date: Sun, 29 Jun 2008 15:07:49 +0300 Subject: [PATCH] quartz: Fix registry key creation. --- dlls/quartz/filtermapper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 0676e90905c..bc8d4c8740f 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -1440,8 +1440,12 @@ static HRESULT WINAPI FilterMapper_RegisterPin( if (SUCCEEDED(hr)) { - lRet = RegCreateKeyExW(hPinsKey, wszTypes, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, NULL, NULL); + HKEY hkeyDummy = NULL; + + lRet = RegCreateKeyExW(hPinsKey, wszTypes, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkeyDummy, NULL); hr = HRESULT_FROM_WIN32(lRet); + + if (hkeyDummy) RegCloseKey(hkeyDummy); } CoTaskMemFree(wszClsid); @@ -1511,13 +1515,17 @@ static HRESULT WINAPI FilterMapper_RegisterPinType( if (SUCCEEDED(hr)) { + HKEY hkeyDummy = NULL; + strcpyW(wszKeyName, wszClsidMajorType); strcatW(wszKeyName, wszSlash); strcatW(wszKeyName, wszClsidSubType); - lRet = RegCreateKeyExW(hKey, wszKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, NULL, NULL); + lRet = RegCreateKeyExW(hKey, wszKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkeyDummy, NULL); hr = HRESULT_FROM_WIN32(lRet); CloseHandle(hKey); + + if (hkeyDummy) RegCloseKey(hkeyDummy); } CoTaskMemFree(wszClsid);