DevHelp GetDescInfo: Difference between revisions
Appearance
Created page with "This service obtains information about the contents of a descriptor. ==Syntax== ===C=== <PRE> DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo ); </PRE> ===Assembler=== <P..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
This service obtains information about the contents of a descriptor. | This service obtains information about the contents of a descriptor. | ||
==Syntax== | ==Syntax== | ||
;C | |||
DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo) | |||
DevHelp_GetDescInfo(SEL | ;Assembler | ||
MOV AX,Selector ; The selector referring to the descriptor | |||
MOV DL,DevHlp_GetDescInfo | |||
CALL [Device_Help] | |||
MOV AX,Selector ; The selector referring to the descriptor | |||
MOV DL,DevHlp_GetDescInfo | |||
==Parameters== | ==Parameters== | ||
;Selector (SEL): The selector referring to the descriptor | |||
; Selector (SEL): | ;SelInfo (PBYTE) : Pointer to the selector information to be returned. See _SELDESCINFO and _GATEDESCINFO for information returned. | ||
Typedef struct _SELDESCINFO{ | |||
; SelInfo (PBYTE) : Pointer to the selector information to be returned. | 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== | ==Return Code== | ||
===C=== | ===C=== | ||
;Success Indicator: | ;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'. | |||
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: | |||
; Possible errors: Descriptor invalid | |||
where: | |||
desc = descriptor | desc = descriptor | ||
attr = attributes (read/write/current protection level) | attr = attributes (read/write/current protection level) | ||
Line 56: | Line 42: | ||
===Assembler=== | ===Assembler=== | ||
<PRE> | <PRE> | ||
'C' Clear if successful. | 'C' Clear if successful. | ||
AL = Descriptor's access byte. | AL = Descriptor's access byte. | ||
Line 76: | Line 61: | ||
Possible errors: | Possible errors: | ||
Descriptor invalid | Descriptor invalid | ||
</PRE> | </PRE> | ||
==Remarks== | ==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. | 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== | ==Example Code== | ||
;C | |||
<PRE> | <PRE> | ||
#include "dhcalls.h" | #include "dhcalls.h" | ||
Line 89: | Line 73: | ||
USHORT APIENTRY DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo ); | USHORT APIENTRY DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo ); | ||
</PRE> | </PRE> | ||
[[Category:DevHlps]] | [[Category:DevHlps]] |
Revision as of 10:56, 5 April 2025
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 );