Jump to content

DevHelp GetDOSVar: Difference between revisions

From EDM2
Created page with "DevHlp_GetDosVar returns the address of a kernel variable. ==Syntax== ===C=== <PRE> DevHelp_GetDOSVar ( USHORT VarNumber, USHORT VarMember, PPVOID KernelVar ) </PRE> ===Asse..."
 
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
DevHlp_GetDosVar returns the address of a kernel variable.
{{DISPLAYTITLE:DevHelp_GetDOSVar}}
DevHlp_GetDOSVar returns the address of a kernel variable.


==Syntax==
==Syntax==
===C===
;C
<PRE>
DevHelp_GetDOSVar ( USHORT VarNumber, USHORT VarMember, PPVOID KernelVar )
DevHelp_GetDOSVar ( USHORT VarNumber, USHORT VarMember, PPVOID KernelVar )
;Assembler
</PRE>
 
===Assembler===
Calling Sequence in Assembler
Calling Sequence in Assembler
<PRE>
     MOV  AL, index             ; Index wanted.
     MOV  AL, index               ; Index wanted.
     MOV  CX, VarMember         ; Only used by index 14 and 16.
     MOV  CX, VarMember           ; Only used by index 14 and 16.
     MOV  DL, DevHlp_GetDOSVar
     MOV  DL, DevHlp GetDOSVar
    CALL  Device Help


    CALL  Device Help
</PRE>
==Parameters==
==Parameters==
===C===
===C===
; VarNumber (USHORT) : The index into the list of read only variables
;VarNumber (USHORT): The index into the list of read only variables
<PRE>
DHGETDOSV_SYSINFOSEG           1
    DHGETDOSV_SYSINFOSEG                                       1
DHGETDOSV_LOCINFOSEG           2
    DHGETDOSV_LOCINFOSEG                                       2
DHGETDOSV_VECTORSDF           4
    DHGETDOSV_VECTORSDF                                       4
DHGETDOSV_VECTORREBOOT         5
    DHGETDOSV_VECTORREBOOT                                     5
DHGETDOSV_VECTORMSATS         6
    DHGETDOSV_VECTORMSATS                                     6
DHGETDOSV_YIELDFLAG           7
    DHGETDOSV_YIELDFLAG                                       7
DHGETDOSV_TCYIELDFLAG         8
    DHGETDOSV_TCYIELDFLAG                                     8
DHGETDOSV_DOSCODEPAGE         11
    DHGETDOSV_DOSCODEPAGE                                     11
DHGETDOSV_INTERRUPTLEV       13
    DHGETDOSV_INTERRUPTLEV                                     13
DHGETDOSV_DEVICECLASSTABLE   14
    DHGETDOSV_DEVICECLASSTABLE                                 14
DHGETDOSV_DMQSSELECTOR       15
    DHGETDOSV_DMQSSELECTOR                                     15
DHGETDOSV_APMINFO             16
    DHGETDOSV_APMINFO                                         16
DHGETDOSV_APM11INFO           17
    DHGETDOSV_APM11INFO                                       17
DHGETDOSV_CPUMODE             18
    DHGETDOSV_CPUMODE                                         18
DHGETDOSV_CPUMODE             19
    DHGETDOSV_CPUMODE                                         19
DHGETDOSV_TOTALCPUS           20
    DHGETDOSV_TOTALCPUS                                       20
;VarMember (USHORT) : Applicable only to VarNumber 14 or 16.
</PRE>
 
; VarMember (USHORT) : Applicable only to VarNumber 14 or 16.
 
For VarNumber = 14
For VarNumber = 14
<PRE>
VarMember=1     (Disk) has a maximum of 32 entries in the DCT.
    VarMember=1                     (Disk) has a maximum of 32
VarMember=2     (Mouse) has a maximum of 3 entries in the DCT.
                                    entries in the DCT.
    VarMember=2                     Mouse) has a maximum of 3
                                    entries in the DCT.
</PRE>
For VarNumber = 16
For VarNumber = 16
<PRE>
VarMember=0     Query presence of APM BIOS.
 
VarMember=1     Query presence of APM BIOS and establish connection.
    VarMember=0                     Query presence of APM BIOS.
