- 积分
- 0
贡献0
飞刀0 FD
注册时间2015-12-16
在线时间0 小时
|
发表于 2010-10-8 13:17:29
|
显示全部楼层
#include <windows.h>
#include "winioctl.h"
BOOL KernelIoControl(DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize,
LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned);
#define IOCTL_HAL_GET_DEVICE_INFO CTL_CODE(FILE_DEVICE_HAL, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_HAL_COLDBOOT CTL_CODE(FILE_DEVICE_HAL, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
//#define IOCTL_HAL_COLDBOOT CTL_CODE(FILE_DEVICE_HAL, 4017, METHOD_BUFFERED, FILE_ANY_ACCESS)
//Unitech PA600II mobile 6.1 测试 OK (2009-09-09)
void WINAPI Reboot (int nBootMode)
{
int inVal;
BYTE outBuf[1024];
DWORD bytesReturned;
//KernelIoControl(IOCTL_HAL_COLDBOOT, &inVal, 4, outBuf, 1024, &bytesReturned);
if(nBootMode == 0)
KernelIoControl(IOCTL_HAL_REBOOT, &inVal, 4, outBuf, 1024, &bytesReturned); //热启动
else
KernelIoControl(IOCTL_HAL_COLDBOOT, &inVal, 4, outBuf, 1024, &bytesReturned); //冷启动
}
试试这个,没有验证过~ |
|