wince 6.0一直困扰我的hive注册表问题,今天解决了,主要问题就是"RegistryFlags"=dword:1 。下面是我参考的,感觉不错,顺便转过来。。。
CE的HIVE注册表可以使用户操作的相关设置以注册表的形式保存到DOM等存储设备中.加了HIVE的相关组件后,可以通过手动或自动方式保存信息到存储设备里.
手动存储方式是执行一个软件后,把用户设置的相关信息回写到HIVE注册表里面
自动存储方式是在Platform.reg中把RegistryFlags设置成1,当用户启动系统后,设置相关信息就会自动的保存到HIVE Registry里面.
在CE5.0 CE6.0下的具体操作如下所示
一. 在CE6.0下实现方法
1. 添加组件:
Catalog->Core OS->CEBASE->FileSystem and Data Store->File System-Interneal
->ROM-only File System
Catalog->Core OS->CEBASE->FileSystem and Data Store->Registry storage->
Hive-based Registry
Catalog->Core OS->CEBASE->FileSystem and Data Store->Storage Manager
->Fat File System
Catalog->Device Drivers->Storage Devices -> ATAPI PCI Support
Catalog->Device Drivers->Storage Devices -> ATAPI PCI Support->
Basic ATAPI PCI CD/DVD ROM Support-> ATAPI PCI/IDE Storage Block Driver
以后操作步骤有两种方法:
方法一: (手动保存信息到HIVE Registry,启动CE后需要执行相应的程序后才可以保存)
2.修改注册表
在platform.reg文件中添加如下内容:
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/init/BootVars]
"SYSTEMHIVE"="//Registry//system.hv"
"PROFILEDIR"="//Registry"
"Start DevMgr"=dword:1
"DefaultUser"="User"
"Flags"=dword:3
[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]
"Flags"=dword:1000
[$(PCI_BUS_ROOT)/Template/GenericIDE]
"Flags"=dword:1000
[$(PCI_BUS_ROOT)/Template/GenericIDE/Device0]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]
"Flags"=dword:1004
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]
"MountAsBootable"=dword:1
[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]
"Class"=dword:06
"SubClass"=dword:04
"NoConfig"=dword:1
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE
; @CESYSGEN IF !FILESYS_FSYSRAM
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]
"MountAsRoot"=dword:1
"MountPermanent"=dword:1
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF !FILESYS_FSYSRAM
3. 编译 image
4. 编写注册表刷新软件(控制台程序)
具体程序如下:
#include "stdafx.h"
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
RegFlushKey( HKEY_LOCAL_MACHINE);
RegFlushKey( HKEY_CLASSES_ROOT);
RegFlushKey( HKEY_CURRENT_USER);
RegFlushKey( HKEY_USERS);
return 0;
}
方法二: (自动保存信息到HIVE Registry)
2.修改注册表
在platform.reg文件中添加如下内容:
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/init/BootVars]
"SYSTEMHIVE"="//Registry//system.hv"
"PROFILEDIR"="//Registry"
"Start DevMgr"=dword:1
"RegistryFlags"=dword:1
"DefaultUser"="User"
"Flags"=dword:3
[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]
"Flags"=dword:1000
[$(PCI_BUS_ROOT)/Template/GenericIDE]
"Flags"=dword:1000
[$(PCI_BUS_ROOT)/Template/GenericIDE/Device0]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]
"Flags"=dword:1004
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]
"MountAsBootable"=dword:1
[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]
"Class"=dword:06
"SubClass"=dword:04
"NoConfig"=dword:1
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE
; @CESYSGEN IF !FILESYS_FSYSRAM
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]
"MountAsRoot"=dword:1
"MountPermanent"=dword:1
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF !FILESYS_FSYSRAM
3. 编译 image
二. 在CE5.0上的实现方法
1. 添加组件:
Catalog->Core OS->CEBASE->FileSystem and Data Store->Registry storage->
Hive-based Registry
Catalog->Core OS->CEBASE->FileSystem and Data Store->Storage Manager
->Fat File System
Catalog->Device Drivers->Storage Devices ->ATAPI PCI/IDE Storage Block Driver -> ATAPI PCI/IDE Storage Block Driver
以后操作步骤有两种方法:
方法一: (手动保存信息到HIVE Registry,启动CE后需要执行相应的程序后才可以保存)
2.修改注册表
在platform.reg文件中添加如下内容:
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/init/BootVars]
"SYSTEMHIVE"="//Registry//system.hv"
"PROFILEDIR"="//Registry"
"Start DevMgr"=dword:1
"DefaultUser"="User"
[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]
"Flags"=dword:1000
[$(PCI_BUS_ROOT)/Template/GenericIDE]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile]
"MountFlags"=dword:2
[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]
"Class"=dword:06
"SubClass"=dword:04
"NoConfig"=dword:1
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE
3. 编译 image
4. 编写注册表刷新软件(控制台程序)
具体程序如下:
#include "stdafx.h"
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,