OS/2 creates and maintains a process information block for every process. An application can use DosGetInfoBlocks to access the process information block. This function returns a pointer to a PIB data structure, which contains the information from the process information block.

The following code fragment returns the address of the process information block of the current process. The calling thread can subsequently browse either the PIB block.

    #define INCL_DOSPROCESS     /* Process and thread values */
    #include <os2.h>

    PTIB     ptib;      /* Address of pointer to thread information block  */
    PPIB     ppib;      /* Address of pointer to process information block */
    APIRET   rc;        /* Return code                                     */

    rc = DosGetInfoBlocks(&ptib,
                          &ppib);

DosGetInfoBlocks also returns the address of the thread information block of the current thread.


[Back] [Next]