代码改变世界

重启WINCE系统

2010-12-09 14:39  lppcoding  阅读(347)  评论(0编辑  收藏  举报
 [DllImport("coredll.dll", CharSet = CharSet.Auto)]
        private extern static int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize, ref int lpBytesReturned);
        [DllImport("coredll.dll", CharSet = CharSet.Auto)]

 private void ResetCE()
        {
            int IOCTL_HAL_REBOOT = 0x101003C;
            int bytesReturned = 0;
            SetCleanRebootFlag();
            KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned); 
        }