home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sherlock.zip / PROCESS / PROCSTAT.H < prev   
C/C++ Source or Header  |  1993-01-01  |  6KB  |  144 lines

  1. /**********************************************************************
  2.  * MODULE NAME :  procstat.h             AUTHOR:  Rick Fishman        *
  3.  * DATE WRITTEN:   2-10-92                                            *
  4.  *                                                                    *
  5.  * DESCRIPTION:                                                       *
  6.  *                                                                    *
  7.  *  This header file contains the function prototype for the asofyet  *
  8.  *  undocumented DosQProcStatus API.  It also contains the structure  *
  9.  *  definitions that are used in the buffer that is returned by the   *
  10.  *  API call.                                                         *
  11.  *                                                                    *
  12.  *  In order to invoke DosQProcStatus, your .DEF file must contain    *
  13.  *  this entry:                                                       *
  14.  *                                                                    *
  15.  *           IMPORTS DOSQPROCSTATUS=DOSCALLS.154                      *
  16.  *                                                                    *
  17.  **********************************************************************/
  18.  
  19. #pragma linkage( DosQProcStatus, far16 pascal )
  20. USHORT DosQProcStatus( PVOID pvBuf, USHORT cbBuf );
  21.  
  22. #define PROCESS_END_INDICATOR   3       // Indicates end of process structs
  23.  
  24. #pragma pack(1)
  25.  
  26. typedef struct _SUMMARY
  27. {
  28.     ULONG   ulThreadCount;              // Number of threads in system
  29.     ULONG   ulProcessCount;             // Number of processes in system
  30.     ULONG   ulModuleCount;              // Number of modules in system
  31.  
  32. } SUMMARY, *PSUMMARY;
  33.  
  34.  
  35. typedef struct _THREADINFO
  36. {
  37.     UCHAR   uchDontKnow1;               //
  38.     UCHAR   uchDontKnow2;               //
  39.     USHORT  usDontKnow3;                //
  40.     USHORT  tidWithinProcess;           // TID within process (TID is 4 bytes!!)
  41.     USHORT  tidWithinSystem;            // TID within system
  42.     ULONG   ulBlockId;                  // Block ID (?)
  43.     USHORT  usPriority;                 // Priority
  44.     USHORT  usDontKnow4;                //
  45.     USHORT  usDontKnow5;                //
  46.     USHORT  usDontKnow6;                //
  47.     USHORT  usDontKnow7;                //
  48.     USHORT  usDontKnow8;                //
  49.     USHORT  usThreadStatus;             // 2=blocked or ready, 5=running
  50.     USHORT  usDontKnow9;                //
  51.  
  52. } THREADINFO, *PTHREADINFO;
  53.  
  54.  
  55. typedef struct _PROCESSINFO
  56. {
  57.     ULONG       ulEndIndicator;         // 1 means not end, 3 means last entry
  58.     PTHREADINFO ptiFirst;               // Address of the 1st Thread Control Blk
  59.     USHORT      pid;                    // Process ID (2 bytes - PID is 4 bytes)
  60.     USHORT      pidParent;              // Parent's process ID
  61.     USHORT      usDontKnow2;            //
  62.     USHORT      usDontKnow3;            //
  63.     USHORT      usDontKnow4;            //
  64.     USHORT      usDontKnow5;            //
  65.     USHORT      idSession;              // Session ID
  66.     USHORT      usDontKnow6;            //
  67.     USHORT      hModRef;                // Module handle of EXE
  68.     USHORT      usThreadCount;          // Number of threads in this process
  69.     USHORT      usSessionType;          // Session type (SSF_TYPE_xx)
  70.     CHAR        achDontKnow7[ 6 ];      //
  71.     USHORT      usThreadIdCount;        // Number of USHORTs in Thread id table?
  72.     USHORT      usModCount;             // Number of USHORTs in ModHandle table?
  73.     USHORT      usUshortCount;          // Number of USHORTs in Ushort table?
  74.     USHORT      usDontKnow8;            //
  75.     ULONG       ulThreadIdTableAddr;    // Maybe the address of a TID table
  76.     PUSHORT    pModHandleTable;    // Address of a ModHandle table (DLLS?)
  77.     ULONG       ulUshortTableAddr;      // Address of a table of USHORTs (?)
  78.  
  79. } PROCESSINFO, *PPROCESSINFO;
  80.  
  81.  
  82. typedef struct _SEMHEADER
  83. {
  84.     USHORT   ownPid;            // 0 Owner PID
  85.     USHORT   achDontKnow1;        // 2
  86.     ULONG    achDontKnow2[2];        // 4
  87.     USHORT   usIndex;            // C Semaphore Index
  88.     USHORT   achDontKnow3;        // E
  89.                     // 10
  90. } SEMHEADER, *PSEMHEADER;
  91.  
  92. typedef struct _SEMINFO
  93. {
  94.     struct _SEMINFO *pNext;        // 0 Pointer to next block
  95.     USHORT   fsFlags;            // 4 (MSB-LSB)
  96.     UCHAR    achDontKnow1[1];        // 6
  97.     UCHAR    uchReferenceCount;     // 7 Number of references
  98.     UCHAR    uchRequestCount;        // 8 Number of requests
  99.     CHAR     achDontKnow2[3];        // 9
  100.     USHORT   usIndex;            // c Semaphore Index
  101.     CHAR     szSemName[ 1 ];        // e ASCIIZ semaphore name
  102.                     // ?
  103. } SEMINFO, *PSEMINFO;
  104.  
  105. typedef struct _SHRMEMINFO
  106. {
  107.     struct _SHRMEMINFO *pNext;           // Pointer to next block
  108.     USHORT      usMemHandle;             // Shared memory handle (?)
  109.     SEL         selMem;                  // Selector
  110.     USHORT      usReferenceCount;        // Number of references
  111.     CHAR        szMemName[ 1 ];          // ASCIIZ shared memory name
  112.  
  113. } SHRMEMINFO, *PSHRMEMINFO;
  114.  
  115.  
  116. typedef struct _MODINFO
  117. {
  118.     struct _MODINFO *pNext;              // Pointer to next block
  119.     USHORT   hMod;                       // Module handle
  120.     USHORT   usModType;                  // Module type (0=16bit,1=32bit)
  121.     ULONG    ulModRefCount;              // Count of module references
  122.     ULONG    ulSegmentCount;             // Number of segments in module
  123.     ULONG    ulDontKnow1;                //
  124.     PSZ      szModName;                  // Addr of fully qualified module name
  125.     USHORT   usModRef[ 1 ];              // Handles of module references
  126.  
  127. } MODINFO, *PMODINFO;
  128.  
  129.  
  130. typedef struct _BUFFHEADER
  131. {
  132.     PSUMMARY        psumm;        // Pointer to SUMMARY section
  133.     PPROCESSINFO    ppi;        // Pointer to PROCESS section
  134.     PSEMINFO        psi;        // Pointer to SEMAPHORE section
  135.     PVOID        pDontKnow1;     // Unknown
  136.     PSHRMEMINFO     psmi;        // Pointer to SHARED MEMORY section
  137.     PMODINFO        pmi;        // Pointer to MODULE section
  138.     PVOID        pDontKnow2;     //
  139.     PVOID        pDontKnow3;     //
  140.  
  141. } BUFFHEADER, *PBUFFHEADER;
  142.  
  143. #pragma pack()
  144.