www.delorie.com/djgpp/doc/dpmi/descriptor-rules.html   search  
Descriptor Usage Rules

The following table shows the DPMI client's restrictions on usage of previously allocated descriptors as input parameters to DPMI functions. The columns represent the ways the DPMI host allocates descriptors for its clients. (The first two columns represent LDT descriptor management functions which allocate descriptors, the third column represents DOS memory functions, and the last column represents "other" descriptors, i.e., unallocated descriptors or descriptors used by the DPMI host for internal purposes.) Each row represents a set of functions where a client passes those previously allocated descriptor(s) to the host as input parameters. A `N' indicates that an "Invalid Selector" error will be generated if the given descriptor is used in the specified function.

Note that a `Y' for a given entry does not indicate that the function will succeed, only that it will not generate an "Invalid Selector" error. Similarly, an `N' does not necessarily indicate a descriptor is invalid for referencing memory, only that it cannot be used with that particular function. This chart does not address the usage of descriptors in pointers.

For example, descriptors allocated by the Allocate LDT Descriptor function may be used in any of the interrogation and modification functions of LDT Descriptor Management, as well as the functions which set exception handlers and interrupt vectors. They may not be passed to Allocate Specific LDT Descriptor or the DOS Memory Block Functions.

  Descriptor Allocators
Functions referring to allocated descriptors Allocate LDT Descriptor, Allocate Specfic LDT Descriptor, Create Alias descriptr, Initial CS, DS, SS Segment to Descriptor, PSP, Environment Pointer, Callback DS, Locked Stack SS Allocate/Resize DOS Memory Block GDT-based Descriptor, System Descriptor, Unallocated Descriptor
Interrogation Functions: Get Segment Base Address, Get Descriptor, Get Multiple Descriptor, Create Segment Alias Y Y Y N
Modification Functions: Set Segment Base Address, Set Segment Limit, Set Descriptor Access Rights, Set Descriptor, Set Multiple Descriptors, Free LDT Descriptor Y N N N
Allocate Specific LDT Descriptor N N N Y(1)
Free/Resize DOS Memory Block N N Y N
Set Exception Handler/Interrupt Vector Y Y(3) Y Y(2)

Notes:

  1. Unallocated descriptors within the range of the LDT only.
  2. GDT-Based segment descriptors only.
  3. Although this call will succeed, a fault will result if the exception or interrupt occurs, since the segment can never be made executable.

      webmaster     delorie software   privacy  
      Copyright © 1996     Updated Apr 1996