mirror of
https://github.com/reactos/reactos.git
synced 2024-06-27 08:21:31 +00:00
[SHELL32] Fix property sheets that can't be closed due to failed init (#4709)
When a PropertySheet fails to init, that fact is being logged and it shows an empty page, but it can't be closed. Handle second failure properly by using FAILED_UNEXPECTEDLY macro. CORE-18333
This commit is contained in:
parent
456f9f96e7
commit
32c20ab112
|
@ -132,13 +132,20 @@ SH_ShowPropertiesDialog(LPCWSTR pwszPath, LPCITEMIDLIST pidlFolder, PCUITEMID_CH
|
||||||
{
|
{
|
||||||
pFileDefExt->AddRef(); // CreateInstance returns object with 0 ref count
|
pFileDefExt->AddRef(); // CreateInstance returns object with 0 ref count
|
||||||
hr = pFileDefExt->Initialize(pidlFolder, pDataObj, NULL);
|
hr = pFileDefExt->Initialize(pidlFolder, pDataObj, NULL);
|
||||||
if (SUCCEEDED(hr))
|
if (!FAILED_UNEXPECTEDLY(hr))
|
||||||
{
|
{
|
||||||
hr = pFileDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&Header);
|
hr = pFileDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&Header);
|
||||||
if (FAILED(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
{
|
||||||
ERR("AddPages failed\n");
|
ERR("AddPages failed\n");
|
||||||
} else
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ERR("Initialize failed\n");
|
ERR("Initialize failed\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadPropSheetHandlers(wszPath, &Header, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj);
|
LoadPropSheetHandlers(wszPath, &Header, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj);
|
||||||
|
|
Loading…
Reference in a new issue