Commit 2439b5fd authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Fixes to IShellFolder::GetAttributesOf implementations, spotted by

silverblade_: - a count of zero is allowed to GetAttributesOf if apidl is NULL - SFGAO_VALIDATE must be cleared upon return
parent f438056b
......@@ -552,10 +552,13 @@ ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 * iface, UINT cidl, LPCITEMIDLI
HRESULT hr = S_OK;
TRACE("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08lx))\n",
This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
if ((!cidl) ||(!apidl) ||(!rgfInOut))
return E_INVALIDARG;
if (!rgfInOut)
return E_INVALIDARG;
if (cidl && !apidl)
return E_INVALIDARG;
if (*rgfInOut == 0)
*rgfInOut = ~0;
......@@ -566,6 +569,8 @@ ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 * iface, UINT cidl, LPCITEMIDLI
apidl++;
cidl--;
}
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*rgfInOut &= ~SFGAO_VALIDATE;
TRACE("-- result=0x%08lx\n", *rgfInOut);
return hr;
......
......@@ -430,10 +430,12 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n",
This, cidl, apidl, *rgfInOut);
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08lx))\n",
This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
if (!cidl || !apidl || !rgfInOut)
if (!rgfInOut)
return E_INVALIDARG;
if (cidl && !apidl)
return E_INVALIDARG;
if (*rgfInOut == 0)
......@@ -446,6 +448,8 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
apidl++;
cidl--;
}
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*rgfInOut &= ~SFGAO_VALIDATE;
TRACE ("-- result=0x%08lx\n", *rgfInOut);
......
......@@ -576,10 +576,12 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl,
HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl,
*rgfInOut);
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08lx))\n", This, cidl, apidl,
rgfInOut, rgfInOut ? *rgfInOut : 0);
if ((!cidl) || (!apidl) || (!rgfInOut))
if (!rgfInOut)
return E_INVALIDARG;
if (cidl && !apidl)
return E_INVALIDARG;
if (*rgfInOut == 0)
......@@ -591,6 +593,8 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl,
apidl++;
cidl--;
}
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*rgfInOut &= ~SFGAO_VALIDATE;
TRACE ("-- result=0x%08lx\n", *rgfInOut);
......
......@@ -428,9 +428,12 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08lx))\n",
This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
if (!cidl || !apidl || !rgfInOut)
if (!rgfInOut)
return E_INVALIDARG;
if (cidl && !apidl)
return E_INVALIDARG;
if (*rgfInOut == 0)
......@@ -443,6 +446,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
apidl++;
cidl--;
}
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*rgfInOut &= ~SFGAO_VALIDATE;
TRACE ("-- result=0x%08lx\n", *rgfInOut);
return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment