reactos操作系统实现(61)

前端之家收集整理的这篇文章主要介绍了reactos操作系统实现(61)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_404_0@前面准备好文件后,就需要从光盘里拷贝文件到安装目录,下面就是这个过程的界面:

@H_404_0@

@H_404_0@

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

@H_404_0@#001 static

@H_404_0@#002 PAGE_NUMBER

@H_404_0@#003 FileCopyPage(PINPUT_RECORD Ir)

@H_404_0@#004 {

@H_404_0@#005 COPYCONTEXT CopyContext;

@H_404_0@#006

@H_404_0@

@H_404_0@显示拷贝文件标题

@H_404_0@#007 MUIDisplayPage(FILE_COPY_PAGE);

@H_404_0@#008

@H_404_0@

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

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

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

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

@H_404_0@#012 CopyContext.TotalOperations = 0;

@H_404_0@#013 CopyContext.CompletedOperations = 0;

@H_404_0@#014

@H_404_0@

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

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

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

@H_404_0@#017 26,

@H_404_0@#018 xScreen - 13,

@H_404_0@#019 yScreen - 20,

@H_404_0@#020 10,

@H_404_0@#021 24,

@H_404_0@#022 TRUE,

@H_404_0@#023 MUIGetString(STRING_SETUPCOPYINGFILES));

@H_404_0@#024

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

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

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

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

@H_404_0@

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

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

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

@H_404_0@#031 40,

@H_404_0@#032 13 + mem_bar_width,

@H_404_0@#033 43,

@H_404_0@#034 13,

@H_404_0@#035 44,

@H_404_0@#036 FALSE,

@H_404_0@#037 "Paged Memory");

@H_404_0@#038

@H_404_0@

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

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

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

@H_404_0@#041 40,

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

@H_404_0@#043 43,

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

@H_404_0@#045 44,

@H_404_0@#046 FALSE,

@H_404_0@#047 "Nonpaged Memory");

@H_404_0@#048

@H_404_0@

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

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

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

@H_404_0@#051 40,

@H_404_0@#052 xScreen - 13,

@H_404_0@#053 43,

@H_404_0@#054 xScreen - 13 - mem_bar_width,

@H_404_0@#055 44,

@H_404_0@#056 FALSE,

@H_404_0@#057 "Free Memory");

@H_404_0@#058

@H_404_0@

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

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

@H_404_0@#060 SetupCommitFileQueueW(NULL,

@H_404_0@#061 SetupFileQueue,

@H_404_0@#062 FileCopyCallback,

@H_404_0@#063 &CopyContext);

@H_404_0@#064

@H_404_0@

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

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

@H_404_0@#066 SetupCloseFileQueue(SetupFileQueue);

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

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

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

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

@H_404_0@#071

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

@H_404_0@#073 return REGISTRY_PAGE;

@H_404_0@#074}

猜你在找的React相关文章