Compartir a través de


IOCTL_HAL_INIT_RTC (Windows CE 5.0)

Send Feedback

This IOCTL resets the real-time clock by calling the OEMSetRealTime function. A request to call OEMSetRealTime is made by calling OEMIoControl function with IOCTL_HAL_INIT_RTC.

Parameters

  • dwIoControlCode
    [in] Set to IOCTL_HAL_INIT_RTC.

    Resets the real-time clock by calling OEMSetRealTime.

  • lpInBuf
    [in] Pointer to the input buffer that contains a SYSTEMTIME structure.

  • nInBufsize
    [in] Size, in bytes, of lpInBuf.

    This should be the size of the SYSTEMTIME structure.

  • lpOutBuf
    [in] Not used; set to NULL.

  • nOutBufSize
    [in] Not used; set to zero.

  • lpBytesReturned
    [in] Not used; may be set to NULL.

Return Values

TRUE indicates success. FALSE indicates failure.

Remarks

During a cold boot, the kernel calls this IOCTL. Systems with a battery-backed real-time clock can then determine whether the current clock time is valid, and if so, 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 IOCTL_HAL_INIT_RTC when the system boots up if the RAM content is invalid. Usually, the RAM clean boot is due to batter 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 IOCTL_HAL_INIT_RTC was called. However, this scenario is different during an update process:

  • When the system boots to the Update Loader image, it will always be a RAM clean boot from Update Loader perspective, but the real-time clock should not be reset. Therefore, the Update Loader OAL should not reset the real-time clock when IOCTL_HAL_INIT_RTC is called, but only return TRUE and do not do anything else.
  • When the update process finishes and the system reboots back to the primary OS, the Update Loader destroys the RAM content so it is a RAM clean boot from the primary OS perspective. In this case, OEMs should not reset the real-time clock either. The primary OS kernel should be notified that the reboot was issued by the Update Loader and then ignore the request for IOCTL_HAL_INIT_RTC. This is done by the OAL so OEMs need to find a way to detect this case.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Pkfuncs.h.

See Also

OEMIoControl | OEMSetRealTime | SYSTEMTIME | Filesys.exe Boot Process | Setting the Real-Time Clock

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.