Share via


IOCTL_HAL_GET_HIVE_RAM_REGION

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. This IOCTL 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 suitable to store the data. The registry data will be stored in the given region of RAM and will persist 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);
            break;
        }
        
        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

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.