;KernelVar (PPVOID) : Pointer to the address of requested variable to be returned.
    VarMember=1                     Query presence of APM BIOS and
                                    establish connection.
</PRE>
; KernelVar (PPVOID) : Pointer to the address of requested variable to be returned.
 


===Assembler===
===Assembler===
<PRE>
MOV  AL, index                ; Index wanted.
 
MOV  CX, VarMember            ; Only used by index 14 and 16.
</PRE>


==Return Code==
==Return Code==
===C===
===C===
; Success Indicator: Clear if successful; returns address of the requested variable in KernelVar.
;Success Indicator: Clear if successful; returns address of the requested variable in KernelVar.
 
;Possible errors: None.
; Possible errors: None.


===Assembler===
===Assembler===
Line 74: Line 55:
==Remarks==
==Remarks==
The following table contains the list of read-only variables
The following table contains the list of read-only variables
 
{|class="wikitable"
Index     Variable Description
!Index||Variable Description
  1       GlobalInfoSeg WORD. Valid at task time and interrupt
|-
          time, but not at INIT time. See below.
|1||GlobalInfoSeg WORD. Valid at task time and interrupt time, but not at INIT time. See below.
  2       LocalInfoSeg DWORD. Selector/segment address of local
|-
          information segment for the current Local Descriptor
|2||LocalInfoSeg DWORD. Selector/segment address of local information segment for the current Local Descriptor Table (LDT). Valid only at task time. See below.
          Table (LDT). Valid only at task time. See below.
|-
  3       Reserved.
|3||Reserved.
  4       VectorSDF DWORD. Pointer to the stand-alone dump
|-
          facility. Valid at task time and interrupt time.
|4||VectorSDF DWORD. Pointer to the stand-alone dump facility. Valid at task time and interrupt time.
  5       VectorReboot DWORD. Pointer to restart the operating
|-
          system. Valid at task time and interrupt time.
|5||VectorReboot DWORD. Pointer to restart the operating system. Valid at task time and interrupt time.
  6       Reserved.
|-
  7       YieldFlag BYTE. Indicator for performing yields.
|6||Reserved.
          Valid only at task time.
|-
  8       TCYieldFlag BYTE. Indicator for performing
|7||YieldFlag BYTE. Indicator for performing yields. Valid only at task time.
          time-critical yields. Valid only at task time.
|-
  9       Reserved.
|8||TCYieldFlag BYTE. Indicator for performing time-critical yields. Valid only at task time.
10       Reserved.
|-
11       DOS session Code Page Tag pointer DWORD.
|9||Reserved.
          Segment offset of the DOS session s current code page
|-
          tag. Valid only at task time.
|10||Reserved.
12       Reserved.
|-
13       Interrupt Level
|11||DOS session Code Page Tag pointer DWORD. Segment offset of the DOS session s current code page tag. Valid only at task time.
14       DeviceClass Table (See DH_RegisterDeviceClass)
|-
15       DMQS Selector   Point to XGA adapter. DMQS
|12||Reserved.
          information offset is assumed to start at zero.
|-
16       APMInfo APMStruc. Advanced Power Management BIOS
|13||Interrupt Level
          Information
|-
17       APMInfo APMStruc version 1.1. Advanced Power
|14||DeviceClass Table (See DH_RegisterDeviceClass)
          Management BIOS Information
|-
18       SMP_Active DWORD Information on the operating system
|15||DMQS Selector Point to XGA adapter. DMQS information offset is assumed to start at zero.
          (OS) support for more than 1 CPU. Returns 1 if the OS
|-
          has SMP support and 0 if the OS has uniprocessor
|16||APMInfo APMStruc. Advanced Power Management BIOS Information
          support.
|-
19       PSDInfo.psd_flags DWORD PSD status area where several
|17||APMInfo APMStruc version 1.1. Advanced Power Management BIOS Information
          pieces of useful information about the PSD can be
|-
          obtained. After obtaining the variable address, the
|18||SMP_Active DWORD Information on the operating system (OS) support for more than 1 CPU. Returns 1 if the OS has SMP support and 0 if the OS has uniprocessor support.
          caller must test the bit for the desired aspect of the
|-
          PSD. The PSD flags definition is as follows  
|19||PSDInfo.psd_flags DWORD PSD status area where several pieces of useful information about the PSD can be obtained. After obtaining the variable address, the caller must test the bit for the desired aspect of the PSD. The PSD flags definition is as follows PSD_INITIALIZED (0x80000000) PSD has been initialized PSD_INSTALLED (0x40000000) PSD has been installed PSD_ADV_INT_MODE (0x20000000) PSD is in advaanced interrupt mode PSD_KERNEL_PIC (0x10000000) Let the kernel interrupt manager EOI
          PSD_INITIALIZED (0x80000000) PSD has been initialized
|-
          PSD_INSTALLED (0x40000000) PSD has been installed
|20||cProcessors DWORD Information for the Multi-Processor environment. Indicates the number of processors currently running in the MP environment. A value of 1 is returned in Uni-Processor environment.
          PSD_ADV_INT_MODE (0x20000000) PSD is in advaanced
|}
          interrupt mode PSD_KERNEL_PIC (0x10000000) Let the
          kernel interrupt manager EOI
