Hive-Based Registry使用
?1.Boot hive ,原文是這樣介紹的:
The boot hive contains system settings that are applied only during boot. The boot hive is read out of ROM and used to start drivers and file systems needed to reach the system hive file. Once the system hive is mounted, the boot hive is discarded. Changes made to the registry during the boot process are copied into the system hive once it is available. The boot hive in ROM remains unchanged.
從這段介紹中可以理解Boot中的信息是用來在后面獲得System hive而在Boot階段所必需包括的注冊(cè)表信息。因此Boot hive中的內(nèi)容只要能讓后面獲得System hive成為可能就可以了。
?2.System hive,原文如下:
The system hive contains system settings that do not pertain to any one user. The OEM selects the system hive file name and location. The system hive file is typically named System.hv, but the location can vary.
The registry value?SystemHive?under?HKEY_LOCAL_MACHINE\init\BootVars?indicates the path and file name of the system hive.
從中可以看出System和用戶無關(guān),由OEM來選擇System hive的文件名與位置,默認(rèn)的System hive會(huì)被命名為System.hv,但位置不固定。在HKEY_LOCAL_MACHINE\init\BootVars?鍵下的值SystemHive?指定System hive的名字和路徑。
?3.User hive,原文如下:
A user hive contains user-specific settings. All user hives are named User.hv and are located inside separate user directories. Each directory is given the name of the user to which it belongs.
The registry value?ProfileDir?under?HKEY_LOCAL_MACHINE\init\BootVars?indicates the location where all user directories are placed.
User hive包括了和用戶相關(guān)的注冊(cè)表信息。所有的User hive都是一樣的名字:User.hv。但是放在不同的用戶目錄下,例如有兩個(gè)用戶的目錄A,B,兩個(gè)目錄里的User hive都叫做User.hv。但是一個(gè)是A/User.hv。另一個(gè)是B/User.hv。同System hive類似,在HKEY_LOCAL_MACHINE\init\BootVars?下的ProfileDir?指定了所有用戶目錄存放的路徑。
?有了以上的信息,下面來看如何使能Hive Registry。
?1.在PB中把Hive-based Registry Catalog item加進(jìn)來。
?2.添加注冊(cè)表[HKEY_LOCAL_MACHINE\init\BootVars]下的內(nèi)容:
??? "SystemHive"="<your system hive location>"
??? "ProfileDir"="<your user hive location>"
??? "DefaultUser"="<username>"
??? "Flags"=dword:<your value>
?3.把在Boot階段所需要的注冊(cè)表信息封裝在所示的注釋中
? ?; HIVE BOOT SECTION
?? <your registry settings>
?? ; END HIVE BOOT SECTION
?4.在存放System hive的分區(qū),要做相應(yīng)的設(shè)置,在CE5.0之后的要設(shè)MountAsBootable = dword:1.對(duì)于早期的版本,則需要設(shè)置MountFlags =dword :2。
分區(qū)路徑為[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<MyProfile>\<MyFileSystem>]
?5.如果希望在每次修改后自動(dòng)保存,那么在[HKEY_LOCAL_MACHINE\init\BootVars]下設(shè)置???????????????????????????? "RegistryFlags"=dword:1
?以上都是根據(jù)PB的幫助文檔和別人的Blog獲得的信息,能不能使用起來我還沒有驗(yàn)證過。不過應(yīng)該差不多了,最后說一下自己的一點(diǎn)理解,也算一個(gè)例子吧。例如我們的系統(tǒng)使用BINFS和FATFS,System.hv存放在FAT上面,那么在Boot Hive中需要把BINFS和FATFS都使能起來,不然在后面的加載過程中得不到System.hv的話其他驅(qū)動(dòng)就沒法加載了。只有在Boot Hive中把BINFS和FATFS都使能起來,這樣才能在FAT分區(qū)中獲得System.hv這樣才能保證后面的驅(qū)動(dòng)正常的加載。
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的Hive-Based Registry使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 硬上三缸被市场教“做人” 全新福特福克
- 下一篇: 处理硬件设备访问权限问题