Make your own free website on Tripod.com
Up ] Docs Home ]

Format of SHARE.EXE hooks (DOS 3.1-6.00)

Back ] Next ]

Offset Size Description

(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 #01687 at AX=5D06h)

Return:

CF - clear if successful
CF - set on error
AX = DOS error code (24h) (see #01680 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
Call: 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)

Call:

DS:SI DOS parameter list (see #01686 at AX=5D00h)
DS:DX (DPL's) name of file to close

Return:

CF - clear if successful
CF - set on error
AX = DOS error code (03h) (see #01680 at AH=59h/BX=0000h)

-24h

DWORD

pointer to FAR routine to lock region of file

Call:

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
AX = DOS error code (21h) (see #01680 at AH=59h)
Note:

Not called if file is marked as remote.

-20h

DWORD

pointer to FAR routine to unlock region of file

Call:

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
AX = DOS error code (21h) (see #01680 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:

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:

DS:SI DOS parameter list (see #01686 at AX=5D00h)
BX = (DPL) index of sharing record
CX = (DPL) index of SFT in SFT chain of sharing rec

Return:

CF - set on error or not loaded
AX = DOS error code (12h) (see #01680 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:

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:

 
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
Call: DS:SI system file table 
Return: AX =  number of handle in JFT which already uses SFT
Note:

Called during open/create of a file.
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:

 
ES:DI  system file table entry for file (see #01641)
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.
NOP if opened with no-inherit or via FCB.


Note:

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:

#01637,#01638