mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
[SHELL32] -CFSFolder: Fix a couple of handle leaks.
svn path=/trunk/; revision=75633
This commit is contained in:
parent
4f8ba0560c
commit
af33a37eb4
1 changed files with 6 additions and 1 deletions
|
@ -85,7 +85,9 @@ HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID* pcl
|
||||||
|
|
||||||
WCHAR wszCLSIDValue[CHARS_IN_GUID];
|
WCHAR wszCLSIDValue[CHARS_IN_GUID];
|
||||||
DWORD dwSize = sizeof(wszCLSIDValue);
|
DWORD dwSize = sizeof(wszCLSIDValue);
|
||||||
if (RegGetValueW(hkeyProgId, NULL, NULL, RRF_RT_REG_SZ, NULL, wszCLSIDValue, &dwSize))
|
LONG res = RegGetValueW(hkeyProgId, NULL, NULL, RRF_RT_REG_SZ, NULL, wszCLSIDValue, &dwSize);
|
||||||
|
RegCloseKey(hkeyProgId);
|
||||||
|
if (res)
|
||||||
{
|
{
|
||||||
ERR("OpenKeyFromFileType succeeded but RegGetValueW failed\n");
|
ERR("OpenKeyFromFileType succeeded but RegGetValueW failed\n");
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
|
@ -254,6 +256,9 @@ HRESULT CFSExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl, RE
|
||||||
{
|
{
|
||||||
initIcon->SetNormalIcon(swShell32Name, 0);
|
initIcon->SetNormalIcon(swShell32Name, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hkey)
|
||||||
|
RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
return initIcon->QueryInterface(iid, ppvOut);
|
return initIcon->QueryInterface(iid, ppvOut);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue