en:docs:fapi:dosgetinfoseg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dosgetinfoseg [2021/10/16 14:24] – created prokusheven:docs:fapi:dosgetinfoseg [2021/12/16 03:04] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== DosGetInfoSeg ======
  
 This call returns the address of a global and local information segment, specific to a process. This call returns the address of a global and local information segment, specific to a process.
  
-==Syntax==+===== Syntax ===== 
  DosGetInfoSeg (GlobalSeg, LocalSeg)  DosGetInfoSeg (GlobalSeg, LocalSeg)
  
-==Parameters== +===== Parameters =====
-;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 +
-      Sunday  +
-      Monday +
-      Tuesday  +
-      Wednesday  +
-      Thursday  +
-      Friday  +
-      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 +
-      DOS mode and OS/2 mode. +
-      OS/2 mode only.  +
-:lastprocess (USHORT) : Process ID of the current foreground process.  +
-:dynvarflag (UCHAR) : Dynamic variation flag: +
- Value  Definition +
-      Absolute +
-      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 +
-      Drive A. +
-      Drive B. +
- . +
- . +
- . +
-      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  +
-      Trace disabled. +
-        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: +  * GlobalSeg (PSEL) - output : Address of the global information segment structure, as defined below: 
-:processid (PID): Current process ID+    * time (ULONG): Time in seconds since 1/1/1970
-:parentprocessid (PID): Parent process ID+    * millisecs (ULONG): Time in milliseconds
-:threadprty (USHORT): Priority of current thread. +    * hours (UCHAR): Current hour
-:threadid (TID): Current thread ID+    * minute (UCHAR): Current minute
-:sessionid (USHORT): Current session ID+    * seconds (UCHAR): Current second
-:procstatus (UCHAR): Process status+    * hundredsec (UCHAR): Current hundredth of a second
-:unused (UCHAR): Unused+    * timezone (USHORT): Minutes from UTC; if hex FFFFH, timezone is undefined
-:foregroundprocess (BOOL): Current process is in foreground (has keyboard focus). Value -1 implies yes, 0 implies no+    * interval (USHORT): Timer interval in tenths of milliseconds
-:typeProcess (UCHAR): Type of process: +    * day (UCHAR): Day
- Value  Definition +    * month (UCHAR): Month
-      Full screen protect mode session+    * year (USHORT): Year
- 1      Requires real mode. +    * weekday (UCHAR): Day-of-week:
-      VIO windowable protect mode session. +
-      Presentation Manager protect mode session. +
-      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.+
  
-==Return Code== +^ Value ^ Definition ^ 
-;rc (USHORT) - return:Return code description is: +| 0     | Sunday | 
-* 0 NO_ERROR+| 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. 
 + 
 +===== Return Code ===== 
 + 
 +rc (USHORT) - return:Return code description is: 
 + 
 +  * 0 NO_ERROR 
 + 
 +===== Remarks =====
  
-==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. 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.
  
Line 98: Line 118:
 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. 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.
  
-==Bindings== +===== Bindings ===== 
-===C=== + 
-<PRE>+====C==== 
 +<code c>
 typedef struct _GINFOSEG { typedef struct _GINFOSEG {
   ULONG   time;               /* time in seconds */   ULONG   time;               /* time in seconds */
Line 160: Line 181:
  
 USHORT  rc;            /* return code */ USHORT  rc;            /* return code */
-</PRE>+</code>
  
-===MASM=== +====MASM==== 
-<PRE>+<code asm>
 GINFOSEG struc GINFOSEG struc
   gis_time                dd  ? ;time in seconds   gis_time                dd  ? ;time in seconds
Line 223: Line 244:
  
 Returns WORD Returns WORD
-</PRE>+</code>
  
 +{{page>en:templates:fapi}}