20       cProcessors DWORD Information for the Multi-Processor
          environment. Indicates the number of processors
          currently running in the MP environment. A value of 1
          is returned in Uni-Processor environment.
 
'''GlobalInfoSeg (PSEL)''' : Address of the global information segment structure, as defined below
'''GlobalInfoSeg (PSEL)''' : Address of the global information segment structure, as defined below


; Time (ULONG): Time in seconds since 1/1/1970.  
;Time (ULONG): Time in seconds since 1/1/1970.
; Millisecs (ULONG): Time in milliseconds.  
;Millisecs (ULONG): Time in milliseconds.
; Hours (UCHAR): Current hour.  
;Hours (UCHAR): Current hour.
; Minute (UCHAR): Current minute.  
;Minute (UCHAR): Current minute.
; Seconds (UCHAR): Current second.  
;Seconds (UCHAR): Current second.
; HundredSec (UCHAR) : Current hundreth of a second.  
;HundredSec (UCHAR): Current hundreth of a second.
; TimeZone (USHORT) : Minutes from UTC. If FFFFH, TimeZone is undefined.  
;TimeZone (USHORT): Minutes from UTC. If FFFFH, TimeZone is undefined.
; Interval (USHORT) : Timer interval in tenths of milliseconds.  
;Interval (USHORT): Timer interval in tenths of milliseconds.
; Day (UCHAR) : Day.  
;Day (UCHAR): Day.
; Month (UCHAR): Month.  
;Month (UCHAR): Month.
; Year (USHORT): Year.  
;Year (USHORT): Year.
; Weekday (UCHAR) : Day of the week
;Weekday (UCHAR): Day of the week
 
::Sunday
        Sunday
::Monday
        Monday
::Tuesday
        Tuesday
::Wednesday
        Wednesday
::Thursday
        Thursday
::Friday
        Friday
::Saturday
        Saturday  
;MajorVersion (UCHAR) : Major version number.
   
;MinorVersion (UCHAR) : Minor version number.
; MajorVersion (UCHAR) : Major version number.
;Revision (UCHAR) : Revision letter.
; MinorVersion (UCHAR) : Minor version number.
;CurrentSession (UCHAR) : Current foreground full-screen session.
; Revision (UCHAR) : Revision letter.
;MaxNumSessions (UCHAR): Maximum number of full-screen sessions.
; CurrentSession (UCHAR) : Current foreground full-screen session.
;HugeShift (UCHAR): Shift count for huge segments.
; MaxNumSessions (UCHAR): Maximum number of full-screen sessions.
;ProtModeInd (UCHAR): Protect-mode-only indicator
; HugeShift (UCHAR): Shift count for huge segments.
::DOS and OS/2 sessions.
; ProtModeInd (UCHAR): Protect-mode-only indicator
::OS/2 session only.
        DOS and OS/2 sessions.
;LastProcess (USHORT) : Process ID of the current foreground process.
        OS/2 session only.  
;DynVarFlag (UCHAR) : Dynamic variation flag
; LastProcess (USHORT) : Process ID of the current foreground process.  
::Absolute.
; DynVarFlag (UCHAR) : Dynamic variation flag
::Enabled.
        Absolute.
