Jump to content

DevHelp FreeGDTSelector

From EDM2
Revision as of 16:32, 4 December 2017 by Martini (talk | contribs) (Created page with "This service frees a selector allocated with the DevHlp_AllocGDTSelector. ==Syntax== ===C=== <PRE> USHORT APIENTRY DevHelp_FreeGDTSelector (SEL Selector) </PRE> ===Assem...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This service frees a selector allocated with the DevHlp_AllocGDTSelector.

Syntax

C

USHORT APIENTRY DevHelp_FreeGDTSelector (SEL Selector)

Assembler

MOV   AX,Selector                 ; GDT selector to free
                                  ; (allocated using AllocateGDTSelector).
MOV   DL,DevHlp_FreeGDTSelector

CALL  [Device_Help]

Parameters

C

Selector (SEL) - input
The GDT selector to free (must have been allocated using AllocateGDTSelector).

Assembler

MOV   AX,Selector                 ; GDT selector to free
                                  ; (allocated using AllocateGDTSelector).
MOV   DL,DevHlp_FreeGDTSelector

Return Code

C

Success Indicator
0
Possible errors
ERROR_ACCESS_DENIED (5)
ERROR_INVALID_PARAMETER (87)

Assembler


   'C' Clear if successful.

   'C' Set if error.
       EAX = Error code.
            Possible errors:
               ERROR_ACCESS_DENIED      (5)
               ERROR_INVALID_PARAMETER  (87)

Remarks

FreeGDTSelector can block, so it is not available at interrupt time. This function uses AX and DL. The selector passed to this function must have been allocated using AllocGDTSelector. This will be verified and an error returned if the selector was not properly allocated. The selectors (DS, ES, FS, and GS) will be changed to NULL if they are equal to the selector being freed.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_FreeGDTSelector (SEL Selector)

Related Functions