This regkey seems to increase on a cold boot and a warm boot. But I want to know what type of reboot the device has made. To detect a clean boot is not the problem.
Yes, read the bootcount from the registry. Its 1 after a cleanboot and increments by 1 after each warmboot.If on WM it will only be reset on a cleanboot, therefore check the date to see if its been reset to its default. Regkey is [HKLM\Comm] "BootCount"=dword:0000
I've attached the C++ files that perform this task. Function is called "RebootDevice()". Will execute either a Warm or a Cold Boot using either the Cad.dll (Motorola specific) or KernelIoControl (Microsoft specifc) methods. With the Warm Boot, you have the option of performing the Application Directory registry merge too. This method does not perform a Clean Boot. That can only be performed through OSUpdate at this time. Hope this helps. Dave Mohnke
6 Replies
This regkey seems to increase on a cold boot and a warm boot. But I want to know what type of reboot the device has made. To detect a clean boot is not the problem.
Write a dummy flag file to \Cache disk before booting. A WB will preserve it. A CB won't. So you will know what happened, won't you?
Thank you. Your code works out of the box.
Is it possible to detect programmatically if the device has made a cold boot or a warm boot?
Yes, read the bootcount from the registry. Its 1 after a cleanboot and increments by 1 after each warmboot.If on WM it will only be reset on a cleanboot, therefore check the date to see if its been reset to its default. Regkey is [HKLM\Comm] "BootCount"=dword:0000
I've attached the C++ files that perform this task. Function is called "RebootDevice()". Will execute either a Warm or a Cold Boot using either the Cad.dll (Motorola specific) or KernelIoControl (Microsoft specifc) methods. With the Warm Boot, you have the option of performing the Application Directory registry merge too. This method does not perform a Clean Boot. That can only be performed through OSUpdate at this time. Hope this helps. Dave Mohnke