|
-9. Useful function call - without include SysIOAPI.DLL9.1. Warm-boot, Cold-boot and power off#include #include "oemioctl.h"// Warn bootKernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);// Cold bootKernelIoControl(IOCTL_COLD_BOOT, NULL, 0, NULL, 0, NULL);// Power off{DWORD dwExtraInfo=0;BYTE bScan=0;keybd_event( VK_OFF, bScan, KEYEVENTF_SILENT, dwExtraInfo );keybd_event( VK_OFF, bScan, KEYEVENTF_KEYUP, dwExtraInfo );}9.2. Get Device IDIn PA600, an unique ID had been burnt into terminal, user can check it by pressing“Func”+”9”.The sample code for read device ID as follow,////////////////////////////////////////////////////////////////HWND hDeviceId = GetDlgItem(hWnd, IDC_DEVICEID);PDEVICE_ID pDeviceID = NULL;TCHAR outBuf[512], szProductID[100], stringBuffer[100];BYTE szBuff[255];DWORD bytesReturned;char platformID[64];pDeviceID = (PDEVICE_ID)outBuf;pDeviceID->dwSize = sizeof(outBuf);if (KernelIoControl(IOCTL_HAL_GET_DEVICEID, NULL, 0, outBuf, sizeof(outBuf), &bytesReturned)){// Platform IDmemcpy((PBYTE)platformID, (PBYTE)pDeviceID + pDeviceID->dwPlatformIDOffset, pDeviceID->dwPlatformIDBytes);// Device ID for WinCE versionmemcpy((PBYTE)stringBuffer, (PBYTE)pDeviceID + pDeviceID->dwPresetIDOffset, pDeviceID->dwPresetIDBytes);swprintf(szProductID, _T("%s"), stringBuffer);// Device ID for Mobile versionmemcpy((PBYTE) szBuff, (PBYTE)pDeviceID + pDeviceID->dwPresetIDOffset, pDeviceID->dwPresetIDBytes);swprintf(szProductID, TEXT("%X%X%X%X%X%X%X%X"),szBuff [0], szBuff [1], szBuff [2], szBuff [3], szBuff [4], szBuff [5], szBuff [6], szBuff [7]);}/////////////////////////////////////////////////////////The code will have platformID holds Platform ID, and deviceID holds Device ID. Previous |