MRCI Fn 0001H: Compress Data
Compatibility: 6.0+
Expects: AX 0001H
CX caller type: 0000H=APPLICATION client (InDOS is clear)
0001H=SYSTEM client (InDOS is set)
DS:SI address of a pre-filled MRCRequestRec structure:
.pfbSrc=address of data to compress
.wSrcLen=size of uncompressed data, in bytes
.pfbDest=buffer to receive compressed data
.wDestLen=size of buffer at pfbDest
ES:BX address of a MRCInfoRec structure obtained via INT 2fH 4a12H
──────────────────────────────────────────────────────────────────
Returns: AX 0000H = success
else = MRCI API Error Code
DS:SI wDestLen field (offset 0eH) is size of compressed data
──────────────────────────────────────────────────────────────────
Info: This fn compresses data. The source and destination addresses
(and other important details) are identified in the MRCRequestRec
structure. The API entry address is obtained via INT 2fH 4a12H.
To use this call, you must:
1 Set up the request record.
2 Make certain that the InDOS Flag is clear (APPLICATION clients)
or set (SYSTEM clients) (see CX notes, below)
3 Start a Windows Critical Section (see INT 2aH 8001H). We are
told to use this exact sequence...
push ax
mov ax,8001H
int 2aH
pop ax
...since Windows may look for and patch this sequence of code.
4 Set up the CPU registers and call the MRCI entry address (it is
the pfpEntry field of the MRCInfoRec obtained via INT 2fH 4a12H
or INT 1aH B001H).
5 End the Windows Critical Section (see INT 2aH 8101H). We are
told to use this exact sequence:
push ax
mov ax,8101H
int 2aH
pop ax
6 Check the return code in AX and the value returned in the
wDestLen field of the MRCRequestRec.
CX identifies the type of caller you are. It is one of:
0=APPLICATION client: You may only call this fn when the InDOS
flag is clear (zero).
1=SYSTEM client: You may only call this fn when the InDOS flag is
set (non-zero)
This distinction is important for TSR writers. InDOS is always
clear when application program code is being executed. But it is
possible for a TSR to take control while InDOS is set and in that
case, it should call MRCI services with CX=0001H.
You may obtain the address of the InDOS flag via DOS fn 34H.
Notes: ■ Check AX for a returned error code. And check the wDestLen
field of the MRCRequestRec structure.
In order to decompress later, you must save the value returned
in wDestLen.
■ The MRCI server will compress the data only if it can save at
least one MRCRequestRec.wChunkLen unit. If compression fails,
remember to record this fact and save the source data and its
length in order to "decompress" it (i.e., copy it verbatim)
correctly later.
■ The result data begins with 'MD0' (4DH, 44H, 00H, 02H) -- a
value that's different from either of the 4-byte signatures
seen in DoubleSpace compressed clusters (see Sector Heap).
See Also: MRCI API
DoubleSpace Overview
DoubleSpace API
INT 2fH: Multiplex Interrupt
DOS Functions
-♦-