📄 ifsmgr.inc
字号:
; instance. The owner of the lock must be marked as 'inactive' before
; this substitution will occur. After the substitution is made, the
; 'inactive' mark is removed from the owner. This prevents erroneous
; substitution is cases where the old file instance may happen to match
; a new file instance that was previously substituted into the lock list.
;
; int IFSMgr_ReassignLockFileInst (plkList, oldFileInst, newFileInst)
;
; PARAMETERS
; plkList - IN pointer to lock list
; oldFileInst - IN previous open file instance
; newFileInst - IN new open file instance
; RETURN
; 0 - Success
;** IFSMgr_UnassignLockList - mark all owners in this list 'inactive'
;
; int IFSMgr_UnassignLockFileInst (plkList)
;
; PARAMETERS
; plkList - IN pointer to lock list
; RETURN
; 0 - Success
;** IFSMgr_MountChildVolume - mount a child volume
;
; A child volume is a volume that is physically related to
; some other volume, known as the parent. For example, some
; on-the-fly data compression schemes represent the compressed
; volume as a file on an uncompressed volume. In this example,
; the uncompressed volume is the parent, and the compressed
; volume is the child.
;
; int IFSMgr_MountChildVolume (pvrp, driveno)
;
; PARAMETERS
; pvrp - IN child volume VRP pointer
; driveno - IN child volume drive number (0 = A:, ...)
; RETURN
; 0 - Success
; (other) - error code
;** IFSMgr_UnmountChildVolume - unmount a child volume
;
; This service is provided to allow the unmounting of a child
; volume on a specified drive.
;
; We unmount the specified volume on the specified drive and
; destroy the resource. Why do we go to all this trouble?
; For removable child volumes which are mounted automatically,
; it is important to make the set of related volumes (i.e.,
; the parent and its children) behave as a unit so that the
; physical media volume tracks properly. Thus, under normal
; circumstances, the notification that a volume is going away
; causes all of its relations to disappear as well. This is
; exactly what we *don't* want to happen in the case where
; the user wishes to destroy one volume in a set. By killing
; the target here, before the volume removal notication is
; received, we insure that there will be no way for the
; volume removal to affect the other related volumes. Sounds
; complicated? You bet it is!
;
; int IFSMgr_UnmountChildVolume (pvrp, driveno)
;
; PARAMETERS
; pvrp - IN child volume VRP pointer
; driveno - IN child volume drive number (0 = A:, ...)
; RETURN
; 0 - Success
; (other) - error code
;** IFSMgr_SwapDrives - swap a parent and child drive
;
; This service is provided to allow the drive letter
; of a child volume and its parent to be swapped.
;
; int IFSMgr_SwapDrives (pvrp, drive1, drive2)
;
; PARAMETERS
; pvrp - IN VRP pointer
; drive1 - IN first drive number (0 = A:, ...)
; drive2 - IN second drive number (0 = A:, ...)
; RETURN
; 0 - Success
; (other) - error code
;** IFSMgr_PNPEvent - report PNP events
;
; int IFSMgr_PNPEvent( dword msg, dword res, dword flags )
;
; PARAMETERS
; msg - IN one of:
; DBT_DEVICEARRIVAL
; DBT_DEVICEQUERYREMOVE
; DBT_DEVICEQUERYREMOVEFAILED
; DBT_DEVICEREMOVEPENDING
; DBT_DEVICEREMOVECOMPLETE
; DBT_DEVICETYPESPECIFIC
; DBT_DEVICEDEVNODESCHANGED
;
; volid - IN Volume ID (A=0) r resource handle
; flags - IN
; one of PNPT_x to specify type:
; PNPT_VOLUME
; PNPT_NET
; 'or'd with 0 or more:
; (if PNPT_VOLUME)
; DBTF_MEDIA
; DBTF_NET
; (if PNPT_NET)
; DBTF_RESOURCE
; DBTF_XPORT
;
; RETURN
; one of PNPE_x
;** IFSMgr_RegisterCFSD - register a mountable filesystem provider
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; Entry TOS = Entrypoint for providers mount routine
; TOS + 4 = Version of IFSMGR provider was built for
; TOS + 8 = pointer to device name strings( in unicode) registered
;
; Exit Provider ID (-1 if error)
;
; Uses C Registers
;** IFSMgr_Win32MapExtendedHandleToSFT - map an extended handle to a SFT
;
; This service allocates a free SFT and maps an extended handle to this
; SFT. It returns the index to the SFT back to the caller. This api is
; for the purpose of redirection for Win32 apps when they spawn DOS apps.
; The SFT and the extended handle track one another from this point on.
; This service MUST be called in the context of the DOS VM the SFT is
; going to be in.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_Win32MapExtendedHandleToSFT( ulong ExtHandle, ushort *psfn );
;
; Entry TOS = Extended handle to be mapped
; TOS + 4 = PSP extended handle is on
; TOS + 8 = Pointer to variable to contain the SFN
;
; Exit EAX = 0 if no error, *psfn contains the SFN
; EAX = non-zero errorcode if error
;
; Uses C Registers
;** IFSMgr_DbgSetFileHandleLimit - set limit for extended handles.
;
; This procedure sets the maximum number of extended handles available
; in the system. The limit is rounded up to the nearest multiple of 256.
; This is a debug-only service and is provided mainly for testing
; purposes to exhaust the available handles quicker. On a retail build,
; it returns without doing anything.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_DbgSetFileHandleLimit( unsigned long MaxHandles );
;
; Entry TOS = Handle limit to be set
;
; Exit EAX = -1 if the limit passed in was invalid
; = 0 if the limit was successfully set
;
; Uses C Registers
;** IFSMgr_Win32MapSFTToExtendedHandle - map a SFT to an extended handle
;
; This service maps an already existing SFT handle to an extended
; handle. This service will work only for SFT handles that are on
; drives supported by the IFS manager.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_Win32MapSFTToExtendedHandle( ushort DOSHandle, ulong *pExtHandle );
;
; Entry TOS = DOS handle to be mapped
; TOS + 4 = Pointer to variable to contain the extended handle
;
; Exit EAX = 0 if no error, *pExtHandle contains the extended handle
; EAX = non-zero errorcode if error
;
; Uses C Registers
;** IFSMgr_InstallFileSystemApiHook - install a filesystem api hook
;
; This service installs a filesystem api hook for the caller. This
; hook is between the IFS manager and a FSD. So, the hooker gets to see
; any calls that the IFS manager makes to FSDs.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; ppIFSFileHookFunc IFSMgr_InstallFileSystemApiHook( pIFSFileHookFunc HookFunc )
;
; Entry TOS = Address of function that is to be installed as the hook
;
; Exit EAX = Pointer to variable containing the address of the previous
; hooker in this chain.
;
; Uses C registers
;** IFSMgr_RemoveFileSystemApiHook - remove previously installed api hook
;
; This service removes a previously installed filesystem api hook. The
; hook can be removed dynamically at any time even if there have been
; other hookers installed on top of this hook.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_RemoveFileSystemApiHook( pIFSFileHookFunc HookFunc )
;
; Entry TOS = Address of function that is to be installed as the hook
;
; Exit EAX = 0 if success, non-zero for failure (invalid hook function)
;
; Uses C registers
;** IFSMgr_RunScheduledEvents - run events if any have been scheduled
;
; Checks to see if any scheduled global events are waiting and performs
; a nested ResumeExec if so.
;
; Entry nothing
;
; Exit carry set if no events were found, clear otherwise
;
;** IFSMgr_CheckDelResource - check/delete all connections for resource.
;
; This service deletes all active connections on the requested shell
; resource. A force level is passed in so that the appropriate checks are
; made before blowing the resource away. The FSD is called via its
; disconnect entry point to disconnect the resource. There is also a flag
; passed in so that this service can be called only to check if the
; resource can be successfully deleted without really deleting it.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_CheckDelResource( pshres psr, int force, int fDelFlag );
;
; Entry TOS = pointer to IFS resource handle passed in on connect
; TOS+4 = force level to use (0-4)
; TOS+8 = delete flag
; non-zero = delete resource
; 0 = just check for deletion
;
; Exit Returns 0 if success, errorcode if failure
;** IFSMgr_Win32GetVMCurdir - return current directory for given drive
;
; This service returns the current directory path for a given drive in the
; current VM context. If the drive is owned by the IFS, we use our IfsCDS
; structure for the current directory. Otherwise, we look in the real-mode
; CDS and extract the current directory for the drive.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_Win32GetVMCurdir( int wDrive, void far *pCurdirBuf );
;
; Entry TOS = 0-based drive number
; TOS+4 = ptr to buffer to contain curdir
;
; Exit EAX = 0 if successful
; pCurdirBuf contains curdir. Note that the path returned does not have
; "D:\" i.e. a curdir of root will be a null path. The path is always
; returned in the OEM character set for DOS consistency reasons.
; EAX = errorcode, if failure
;** IFSMgr_SetupFailedConnection - api call out on the connect operation
;
; This service is used by the ifs manager to export a connect operation
; when it has been failed by all registered net providers. Any VxD can
; hook this service and then establish a fake connection.
;
; This procedure uses the C6 386 _cdecl calling sequence
;
; int IFSMgr_SetupFailedConnection( pioreq pir, unsigned long *ProId );
;
; Entry TOS = pointer to ioreq structure(filled in for connect operation)
; TOS+4 = pointer to variable to contain provider id if connection done
;
; Exit EAX = 0 if successful, errorcode if failure.
;** _GetMappedErr - returns the mapped error from the ext. error
;
; Entry TOS = int21 function number
; TOS+4 = Extended Error Code
;
; Exit (eax) = Mapped error code
;
; Uses C registers (eax, ecx, edx, flags)
;
;*** IFSMgr_GetLockState - get lock state for specified drive
;
; This service is provided to allow file system clients
; (e.g., Compressed Volume Managers) to query if the
; specified drive is locked.
;
; This service uses the C calling convention.
;
; ENTRY driveno - volume drive number (0 = A:, ...)
; pdwtype - pointer to DWORD in which to return type
; pdwflags - pointer to DWORD in which to return flags
; pdwowner - pointer to DWORD in which to return owning thread
;
; NULL may be passed in for any of the above pointer
; values if the caller does not wish to see the
; corresponding return value.
;
; RETURN int - error code (0 if successful)
;
; USES EAX, ECX, EDX, Flags
;** IFSMgr_Win32_Get_Ring0_Handle
;
; This routine returns a ring 0 handle for a given extended handle. There
; are certain conditions under which the ring 0 handle is not returned
; because we must get an int 21h to send the i/o request down as follows:
; 1. This handle is not an extended handle.
; 2. We are in Win31 filesystem mode.
; 3. There is an app in the VM that has hooked int 21h.
; If none of these conditions are triggered, the ring 0 handle is
; returned for the next read/write operation. This service also returns
; the current position of the file since the caller does not have any
; idea of the current file position.
;
; Entry EBX = extended handle
;
; Exit CY clear --> handle mapped successfully,
; EBX = ring 0 handle
; EDX = current file position
; CY set --> handle was not mapped
; EBX is preserved in this case
;
; Uses EAX, ECX
;** IFSMgr_SetLoopback
;
; This routine is intended to be called by a server to add a loopback
; path to ifsmgr's loopback path list.
;
; This routine uses the __cdecl calling convention.
;
; ENTRY pszUNCPath - ansi string of the form \\<server>\<share>
; pszLocalPath - ansi string of the form <drive>:<path>
;
; RETURN nothing
;
; USES EAX, ECX, EDX, Flags
;** IFSMgr_ClearLoopback
;
; This routine is intended to be called by a server to remove a
; loopback path from ifsmgr's loopback path list.
;
; This routine uses the __cdecl calling convention.
;
; ENTRY pszUNCPath - ansi string of the form \\<server>\<share>
;
; RETURN nothing
;** IFSMgr_ParseOneElement
;
; This routine is intended to be called on a single path element i.e
; a filename or directory name, path separators are not allowed. It
; parses this name and returns the parse flags for it in the
; FILE_FLAG_* format defined in ifs.h. Callers can use this service to
; determine whether the name passed in is a shortname or LFN.
;
; This routine uses the __cdecl calling convention
;
; int IFSMgr_ParseOneElement( string_t pstr );
;
; Entry pstr = ptr to path element in unicode format
;
; Exit EAX = parse flags, if no error the following flags are returned:
; FILE_FLAG_IS_LFN = path element is LFN
; FILE_FLAG_HAS_STAR = path element contains '*' wildcard
; FILE_FLAG_WILDCARDS = path element contains wildcards
; FILE_FLAG_HAS_DOT = path element contains a dot char
; EAX = -1 if there was a parse error
;
; Uses C registers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -