📄 ifsmgr.inc
字号:
;
; The entry/exit conditions for preambles are:
; Entry EBX - Handle of VM
; ECX - Function (value of users AH)
; EBP - Client register structure
; ESI - 0
; Exit if request is to be hooked
; Carry Clear
; EBX - Handle of VM
; EBP - Client register structure
; ESI - 0 or FSD ID
; Exit if request is not to be hooked
; jump to the old preamble with the entry conditions preserved
; Only EBX and EBP need to be preserved, ESI must be set properly
;
; Entry TOS - High word = Interrupt level (must be 21h)
; Low word = Function number (value to look for in AH)
; TOS + 4 - Entry point of preamble
; Exit EAX - 0 if error
; Previous preamble routine (preambles must chain) if success
;** IFSMgr_SetPathHook - Set a hook to identify custom path prefixs
;
; FSDs that look for special path prefixs to locate remote resources
; can use IFSMgr_SetPathHook to give IFSMgr the entrypoint of a routine
; that can identify a special path prefix.
;
; The entry/exit conditions for the path checker are:
; Entry ESI - ASCIIZ path (NOTE: ESI must be preserved)
; Exit Path recognized - return with:
; 'C' clear - Path recognized
; EAX - length of portion of path that is specific to FSD
; EDX - Provider ID of FSD claiming path
; 'Z' - Set if device check should be skipped in preamble
; Clear if device check should be performed in preamble
; Path not recognized - pass request it on next path checker.
; Uses EAX, EBC, ECX, EDX, EDI
;
; Entry TOS - Entry point of path checker
; Exit EAX - 0 if error
; Previous path checker (path checkers must chain) if success
;** IFSMgr_ChangeDir - Change Directory
;
; FSDs that need to cause a change the current path on a given drive
;
; Entry TOS - Pointer to IOReq
; ir_data - pointer to ASCIIZ path string
; ir_drv - set to default drive (needed if path string
; does not contain drive letter)
; TOS+4 - VM to change directory for. 0 for current VM.
; Exit ir_error set appropriately
;** IFSMgr_CDROM_Attach - Special service for CDFS to force a mount on a
; drive that is passed in. The VRP for the volume that is mounted on
; the drive is returned to the caller of the service. The caller can
; use this VRP to pass i/o requests down to the IO subsystem. The CDFS
; needs to handle direct ioctls from DOS applications on driveletters
; for which it has no volume parameters at all. If a volume is already
; mounted on the drive, the IFS manager returns the VRP for that volume
; without forcing a mount. Each call to attach increments the drive
; useage count.
;
; NOTE: This service works only under Chicago. It just returns success
; under Snowball.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; The entry/exit conditions for this service are:
; Entry TOS - Driveletter (0-based)
; TOS + 4 - Pointer to dword to contain the VRP pointer
;
; Exit EAX - 0 if success. VRP pointer updated in variable.
; - Errorcode if failure.
;
; Uses C registers (eax, ecx, edx, flags)
;** IFSMgr_CDROM_Detach - Special service provided to the CDFS to indicate
; that it does not need to use the drive anymore. The drive useage count
; is decremented for every detach operation. If the drive useage count
; goes down to zero, the volume resource associated with the drive is
; automatically freed.
;
; NOTE: This service works only under Chicago.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; The entry/exit conditions for this service are:
; Entry TOS - Driveletter (0-based)
; TOS + 4 - VRP pointer of drive returned on IFSMgr_CDROM_Attach
;
; Exit None
;
; Uses C registers (eax, ecx, edx, flags)
;** IFSMgr_Win32DupHandle - This service is provided for the Win32 VxD
; to do an inter-process dup. This service works for both extended
; handles and normal DOS handles.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int Win32DupHandle(pid_t srcpid, pid_t duppid, ulong *phandle,
; uchar flag,ulong *fReturnFlags )
;
; Entry TOS = process id of process issuing dup (must be current process)
; TOS+4 = process id of process handle is to be dup'ed into
; TOS+8 = ptr handle to be dup'ed (returns dup'ed handle)
; TOS+12 = flag to indicate kind of dup - normal or for memory-mapping
; TOS+16 = global Netware handle if running on real-mode NETX
; TOS+20 = ptr to variable to contain return flags (defined below)
;
; Exit EAX = 0 if success
; TOS+8 contains new handle
; TOS+16 contains return flags
; = errorcode if failure
;
; Uses C registers (eax, ecx, edx, flags)
; Return flag values for Win32DupHandle
WDUP_RMM_DRIVE equ 0001h ; file handle mapped to RMM drive
WDUP_NETWARE_HANDLE equ 0002h ; file handle belongs to Netware
;** IFSMgr_Get_Drive_Info - this service returns information about a
; given volume.
;
; Entry
; al = volume (A=0)
;
; Exit
; (carry clear)
; eax = flags
; FDRV_INT13 ; volume lives on an int13 drive
; FDRV_FASTDISK ; volume is on a drive for which a
; ; fastdisk driver is present
; FDRV_COMP ; compression driver detected on this volume
; FDRV_RMM ; volume can be accessed through RMM
; FDRV_USE_RMM ; volume must be accessed through RMM
; FDRV_DOS ; DBP exists for this volume... DOS
; ; knows about it
; FDRV_COMPHOST ; host volume for compression driver (dblspace)
; FDRV_N
;** Query_PhysLock - service to determined if current process has the
; int13 physical lock.
;
; Entry
; eax = int 13 unit number (0-7) or (80h-87h)
;
; Exit
; NC if the current process has the int 13 lock
; CY if the current process does not have the int 13 lock
;
; Uses ALL except ebx, edi
;
;** _VolFlush - volume based flush/invalidate
;
; Entry TOS = logical unit number to flush/invalidate
; TOS+4 = flags
; 0 ; just flush the cache
; VOL_DISCARD_CACHE ; flush and invalidate the cache
; VOL_REMOUNT ; flush and invalidate the cache
; ; & remount the vol (recompute
; ; the FAT "geometry" variables)
;
; Exit (eax) = non-zero if error on flush/invalidate
;
; Uses C registers (eax, ecx, edx, flags)
;
;** NotifyVolumeArrival - called when a new volume appears in the system.
; Updates the CDSs in all the VMs and updates IFSMGR data structs to
; indicate this is a new supported volume
;
; Entry TOS = logical unit number for new volume
;
; Exit None
;
; Uses eax, ecx, edx, flags
;
;** NotifyVolumeRemoval - called when a new volume is removed.
; Updates the CDSs in all the VMs and updates IFSMGR data structs to
; indicate this is no longer a supported volume
;
; Entry TOS = logical unit number for new volume
;
; Exit None
;
; Uses eax, ecx, edx, flags
;
;** QueryVolumeRemoval - called when a new volume is to be removed.
; Checks if there are any open files on he volume. If yes closes them
; after querying the user. Then unmounts the FSD.
;
; Entry TOS = logical unit number for new volume
;
; Exit (eax) = 0 if successfull non-zero otherwise
;
; Uses eax, ecx, edx, flags
;
;** IFSMgr_FSDUnmountCFSD - called by a CFSD to unmount its resource. The
; CFSD passes in the volume handle previously passed to it on its mount
; and is called back to do the actual unmount operation.
;
; Entry TOS = IFS manager volume handle
;
; Exit (eax) = 0 if successfull non-zero otherwise
;
; Uses C registers (eax, ecx, edx, flags)
;** IFSMgr_GetConversionTablePtrs - called to obtain a ptr to a table
; of conversion tables ptrs within the IFSmgr. The ptrs reference
; AVL-tree-based run-length encoded structs for converting
; UNICODE->ANSI
; UNICODE->OEM
; ANSI->UNICODE
; OEM->UNICODE
; UNICODE->UPPER (delta table)
; UNICODE->UPPER (conversion table)
; These tables are referenced by the routines MapUniToBCS and
; MapBCSToUni UniToUpper implemented in unicode.asm.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; Entry nothing
;
; Exit ptr to following structure
; dword count of ptrs in following table
; dword flat-ptr to UniToWinAnsiTable (ring-0 data)
; dword flat-ptr to UniToOemTable (ring-0 data)
; dword flat-ptr WinAnsiToUniTable (ring-0 data)
; dword flat-ptr to OemToUniTable (ring-0 data)
; dword flat-ptr to UniToUpperDelta (ring-0 data)
; dword flat-ptr to UniToUpperTable (ring-0 data)
; Uses eax
;
;;* See Ifs.h for function prototypes for:
;
; IFSMgr_NetToDosTime
; IFSMgr_DosToNetTime
; IFSMgr_DosToWin32Time
; IFSMgr_Win32ToDosTime
; IFSMgr_NetToWin32Time
; IFSMgr_Win32ToNetTime
; IFSMgr_MetaMatch
; IFSMgr_TransMatch
; UniToBCS
; UniToBCSPath
; BCSToUni
; UniToUpper
;** IFSMgr_CheckAccessConflict - check if desired access can be granted
;
; This function validates the desired access mode and
; determines if the desired access to the file can be
; granted.
;
; int IFSMgr_CheckAccessConflict (fSoftCompatDisable, pf, pfn, cookie)
;
; PARAMETERS
; softCompatDisable
; - IN boolean which defeats "soft" share
; semantics if they are enabled. The "soft"
; share semantics are in effect IFF the
; fSoftCompat flag is TRUE.
; Non-zero specifies "hard" share rules.
; pf - IN pointer to file mode descriptor
; specifying desired access
; pfn - IN pointer to enumeration function
; cookie - IN cookie for enumeration function
; RETURN
; 0 - desired mode is compatable
; (other) - error code
;** IFSMgr_LockFile - lock a range of bytes in a file
;
; This function is called to lock a range of bytes in
; a file. Locks may not overlap; a lock may not be of
; of zero length.
;
; int IFSMgr_LockFile (pp, offmin, cb, owner, fileinst)
;
; PARAMETERS
; pp - IN pointer to file cookie
; offmin - IN starting file offset of the lock
; cb - IN length of the locked region
; owner - IN owner of the lock
; fileinst - IN open instance to which lock belongs
; pp - OUT file cookie filled in
; RETURN
; 0 - Success
; (other) - error code
;** IFSMgr_UnlockFile - unlock a range of bytes in a file
;
; This function is called to unlock a range of bytes in
; a file. Locks may not overlap; a lock may not be of
; of zero length; a lock may not extend beyond the
; maximum file size; an unlock must match a lock exactly.
;
; int IFSMgr_UnlockFile (pp, offmin, cb, owner, fileinst)
;
; PARAMETERS
; pp - IN pointer to file cookie
; offmin - IN starting file offset of the lock
; cb - IN length of the locked region
; owner - IN owner of the lock
; fileinst - IN open file instance
; pp - OUT file cookie possibly set to NULL
; RETURN
; 0 - Success
; (other) - error code
;** IFSMgr_RemoveLocks - remove all locks for a given owner
;
; This function is called to remove all locks from a file
; for a specified owner.
;
; If the special owner id 0 is passed in, then all locks on
; the file are removed.
;
; If the file instance is NULL, then locks are removed for
; all instances. So, to remove all locks, pass in owner 0
; and file instance NULL.
;
; void IFSMgr_RemoveLocks (pp, owner, fileinst)
;
; PARAMETERS
; pp - IN pointer to file cookie
; owner - IN owner of the lock
; fileinst - IN open file instance
; pp - OUT file cookie possibly set to NULL
; RETURN
; NONE
;** IFSMgr_CheckLocks - check if an i/o operation violates a lock
;
; This function is called to check if i/o over a
; specified range would violate any locks on the file.
; A range length of zero is interpreted to mean the
; file is going to be truncated at the given offset;
; any locks at or above the given offset will result in a
; lock violation.
;
; int IFSMgr_CheckLocks (p, offmin, cb, owner, fileinst)
;
; PARAMETERS
; p - file cookie
; offmin - starting file offset of the lock
; cb - length of the locked region
; owner - owner of the lock
; fileinst - open file instance
; RETURN
; 0 - Success
; (other) - error code
;** IFSMgr_CountLocks - count locks for a given file instance
;
; This function is called to count all locks on a file
; for a specified instance.
;
; int IFSMgr_CountLocks (p, fileinst)
;
; PARAMETERS
; p - IN file cookie
; fileinst - IN open file instance
; RETURN
; int - count of locks for instance
;** IFSMgr_ReassignLockInst - reassign file instances for existing lock list
;
; This function is called to replace existing 'file instance' fields
; in the lock list with a new 'file instance'. This is done upon exit
; from a level 4 exclusive lock when the IFS manager re-opens existing
; files. Typically, the FSD (at least VFAT) will create a new 'file
; instance' (i.e. SFT) upon opening a file. The IFS has saved the
; 'file instance' that was previously associated with the file and
; passes it to the FSD when the open is done. The FSD, after
; obtaining the new file instance value, calls this service to
; replace old file instances in the lock list with the new file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -