In DPMI, interrupt 0x31 services 0x0000 and 0x0100 are capable of simultaneously allocating multiple protected-mode selectors in a single call. When that happens, both services return only the first allocated selector; the others are obtained by adding a fixed increment (repeatedly if necessary), whose value is obtainable from service 0x0003.
All the DPMI hosts I (somewhat superficially) tried this under — Borland’s, Windows 3.11, DOS/4GW and CWSDPMI — return the value 8 from this service, which means that descriptors are allocated in contiguous blocks (as the three least-significant bits do not index selectors, but determine the privilege level and choose between the GDT and the LDT). In principle though, nothing stops a DPMI host from using a larger multiple of 8.
The section of the DPMI specification describing the 0x0003 call (§8.4) does not explain at all why the DPMI host is allowed to do this or how it might be useful for the host to allocate descriptors non-contiguously. What purpose could this freedom serve? What does it afford implementations? Was there a DPMI host implementation that took advantage of it?
(I would prefer an official document or a statement from someone who worked on or was familiar with the development of the DPMI specification, but failing that, speculation may be enough.)
__AHINCR... – Stephen Kitt Aug 05 '21 at 13:03__AHINCRseems to imply the value in protected mode is always 8 anyway, so it doesn’t really provide any justification for this call’s existence. Sure, you need to invoke it if you want to implement your own__AHINCRportable to different DPMI hosts. But it might as well have not existed, with the DPMI contract specifying the increment as always 8. And yet it is there. What is it there for? – user3840170 Aug 05 '21 at 19:14__AHINCR(which was present in the Windows 2 kernel); I’m not sure what the exact chronology is, but perhaps he also knew how it enabled Windows 2 programs to run without change in protected mode on the skunkworks kernel that would become Windows 3. Since it had proven useful, something similar in DPMI might seem useful too, even with no immediate use. (__AHINCRand the spec for far pointers came before protected mode for Windows applications.) – Stephen Kitt Aug 05 '21 at 20:56DosAllocHugeandDosGetHugeShift(replaced with object allocation in 2.x). – Stephen Kitt Aug 06 '21 at 08:49__AHINCRorDosGetHugeShiftto be real-mode compatible, so not fixing this value to 8 is basically free. – Michael Karcher Aug 06 '21 at 09:28DosGetHugeShiftdid have varying results depending on the version of OS/2, so the API was useful even for protected-mode-only code. – Stephen Kitt Aug 06 '21 at 09:38