_UNDOCUMENTED CORNER_ by Troy Folger edited by Andrew Schulman Listing One /* Excerpt from DOSQPROC.H. Complete header file available electronically. */ /* VOID * p16Buf = NULL; * USHORT cbBuf = DQPS_BUFSIZE; * qsPtrRec_t * pPtrRec; * DosQProcStatus(p16Buf,cbBuf); * pPtrRec = (qsPtrRec_t *)p16Buf; * // ... */ typedef struct qsPtrRec_s { qsGrec_t * pGlobalRec; /* ptr to the global data structure */ qsPrec_t * pProcRec; /* ptr to process data list */ qsS16Headrec_t * p16SemRec; /* ptr to 16 bit system sem list */ VOID * Reserved; /* always NULL - see comments above */ qsMrec_t * pShrMemRec; /* ptr to shared memory seg list */ qsLrec_t * pLibRec; /* ptr to module table entry list */ } qsPtrRec_t; Listing Two /* Excerpt from DOSQPROC.H. Complete header file available electronically. */ /* process 'type' definitions */ #define PT_FULL_SCREEN 0 #define PT_DOS_OR_WINOS2 1 /* kernel (SYSINIT) process */ #define PT_WINDOWED 2 /* OS/2 windowed session */ #define PT_PM 3 /* Presentation Manager */ #define PT_DETACHED 4 /* process status definitions */ #define PS_IN_EXITLIST 0x01 #define PS_EXITING_THREAD_1 0x02 #define PS_PROCESS_EXITING 0x04 #define PS_TERMINATION_AWARE 0x10 #define PS_PARENT_EXEC_WAIT 0x20 #define PS_DYING 0x40 #define PS_EMBRYONIC 0x80 /* thread status definitions */ #define TS_READY 1 #define TS_BLOCKED 2 #define TS_RUNNING 5 Listing Three /* Constructing a pointer to the list of semaphore detail records. Excerpt from PROCINFO.C */ qsPtrRec_t * pPtrRec; qsS16rec_t * pSemRec; // ... pSemRec = (qsS16rec_t *)(pPtrRec->p16SemRec + 1); Figure 1: #ifdef __BORLANDC__ /* OS/2 2.x prototype with Borland C++ 1.0, 1.01 _far16 * semantics */ APIRET16 APIENTRY16 DosQProcStatus(VOID _far16 * p16Buf, USHORT cbBuf); #else /* typical OS/2 2.x prototype */ APIRET16 APIENTRY16 DosQProcStatus(PVOID p16Buf, USHORT cbBuf); #endif /* suggested buffer size for DosQProcStatus */ #define DQPS_BUFSIZE 0xFFFF Listing Two /* Excerpt from DOSQPROC.H. Complete header file available electronically. */ /* process 'type' definitions */ #define PT_FULL_SCREEN 0 #define PT_DOS_OR_WINOS2 1 /* kernel (SYSINIT) process */ #define PT_WINDOWED 2 /* OS/2 windowed session */ #define PT_PM 3 /* Presentation Manager */ #define PT_DETACHED 4 /* process status definitions */ #define PS_IN_EXITLIST 0x01 #define PS_EXITING_THREAD_1 0x02 #define PS_PROCESS_EXITING 0x04 #define PS_TERMINATION_AWARE 0x10 #define PS_PARENT_EXEC_WAIT 0x20 #define PS_DYING 0x40 #define PS_EMBRYONIC 0x80 /* thread status definitions */ #define TS_READY 1 #define TS_BLOCKED 2 #define TS_RUNNING 5