Annotation of os2sdk/demos/examples/infoseg/infoseg.c, revision 1.1.1.2

1.1       root        1: /*
1.1.1.2 ! root        2:  * Example of DosGetInfoSeg usage
1.1       root        3:  *
                      4:  * Gets the local and global data segments and displays some of their contents
                      5:  *
1.1.1.2 ! root        6:  * Created by Microsoft Corp. 1986
1.1       root        7:  */
                      8: 
1.1.1.2 ! root        9: #define  INCL_DOSINFOSEG
1.1       root       10: 
1.1.1.2 ! root       11: #include <os2def.h>
        !            12: #include <bsedos.h>    /* contains MAKEPG and MAKEPLINFOSEG definitions */
1.1       root       13: 
                     14: main()
                     15: {
1.1.1.2 ! root       16:        PGINFOSEG gdt;
        !            17:        PLINFOSEG ldt;
        !            18:        SEL gdt_handle, ldt_handle;
1.1       root       19:        
                     20:        /* get the infoseg handles */
1.1.1.2 ! root       21:        DosGetInfoSeg(&gdt_handle, &ldt_handle);
1.1       root       22:        
                     23:        /* convert the handles into far pointers */
1.1.1.2 ! root       24:        gdt = MAKEPGINFOSEG(gdt_handle);
        !            25:        ldt = MAKEPLINFOSEG(ldt_handle);
1.1       root       26:        
                     27:        /* display the contents of the segments */
                     28:        printf("This is thread %u of process %u\n",
1.1.1.2 ! root       29:                ldt->tidCurrent,
        !            30:                ldt->pidCurrent);
1.1       root       31:        printf("The current time is %u:%2u:%2u.%2u\n",
1.1.1.2 ! root       32:                gdt->hour, gdt->minutes, gdt->seconds, gdt->hundredths);
1.1       root       33: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.