Int 21 Fn 52 U - Dos 2+ Internal - "sysvars" - Get List Of Lists (Cont.)

the next stack to be allocated (initially same as value in
0Eh and works its way down in steps of 8 to the value in
0Ch as hardware interrupts pre-empt each other)

Note: the STACKS code segment data may, if present, be located as follows:
DOS 3.2: The code segment data is at a paragraph boundary fairly early
in the IBMBIO segment (seen at 0070:0190h)
DOS 3.3: The code segment is at a paragraph boundary in the DOS data
segment, which may be determined by inspecting the segment
pointers of the vectors for those of interrupts 02h, 08h-0Eh,
70h, 72-77h which have not been redirected by device drivers
or TSRs.
DOS 4.0+ Identified by sub-segment control block type "S" within the DOS
data segment.

See Also: #1322,INT B4"STACKMAN"

Format of array elements in STACKS data segment:
Offset Size Description (Table 1321)
00h BYTE status: 00h=free, 01h=in use, 03h=corrupted by overflow of
higher stack.
01h BYTE not used
02h WORD previous SP
04h WORD previous SS
06h WORD ptr to word at top of stack (new value for SP). The word at the
top of the stack is preset to point back to this control
block.

Format of SHARE.EXE hooks (DOS 3.1-6.00):
Offset Size Description (Table 1322)
(offsets from first system file table--pointed at by ListOfLists+04h)
-3Ch DWORD pointer to FAR routine for ???

