public HResult GetParent(out IShellItem ppsi) { IntPtr pidl = Shell32.ILClone(_pidl); if (ILShell32.ILRemoveLastID(pidl)) { ppsi = new ShellItemImpl(pidl, true); return(HResult.S_OK); } else { ppsi = null; return(HResult.MK_E_NOOBJECT); } }
public int Compare(IShellItem psi, SICHINT hint) { ShellItemImpl other = (ShellItemImpl)psi; ShellItemImpl myParent = GetParent(); ShellItemImpl theirParent = other.GetParent(); if (Shell32.ILIsEqual(myParent._pidl, theirParent._pidl)) { return(myParent.GetIShellFolder().CompareIDs( // (SHCIDS) (IntPtr)hint, ILShell32.ILFindLastID(_pidl), ILShell32.ILFindLastID(other._pidl))); } else { return(1); } }