mov ax, 4404h ; IOCTL command
mov bl, Drive ; drive number (one-based)
mov cx, size DataPacket ; size of data packet
mov dx, seg DataPacket ; address of data packet
mov ds, dx
mov dx, offset DataPacket
int 21h
jc error
cmp DataPacket.dspResult, ; 'OK' ; test for success
jne failure ; call failed
Reads raw data from a compressed volume file (CVF) into a buffer.
Value | Meaning |
---|---|
0001h | ERROR_INVALID_FUNCTION |
0005h | ERROR_ACCESS_DENIED |
0006h | ERROR_INVALID_HANDLE |
000Dh | ERROR_INVALID_DATA |
DSHDR, DSRAWIO, RawClusterInfo
mov ax, 4404h ; IOCTL command
mov bl, Drive ; drive number (one-based)
mov cx, size DataPacket ; size of data packet
mov dx, seg DataPacket ; address of data packet
mov ds, dx
mov dx, offset DataPacket
int 21h
jc error
cmp DataPacket.dspResult, ; 'OK' ; test for success
jne failure ; call failed
Writes raw data from a buffer into a compressed volume file (CVF).
Value | Meaning |
---|---|
0001h | ERROR_INVALID_FUNCTION |
0005h | ERROR_ACCESS_DENIED |
0006h | ERROR_INVALID_HANDLE |
000Dh | ERROR_INVALID_DATA |
DSHDR, DSRAWIO, RawClusterInfo
DSHDR STRUC
dspStamp dw ? ; Identifying stamp ('DM')
dspCommand db ? ; Command ('R' or 'W')
dspResult dw ? ; see below
DSHDR ENDS
Defines the portion of the IOCTL header that is common to all DriveSpace Receive Control Data IOCTLs. Notice that WORD alphanumeric constants are shown as they would be defined for MASM. Thus, 'DM' is equivalent to 444Dh, and 'OK' is equivalent to 4B4Fh. When dumped as two consecutive bytes or as a text string, these values would appear as "MD" and "KO" respectively. The dspCommand field is typically an ASCII character. For the raw read IOCTL, dspCommand is set to 'r'; for raw writes, it is set to 'w'.
Value | Meaning |
---|---|
DSRROK ('OK') | Success |
DSRRWRITE (0001h) | Intervening write occurred |
DSRRLOCK (0002h) | Buffer lock failed |
DSRRIO (0003h) | I/O error |
DSRRBADCLUS (0004h) | Invalid MDFAT index |
DSRRUNALLOC (0005h) | Attempt to read unallocated cluster |
DSRRBADSECTOR (0006h) | Bad starting sector |
DSRRBADSIZE (0007h) | Bad cluster size |
DSRRNOSIZE (0008h) | Uncompressed size unknown |
DSRRNOTFREE (0009h) | Some target sectors were not free |
DSRRXBOUND (000Ah) | Allocation crosses BitFAT boundary |
DSRRNULLPTR (000Bh) | NULL pointer passed to write |
DSRRSECCOUNT (000Ch) | Sector count mismatch |
DSRRPKTSIZE (000Dh) | Packet size is too small |
DSRRDATAWRITE (000Eh) | Data was written |
DSRRBADFRAG (000Fh) | Bad fragment table |
DSRAWIO STRUC
dsr_hdr db SIZE DSHDR dup(?) ; Packet header
dsr_flags db ? ; Flags
dsr_cclus dw ? ; Count of clusters to operate on
dsr_reserved0 dd 0 ; Reserved
dsr_reserved1 dd 0 ; Reserved
DSRAWIO ENDS
Contains information about a raw I/O IOCTL operation. Immediately precedes an array of RawClusterInfo structures.
RawClusterInfo
RawClusterInfo STRUC
rci_pdata dd ? ; Pointer to raw cluster data buffer
rci_isecstart dd ? ; Starting sector in sector heap
rci_ifat dw ? ; FAT index
rci_csec db ? ; Count of raw sectors
rci_flags db ? ; Flags
rci_reserved dd 0 ; Reserved
RawClusterInfo ENDS
Contains information used by the raw cluster I/O IOCTLs. All pointers are flat model pointers. The same structure is used for both reads and writes, but the fields are treated somewhat differently.
The rci_flags field can a combination of these values:
Value | Meaning |
---|---|
RCFMARK (01h) | Marked cluster |
RCFFRAG (02h) | Fragmented cluster |
RCFUNCOMP (04h) | Uncompressed cluster |
RCFALLOC (08h) | Allocated cluster |
FRAGHDR STRUC
fhcFrag dd ? ; Count of fragments
fhaFrag dd ? DUP (?) ; Variable size array of fragment entries
FRAGHDR ENDS
Contains information about fragmented clusters. The first sector of fragmented sections contains a FRAGHDR structure.
The count of sectors stored for each fragment header entry is actually the count of sectors in the fragment minus one. Also, the first entry in fhaFrag describes the first fragment in the cluster, just as the MDFAT entry does.
You can use the following values to retrieve information from a segment entry in the fhaFrag array:
Value | Meaning |
---|---|
FG_SECTORWIDTH (23) | Width of sector number |
FG_SECTORSHIFT (0) | Shift sector number to low end |
FG_SECTORMASK (((1 SHL FG_SECTORWIDTH) - 1) SHL FG_SECTORSHIFT) | Mask for sector number |
FG_RESERVEDWIDTH (3) | Width of reserved bits |
FG_RESERVEDSHIFT (FG_SECTORSHIFT + FG_SECTORWIDTH) | Shift reserved bits to low end |
FG_RESERVEDMASK (((1 SHL FG_RESERVEDWIDTH) - 1) SHL FG_RESERVEDSHIFT) | Mask for reserved bits |
FG_CSECWIDTH (6) | Width of sector count |
FG_CSECSHIFT (FG_RESERVEDSHIFT + FG_RESERVEDWIDTH) | Shift sector count to low end |
FG_CSECMASK (((1 SHL FG_CSECWIDTH) - 1) SHL FG_CSECSHIFT) | Mask for sector count |