How-To Hard reset Windows Mobile 5.0. ?

  • Thread starter Thread starter Halvor Oppen
  • Start date Start date
H

Halvor Oppen

Hi all.



I need a way to hard reset WM5 devices by code. I have tried to set the
SetCleanRebootFlag() flag and used the KernelIoControl function to restart
the device. But this will not clear the memory.



I know that Microsoft does a hard reset with Exchange ActiveSync and MSFP.
So it should be a general way to do this.


Do any of you have an API or another solution for doing this?



Regards,

Halvor.
 
This works for me, though it does not work in VS.Net 2003 emulator:

public const uint FILE_DEVICE_HAL = 0x00000101;
public const uint METHOD_BUFFERED = 0;
public const uint FILE_ANY_ACCESS = 0;

public static uint CTL_CODE(uint DeviceType, uint Function, uint Method,
uint Access)
{
return ((DeviceType << 16) | (Access << 14) | (Function << 2) | Method);
}

/// <summary>
/// This routine will reboot the pocketPC
/// </summary>
/// <returns></returns>
public static uint ResetPocketPC()
{
uint bytesReturned = 0;
uint IOCTL_HAL_REBOOT = CTL_CODE(FILE_DEVICE_HAL, 15,
METHOD_BUFFERED, FILE_ANY_ACCESS);
return KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0,
IntPtr.Zero, 0, ref bytesReturned);
}
 
For Windows Mobile 5.0 there is no (official?) API to do a hard reset.
OEM specific APIs might exist.
 
Back
Top