Example #1
0
        /// <summary>
        /// 分层扫描接口 扫描分区
        /// </summary>
        /// <param name="partition">分区</param>
        /// <returns></returns>
        public List <FNodeX> GetFileSystemByDir(FileSystemPartition partition)
        {
            RunPartition = partition;
            MountDevice();

            VOL_BPB_INFO vol = new VOL_BPB_INFO();

            var result = FileServiceCoreDll.GetPartInfo(partition.Mount, ref vol);

            if (0 != result)
            {
            }

            LINK_DIR_FILE_NODE_INFO link = new LINK_DIR_FILE_NODE_INFO();

            result = FileServiceCoreDll.ScanFilesByDir(partition.Mount, GetFileSystemByDirScanCallBack, vol.root_ino, ref link);
            if (0 != result)
            {
            }

            // 构建当前分区节点
            var treeNode = new FNodeX
            {
                Source      = link.NodeDataInfo,
                FileName    = partition.VolName,
                IsRoot      = true,
                IsPartition = true,
                Key         = link.NodeDataInfo.FileId,
                ParentKey   = link.NodeDataInfo.ParentFileId
            };
            // 加载树结构;
            var source = BuildDataDictionary(link);

            BuildTree(treeNode, source);

            return(treeNode.Collection);
        }
Example #2
0
 public static extern Int32 GetPartInfo(IntPtr mountHandle, ref VOL_BPB_INFO vbi);