mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[SHELL32] CDesktopFolder::GetUIObjectOf: fix crash when requested to create a IID_IContextMenu for 0 items.
* Tests show that we should return a valid object even in this case.
This commit is contained in:
parent
d2b91deb33
commit
0d077c3068
1 changed files with 5 additions and 2 deletions
|
@ -608,7 +608,7 @@ HRESULT WINAPI CDesktopFolder::GetUIObjectOf(
|
|||
|
||||
if (IsEqualIID (riid, IID_IContextMenu))
|
||||
{
|
||||
if (_ILIsSpecialFolder(apidl[0]))
|
||||
if (cidl > 0 && _ILIsSpecialFolder(apidl[0]))
|
||||
{
|
||||
hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
|
||||
}
|
||||
|
@ -619,7 +619,10 @@ HRESULT WINAPI CDesktopFolder::GetUIObjectOf(
|
|||
/* Otherwise operations like that involve items from both user and shared desktop will not work */
|
||||
HKEY hKeys[16];
|
||||
UINT cKeys = 0;
|
||||
AddFSClassKeysToArray(apidl[0], hKeys, &cKeys);
|
||||
if (cidl > 0)
|
||||
{
|
||||
AddFSClassKeysToArray(apidl[0], hKeys, &cKeys);
|
||||
}
|
||||
|
||||
DEFCONTEXTMENU dcm;
|
||||
dcm.hwnd = hwndOwner;
|
||||
|
|
Loading…
Reference in a new issue