4

How to perform cold-boot & warm-boot using C# for Windows Mobile 5.0?

and is there any program that can run command prompt on windows-mobile 5.0 ?

thanks in advance

Jack Marchetti
  • 15,536
  • 14
  • 81
  • 117
Gali
  • 14,511
  • 28
  • 80
  • 105

1 Answers1

5
[DllImport("coredll.dll")]

        public static extern int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize,ref int lpBytesReturned);

        private int CTL_CODE(int DeviceType, int Func, int Method, int Access)

        {           

           return (DeviceType << 16) | (Access << 14) | (Func << 2) | Method;

        }
        private int ResetPocketPC()

        {
            const int FILE_DEVICE_HAL = 0x101;

            const int METHOD_BUFFERED = 0;

            const int FILE_ANY_ACCESS = 0;

            int bytesReturned = 0;

            int IOCTL_HAL_REBOOT;

            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);

        }

More informations and how to use the code can be obtained from CodeProject. There is another great article about this at Psion Cummunity Blog, that I highly recommend you to check out too.

Nathan Campos
  • 28,769
  • 59
  • 194
  • 300