[Toc][Index]

DosGetInfoSeg


Bindings:  C, MASM 

This call returns the address of a global and local information segment, 
specific to a process. 
 DosGetInfoSeg     (GlobalSeg, LocalSeg) 
 
 GlobalSeg (PSEL) - output 
    Address of the global information segment structure, as defined below: 
    
    time (ULONG) 
       Time in seconds since 1/1/1970. 
    millisecs (ULONG) 
       Time in milliseconds. 
    hours (UCHAR) 
       Current hour. 
    minute (UCHAR) 
       Current minute. 
    seconds (UCHAR) 
       Current second. 
    hundredsec (UCHAR) 
       Current hundredth of a second. 
    timezone (USHORT) 
       Minutes from UTC; if hex FFFFH, timezone is undefined. 
    interval (USHORT) 
       Timer interval in tenths of milliseconds. 
    day (UCHAR) 
       Day. 
    month (UCHAR) 
       Month. 
    year (USHORT) 
       Year. 
    weekday (UCHAR) 
       Day-of-week: 
       Value     Definition 
       0         Sunday 
       1         Monday 
       2         Tuesday 
       3         Wednesday 
       4         Thursday 
       5         Friday 
       6         Saturday 
    majorversion (UCHAR) 
       Major version number. 
    minorversion (UCHAR) 
       Minor version number. 
    revision (UCHAR) 
       Revision letter. 
    currentsession (UCHAR) 
       Current foreground full-screen session. 
    maxnumsessions (UCHAR) 
       Maximum number of full-screen sessions. 
    hugeshift (UCHAR) 
       Shift count for huge segments. 
    protmodeind (UCHAR) 
       Protect-mode-only indicator: 
       Value     Definition 
       0         DOS mode and OS/2 mode. 
       1         OS/2 mode only. 
    lastprocess (USHORT) 
       Process ID of the current foreground process. 
    dynvarflag (UCHAR) 
       Dynamic variation flag: 
       Value     Definition 
       0         Absolute 
       1         Enabled. 
    maxwait (UCHAR) 
       Maximum wait in seconds. 
    mintimeslice (USHORT) 
       Minimum timeslice in milliseconds. 
    maxtimeslice (USHORT) 
       Maximum timeslice in milliseconds. 
    bootdrive (USHORT) 
       Drive from which the system was booted: 
       Value     Definition 
       1         Drive A. 
       2         Drive B. 
       .           
       .           
       .           
       n         Drive n. 
    traceflags (UCHAR) 
       32 system trace major code flags. Each bit corresponds to a trace 
       major code, hex 00-FFH. The most significant bit (left-most) of the 
       first byte corresponds to major code hex 00H. 
       Value     Definition 
       0         Trace disabled. 
       1         Trace enabled. 
    maxtextsessions (UCHAR) 
       Maximum number of VIO windowable sessions. 
    maxpmsessions (UCHAR) 
       Maximum number of Presentation Manager sessions. 
 LocalSeg (PSEL) - output 
    Address of the selector for the local information segment structure, 
    as defined below: 
    processid (PID) 
       Current process ID. 
    parentprocessid (PID) 
       Parent process ID. 
    threadprty (USHORT) 
       Priority of current thread. 
    threadid (TID) 
       Current thread ID. 
    sessionid (USHORT) 
       Current session ID. 
    procstatus (UCHAR) 
       Process status. 
    unused (UCHAR) 
       Unused. 
    foregroundprocess (BOOL) 
       Current process is in foreground (has keyboard focus). Value -1 
       implies yes, 
       0 implies no. 
    typeProcess (UCHAR) 
       Type of process: 
       Value     Definition 
       0         Full screen protect mode session. 
       1         Requires real mode. 
       2         VIO windowable protect mode session. 
       3         Presentation Manager protect mode session. 
       4         Detached protect mode process. 
    unused (UCHAR) 
       Unused. 
    environmentsel (SEL) 
       Environment selector. 
    cmdlineoff (USHORT) 
       Command line offset in the segment addressed by environmentsel. 
    dataseglen (USHORT) 
       Length of data segment in bytes. 
    stacksize (USHORT) 
       Stack size in bytes. 
    heapsize (USHORT) 
       Heap size in bytes. 
    hmodule (HMODULE) 
       Module handle. 
    dssel (SEL) 
       Data segment selector. 
 rc (USHORT) - return 
    Return code description is: 
    0         NO_ERROR 
 
 Remarks 
 Items of general interest are kept in the global information segment. 
 Items of information specific to a particular process are kept in the 
 local information segment.  This information can be directly read  by the 
 application program.  Both of these segments are defined as read-only 
 segments.  The application program cannot modify this data. 
 Assuming n1, n2, and n3 are the maximum number of full-screen sessions, 
 VIO-windowable sessions, and Presentation Manager sessions, the first 0 
 through (n1-1) session numbers are assigned to full-screen sessions.  The 
 next n2 session numbers are assigned to VIO-windowable sessions, and the 
 next n3 session numbers are assigned to Presentation Manager sessions. 
 Session numbers in the range (n1+n2+n3) through 255 are reserved. 
  Applications should use (n1+n2+n3-1) as an upper boundary. Applications 
 should not assume that all session numbers starting with (n1+n2) and 
 higher are Presentation Manager sessions. 
 The application program must be careful when referencing the date or time 
 fields in the global information segment.  A timer interrupt can be 
 received by the system in between the instructions that read the 
 individual fields, changing the data in these fields. For example, if the 
 time is currently 23:59:59 on Tuesday, 6/2/87, the program can read the 
 hours field (23). A timer interrupt can now be received, changing the 
 time to 00:00:00 on Wednesday, 6/3/87.  The program reads the rest of the 
 time field (0 minutes) and the date field.  The program would then think 
 the current time and date is 23:00:00 on Wednesday, 6/3/87, which is 
 incorrect. 
 The application program should read all time and date fields it uses as 
 quickly as possible.  It can then compare the least significant time 
 field it uses (milliseconds, hundredths, seconds, or minutes) against the 
 current value in the global information segment.  If the value has not 
 changed, the rest of the information is valid.  If the value has changed, 
 the program time or date information should be read again, as the 
 information is updated while the program reads it. 

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs