To programmatically detect a warm reset, cold reset and a clean reset, you'll need the following Kernel IOCTLs:

  • IOCTL_PTX_IS_COLDBOOT
  • IOCTL_PTX_DO_AUTORESTORE

These IOCTLs utilize the KernelIoControl API:  http://msdn.microsoft.com/en-us/library/aa909165.aspx

The both return a BOOL value in their respective lpOutBuf parameters.  Depending on the Operating System variant, the combination of both IOCTLs will tell you whether a warm, cold, or clean reboot have occured:

Windows CE 5.0 IOCTL_PTX_IS_COLDBOOT IOCTL_PTX_DO_AUTORESTORE
Warm Reboot FALSE TRUE
Cold Reboot TRUE TRUE
CLEAN START TRUE FALSE

 

Windows CE 6.0 IOCTL_PTX_IS_COLDBOOT IOCTL_PTX_DO_AUTORESTORE
Warm Reboot FALSE FALSE
Cold Reboot TRUE FALSE
CLEAN START TRUE TRUE

 

Windows Mobile 6.x IOCTL_PTX_IS_COLDBOOT IOCTL_PTX_DO_AUTORESTORE

Warm/Cold Reboot (*)

TRUE FALSE
CLEAN START TRUE TRUE

(*) NOTE:  For Windows Mobile 6.x, there is no notion of warm or cold reset.  Its just a reboot (as it would be on a PC.

See also:  http://community.psion.com/downloads/developer_sdkhdk/m/sample__demo_code/22234.aspx