DevHlp_GetDosVar returns the address of a kernel variable.
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
Results in Assembler
C Clear if successful. AX BX points to the index.
C Set if error.
Calling Sequence in C
#include "dhcalls.h"
USHORT APIENTRY DevHelp_GetDOSVar
VarNumber (USHORT)
DHGETDOSV_SYSINFOSEG 1DHGETDOSV_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 20VarMember (USHORT)
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)
Results in C
Success Indicator Clear if successful; returns address of the requested variable in KernelVar. Possible errors None.
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)
Time (ULONG)
ProcessID (PID)
APMInfo
APM CodeSeg (WORD)
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.