Jump to content

DevHelp_GetDescInfo

From EDM2
Revision as of 05:41, 11 May 2025 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This service obtains information about the contents of a descriptor.

Syntax

C
DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo)
Assembler
MOV   AX,Selector                  ; The selector referring to the descriptor
MOV   DL,DevHlp_GetDescInfo

CALL  [Device_Help]

Parameters

Selector (SEL)
The selector referring to the descriptor
SelInfo (PBYTE)
Pointer to the selector information to be returned. See _SELDESCINFO and _GATEDESCINFO for information returned.
Typedef struct _SELDESCINFO{
         UCHAR  Type;
         UCHAR  Granularity;
         LIN    BaseAddr
         ULONG  Limit
         } SELDESCINFO;
Typedef struct _GATEDESCINFO{
         UCHAR  Type;
         UCHAR  ParmCount;
         SEL    Selector;
         USHORT Reserved_1;
         ULONG  Offset;
         } GATEDESCINFO;


Return Code

C

Success Indicator
0
If the descriptor is a callgate, the number of parameters is returned in 'desc_attr'; the selector is returned in the 'desc_laddr' and the offset is returned to the 'desc_cb'.
Possible errors
Descriptor invalid
where:
 desc  = descriptor
 attr  = attributes     (read/write/current protection level)
 laddr = linear address (physical memory start)
 cb    = count of bytes (length)

Assembler

   'C' Clear if successful.
       AL  = Descriptor's access byte.
       AH  = If the descriptor is not a call gate,
             AH = The Big and Granularity fields of attribute byte.
             If the descriptor is a call gate,
             AH = The number of parameters.
       ECX = If the descriptor is not a call gate,
             ECX = 32-bit linear address stored in descriptor.
             If the descriptor is a call gate,
             CX = Selector.
       EDX = If the descriptor is not a call gate,
             EDX = The 32-bit, byte-granular size of descriptor (=0 if 4 GB).
             If the descriptor is a call gate,
             EDX = 32-bit offset (0:32 addressing).

   'C' Set if error.
       EAX = Error code.
            Possible errors:
               Descriptor invalid

Remarks

When called for a Local Descriptor Table (LDT) descriptor, GetDescInfo can block other threads from executing. Therefore, at interrupt time, this routine can be called only for Global Descriptor Table (GDT) descriptors. The routine can be called with either type of descriptor at initialization or task time.

Example Code

C
#include  "dhcalls.h"

USHORT APIENTRY DevHelp_GetDescInfo(SEL   Selector, PBYTE SelInfo );