;MaxWait (UCHAR) : Maximum wait in seconds.
        Enabled.  
;MinTimeSlice (USHORT) : Minimum time slice in milliseconds.
   
;MaxTimeSlice (USHORT) : Maximum time slice in milliseconds.
; MaxWait (UCHAR) : Maximum wait in seconds.
;BootDrive (USHORT) : Drive from which the system startup occurred
; MinTimeSlice (USHORT) : Minimum time slice in milliseconds.
::Drive A
; MaxTimeSlice (USHORT) : Maximum time slice in milliseconds.
::Drive B
; BootDrive (USHORT) : Drive from which the system startup occurred
::Drive n.
 
;TraceFlags (UCHAR): Thirty-two system trace major code flags. Each bit corresponds to a trace major code 00H-FFH. The most significant bit (left-most) of the first byte corresponds to major code 00H. Values are:
        Drive A
        Drive B
        n
            Drive n.
 
; TraceFlags (UCHAR) : Thirty-two system trace major code flags. Each bit corresponds to a trace major code 00H-FFH. The most significant bit (left-most) of the first byte corresponds to major code 00H. Values are
* Trace disabled.
* Trace disabled.
* Trace enabled.  
* Trace enabled.
       
;MaxTextSessions (UCHAR) : Maximum number of VIO windowable sessions.
; MaxTextSessions (UCHAR) : Maximum number of VIO windowable sessions.
;MaxPMSessions (UCHAR) : Maximum number of Presentation Manager sessions.
; MaxPMSessions (UCHAR) : Maximum number of Presentation Manager sessions.


'''LocalInfoSeg (PSEL)'''
'''LocalInfoSeg (PSEL)'''


Address of the selector for the local information segment structure, as defined below
Address of the selector for the local information segment structure, as defined below
       
; ProcessID (PID) : Current Process ID.
; ProcessID (PID) : Current Process ID.
; ParentProcessID (PID) : Parent Process ID.
; ParentProcessID (PID) : Parent Process ID.
Line 189: Line 155:
; ProcStatus (UCHAR) : Process status.
; ProcStatus (UCHAR) : Process status.
; Unused (UCHAR) : Unused.
; Unused (UCHAR) : Unused.
; ForegroundProcess (BOOL) : Current process is in foreground (has keyboard focus)
;ForegroundProcess (BOOL) : Current process is in foreground (has keyboard focus)
                Implies YES
::Implies YES
                Implies NO.  
::Implies NO.
; TypeProcess (UCHAR) : Type of process
;TypeProcess (UCHAR) : Type of process
                Full screen protect-mode session.
::Full screen protect-mode session.
                Requires real mode.
::Requires real mode.
                VIO windowable protect-mode session.
::VIO windowable protect-mode session.
                Presentation Manager protect-mode session.
::Presentation Manager protect-mode session.
                Detached protect-mode process.  
::Detached protect-mode process.
           
;Unused (UCHAR) : Unused.
; Unused (UCHAR) : Unused.
;EnvironmentSel (SEL) : Environment selector.
; EnvironmentSel (SEL) : Environment selector.
;CmdLineOff (USHORT) : Command line offset in the segment addressed by EnvironmentSel.
; CmdLineOff (USHORT) : Command line offset in the segment addressed by EnvironmentSel.
;DataSegLen (USHORT) : Length of the data segment in bytes.
; DataSegLen (USHORT) : Length of the data segment in bytes.
;StackSize (USHORT) : Stack size in bytes.
; StackSize (USHORT) : Stack size in bytes.
;HeapSize (USHORT) : Heap size in bytes.
; HeapSize (USHORT) : Heap size in bytes.
;HModule (UHMODULE): Module handle.
; HModule (UHMODULE): Module handle.
;DSSel (SEL) : Data segment selector.
; DSSel (SEL) : Data segment selector.  


'''APMInfo'''
'''APMInfo'''


Advanced Power Management BIOS Information, as defined below
Advanced Power Management BIOS Information, as defined below
 
