reactos操作系统实现(61)

前端之家收集整理的这篇文章主要介绍了reactos操作系统实现(61)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

前面准备好文件后,就需要从光盘里拷贝文件到安装目录,下面就是这个过程的界面:@H_404_5@

@H_404_5@

@H_404_5@

实现这个过程的代码如下:@H_404_5@

#001 static@H_404_5@

#002 PAGE_NUMBER@H_404_5@

#003 FileCopyPage(PINPUT_RECORD Ir)@H_404_5@

#004 {@H_404_5@

#005 COPYCONTEXT CopyContext;@H_404_5@

#006 @H_404_5@

@H_404_5@

显示拷贝文件标题@H_404_5@

#007 MUIDisplayPage(FILE_COPY_PAGE);@H_404_5@

#008 @H_404_5@

@H_404_5@

创建一个拷贝文件的环境结构。@H_404_5@

#009 /* Create context for the copy process */@H_404_5@

#010 CopyContext.DestinationRootPath = DestinationRootPath.Buffer;@H_404_5@

#011 CopyContext.InstallPath = InstallPath.Buffer;@H_404_5@

#012 CopyContext.TotalOperations = 0;@H_404_5@

#013 CopyContext.CompletedOperations = 0;@H_404_5@

#014 @H_404_5@

@H_404_5@

创建显示拷贝文件进度条。@H_404_5@

#015 /* Create the progress bar as well */@H_404_5@

#016 CopyContext.ProgressBar = CreateProgressBar(13,@H_404_5@

#017 26,@H_404_5@

#018 xScreen - 13,@H_404_5@

#019 yScreen - 20,@H_404_5@

#020 10,@H_404_5@

#021 24,@H_404_5@

#022 TRUE,@H_404_5@

#023 MUIGetString(STRING_SETUPCOPYINGFILES));@H_404_5@

#024 @H_404_5@

#025 // fit memory bars to screen width,distribute them uniform@H_404_5@

#026 unsigned int mem_bar_width = (xScreen - 26) / 5;@H_404_5@

#027 mem_bar_width -= mem_bar_width % 2; // make even@H_404_5@

#028 /* ATTENTION: The following progress bars are debug stuff,which should not be translated!! */@H_404_5@

@H_404_5@

创建分页内存使用情况的柱条。@H_404_5@

#029 /* Create the paged pool progress bar */@H_404_5@

#030 CopyContext.MemoryBars[0] = CreateProgressBar(13,@H_404_5@

#031 40,@H_404_5@

#032 13 + mem_bar_width,@H_404_5@

#033 43,@H_404_5@

#034 13,@H_404_5@

#035 44,@H_404_5@

#036 FALSE,@H_404_5@

#037 "Paged Memory");@H_404_5@

#038 @H_404_5@

@H_404_5@

创建非分页内存使用情况的柱条。@H_404_5@

#039 /* Create the non paged pool progress bar */@H_404_5@

#040 CopyContext.MemoryBars[1] = CreateProgressBar((xScreen / 2)- (mem_bar_width / 2),@H_404_5@

#041 40,@H_404_5@

#042 (xScreen / 2) + (mem_bar_width / 2),@H_404_5@

#043 43,@H_404_5@

#044 (xScreen / 2)- (mem_bar_width / 2),@H_404_5@

#045 44,@H_404_5@

#046 FALSE,@H_404_5@

#047 "Nonpaged Memory");@H_404_5@

#048 @H_404_5@

@H_404_5@

创建全局内存使用情况的柱条。@H_404_5@

#049 /* Create the global memory progress bar */@H_404_5@

#050 CopyContext.MemoryBars[2] = CreateProgressBar(xScreen - 13 - mem_bar_width,@H_404_5@

#051 40,@H_404_5@

#052 xScreen - 13,@H_404_5@

#053 43,@H_404_5@

#054 xScreen - 13 - mem_bar_width,@H_404_5@

#055 44,@H_404_5@

#056 FALSE,@H_404_5@

#057 "Free Memory");@H_404_5@

#058 @H_404_5@

@H_404_5@

调用函数SetupCommitFileQueueW来进行所有文件拷贝。@H_404_5@

#059 /* Do the file copying */@H_404_5@

#060 SetupCommitFileQueueW(NULL,@H_404_5@

#061 SetupFileQueue,@H_404_5@

#062 FileCopyCallback,@H_404_5@

#063 &CopyContext);@H_404_5@

#064 @H_404_5@

@H_404_5@

已经完成文件拷贝,删除分配的资源。@H_404_5@

#065 /* If we get here,we're done,so cleanup the queue and progress bar */@H_404_5@

#066 SetupCloseFileQueue(SetupFileQueue);@H_404_5@

#067 DestroyProgressBar(CopyContext.ProgressBar);@H_404_5@

#068 DestroyProgressBar(CopyContext.MemoryBars[0]);@H_404_5@

#069 DestroyProgressBar(CopyContext.MemoryBars[1]);@H_404_5@

#070 DestroyProgressBar(CopyContext.MemoryBars[2]);@H_404_5@

#071 @H_404_5@

#072 /* Go display the next page */@H_404_5@

#073 return REGISTRY_PAGE;@H_404_5@

#074}@H_404_5@

猜你在找的React相关文章