home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / apchal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  5.4 KB  |  122 lines

  1.  
  2. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  3.  
  4. Copyright (c)  1998 Microsoft Corporation
  5.  
  6. Module Name:
  7.  
  8.     ApcHal.h
  9.  
  10.     Contains the definitions for public HAL operations.
  11.  
  12. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  13.  
  14.  
  15. #ifndef APCHAL_H
  16. #define APCHAL_H
  17.  
  18. // These entries must be supported by AutoPC HAL's and must equate to these exact numbers
  19. // as these constants are exported to application software that are not part of the platform
  20. // directory.
  21.  
  22. // Each event entry is logged with a subsystem identifyer
  23. #define LOG_SUBSYSTEM_HAL                   0x1
  24. #define LOG_SUBSYSTEM_CPM                   0x2
  25. #define LOG_SUBSYSTEM_OS                    0x3
  26. #define LOG_SUBSYSTEM_SPEECH                0x4
  27. #define LOG_SUBSYSTEM_AUDIO                 0x5
  28. #define LOG_SUBSYSTEM_PNAPI                 0x6
  29. #define LOG_SUBSYSTEM_VIO                   0x7
  30. #define LOG_SUBSYSTEM_DRIVER                0x8
  31. #define LOG_SUBSYSTEM_POWERMGMT             0x9
  32. #define LOG_SUBSYSTEM_SHELL                 0xA
  33. #define LOG_SUBSYSTEM_FORMMGR               0xB
  34. #define LOG_SUBSYSTEM_WIRELESS              0xC
  35. #define LOG_SUBSYSTEM_APPLICATION           0xD
  36. // Entries 0 - 0x7FFF are reserved for Microsoft
  37. // ISV's may define values in the range of 0x8000-0xFFFF
  38. #define LOG_SUBSYSTEM_USER                  0x8000
  39.  
  40. // Each log entry needs an event classification
  41. #define LOG_EVENT_FATAL_APPLICATION_ERROR   0x0
  42. #define LOG_EVENT_UNHANDLED_EXCEPTION       0x1
  43. #define LOG_EVENT_HANDLED_EXCEPTION         0x2
  44. #define LOG_EVENT_APP_NOT_RESPONDING        0x3
  45. #define LOG_EVENT_PSL_NOT_RESPONDING        0x4
  46. #define LOG_EVENT_WARM_RESTART_REQUESTED    0x5
  47. #define LOG_EVENT_WARM_RESTART_FORCED       0x6
  48. #define LOG_EVENT_COLD_RESTART_REQUESTED    0x7
  49. #define LOG_EVENT_COLD_RESTART_FORCED       0x8
  50. #define LOG_EVENT_UNEXPECTED_CONDIITON      0x9
  51. #define LOG_EVENT_HARDWARE_FAILURE          0xa
  52. #define LOG_EVENT_MISSED_INTERRUPT          0xb
  53. // Entries 0 - 0x7FFF are reserved for Microsoft
  54. // ISV's may define values in the range of 0x8000-0xFFFF
  55. #define LOG_EVENT_USER                      0xb
  56.  
  57. #define MAKELOGEVENT(subsystem, event)      ((DWORD)(subsystem << 16 | event))
  58. #define LOGSUBSYSTEM(eventclass)            ((DWORD)((eventclass >> 16) & 0xFFFF))
  59. #define LOGEVENT(eventclass)                ((DWORD)(eventclass & 0xFFFF))
  60. #define WriteSystemEventLog(szMsg, cbMsg, subsystem, event) KernelIoControl(IOCTL_HAL_WRITE_LOG, szMsg, cbMsg, NULL, MAKELOGEVENT(subsystem, event), NULL)
  61. #define ReadSystemEventLog(szOut, cbOut, pLogEntry, pcbOut) KernelIoControl(IOCTL_HAL_READ_LOG, pLogEntry, 0, szOut, cbOut, pcbOut)
  62. #define ClearSystemEventLog() KernelIoControl(IOCTL_HAL_CLEAR_LOG, 0, 0, 0, 0, 0)
  63. #define GetSystemEventLogInfo(pInfo) KernelIoControl(IOCTL_HAL_GET_LOG_INFO, pInfo, 0, 0, 0, 0)
  64.  
  65. // KernelIoControl(IOCTL_HAL_WRITE_LOG, szMessage, cbMessage, NULL, MAKELOGEVENT(subsystem, event), NULL);
  66. // Writes a message to a circular log..  Max size of 2K per entry.
  67. #define CBMSGLOGMAX                     2048
  68. #define IOCTL_HAL_WRITE_LOG             5760    /* Write an entry to the exception log */
  69.  
  70. // Use this data structure for the IOCTL_HAL_READ_LOG IOCtl.
  71. typedef struct
  72. {
  73.     DWORD       LogEntry;       // Control word used by log reading to maintain position info.
  74.     DWORD       dwSequenceId;   // Sequence identifier
  75.     FILETIME    EntryTime;      // Time entry was logged
  76.     DWORD       dwEventClass;   // Subsystem and Event Class information
  77.     BOOL        bFinalEntryData;// Indicates if there is more data for entry
  78.  
  79. } LOGENTRYINFO, *PLOGENTRYINFO;
  80.  
  81. // KernelIoControl(IOCTL_HAL_READ_LOG, PLOGENTRYINFO, 0, szOutbuffer, cbOutbuffer, &cbDataSize)
  82. // lpInBuf == PLOGENTRYINFO    pEntryInfo
  83. // lpBytesReturned == pdwDataSize
  84. // nOutBufSize == dwBufferSize
  85. // lpOutBuf == pBuffer
  86.  
  87. #define IOCTL_HAL_READ_LOG              5761    /* Read an entry from the log */
  88.  
  89. // KernelIoControl(IOCTL_HAL_CLEAR_LOG, 0, 0, 0, 0, 0)
  90.  
  91. #define IOCTL_HAL_CLEAR_LOG             5762    /* clear the event log */
  92.  
  93. // use this structure for the IOCTL_HAL_GET_LOG_INFO 
  94. typedef struct
  95. {
  96.     int iSize;                // sizeof structure (calling function fills this in)
  97.     int iTotalLogs;            // total number of logs since last reset
  98.     int iAvailableLogs;        // number of available logs in buffer
  99.     int iMaxLogs;            // number of logging slots in the event log
  100. } EVENTLOG_INFO, *PEVENTLOG_INFO;
  101.  
  102. // KernelIoControl(IOCTL_HAL_GET_LOG_INFO, PEVENTLOG_INFO, 0, 0, 0, 0)
  103. // lpInBuf == PEVENTLOG_INFO    pLogInfo
  104.  
  105. #define IOCTL_HAL_GET_LOG_INFO          5764
  106.  
  107. // Determine what mode of operation the system is running in.
  108. // There are special boot modes used when doing backup and restore
  109. // or other special OEM defined states.  A value of 0 means that the system
  110. // has normally booted.
  111. // KernelIoControl(IOCTL_HAL_GETBOOTMODE, NULL, 0, &dwBootMode, sizeof(DWORD), NULL);
  112.  
  113. #define IOCTL_HAL_GETBOOTMODE           63      /* Obtain the mode of operationg during boot */
  114.  
  115. // Gets the physical address of the flag which contains the bootup power mode.
  116. // KernelIoControl(IOCTL_HAL_GET_POWERMODEFLAGS_ADDRESS, NULL, 0, &dwFlags, sizeof(DWORD));
  117. #define IOCTL_HAL_GET_POWERMODEFLAGS_ADDRESS 5765 /* Get Power mode flag address */
  118. #define IOCTL_HAL_GET_POWERMODEFLAGS 5766 /* Get Power mode flag */
  119. #define IOCTL_HAL_SET_POWERMODEFLAGS 5767 /* Set Power mode flag */
  120.  
  121. #endif
  122.