Install Resident Service Provider Callback

Protected mode resident service providers (protected mode
TSRs) can provide services to 16-bit DPMI programs, 32-bit
DPMI programs, or both. A resident service provider uses
this function to request notification from the host whenever
another DPMI program in the same virtual machine is loaded
or terminated.

Call With:

AX = 0C00H
ES:(E)DI= selector:offset of 40-byte buffer with the
following structure:

OffsetLengthContents
00H 8Descriptor for 16-bit data segment
08H 8Descriptor for 16-bit code segment
10H 2Offset of 16-bit callback procedure
12H 2Reserved
14H 8Descriptor for 32-bit data segment
1CH 8Descriptor for 32-bit code segment
24H 4Offset of 32-bit callback procedure

Returns:

if function successful
Carry flag= clear

if function unsuccessful
Carry flag= set
AX = error code
8021H invalid value (access rights/type bytes
invalid, or offset outside segment
limits)
8025H invalid linear address (descriptor
references a linear address range outside
that allowed for DPMI clients)
8015H callback unavailable (host unable to
allocate resources for resident handler
initialization callback)

Notes:

o A DPMI client that uses this function declares its intent
to provide resident protected mode services. The client
must subsequently terminate and stay resident using Int
31H Fn 0C01H. DPMI clients which intend to stay
resident only to provide services to real mode programs
should not use this function.
o The data structure provides room for a data descriptor, a
code descriptor, and an offset for both 16-bit and 32-bit
protected modes. The client can conveniently initialize
the descriptor fields to valid values by fetching copies
of its current code and data descriptors with Int 31H
Function 000BH.
o If only one mode is supported by the resident service
provider, then the code descriptor for the unsupported
mode should be initialized to zero.
o This function is called on the locked protected mode
stack.

o For further details on programming of resident service
providers, see page 41.