Share via


IOCTL_HAL_SAVE_HIVE_RAM_REGION (Compact 2013)

10/16/2014

This I/O control message is called by Filesys.exe when an application calls RegSaveKey if the registry hive is stored in a region of RAM specified by the OEM. Send this message with OEMIoControl.

Syntax

BOOL OEMIoControl(
    DWORD dwIoControlCode,    // use IOCTL_HAL_SAVE_HIVE_RAM_REGION
    LPVOID lpInBuffer,        // pointer to input buffer
    DWORD nInBufferSize,      // input buffer size
    LPVOID lpOutBuffer,       // pointer to output buffer
    DWORD nOutBufferSize,     // output buffer size
    LPDWORD lpBytesReturned   // number of bytes returned
);

Parameters

  • dwIoControlCode
    [in] Control code for the operation. Use IOCTL_HAL_SAVE_HIVE_RAM_REGION for this operation.
  • nInBufferSize
    [in] Set to sizeof(HiveRAMInfo), the size of lpInBuffer.
  • lpOutBuffer
    [in] Set to NULL.
  • nOutBufferSize
    [in] Set to zero.
  • lpBytesReturned
    [in] Set to NULL.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

This I/O control gives the OEM a chance to copy the registry RAM region to persistent storage while the registry is in a steady state. Applications that attempt to read from, or modify, the registry during the RegSaveKey call are blocked until the I/O control call is complete. The hive-based registry does not provide another mechanism for backing up or restoring the hive RAM region. This I/O control is only called during RegSaveKey if the hive-based registry is in use and if the OEM has implemented this I/O control.

If the I/O control does not exist, or if the call fails, RegSaveKey does not overwrite the error set by the I/O control using SetLastError. The I/O control is not called if RegSaveKey is called with HKEY_CURRENT_USER or with any subkey of HKEY_CURRENT_USER. It is called in all other cases.

Applications typically call RegSaveKey twice, once to save the system hive and once to save the user hive. Because the I/O control is only called when an application saves the system hive, the OEM does not save the hive RAM region twice. All user data is stored in the same hive RAM region as system data, so a single save suffices to persist all registry data.

Requirements

Header

pkfuncs.h

See Also

Reference

Filesys.exe IOCTLs
IOCTL_HAL_GET_HIVE_RAM_REGION