Note: not called by MS-DOS 3.3, set to 0000h:0000h by
SHARE 3.3+
-38h DWORD pointer to FAR routine called on opening file
on call, internal DOS location points at filename
(see #1373 at AX=5D06h)

Return: CF clear if successful
CF set on error
AX = DOS error code (24h)
(see #1366 at AH=59h/BX=0000h)

Note: SHARE directly accesses DOS-internal data to get name of
file just opened
-34h DWORD pointer to FAR routine called on closing file
ES:DI -> system file table

Note: does something to every Record Lock Record for file
-30h DWORD pointer to FAR routine to close all files for given computer
(called by AX=5D03h)
-2Ch DWORD pointer to FAR routine to close all files for given process
(called by AX=5D04h)
-28h DWORD pointer to FAR routine to close file by name
(called by AX=5D02h)
DS:SI -> DOS parameter list (see #1372 at AX=5D00h)
DPL's DS:DX -> name of file to close

Return: CF clear if successful
CF set on error
AX = DOS error code (03h)
(see #1366 at AH=59h/BX=0000h)
-24h DWORD pointer to FAR routine to lock region of file
call with BX = file handle
---DOS 3.x---
CX:DX = starting offset
SI:AX = size
---DOS 4.0+ ---
DS:DX -> lock range
DWORD start offset
DWORD size in bytes

Return: CF set on error
AL = DOS error code (21h) (see #1366 at AH=59h)

Note: not called if file is marked as remote
-20h DWORD pointer to FAR routine to unlock region of file
call with BX = file handle
---DOS 3.x---
CX:DX = starting offset
SI:AX = size
---DOS 4.0+ ---
DS:DX -> lock range
DWORD start offset
DWORD size in bytes

Return: CF set on error
AL = DOS error code (21h) (see #1366 at AH=59h)

Note: not called if file is marked as remote
-1Ch DWORD pointer to FAR routine to check if file region is locked
call with ES:DI -> system file table entry for file
CX = length of region from current position in file

Return: CF set if any portion of region locked
AX = 0021h
-18h DWORD pointer to FAR routine to get open file list entry
(called by AX=5D05h)
call with DS:SI -> DOS parameter list (see #1372 at AX=5D00h)
DPL's BX = index of sharing record
DPL's CX = index of SFT in SFT chain of sharing rec

Return: CF set on error or not loaded
AX = DOS error code (12h) (see #1366 at AH=59h)
CF clear if successful
ES:DI -> filename
CX = number of locks owned by specified SFT
BX = network machine number
DX destroyed
-14h DWORD pointer to FAR routine for updating FCB from SFT???
call with DS:SI -> unopened FCB
ES:DI -> system file table entry

Return: BL = C0h???

Note: copies following fields from SFT to FCB:
starting cluster of file 0Bh 1Ah
sharing record offset 33h 1Ch
file attribute 04h 1Eh
-10h DWORD pointer to FAR routine to get first cluster of FCB file ???
call with ES:DI -> system file table entry
DS:SI -> FCB

Return: CF set if SFT closed or sharing record offsets
mismatched
CF clear if successful
BX = starting cluster number from FCB
-0Ch DWORD pointer to FAR routine to close file if duplicate for process
DS:SI -> system file table

Return: AX = number of handle in JFT which already uses SFT

Note: called during open/create of a file

Note: if SFT was opened with inheritance enabled and sharing
mode 111, does something to all other SFTs owned by
same process which have the same file open mode and
sharing record
-08h DWORD pointer to FAR routine for closing file

Note: closes various handles referring to file most-recently
opened
-04h DWORD pointer to FAR routine to update directory info in related SFT
entries
call with ES:DI -> system file table entry for file (see #1327)
AX = subfunction (apply to each related SFT)
00h: update time stamp (offset 0Dh) and date
stamp (offset 0Fh)
01h: update file size (offset 11h) and starting
cluster (offset 0Bh). Sets last-accessed
cluster fields to start of file if file
never accessed
02h: as function 01h, but last-accessed fields
always changed
03h: do both functions 00h and 02h

Note: follows ptr at offset 2Bh in system file table entries

Note: NOP if opened with no-inherit or via FCB

Notes: most of the above hooks (except -04h, -14h, -18h, and -3Ch) assume
either that SS=DOS DS or SS=DS=DOS DS and directly access
DOS-internal data
sharing hooks are not supported by DR DOS 5-6; they appear to be
supported by Novell DOS 7, with a segment of 0000h indicating the
DOS data segment

See Also: #1323,#1324

Format of sharing record:
Offset Size Description (Table 1323)
00h BYTE flag
00h free block
01h allocated block
FFh end marker
01h WORD size of block
03h BYTE checksum of pathname (including NUL)
if sum of ASCII values is N, checksum is (N/256 + N%256)
04h WORD offset in SHARE's DS of first Record Lock Record (see #1324)
06h DWORD pointer to start of system file table chain for file
0Ah WORD unique sequence number
0Ch var ASCIZ full pathname

Note: not supported by DR DOS SHARE 1.1 and 2.0; will reportedly be
supported by Novell DOS 7

See Also: #1322,#1324

Format of SHARE.EXE Record Lock Record:
Offset Size Description (Table 1324)
00h WORD offset in SHARE's DS of next lock table in list or 0000h
02h DWORD offset in file of start of locked region
06h DWORD offset in file of end of locked region
0Ah DWORD pointer to System File Table entry for this file
0Eh WORD PSP segment of lock's owner
---DOS 5+ ---
10h WORD lock type: (00h lock all, 01h lock writes only)

See Also: #1322,#1323,#1325,#1328

Format of DOS 2.x system file tables:
Offset Size Description (Table 1325)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 28h bytes per file
Offset Size Description
00h BYTE number of file handles referring to this file
01h BYTE file open mode (see #1090 at AH=3Dh)
02h BYTE file attribute
03h BYTE drive (0 = character device, 1 = A, 2 = B, etc)
04h 11 BYTEs filename in FCB format (no path,no period,blank-padded)
0Fh WORD ???
11h WORD ???
13h DWORD file size???
17h WORD file date in packed format (see #1352 at AX=5700h)
19h WORD file time in packed format (see #1351 at AX=5700h)
1Bh BYTE device attribute (see #1110 at AX=4400h)
---character device---
1Ch DWORD pointer to device driver
---block device---
1Ch WORD starting cluster of file
1Eh WORD relative cluster in file of last cluster accessed
------
20h WORD absolute cluster number of current cluster
22h WORD ???
24h DWORD current file position???

See Also: #1326,#1327,#1328

Format of DOS 3.0 system file tables and FCB tables:
Offset Size Description (Table 1326)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 38h bytes per file
Offset Size Description
00h-1Eh as for DOS 3.1+ (see #1327)
1Fh WORD byte offset of directory entry within sector
21h 11 BYTEs filename in FCB format (no path/period, blank-padded)
2Ch DWORD (SHARE.EXE) pointer to previous SFT sharing same file
30h WORD (SHARE.EXE) network machine number which opened file
(Windows Enhanced mode DOSMGR uses the virtual machine
ID as the machine number; see INT 2F/AX=1683h)
32h WORD PSP segment of file's owner (first three entries for
AUX/CON/PRN contain segment of IO.SYS startup code)
34h WORD (SHARE.EXE) offset in SHARE code seg of share record
36h WORD ??? apparently always 0000h

See Also: #1325,#1327,#1328

Format of DOS 3.1-3.3x, DR DOS 5.0-6.0 system file tables and FCB tables:
Offset Size Description (Table 1327)
00h DWORD pointer to next file table (offset FFFFh if last)
04h WORD number of files in this table
06h 35h bytes per file
Offset Size Description
00h WORD number of file handles referring to this file
02h WORD file open mode (see AX=6C00h, #1090 at AH=3Dh)
bit 15 set if this file opened via FCB
04h BYTE file attribute (see #1107 at AX=4301h)
05h WORD device info word (see #1110 at AX=4400h)
bit 15 set if remote file
bit 14 set means do not set file date/time on closing
bit 12 set means don't inherit on EXEC
bits 5-0 drive number for disk files
07h DWORD pointer to device driver header if character device
else pointer to DOS Drive Parameter Block
(see #1083 at AH=32h)
0Bh WORD starting cluster of file
0Dh WORD file time in packed format (see #1351 at AX=5700h)
not used for character devices in DR DOS
0Fh WORD file date in packed format (see #1352 at AX=5700h)
not used for character devices in DR DOS
11h DWORD file size
---system file table---
15h DWORD current offset in file (may be larger than size of
file; INT 21/AH=42h does not check new position)
---FCB table---
15h WORD counter for last I/O to FCB

.NG limit reached, continued in next section...