reactos操作系统实现(61)

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

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

#001 static

#002 PAGE_NUMBER

#003 FilecopyPage(PINPUT_RECORD Ir)

#004 {

#005 copYCONTEXT copyContext;

#006

显示拷贝文件标题

#007 MUIdisplayPage(FILE_copY_PAGE);

#008

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

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

#010 copyContext.DestinationRootPath = DestinationRootPath.Buffer;

#011 copyContext.InstallPath = InstallPath.Buffer;

#012 copyContext.TotalOperations = 0;

#013 copyContext.CompletedOperations = 0;

#014

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

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

#016 copyContext.ProgressBar = CreateProgressBar(13,

#017 26,

#018 xScreen - 13,

#019 yScreen - 20,

#020 10,

#021 24,

#022 TRUE,

#023 MUIGetString(STRING_SETUPcopYINGFILES));

#024

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

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

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

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

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

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

#030 copyContext.MemoryBars[0] = CreateProgressBar(13,

#031 40,

#032 13 + mem_bar_width,

#033 43,

#034 13,

#035 44,

#036 FALSE,

#037 "Paged Memory");

#038

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

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

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

#041 40,

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

#043 43,

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

#045 44,

#046 FALSE,

#047 "Nonpaged Memory");

#048

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

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

#050 copyContext.MemoryBars[2] = CreateProgressBar(xScreen - 13 - mem_bar_width,

#051 40,

#052 xScreen - 13,

#053 43,

#054 xScreen - 13 - mem_bar_width,

#055 44,

#056 FALSE,

#057 "Free Memory");

#058

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

#059 /* Do the file copying */

#060 SetupCommitFileQueueW(NULL,

#061 SetupFileQueue,

#062 FilecopyCallback,

#063 &copyContext);

#064

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

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

#066 SetupCloseFileQueue(SetupFileQueue);

#067 DestroyProgressBar(copyContext.ProgressBar);

#068 DestroyProgressBar(copyContext.MemoryBars[0]);

#069 DestroyProgressBar(copyContext.MemoryBars[1]);

#070 DestroyProgressBar(copyContext.MemoryBars[2]);

#071

#072 /* Go display the next page */

#073 return REGISTRY_PAGE;

#074}

相关文章

react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...
react 本身提供了克隆组件的方法,但是平时开发中可能很少使...
mobx 是一个简单可扩展的状态管理库,中文官网链接。小编在接...
我们在平常的开发中不可避免的会有很多列表渲染逻辑,在 pc ...