实现永久性注册表数据保存(VIACEPC BSP)

目标系统的硬件环境:
VIA CLE266 NorthBridge + VT8235 SouthBridge,Transcend TS32MDOM40V DOM
目标系统的软件环境:
Windows CE 5.0,VIA CLE266/CN400/CN700 CEPC BSP

Hive-based:

  • 将 Catalog/Device Drivers/Storage Devices/Storage Devices/ATAPI PCI/IDE Storage Block Driver/ATAPI PCI/IDE Storage Block Driver 加入 Workspace;
  • 将 Catalog/Core OS/Windows CE devices/File Systems and Data Store/Storage Manager/FAT File System 加入 Workspace;
  • 将 Catalog/Core OS/Windows CE devices/File Systems and Data Store/Registry Storage/Hive-based Registry 加入 Workspace;
  • 菜单 Platform->Settings,在“Platform Settings”对话框中选择“Environment”标签,通过设置环境变量:
    SET PRJ_ENABLE_FSREGHIVE = 1
    保证如下注册表键值即可:
    [HKEY_LOCAL_MACHINE/init/BootVars]
       "Flags"=dword:3
    [HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile]
        "MountAsBootable"=dword:1
  • 然后,执行 Sysgen 即可。

RAM-based:

  • 将 Catalog/Device Drivers/Storage Devices/Storage Devices/ATAPI PCI/IDE Storage Block Driver/ATAPI PCI/IDE Storage Block Driver 加入 Workspace;
  • 将 Catalog/Core OS/Windows CE devices/File Systems and Data Store/Storage Manager/FAT File System 加入 Workspace;
  • 将 Catalog/Core OS/Windows CE devices/File Systems and Data Store/Registry Storage/RAM-based Registry 加入 Workspace;
  • 将 Catalog/Third Party/BSPs/VIA CLE266/CN400/CN700 CEPC: x86/HDD Registry Save 加入 Workspace;
  • 然后,执行 Sysgen 即可。

Power-down flush:

Windows CE .Net 4.2 版的 VIACEPC BSP 提供了 SCIPWM 驱动程序用于处理 power-down flush。

  • 对于 hive-based 注册表:
    菜单 Platform->Settings,在“Platform Settings”对话框中选择“Environment”标签,通过设置环境变量:
    SET PRJ_ENABLE_REGFLUSH_THREAD = 1 
    即可实现 lazy-flush。
    故 SCIPWM 只用来处理例如按下电源按钮关机之类的 power-down 中断。
  • 对于 RAM-based 注册表:
    由于 VIA 的 HddRegSave 驱动程序使用的是 save-and-restore 方式,故 SCIPWM 是必须的。
    此外,还要修改 $(_WINCEROOT)/PUBLIC/SHELL/OAK/HPC/EXPLORER/TASKBAR/stmenu.cpp 中的 StartMenu_ProcessCommand 函数,使其在执行“挂起”时保存注册表数据。
case  IDM_START_SUSPEND:
{
    DWORD dwType;
    DWORD dwLen;
    DWORD dwValue;
    DWORD lRet;

    dwValue 
= TRUE;    // Set default
    dwLen = sizeof(dwValue);
    lRet 
= RegQueryValueEx(HKEY_LOCAL_MACHINE, L"Suspend",
    (LPDWORD) L
"Explorer"&dwType,
    (LPBYTE) 
&dwValue, &dwLen);
    
if (dwValue)
    
{
        RegCopyFile(L"
//temp//wcereg");
        CopyFile(L"
//temp//wcereg", L"//IDE Flash//wcereg", FALSE);
        GwesPowerOffSystem();
    }

    
break;
}

 

 原文地址 http://blog.csdn.net/keyssoft/archive/2007/06/07/1641965.aspx

你可能感兴趣的:(thread,windows,.net,File,System,X86)