Search by Tags

IOCTL HAL REBOOT

 

Article updated at 13 Feb 2019
Compare with Revision




Subscribe for this article updates

Using this IOCTL, you can reboot the system.

Please note, the following SoCs support only cold boot:

  • VF50
  • VF61
  • i.MX6
  • i.MX7

Definitions

# <a id="define_FILE_DEVICE_HAL_0x101" name="define_FILE_DEVICE_HAL_0x101" href="#define_FILE_DEVICE_HAL_0x101"> define FILEDEVICEHAL				0x101</a>
 
# <a id="define_METHOD_BUFFERED_0x0" name="define_METHOD_BUFFERED_0x0" href="#define_METHOD_BUFFERED_0x0"> define METHODBUFFERED				0x0</a>
 
# <a id="define_FILE_ANY_ACCESS_0x0" name="define_FILE_ANY_ACCESS_0x0" href="#define_FILE_ANY_ACCESS_0x0"> define FILEANYACCESS				0x0</a>
 
# <a id="define_CTL_CODE_DeviceType_Function_Method_Access_DeviceType_16_Access_14_Function_2_Method" name="define_CTL_CODE_DeviceType_Function_Method_Access_DeviceType_16_Access_14_Function_2_Method" href="#define_CTL_CODE_DeviceType_Function_Method_Access_DeviceType_16_Access_14_Function_2_Method"> define CTLCODE( DeviceType, Function, Method, Access ) (((DeviceType) &lt;&lt; 16) | ((Access) &lt;&lt; 14) | ((Function) &lt;&lt; 2) | (Method))</a>
 
# <a id="define_IOCTL_HAL_REBOOT_CTL_CODEFILE_DEVICE_HAL_15_METHOD_BUFFERED_FILE_ANY_ACCESS" name="define_IOCTL_HAL_REBOOT_CTL_CODEFILE_DEVICE_HAL_15_METHOD_BUFFERED_FILE_ANY_ACCESS" href="#define_IOCTL_HAL_REBOOT_CTL_CODEFILE_DEVICE_HAL_15_METHOD_BUFFERED_FILE_ANY_ACCESS"> define IOCTLHALREBOOT			CTLCODE(FILEDEVICEHAL,  15,      METHODBUFFERED, FILEANYACCESS)</a>
 
 
BOOL KernelIoControl(DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned);

Sample

// To force a Cold Boot: let the 2nd function parameter point to a value 0
//                       *lpInBuf = 0;
// To force a Warm Boot: let the 2nd function parameter be NULL
//                       lpInBuf = 0;
if(coldBoot)
{ 
    DWORD zero=0;
    KernelIoControl(IOCTL_HAL_REBOOT, &zero, 4, NULL, 0, NULL);
}
else
{
    KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
}