Operation Manual
ProgrammingChapter —7
218 700 Series Color Mobile Computer User’s Manual
Parameters
lpInBuf Should be set to NULL.
lpInBufSize Should be set to zero.
lpOutBuf Should be NULL.
nOutBufSize Should be zero.
Return Values
None.
IOCTL_HAL_GET_RESET_INFO
This code allows software to check the type of the most recent reset.
Usage
#include “oemioctl.h”
Syntax
BOOL KernelIoControl( IOCTL_HAL_GET_RESET_INFO,LPVOID lpInBuf,DWORD
nInBufSize,LPVOID lpOutBuf,DWORD nOutBufSize,LPDWORD lpBytesReturned );
Parameters
lpInBuf Should be set to NULL.
lpInBufSize Should be set to zero.
lpOutBuf Must point to a HAL_RESET_INFO structure. See sample below.
nOutBufSize The size of HAL_RESET_INF O in bytes.
lpBytesReturned The nu mber of bytes re turned by the function.
Return Values
Returns TRUE if function succeeds. Returns FALSE if the function fails.
GetLastError() may be used to get the extended error value.
Sample
typedef struct {
DWORD ResetReason; // most recent reset type
DWORD ObjectStoreState; // state of object store
} HAL_RESET_INFO, * PHAL_RESET_INFO;
// Reset reason types
#define HAL_RESET_TYPE_UNKNOWN 0
#define HAL_RESET_REASON_HARDWARE 1 // cold
#define HAL_RESET_REASON_SOFTWARE 2 // suspend
#define HAL_RESET_REASON_WATCHDOG 4
#define HAL_RESET_BATT_FAULT 8 // power fail
#define HAL_RESET_VDD_FAULT 16 // warm boot
// Object store state flags
#define HAL_OBJECT_STORE_STATE_UNKNOWN 0
#define HAL_OBJECT_STORE_STATE_CLEAR 1