home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / uptime2.zip / dqps.h next >
C/C++ Source or Header  |  1996-06-11  |  5KB  |  116 lines

  1. #ifndef DQPS_H
  2. #define DQPS_H
  3. /*
  4.  
  5.   The explanation for all the structures are in Kai Uwe Rommel's
  6.   documentation available in
  7.   
  8.   at ftp.leo.org in directory /pub/comp/os/os2/doc as proc.zip
  9.   
  10. */
  11.  
  12.  
  13.  
  14. /*
  15.    
  16.    declare the 16-bit DosQProcStatus in such a manner that gcc-emx will accept
  17.    it.
  18.    
  19.    
  20. */
  21.  
  22. unsigned _THUNK_PASCAL_FUNCTION (DosQProcStatus) (ULONG* buffer, USHORT buffer_size); 
  23.  
  24. typedef struct qsGrec_s {
  25.    ULONG cThrds;                /* number of threads in use */
  26.    ULONG Reserved1;
  27.    ULONG Reserved2;
  28. } qsGrec_t;
  29.  
  30. typedef struct qsTrec_s {
  31.    ULONG RecType;               /* 00: Record Type */
  32.                                 /*     Thread rectype = 0x00000100 */
  33.    USHORT tid;                  /* 04: thread ID */
  34.    USHORT slot;                 /* 06: "unique" thread slot number */
  35.    ULONG sleepid;               /* 08: sleep id thread is sleeping on */
  36.    ULONG priority;              /* 0C: thread priority */
  37.    ULONG systime;               /* 10: thread system time */
  38.    ULONG usertime;              /* 14: thread user time */
  39.    UCHAR state;                 /* 18: thread state */
  40.    UCHAR padchar ;              /* 19: */
  41.    USHORT padshort ;            /* 1A: */
  42. } qsTrec_t;                     /* Total size: 28 bytes */
  43.  
  44. typedef struct qsPrec_s {
  45.    ULONG RecType;               /* 00: type of record being processed */
  46.                                 /*     process rectype = 0x00000001   */
  47.    qsTrec_t * _Seg16 pThrdRec;  /* 04: ptr to 1st thread rec for this prc */
  48.    USHORT pid;                  /* 08: process ID */
  49.    USHORT ppid;                 /* 0A: parent process ID */
  50.    ULONG type;                  /* 0C: process type */
  51.    ULONG stat;                  /* 10: process status */
  52.    ULONG sgid;                  /* 14: process screen group */
  53.    USHORT hMte;                 /* 18: program module handle for process */
  54.    USHORT cTCB;                 /* 1A: # of TCBs in use in process */
  55.    ULONG Reserved1 ;
  56.    ULONG Reserved2 ;
  57.    USHORT c16Sem;               /* 24: # of 16 bit system sems in use by proc */
  58.    USHORT cLib;                 /* 26: number of runtime linked libraries */
  59.    USHORT cShrMem;              /* 28: number of shared memory handles */
  60.    USHORT Reserved3 ;
  61.    USHORT * _Seg16 p16SemRec;   /* 2C: ptr to head of 16 bit sem inf for proc */
  62.    USHORT * _Seg16 pLibRec;     /* 30: ptr to list of runtime lib in use by process */
  63.    USHORT * _Seg16 pShrMemRec;  /* 34: ptr to list of shared mem handles in use by process */
  64.    ULONG Reserved4 ;            /* 38: */
  65. } qsPrec_t;                     /* Total size: 60 bytes */
  66.  
  67. typedef struct qsS16Headrec_s { 
  68.    ULONG SRecType;              /* semaphore rectype = 3 */
  69.    ULONG Reserved1;             /* overlays NextRec of 1st qsS16rec_t*/
  70.    ULONG Reserved2;
  71.    ULONG S16TblOff;             /* index of first semaphore,SEE PSTAT OUTPUT*/
  72.                                 /* System Semaphore Information Section     */
  73. } qsS16Headrec_t;
  74.  
  75. typedef struct qsS16rec_s { 
  76.    ULONG NextRec;               /* offset to next record in buffer*/
  77.    UINT  s_SysSemOwner ;        /* thread owning this semaphore   */
  78.    UCHAR s_SysSemFlag ;         /* system semaphore flag bit field*/
  79.    UCHAR s_SysSemRefCnt ;       /* number of references to this   */
  80.                                 /*   system semaphore             */
  81.    UCHAR s_SysSemProcCnt ;      /*number of requests by sem owner*/
  82.    UCHAR Reserved1;
  83.    ULONG Reserved2;
  84.    UINT  Reserved3;
  85.    CHAR  SemName;               /* start of semaphore name string */
  86. } qsS16rec_t;
  87.  
  88.  
  89. typedef struct qsMrec_s { 
  90.    ULONG  MemNextRec;           /* offset to next record in buffer */
  91.    USHORT hmem;                 /* handle for shared memory */
  92.    USHORT sel;                  /* shared memory selector */
  93.    USHORT refcnt;               /* reference count */
  94.    CHAR   Memname;              /* start of shared memory name string */
  95. } qsMrec_t;
  96.  
  97. typedef struct qsLrec_s { 
  98.    void * _Seg16 pNextRec;      /* pointer to next record in buffer */
  99.    USHORT hmte;                 /* handle for this mte */
  100.    USHORT Reserved1;            /* Reserved */
  101.    ULONG  ctImpMod;             /* # of imported modules in table */
  102.    ULONG  Reserved2;            /* Reserved */
  103.    ULONG  Reserved3;            /* Reserved */
  104.    UCHAR * _Seg16 pName;        /* ptr to name string following stru*/
  105. } qsLrec_t;
  106.  
  107. typedef struct qsPtrRec_s {
  108.    qsGrec_t *pGlobalRec;        /* ptr to the global data section */
  109.    qsPrec_t *pProcRec;          /* ptr to process record section  */
  110.    qsS16Headrec_t *p16SemRec;   /* ptr to 16 bit sem section      */
  111.    qsMrec_t *pShrMemRec;        /* ptr to shared mem section      */
  112.    qsLrec_t *pLibRec;           /* ptr to exe module record section */
  113. } qsPtrRec_t;
  114.  
  115. #endif
  116.