private static void LoadPartContent(IPartition part, IProgressReporter reporter) { var partStoken = part.GetStoken(Constants.PartitionKey_Ext); var partInfo = partStoken.GetInstance <ExtPartInfo>(Constants.PartitionStokenTag_ExtPartInfo); var partManager = partInfo.ExtUnmanagedManager; if (partManager.ExtManagerPtr == IntPtr.Zero) { LoggerService.WriteCallerLine($"{nameof(partManager.ExtManagerPtr)} can't be nullptr."); return; } #if DEBUG //var nodePtr = ExtX_Get_InodeInfo(partManager.ExtManagerPtr, 46); //var stBPtr = ExtX_Get_BlockList(partManager.ExtManagerPtr, nodePtr); //var ss = ExtX_Parse_Dir(partManager.ExtManagerPtr, stBPtr); #endif var stExt4INodePtr = ExtX_Get_InodeInfo(partManager.ExtManagerPtr, 2); //加载Inode,BlockList,Dir; if (stExt4INodePtr == IntPtr.Zero) { //LoggerService.WriteCallerLine($"{nameof(stExt4INodePtr)} can't be nullptr."); return; } var stBlockListPtr = ExtX_Get_BlockList(partManager.ExtManagerPtr, stExt4INodePtr); //加载Inode,BlockList,Dir; if (stBlockListPtr == IntPtr.Zero) { //LoggerService.WriteCallerLine($"{nameof(stBlockListPtr)} can't be nullptr."); return; } var stDirEntryPtr = ExtX_Parse_Dir(partManager.ExtManagerPtr, stBlockListPtr); //加载Inode,BlockList,Dir; if (stDirEntryPtr == IntPtr.Zero) { //LoggerService.WriteCallerLine($"{nameof(stDirEntryPtr)} can't be nullptr."); return; } //当前分区已经被加载的大小; long partLoadedSize = 0; DealWithFileNode( part, partInfo, stDirEntryPtr, sz => { if (reporter == null) { return; } partLoadedSize += sz; if (partStoken.Size == 0) { return; } var per = (int)(partLoadedSize * 100 / partStoken.Size); if (per > 100) { per = 100; } if (partStoken.Size != 0) { reporter.ReportProgress(per); } }, () => reporter?.CancelPending ?? false ); }