;APM CodeSeg (WORD) : APM 16-bit code segment (real-mode segment base address). From APM BIOS, INT 15h AX=5302H.
; APM CodeSeg (WORD) : APM 16-bit code segment (real-mode segment base address). From APM BIOS, INT 15h AX=5302H.
;APMDataSeg (WORD): APM16 - bitdatasegment( real - modesegmentbaseaddress ) .FromAPMBIOS ,INT15hAX = 5302H .
; APMDataSeg (WORD): APM16 - bitdatasegment( real - modesegmentbaseaddress ) .FromAPMBIOS ,INT15hAX = 5302H .
; APM Offset (WORD): Offset to entry point. From APM BIOS, INT 15h AX=5302H.
; APM Offset (WORD): Offset to entry point. From APM BIOS, INT 15h AX=5302H.
; APM Flags (WORD): APM capability flags. From APM BIOS, INT 15h AX=5300H.
; APM Flags (WORD): APM capability flags. From APM BIOS, INT 15h AX=5300H.
; APM Level (WORD): APM revision level. From APM BIOS, INT 15h AX=5300H.
; APM Level (WORD): APM revision level. From APM BIOS, INT 15h AX=5300H.
; APM CPUIdle (6 bytes (DF)) : APM Services Entry Point for CPU Idle and Busy Functions.  
; APM CPUIdle (6 bytes (DF)) : APM Services Entry Point for CPU Idle and Busy Functions.


'''Note:''' APM CodeSeg and APM DataSeg are segment addresses, not selectors. It is the responsibility of the device driver to convert the segment address to a valid protect-mode selector.  
'''Note:''' APM CodeSeg and APM DataSeg are segment addresses, not selectors. It is the responsibility of the device driver to convert the segment address to a valid protect-mode selector.


The first time GetDOSVar is called at device-driver initialization with index (AL) = 10H and CX = 1, the system sets the values for APM CodeSeg, APM DataSeg, APM Offset, APM Flags, and APM Level. On return, AX BX points to the APMInfo structure.
The first time GetDOSVar is called at device-driver initialization with index (AL) = 10H and CX = 1, the system sets the values for APM CodeSeg, APM DataSeg, APM Offset, APM Flags, and APM Level. On return, AX BX points to the APMInfo structure.
Line 227: Line 191:
If GetDOSVar is called after device-driver initialization with index (AL) = 10H, no information in the APMInfo structure is modified. On return, AX BX points to the APMInfo structure.
If GetDOSVar is called after device-driver initialization with index (AL) = 10H, no information in the APMInfo structure is modified. On return, AX BX points to the APMInfo structure.


APM CPUIdle contains the address of the CPU Idle and Busy processing routines from the Power Management Services device driver. This variable is initially empty (NULL) until Power Management Services loads and places the addresses for the CPU Idle and Busy routines into the variable area. The variable address must be the 16 16 Selector Offset. The Offset is 0-extended to 32 bits, and the value must be represented in 16 32 format. The APM CPUIdle function utilizes the AX register as the control selection flag for BUSY (AX=00001H) and IDLE (AX=0000H) requests.
APM CPUIdle contains the address of the CPU Idle and Busy processing routines from the Power Management Services device driver. This variable is initially empty (NULL) until Power Management Services loads and places the addresses for the CPU Idle and Busy routines into the variable area. The variable address must be the 16:16 Selector Offset. The Offset is 0-extended to 32 bits, and the value must be represented in 16:32 format. The APM CPUIdle function utilizes the AX register as the control selection flag for BUSY (AX=00001H) and IDLE (AX=0000H) requests.


These variables are maintained by the kernel for the benefit of physical device drivers. Notice that the address returned is the address of the indicated variable; the variable can contain a vector to some facility, or it can contain a structure.  
These variables are maintained by the kernel for the benefit of physical device drivers. Notice that the address returned is the address of the indicated variable; the variable can contain a vector to some facility, or it can contain a structure.


==Example Code==
==Example Code==
===C===
===C===
<PRE>
<PRE>
#include  "dhcalls.h"


USHORT APIENTRY DevHelp_GetDOSVar( USHORT VarNumber,
                                  USHORT VarMember,
                                  PPVOID KernelVar );
