hlItemGetPath() public static method

public static hlItemGetPath ( IntPtr pItem, IntPtr lpPath, uint uiPathSize ) : bool
pItem IntPtr
lpPath IntPtr
uiPathSize uint
return bool
        private void FindFiles(IntPtr dir, PackageNode node, uint package)
        {
            uint count = HLLib.hlFolderGetCount(dir);

            for (uint i = 0; i < count; i++)
            {
                var item     = HLLib.hlFolderGetItem(dir, i);
                var itemNode = new PackageNode();
                itemNode.Name      = HLLib.hlItemGetName(item).ToLower();
                itemNode.Directory = HLLib.hlItemGetType(item) == HLLib.HLDirectoryItemType.HL_ITEM_FOLDER;

                var pathPtr = Marshal.AllocHGlobal(255);
                HLLib.hlItemGetPath(item, pathPtr, 255);
                var pathBuffer = new byte[255];
                Marshal.Copy(pathPtr, pathBuffer, 0, 255);
                itemNode.Path = Encoding.ASCII.GetString(pathBuffer).TrimEnd('\0').ToLower();

                uint filesize;
                HLLib.hlItemGetSize(item, out filesize);
                itemNode.FileSize = filesize;

                if (itemNode.Directory)
                {
                    if (node.Directories.ContainsKey(itemNode.Name))
                    {
                        FindFiles(item, node.Directories[itemNode.Name], package);
                    }
                    else
                    {
                        FindFiles(item, itemNode, package);
                        node.Directories[itemNode.Name] = itemNode;
                    }
                }
                else
                {
                    itemNode.FilePtr          = item;
                    itemNode.FilePackage      = package;
                    node.Files[itemNode.Name] = itemNode;
                }
            }
        }