IOCTL_HAL_GET_HIVE_RAM_REGION (Windows CE 5.0)
This IOCTL allows you to specify a region of RAM to hold the registry hive instead of using it as a memory-mapped file on a file system. It is implemented by the OEM in the OAL, and called by Filesys.exe.
Parameters
- dwIoControlCode
[in] Set to the IOCTL_HAL_GET_HIVE_RAM_REGION IOCTL. - lpInBuf
[in] Ignored; set to NULL. - nInBufsize
[in] Ignored; set to zero. - lpOutBuf
[out] Pointer to a HiveRAMInfo structure filled by this IOCTL. - nOutBufSize
[in] Size of a HiveRAMInfo structure, for example, sizeof(HiveRAMInfo). - lpBytesReturned
[out] Ignored; set to NULL.
Return Values
TRUE indicates success. FALSE indicates failure.
Remarks
The registry calls the IOCTL_HAL_GET_HIVE_RAM_REGION IOCTL during the first boot phase to determine if a region of RAM is suitable to store the data. The registry data is stored in the specified region of RAM and persists as long as RAM persists. When registry data is stored in a RAM region, the user hive and system hive are stored together. There is no separate user hive, so there is no way to maintain separate copies of HKEY_CURRENT_USER for each user. Therefore, all users share the same registry.
User profile directories are created for each user, and are placed in the object store, as specified by the ProfileDir registry subkey. For more information, see User Profile Storage.
The following code example shows an implementation of IOCTL_HAL_GET_HIVE_RAM_REGION.
case IOCTL_HAL_GET_HIVE_RAM_REGION : {
HiveRAMInfo *pRAMInfo = (HiveRAMInfo*) lpOutBuf;
if (lpInBuf || nInBufSize || !lpOutBuf || (nOutBufSize != sizeof(HiveRAMInfo))) {
SetLastError(ERROR_INVALID_PARAMETER);
return (FALSE);
}
pRAMInfo->wVersion = 1;
pRAMInfo->wFlags = HIVE_REGION_COMBINED;
pRAMInfo->SystemRegion.lpStart = (LPVOID)0x80100000;
pRAMInfo->SystemRegion.dwLength = 0x00020000;
pRAMInfo->SystemRegion.dwVirtCopyFlags = PAGE_NOCACHE;
return TRUE;
}
The SystemRegion.lpStart and SystemRegion.dwLength members are editable; the values shown here are examples.
Requirements
OS Versions: Windows CE .NET 4.1 and later.
Header: Pkfuncs.h.
See Also
Hive-Based Registry Stored in RAM | User Profile Storage | HiveRAMInfo | HiveRAMRegion | IOCTL_HAL_SAVE_HIVE_RAM_REGION
Send Feedback on this topic to the authors