Purpose
DosQuerySysState returns information about various resources in use by the system. The EntityList parameter determines which information is returned according to the bits set in this parameter.
Syntax
#define INCL_DOSPROFILE #define INCL_DOSERRORS #include os2.h>
APIRET APIENTRY DosQuerySysState
Parameters
EntityList (ULONG) input
QS_PROCESS
Returns
ulrc (APIRET) returns
DosQuerySysState returns one of the following values
87
Remarks
The information returned by DosQuerySysState begins with a pointer to the global record structure, qsGrec_s. Following this will be a series of other records which depend on what information was requested. Some of these subsequent record structures contain an identifier as their first member, which enables the returned information to be interpreted without any order being imposed.
Entities that may be requested are
Process information
The structures returned will be a combination of the following
qsGrec_t
Related Functions
Example Code
#define BUFSIZE 64*1024int main(int argc, char *argv[], char *envp[]) { APIRET rc; qsGrec_t ** pBuf; qsGrec_t * pGrec; qsLrec_t * pLrec; pBuf=malloc(BUFSIZE); /* allocate a 64K buffer */ if (pBuf == NULL) { printf("Not enough memoryan"); return ERROR_NOT_ENOUGH_MEMORY; } /* endif */ /* query module information */ rc=DosQuerySysState(QS_MTE, 0L, 0L, 0L, pBuf, BUFSIZE); if (rc!=0) { printf("DosQuerySysState returned rc=%u\n",rc); return rc; } /* endif */ pGrec = * pBuf; printf("Threads=%u 32-bit Sems=%u File Names=%u\n\n", pGrec->cThrds, pGrec->c32SSem, pGrec->cMFTNodes); pLrec = (ULONG)pGrec + sizeof(qsGrec_t); while (pLrec) { if (pLrec->pName) printf("hmte=%04x %s\n", pLrec->hmte, pLrec->pName); pLrec = pLrec->pNextRec; } /* endwhile */ return rc; }