Jump to content

DosQProcStatus

From EDM2
Revision as of 18:41, 24 August 2017 by Martini (talk | contribs)

DosQProcStatus is an undocumented function in OS/2 v1.2 is used by PSTAT.EXE and PS.EXE to get system information about processes, threads etc. It fills a buffer with system information about threads, processes, dynylink-libraries, system semaphores and named shared segments.

Prototype

APIRET16 APIENTRY16 DosQProcStatus ( PULONG buffer, USHORT buffer_size ) ; 

Linkage Definition

IMPORTS DOSQPROCSTATUS = DOSCALL1.154 

Parameters

PULONG buffer
Address of buffer for results. See DQPS.H for the layout.
USHORT buffer_size
Size of result buffer.

Remarks

This function is a slightly altered version of the function of the same name that was present in OS/2 1.x, and which formed the basis of the PSTAT program. Though it remains a 16-bit function call, returning data formatted for a 16-bit application, it is nonetheless different from the original OS/2 1.x function in that the data structure returned is much more complete and is easier to use.

Note: Because this function remains a 16-bit version, the data buffer provided to it must be allocated with the OBJ_TILED attribute and cannot exceed 64K in size. There are times when 64K is not enough for the entire data structure, in which case the structure is truncated. This can lead to memory access violations upon trying to scan the structure. To avoid this problem you might want to use the DosQuerySysState function instead.


Note for OS/2 1.xOS/2 fills this buffer with system information. The amount of information you will get depends on how many system resources are actually used. The size of the buffer (and therefore the value of cbBuf) should be around 4 kBytes. This should be enough, even in the case of a heavy loaded system. The data you will get back is structured as a linked list. Each entry starts with a 16-bit code (0001 = thread information entry, 0004 = named shared segment etc.). The second 16-bit value is the pointer to the next entry followed by specific information about the entry.

Links

  • Information about this function on OS/2 1.x [1]