</PRE>
</PRE>
===Assembler===
<PRE>
</PRE>
==Related Functions==


[[Category:DevHlps]]
[[Category:DevHlps]]

Latest revision as of 05:41, 11 May 2025

DevHlp_GetDOSVar returns the address of a kernel variable.

Syntax

C
DevHelp_GetDOSVar ( USHORT VarNumber, USHORT VarMember, PPVOID KernelVar )
Assembler

Calling Sequence in Assembler

   MOV   AL, index              ; Index wanted.
   MOV   CX, VarMember          ; Only used by index 14 and 16.
   MOV   DL, DevHlp_GetDOSVar
   CALL   Device Help 

Parameters

C

VarNumber (USHORT)
The index into the list of read only variables
DHGETDOSV_SYSINFOSEG           1
DHGETDOSV_LOCINFOSEG           2
DHGETDOSV_VECTORSDF            4
DHGETDOSV_VECTORREBOOT         5
DHGETDOSV_VECTORMSATS          6
DHGETDOSV_YIELDFLAG            7
DHGETDOSV_TCYIELDFLAG          8
DHGETDOSV_DOSCODEPAGE         11
DHGETDOSV_INTERRUPTLEV        13
DHGETDOSV_DEVICECLASSTABLE    14
DHGETDOSV_DMQSSELECTOR        15
DHGETDOSV_APMINFO             16
DHGETDOSV_APM11INFO           17
DHGETDOSV_CPUMODE             18
DHGETDOSV_CPUMODE             19
DHGETDOSV_TOTALCPUS           20
VarMember (USHORT)
Applicable only to VarNumber 14 or 16.

For VarNumber = 14

VarMember=1      (Disk) has a maximum of 32 entries in the DCT.
VarMember=2      (Mouse) has a maximum of 3 entries in the DCT.

For VarNumber = 16

VarMember=0      Query presence of APM BIOS.
VarMember=1      Query presence of APM BIOS and establish connection.
KernelVar (PPVOID)
Pointer to the address of requested variable to be returned.

Assembler

MOV   AL, index                ; Index wanted.
MOV   CX, VarMember            ; Only used by index 14 and 16.

Return Code

C

Success Indicator
Clear if successful; returns address of the requested variable in KernelVar.
Possible errors
None.

Assembler

  • C Clear if successful. AX BX points to the index.
  • C Set if error.

Remarks

The following table contains the list of read-only variables

Index Variable Description
1 GlobalInfoSeg WORD. Valid at task time and interrupt time, but not at INIT time. See below.
2 LocalInfoSeg DWORD. Selector/segment address of local information segment for the current Local Descriptor Table (LDT). Valid only at task time. See below.
3 Reserved.
4 VectorSDF DWORD. Pointer to the stand-alone dump facility. Valid at task time and interrupt time.
5 VectorReboot DWORD. Pointer to restart the operating system. Valid at task time and interrupt time.
6 Reserved.
7 YieldFlag BYTE. Indicator for performing yields. Valid only at task time.
8 TCYieldFlag BYTE. Indicator for performing time-critical yields. Valid only at task time.
9 Reserved.
10 Reserved.
11 DOS session Code Page Tag pointer DWORD. Segment offset of the DOS session s current code page tag. Valid only at task time.
12 Reserved.
13 Interrupt Level
14 DeviceClass Table (See DH_RegisterDeviceClass)
15 DMQS Selector Point to XGA adapter. DMQS information offset is assumed to start at zero.
16 APMInfo APMStruc. Advanced Power Management BIOS Information
17 APMInfo APMStruc version 1.1. Advanced Power Management BIOS Information
18 SMP_Active DWORD Information on the operating system (OS) support for more than 1 CPU. Returns 1 if the OS has SMP support and 0 if the OS has uniprocessor support.
19 PSDInfo.psd_flags DWORD PSD status area where several pieces of useful information about the PSD can be obtained. After obtaining the variable address, the caller must test the bit for the desired aspect of the PSD. The PSD flags definition is as follows PSD_INITIALIZED (0x80000000) PSD has been initialized PSD_INSTALLED (0x40000000) PSD has been installed PSD_ADV_INT_MODE (0x20000000) PSD is in advaanced interrupt mode PSD_KERNEL_PIC (0x10000000) Let the kernel interrupt manager EOI
20 cProcessors DWORD Information for the Multi-Processor environment. Indicates the number of processors currently running in the MP environment. A value of 1 is returned in Uni-Processor environment.

