Beispiel #1
0
        internal PIDL getPIDL()
        {
            if (_pidl != null)
            {
                return(new PIDL(_pidl, true));
            }

            if (FullName == "::{00021400-0000-0000-C000-000000000046}") //Desktop
            {
                return(DirectoryInfoEx.CSIDLtoPIDL(ShellAPI.CSIDL.CSIDL_DESKTOP));
            }
            return(PathToPIDL(FullName));
        }
        internal static PIDL getParentPIDL(PIDL pidl, out PIDL relPIDL)
        {
            relPIDL = new PIDL(pidl, true); //0.21
            if (pidl.Size == 0)
            {
                return(pidl);
            }
            IntPtr pParent = PIDL.ILClone(pidl.Ptr);

            relPIDL = getRelativePIDL(pidl);
            if (pParent == IntPtr.Zero || !PIDL.ILRemoveLastID2(ref pParent))
            {
                return(DirectoryInfoEx.CSIDLtoPIDL(ShellAPI.CSIDL.DESKTOP));
            }

            return(new PIDL(pParent, false)); //pParent will be freed by the PIDL.
        }