3

I've seen a lot of code regarding the IOCTL and I tried using some code that shows how to cold boot a Windows Mobile device by setting SetCleanRebootFlag() and int IOCTL_HAL_REBOOT = 0x101003C; but it doesn't reset the boot count under HKLM\Comm\BootCount and that's the quick way for me to check cold boot (should be reset to '0'). Can someone show me code for a 'cold boot'? I'm referencing code I've used from here: Reboot Windows Mobile 6.x device programmatically using C#

Regards, Scott

Community
  • 1
  • 1
spickles
  • 635
  • 1
  • 12
  • 21

1 Answers1

4

That counter isn't reset to zero with devices that have a persistent registry (most Windows Mobile devices since WM5 have this). Does your device have one?

Your CPU may have a status register indicating the cause of the last reboot. You can try checking that. Alternately, your OEM may have provided an IOCTL for the same purpose.

A clean registry requires a "clean boot". There is no standard way of performing a clean boot on windows mobile devices. You will have to refer to your OEM provided documentation for this.

If you just want to reboot the device, I use SetSystemPowerState:

::SetSystemPowerState( NULL, POWER_STATE_RESET, POWER_FORCE );

-PaulH

PaulH
  • 7,759
  • 8
  • 66
  • 143