Commit a690db9f authored by David Hedberg's avatar David Hedberg Committed by Alexandre Julliard

shell32: Replace some checks with calls to _ILIsEmpty().

parent d6db3732
......@@ -239,7 +239,7 @@ static void InitializeTreeView( browse_info *info )
return;
}
if (pidlChild && pidlChild->mkid.cb) {
if (!_ILIsEmpty(pidlChild)) {
hr = IShellFolder_BindToObject(lpsfParent, pidlChild, 0, &IID_IShellFolder, (LPVOID*)&lpsfRoot);
} else {
lpsfRoot = lpsfParent;
......@@ -519,7 +519,7 @@ static LRESULT BrsFolder_Treeview_Expand( browse_info *info, NMTREEVIEWW *pnmtv
if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
return 0;
if (lptvid->lpi && lptvid->lpi->mkid.cb) {
if (!_ILIsEmpty(lptvid->lpi)) {
r = IShellFolder_BindToObject( lptvid->lpsfParent, lptvid->lpi, 0,
&IID_IShellFolder, (LPVOID *)&lpsf2 );
} else {
......
......@@ -217,7 +217,7 @@ BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
{
TRACE_(shell)("pidl=%p\n",pidl);
if (!pidl || !pidl->mkid.cb)
if (_ILIsEmpty(pidl))
return FALSE;
ILFindLastID(pidl)->mkid.cb = 0;
return TRUE;
......@@ -2062,7 +2062,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
*/
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
{
if(pidl && pidl->mkid.cb != 0x00)
if(!_ILIsEmpty(pidl))
return (LPPIDLDATA)pidl->mkid.abID;
return NULL;
}
......
......@@ -716,7 +716,7 @@ static HRESULT UNIXFS_initialize_target_folder(UnixFolder *This, const char *szB
WCHAR *dos_name;
/* Determine the path's length bytes */
while (current && current->mkid.cb) {
while (!_ILIsEmpty(current)) {
dwPathLen += UNIXFS_filename_from_shitemid(current, NULL) + 1; /* For the '/' */
current = ILGetNext(current);
};
......@@ -734,7 +734,7 @@ static HRESULT UNIXFS_initialize_target_folder(UnixFolder *This, const char *szB
pNextDir += strlen(szBasePath);
if (This->m_dwPathMode == PATHMODE_UNIX || IsEqualCLSID(&CLSID_MyDocuments, This->m_pCLSID))
This->m_dwAttributes |= SFGAO_FILESYSTEM;
while (current && current->mkid.cb) {
while (!_ILIsEmpty(current)) {
pNextDir += UNIXFS_filename_from_shitemid(current, pNextDir);
*pNextDir++ = '/';
current = ILGetNext(current);
......@@ -948,7 +948,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_BindToObject(IShellFolder2* iface
TRACE("(iface=%p, pidl=%p, pbcReserver=%p, riid=%p, ppvOut=%p)\n",
iface, pidl, pbcReserved, riid, ppvOut);
if (!pidl || !pidl->mkid.cb)
if (_ILIsEmpty(pidl))
return E_INVALIDARG;
if (IsEqualCLSID(This->m_pCLSID, &CLSID_FolderShortcut)) {
......@@ -993,8 +993,8 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_CompareIDs(IShellFolder2* iface,
TRACE("(iface=%p, lParam=%ld, pidl1=%p, pidl2=%p)\n", iface, lParam, pidl1, pidl2);
isEmpty1 = !pidl1 || !pidl1->mkid.cb;
isEmpty2 = !pidl2 || !pidl2->mkid.cb;
isEmpty1 = _ILIsEmpty(pidl1);
isEmpty2 = _ILIsEmpty(pidl2);
if (isEmpty1 && isEmpty2)
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
......@@ -1160,7 +1160,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i
if ((GET_SHGDN_FOR(uFlags) & SHGDN_FORPARSING) &&
(GET_SHGDN_RELATION(uFlags) != SHGDN_INFOLDER))
{
if (!pidl || !pidl->mkid.cb) {
if (_ILIsEmpty(pidl)) {
lpName->uType = STRRET_WSTR;
if (This->m_dwPathMode == PATHMODE_UNIX) {
UINT len = MultiByteToWideChar(CP_UNIXCP, 0, This->m_pszPath, -1, NULL, 0);
......
......@@ -271,7 +271,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
TRACE("(%p %s %p %s %p)\n", pidlRoot, debugstr_w(pathRoot), pidlComplete, debugstr_guid(riid), ppvOut);
if (!pidlRoot || !ppvOut || !pidlComplete || !pidlComplete->mkid.cb)
if (!pidlRoot || !ppvOut || _ILIsEmpty(pidlComplete))
return E_INVALIDARG;
*ppvOut = NULL;
......
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