| 1 |  | 
|---|
| 2 | /* | 
|---|
| 3 | *@@sourcefile ras.h: | 
|---|
| 4 | *      "Reliability, Availability, Serviceability" (RAS) | 
|---|
| 5 | *      prototypes. In other words, undocumented OS/2 functions | 
|---|
| 6 | *      for problem determination (system dumps, process dumps, | 
|---|
| 7 | *      tracing, etc.). | 
|---|
| 8 | * | 
|---|
| 9 | *      This file has been taken directly from the OS/2 Debugging | 
|---|
| 10 | *      Handbook, V0.7a. | 
|---|
| 11 | * | 
|---|
| 12 | *@@added V0.9.0 | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef RAS_HEADER_INCLUDED | 
|---|
| 16 | #define RAS_HEADER_INCLUDED | 
|---|
| 17 |  | 
|---|
| 18 | /* definitions for DosDumpProcess */ | 
|---|
| 19 | #define DDP_DISABLEPROCDUMP     0x00000000L     /* disable process dumps */ | 
|---|
| 20 | #define DDP_ENABLEPROCDUMP      0x00000001L     /* enable process dumps */ | 
|---|
| 21 | #define DDP_PERFORMPROCDUMP     0x00000002L     /* perform process dump */ | 
|---|
| 22 |  | 
|---|
| 23 | /* definitions for DosSuppressPopUps */ | 
|---|
| 24 | #define SPU_DISABLESUPPRESSION  0x00000000L     /* disable popup suppression */ | 
|---|
| 25 | #define SPU_ENABLESUPPRESSION   0x00000001L     /* enable popup suppression */ | 
|---|
| 26 |  | 
|---|
| 27 | /* definitions for DosQueryRASInfo Index */ | 
|---|
| 28 | #define SIS_MMIOADDR            0 | 
|---|
| 29 | #define SIS_MEC_TABLE           1 | 
|---|
| 30 | #define SIS_SYS_LOG             2 | 
|---|
| 31 | #define LF_LOGENABLE    0x0001          /* Logging enabled */ | 
|---|
| 32 | #define LF_LOGAVAILABLE 0x0002          /* Logging available */ | 
|---|
| 33 |  | 
|---|
| 34 | APIRET  APIENTRY        DosQueryRASInfo(ULONG Index, PPVOID Addr); | 
|---|
| 35 |  | 
|---|
| 36 | APIRET  APIENTRY        DosForceSystemDump(ULONG reserved); | 
|---|
| 37 |  | 
|---|
| 38 | APIRET  APIENTRY        DosDumpProcess(ULONG Flag, ULONG Drive, PID Pid); | 
|---|
| 39 |  | 
|---|
| 40 | APIRET  APIENTRY        DosSuppressPopUps(ULONG Flag, ULONG Drive); | 
|---|
| 41 |  | 
|---|
| 42 | APIRET16  APIENTRY16    DosSysTrace(USHORT Majorcode, USHORT Length, | 
|---|
| 43 | USHORT Minorcode, PCHAR pData); | 
|---|
| 44 |  | 
|---|
| 45 | APIRET16 APIENTRY16 DosGetSTDA(SEL, SHORT, SHORT ); | 
|---|
| 46 |  | 
|---|
| 47 | /* 32-bit Logging Facility Function Prototypes                   */ | 
|---|
| 48 |  | 
|---|
| 49 | /*--------------------------------------------*/ | 
|---|
| 50 | /* Logging Defines                            */ | 
|---|
| 51 | /*--------------------------------------------*/ | 
|---|
| 52 | #define ERRLOG_SERVICE        1L | 
|---|
| 53 | #define ERRLOG_VERSION        1 | 
|---|
| 54 |  | 
|---|
| 55 | /*--------------------------------------------*/ | 
|---|
| 56 | /* LogRecord status bits                      */ | 
|---|
| 57 | /*--------------------------------------------*/ | 
|---|
| 58 | #define LF_BIT_PROCNAME     0x0001L | 
|---|
| 59 | #define LF_BIT_ORIGIN_256   0x0002L | 
|---|
| 60 | #define LF_BIT_DATETIME     0x0004L | 
|---|
| 61 | #define LF_BIT_SUSPEND      0x0008L | 
|---|
| 62 | #define LF_BIT_RESUME       0x0010L | 
|---|
| 63 | #define LF_BIT_REDIRECT     0x0020L | 
|---|
| 64 | #define LF_BIT_GETSTATUS    0x0040L | 
|---|
| 65 | #define LF_BIT_REGISTER     0x0080L | 
|---|
| 66 | #define LF_BIT_REMOTE_FAIL  0x0100L | 
|---|
| 67 |  | 
|---|
| 68 | /*--------------------------------------------*/ | 
|---|
| 69 | /*    Log Entry Record Header for 2.X         */ | 
|---|
| 70 | /*    This is format used by 2.0 device       */ | 
|---|
| 71 | /*     drivers and callers of LogAddEntries   */ | 
|---|
| 72 | /*--------------------------------------------*/ | 
|---|
| 73 | typedef struct LogRecord | 
|---|
| 74 | { | 
|---|
| 75 | USHORT   len ;                   /* this record length(includes len field)*/ | 
|---|
| 76 | USHORT   rec_id ;                /* record id                             */ | 
|---|
| 77 | ULONG    status ;                /* record status bits(see LF_BIT_)       */ | 
|---|
| 78 | UCHAR    qualifier[4] ;          /* qualifier tag                         */ | 
|---|
| 79 | ULONG    reserved ; | 
|---|
| 80 | ULONG    time ;                  /* hours minutes seconds hundreds        */ | 
|---|
| 81 | ULONG    date ;                  /* day month (USHORT)year                */ | 
|---|
| 82 | UCHAR    data[1] ;               /* begin of variable data that includes: */ | 
|---|
| 83 | /* Originator(256 bytes if LF_BIT_ORIGIN_256)*/ | 
|---|
| 84 | /* else 8 bytes long                         */ | 
|---|
| 85 | /* Processname(260 bytes) only if status     */ | 
|---|
| 86 | /* LF_BIT_PROCNMAME set                      */ | 
|---|
| 87 | /* FormatDLLName(12 bytes)                   */ | 
|---|
| 88 | /* Variable data                             */ | 
|---|
| 89 | } LOGRECORD ; | 
|---|
| 90 | /* typedef LOGRECORD far *PLOGREC ; */ | 
|---|
| 91 |  | 
|---|
| 92 | /*----------------------------------------------*/ | 
|---|
| 93 | /* Format of buffer sent to LogAddEntries       */ | 
|---|
| 94 | /*----------------------------------------------*/ | 
|---|
| 95 | typedef struct LogEntryRec | 
|---|
| 96 | { | 
|---|
| 97 | USHORT    version ;                            /* this version is 1       */ | 
|---|
| 98 | USHORT    count   ;                /* number of log records in this buffer*/ | 
|---|
| 99 | LOGRECORD logrec  ;                            /* repeated count times    */ | 
|---|
| 100 | } LOGENTRYREC ; | 
|---|
| 101 | /* typedef LOGENTRYREC far *PLOGENTRYREC ; */ | 
|---|
| 102 |  | 
|---|
| 103 | /*--------------------------------------------------*/ | 
|---|
| 104 | /* Logging facility Function prototypes             */ | 
|---|
| 105 | /*--------------------------------------------------*/ | 
|---|
| 106 | APIRET APIENTRY LogOpen( PHFILE phf ); | 
|---|
| 107 |  | 
|---|
| 108 | APIRET APIENTRY LogClose( HFILE hf ); | 
|---|
| 109 |  | 
|---|
| 110 | APIRET APIENTRY  LogAddEntries( HFILE hf, ULONG ulService, PVOID pLogEntries ); | 
|---|
| 111 |  | 
|---|
| 112 |  | 
|---|
| 113 | /* 16-bit Logging Facility Function Prototypes                   */ | 
|---|
| 114 |  | 
|---|
| 115 |  | 
|---|
| 116 | APIRET16 APIENTRY16     DosLogRegister(PUSHORT LogHandle, | 
|---|
| 117 | PVOID LogRegList, | 
|---|
| 118 | PUSHORT RequestID); | 
|---|
| 119 |  | 
|---|
| 120 |  | 
|---|
| 121 | APIRET16 APIENTRY16     DosLogEntry(USHORT Function, | 
|---|
| 122 | PVOID LogData); | 
|---|
| 123 |  | 
|---|
| 124 | APIRET16 APIENTRY16     DosLogRead(USHORT LogHandle, | 
|---|
| 125 | USHORT Length, | 
|---|
| 126 | PVOID LogBuffer, | 
|---|
| 127 | PUSHORT ReadSize); | 
|---|
| 128 |  | 
|---|
| 129 | #endif | 
|---|
| 130 |  | 
|---|