GlobalInfoSeg (PSEL) : 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 hundreth of a second.
TimeZone (USHORT)
Minutes from UTC. If 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 the week
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
DOS and OS/2 sessions.
OS/2 session only.
LastProcess (USHORT)
Process ID of the current foreground process.
DynVarFlag (UCHAR)
Dynamic variation flag
Absolute.
Enabled.
MaxWait (UCHAR)
Maximum wait in seconds.
MinTimeSlice (USHORT)
Minimum time slice in milliseconds.
MaxTimeSlice (USHORT)
Maximum time slice in milliseconds.
BootDrive (USHORT)
Drive from which the system startup occurred
Drive A
Drive B
Drive n.
TraceFlags (UCHAR)
Thirty-two system trace major code flags. Each bit corresponds to a trace major code 00H-FFH. The most significant bit (left-most) of the first byte corresponds to major code 00H. Values are:
  • Trace disabled.
  • Trace enabled.
MaxTextSessions (UCHAR)
Maximum number of VIO windowable sessions.
MaxPMSessions (UCHAR)
Maximum number of Presentation Manager sessions.

LocalInfoSeg (PSEL)

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)
Implies YES
Implies NO.
TypeProcess (UCHAR)
Type of process
Full screen protect-mode session.
Requires real mode.
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 the data segment in bytes.
StackSize (USHORT)
Stack size in bytes.
HeapSize (USHORT)
Heap size in bytes.
HModule (UHMODULE)
Module handle.
DSSel (SEL)
Data segment selector.

APMInfo

Advanced Power Management BIOS Information, as defined below

APM CodeSeg (WORD)
APM 16-bit code segment (real-mode segment base address). From APM BIOS, INT 15h AX=5302H.
APMDataSeg (WORD)
APM16 - bitdatasegment( real - modesegmentbaseaddress ) .FromAPMBIOS ,INT15hAX = 5302H .
APM Offset (WORD)
Offset to entry point. From APM BIOS, INT 15h AX=5302H.
APM Flags (WORD)
APM capability flags. From APM BIOS, INT 15h AX=5300H.
APM Level (WORD)
APM revision level. From APM BIOS, INT 15h AX=5300H.
APM CPUIdle (6 bytes (DF))
APM Services Entry Point for CPU Idle and Busy Functions.

Note: APM CodeSeg and APM DataSeg are segment addresses, not selectors. It is the responsibility of the device driver to convert the segment address to a valid protect-mode selector.

The first time GetDOSVar is called at device-driver initialization with index (AL) = 10H and CX = 1, the system sets the values for APM CodeSeg, APM DataSeg, APM Offset, APM Flags, and APM Level. On return, AX BX points to the APMInfo structure.

If GetDOSVar is called at device-driver initialization with index (AL) = 10h and CX = 0, the system sets the values for APM Flags and APM Level. On return, AX BX points to the APMInfo structure. Other fields in the APMInfo structure might have been set by a previous call to GetDOSVar with index = 10h and CX = 1.

If GetDOSVar is called after device-driver initialization with index (AL) = 10H, no information in the APMInfo structure is modified. On return, AX BX points to the APMInfo structure.

APM CPUIdle contains the address of the CPU Idle and Busy processing routines from the Power Management Services device driver. This variable is initially empty (NULL) until Power Management Services loads and places the addresses for the CPU Idle and Busy routines into the variable area. The variable address must be the 16:16 Selector Offset. The Offset is 0-extended to 32 bits, and the value must be represented in 16:32 format. The APM CPUIdle function utilizes the AX register as the control selection flag for BUSY (AX=00001H) and IDLE (AX=0000H) requests.

These variables are maintained by the kernel for the benefit of physical device drivers. Notice that the address returned is the address of the indicated variable; the variable can contain a vector to some facility, or it can contain a structure.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_GetDOSVar( USHORT VarNumber,
                                   USHORT VarMember,
                                   PPVOID KernelVar );