Share via


IOCTL_HAL_INIT_RTC (Compact 2013)

10/16/2014

This I/O control message resets the real-time clock by calling the OEMSetRealTime function. A request to call OEMSetRealTime is made by calling the OEMIoControl function with this I/O control. Send this message with OEMIoControl.

Syntax

BOOL OEMIoControl(
    DWORD dwIoControlCode,    // use IOCTL_HAL_INIT_RTC
    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_INIT_RTC for this operation.
  • lpInBuffer
    [in] Pointer to the input buffer that contains a SYSTEMTIME structure.
  • nInBufferSize
    [in] Set to the size of lpInBuffer. Should be sizeof(SYSTEMTIME)
  • lpOutBuffer
    [in] Not used; set to NULL.
  • nOutBufferSize
    [in] Not used; set to zero.
  • lpBytesReturned
    [in] Not used; set to NULL.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

To get extended error information, call GetLastError. GetLastError may return other standard error messages as appropriate.

Remarks

During a cold boot, the kernel calls this I/O control. Systems with a battery-backed real-time clock can then determine whether the current clock time is valid, and if this is the case, ignore the time provided by the kernel. Otherwise, set the real-time clock to match the provided time. Systems without a battery-backed clock should use the default time provided by the kernel to initialize their real-time clock as part of the cold boot sequence.

For devices that do not have external power for the real-time clock, Filesys.exe calls this I/O control when the system starts if the RAM content is invalid. Usually, the RAM clean boot is because of battery power being out or if the persistent storage was cleared. For devices without external power for the real-time clock, OEMs need to reset their real-time clock if this I/O control was called.

Requirements

Header

pkfuncs.h

See Also

Reference

Other OAL IOCTLs
OEMIoControl
OEMSetRealTime