|
|
Microsoft OS/2 SDK 03-01-1988
/*
* Example of DosGetInfoSeg usage
*
* Gets the local and global data segments and displays some of their contents
*
* Created by Microsoft Corp. 1986
*/
#define INCL_DOSINFOSEG
#include <os2def.h>
#include <bsedos.h> /* contains MAKEPG and MAKEPLINFOSEG definitions */
main()
{
PGINFOSEG gdt;
PLINFOSEG ldt;
SEL gdt_handle, ldt_handle;
/* get the infoseg handles */
DosGetInfoSeg(&gdt_handle, &ldt_handle);
/* convert the handles into far pointers */
gdt = MAKEPGINFOSEG(gdt_handle);
ldt = MAKEPLINFOSEG(ldt_handle);
/* display the contents of the segments */
printf("This is thread %u of process %u\n",
ldt->tidCurrent,
ldt->pidCurrent);
printf("The current time is %u:%2u:%2u.%2u\n",
gdt->hour, gdt->minutes, gdt->seconds, gdt->hundredths);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.