DevHelp AllocGDTSelector

This service allocates a set of Global Descriptor Table (GDT) selectors for a physical device driver to use. This allocation is performed at device driver INIT (initialization) time.

C
DevHelp_AllocGDTSelector (PSEL  Selectors, USHORT Count)

Assembler
 MOV  ES,address_high         ; 16:16 address of GDT selector array MOV  DI,address_low          ; MOV  CX,number               ; Number of selectors requested MOV  DL,DevHlp_AllocGDTSelector

CALL [Device_Help] 

C

 * Selectors (PSEL): - input - 16:16 address of GDT selector array
 * Count (USHORT):  - input - Number of selectors requested

Assembler
 MOV  ES,address_high         ; 16:16 address of GDT selector array MOV  DI,address_low          ; MOV  CX,number               ; Number of selectors requested MOV  DL,DevHlp_AllocGDTSelector

CALL [Device_Help] 

C

 * Success Indicator: 0


 * Possible errors:
 * ERROR_INVALID_ADDRESS         (487)
 * ERROR_ZERO_SELECTORS_REQUESTED (488)
 * ERROR_NOT_ENOUGH_SELECTORS_AVA (489)

Assembler
 'C' Clear if successful.

'C' Set if error. AX = Error code. Possible errors: ERROR_INVALID_ADDRESS                (487) ERROR_ZERO_SELECTORS_REQUESTED       (488) ERROR_NOT_ENOUGH_SELECTORS_AV        (489) 

Remarks
AllocGDTSelector allocates a set of GDT selectors for a physical device driver to use for task-time and interrupt-time operations. The address passed in ES:DI gives the location of an array of words to be filled in with the GDT selectors allocated. The value of CX specifies the number of selectors to be allocated. Note that the selector values returned might not be contiguous values. The interrupt handler of a physical device driver must be able to address data buffers, regardless of the context of the current process. (The current LDT does not necessarily address the data space that contains the data buffer that the interrupt handler needs to access.) PhysToGDTSel establishes the addressability of a GDT selector, and the GDT selector's addressability remains valid and unchanged until another call to PhysToGDTSel is made for the same selector.

C

 * 1) include "dhcalls.h"

USHORT APIENTRY DevHelp_AllocGDTSelector (PSEL  Selectors, USHORT Count) 