📄 ifs.inc
字号:
srch_key struc
sk_drive db ? ; Drive specifier (set by IFS MGR)
sk_pattern db 11 dup (?) ; Reserved (pattern sought)
sk_attr db ? ; Reserved (attribute sought)
sk_localFSD db 4 dup (?) ; available for use local FSDs
sk_netFSD db 2 dup (?) ; available for use by network FSDs
sk_ifsmgr db 2 dup (?) ; reserved for use by IFS MGR
srch_key ends
;typedef struct srch_entry srch_entry;
srch_entry struc
se_key db (size srch_key) dup (?) ; resume key
se_attrib db ? ; file attribute
se_time dw ? ; time of last modification to file
se_date dw ? ; date of last modification to file
se_size dd ? ; size of file
se_name db 13 dup (?) ; ASCIIZ name with dot included
srch_entry ends
;* Win32 Date Time structure
; This structure defines the new Win32 format structure for returning the
; date and time
;
;typedef struct _FILETIME _FILETIME;
_FILETIME struc
dwLowDateTime dd ?
dwHighDateTime dd ?
_FILETIME ends
;* Win32 Find Structure
; This structure defines the contents of the result buffer on a
; Win32 FindFirst / FindNext. These calls are accessed by the new
; LFN find apis
;
;typedef struct _WIN32_FIND_DATA _WIN32_FIND_DATA;
_WIN32_FIND_DATA struc
dwFileAttributes dd ?
ftCreationTime db (size _FILETIME) dup (?)
ftLastAccessTime db (size _FILETIME) dup (?)
ftLastWriteTime db (size _FILETIME) dup (?)
nFileSizeHigh dd ?
nFileSizeLow dd ?
dwReserved0 dd ?
dwReserved1 dd ?
cFileName dw MAX_PATH dup (?) ; includes NUL
cAlternateFileName dw 14 dup (?) ; includes NUL
_WIN32_FIND_DATA ends
;* Win32 File Info By Handle Structure
; This structure defines the contents of the result buffer on a
; Win32 FileInfoByHandle. These calls are accessed by the new
; LFN find apis
;
;typedef struct _BY_HANDLE_FILE_INFORMATION _BY_HANDLE_FILE_INFORMATION;
_BY_HANDLE_FILE_INFORMATION struc ; bhfi
bhfi_dwFileAttributes dd ?
bhfi_ftCreationTime db (size _FILETIME) dup (?)
bhfi_ftLastAccessTime db (size _FILETIME) dup (?)
bhfi_ftLastWriteTime db (size _FILETIME) dup (?)
bhfi_dwVolumeSerialNumber dd ?
bhfi_nFileSizeHigh dd ?
bhfi_nFileSizeLow dd ?
bhfi_nNumberOfLinks dd ?
bhfi_nFileIndexHigh dd ?
bhfi_nFileIndexLow dd ?
_BY_HANDLE_FILE_INFORMATION ends
; these are win32 defined flags for GetVolInfo
FS_CASE_IS_PRESERVED equ 000000002h
FS_UNICODE_STORED_ON_DISK equ 000000004h
; these flags for GetVolInfo are NOT defined
FS_VOL_IS_COMPRESSED equ 000008000h
FS_VOL_SUPPORTS_LONG_NAMES equ 000004000h
; these flags are returned by IFSMgr_Get_Drive_Info
FDRV_INT13 equ 001h
FDRV_FASTDISK equ 002h
FDRV_COMP equ 004h
FDRV_RMM equ 008h
FDRV_DOS equ 010h
FDRV_USE_RMM equ 020h
FDRV_COMPHOST equ 040h
FDRV_NO_LAZY equ 080h
;* TUNINFO - Tunneling Information
; This structure defines the information passed into the FSD on
; a Create or Rename operation if tunneling was detected. This
; gives a set of advisory information to create the new file with.
; if ir_ptuninfo is NULL on Create or Rename, none of this information
; is available. All of this information is advisory. tuni_bfContents
; defines what pieces of tunneling information are available.
;
;typedef struct TUNINFO TUNINFO;
ifdef MASM ; vireo
TUNINFO struc
tuni_bfContents dd ?
% tuni_pAltName $P ?
tuni_ftCreationTime db (size _FILETIME) dup (?)
tuni_ftLastAccessTime db (size _FILETIME) dup (?)
tuni_ftLastWriteTime db (size _FILETIME) dup (?)
TUNINFO ends
endif ; vireo
TUNI_CONTAINS_ALTNAME equ 000000001h ; pAltName available
TUNI_CONTAINS_CREATIONT equ 000000002h ; ftCreationTime available
TUNI_CONTAINS_LASTACCESST equ 000000004h ; ftLastAccessTime available
TUNI_CONTAINS_LASTWRITET equ 000000008h ; ftLastWriteTime available
;* _QWORD - 64-bit data type
; A struct used to return 64-bit data types to C callers
; from the qwUniToBCS & qwUniToBCS rotuines. These
; 'routines' are just alias' for UntoToBCS & UniToBCSPath
; routines and do not exist as separate entities. Both
; routines always return a 64-bit result. The lower
; 32-bits are a length. The upper 32-bits are flags.
; Typically, the flag returned indicates whether a mapping
; resulted in a loss on information in the UNICODE to BCS
; translation (i.e. a unicode char was converted to an '_').
;
;typedef struct _QWORD _QWORD;
_QWORD struc
ddLower dd ?
ddUpper dd ?
_QWORD ends
;* ParsedPath - structure of an IFSMgr parsed pathname
PathElement struc
pe_length dw ?
pe_unichars dw 1 dup (?)
PathElement ends
ParsedPath struc
pp_totalLength dw ?
pp_prefixLength dw ?
pp_elements db (1*size PathElement) dup (?)
ParsedPath ends
;* Macros to mainipulate parsed pathnames receieved from IFSMgr
;NOINC
;#define IFSPathSize(ppath) ((ppath)->pp_totalLength + sizeof(short))
;#define IFSPathLength(ppath) ((ppath)->pp_totalLength - sizeof(short)*2)
;#define IFSLastElement(ppath) ((PathElement *)((char *)(ppath) + (ppath)->pp_prefixLength))
;#define IFSNextElement(pel) ((PathElement *)((char *)(pel) + (pel)->pe_length))
;#define IFSIsRoot(ppath) ((ppath)->pp_totalLength == 4)
;INC
;* Function prototypes for IFSMgr services
; Values for charSet passed to character conversion routines
BCS_WANSI equ 0 ; use Windows ANSI set
BCS_OEM equ 1 ; use current OEM character set
BCS_UNI equ 2 ; use UNICODE character set
; Matching semantics flags passed to MetaMatchUni()
UFLG_META equ 001h
UFLG_NT equ 002h
UFLG_NT_DOS equ 004h
UFLG_DOS equ 000h
; define the utb and btu ptr table structures
;typedef struct CPPtrs CPPtrs;
CPPtrs struc
AnsiPtr dd ?
OEMPtr dd ?
CPPtrs ends
;typedef struct UnitoUpperTab UnitoUpperTab;
UnitoUpperTab struc
delta dd ?
TabPtr dd ?
UnitoUpperTab ends
;typedef struct CPTablePtrs CPTablePtrs;
CPTablePtrs struc
CPT_Length dd ?
utbPtrTab db (size CPPtrs) dup (?)
btuPtrTab db (size CPPtrs) dup (?)
UnitoUpperPtr db (size UnitoUpperTab) dup (?)
CPTablePtrs ends
;NOINC
;unsigned int _cdecl UniToBCS(
; unsigned char *pStr,
; string_t pUni,
; unsigned int length,
; unsigned int maxLength,
; unsigned int charSet);
;
;
;unsigned int UniToBCSPath(
; unsigned char *pStr,
; PathElement *pPth,
; unsigned int maxLength,
; int charSet);
;
;
;_QWORD qwUniToBCS(
; unsigned char *pStr,
; string_t pUni,
; unsigned int length,
; unsigned int maxLength,
; unsigned int charSet);
;
;
;_QWORD qwUniToBCSPath(
; unsigned char *pStr,
; PathElement *pPth,
; unsigned int maxLength,
; int charSet);
;
;
;unsigned int _cdecl BCSToUni(
; string_t pUni,
; unsigned char *pStr,
; unsigned int length,
; int charSet);
;
;
;unsigned int UniToUpper(
; string_t pUniUp,
; string_t pUni,
; unsigned int length);
;
;
;unsigned int BCSToBCS (unsigned char *pDst,
; unsigned char *pSrc,
; unsigned int dstCharSet,
; unsigned int srcCharSet,
; unsigned int maxLen);
;
;
;unsigned int BCSToBCSUpper (unsigned char *pDst,
; unsigned char *pSrc,
; unsigned int dstCharSet,
; unsigned int srcCharSet,
; unsigned int maxLen);
;
;
; Map a single Unicode character to OEM
; * Entry (uniChar) - character to map
; *
; * Returns (oemChar) - character in OEM set
; * (if oemChar > 255, then DBCS character with
; * lead byte in LSB and trail byte in next byte)
;
;unsigned int _cdecl UniCharToOEM(unsigned short uniChar);
;
;
;unsigned int IFSMgr_MetaMatch(
; string_t pUniPat,
; string_t pUni,
; int MatchSem);
;
; IFSMgr_TransMatch - translate and match
; *
; * The routine converts a DOS format 43 bytes search buffer into
; * _WIN32_FIND_DATA format and will optionally perform attribute and
; * pattern matching on the entry.
; *
; * Entry (pir) - ptr to ioreq structure
; * ir_attr - attribute value from FINDOPEN call.
; * (pse) - ptr to DOS format search buffer
; * (pattern) - ptr to Unicode pattern string (0 terminated)
; * (pwf) - ptr to _WIN32_FIND_DATA structure to fill in
; * Exit != 0 if match
; * ir_pos - value from sk_localFSD.
; * (used for restarting finds)
; * 0 if no match
;
;int IFSMgr_TransMatch(
; pioreq pir,
; srch_entry *pse,
; string_t pattern,
; _WIN32_FIND_DATA *pwf);
;
;
; Time format conversion routines
; *
; * These routines will convert from time/date information between
; * the various formats used and required by IFSMgr and FSDs.
;
;
;;extern _FILETIME _cdecl IFSMgr_DosToWin32Time(dos_time dt);
;
;;extern _FILETIME IFSMgr_NetToWin32Time(unsigned long time);
;
;;extern dos_time IFSMgr_Win32ToDosTime(_FILETIME ft);
;
;;extern dos_time IFSMgr_NetToDosTime(unsigned long time);
;
;;extern unsigned long IFSMgr_DosToNetTime(dos_time dt);
;
;;extern unsigned long IFSMgr_Win32ToNetTime(_FILETIME ft);
;
;
; IFSMgr_CallProvider - call file system provider
; *
; * The IFSMgr makes all calls to file system providers via this
; * service. It is possible for a VxD to hook this service to monitor
; * file system operations.
; *
; * Entry (pir) - ptr to ioreq structure
; * (fnID) - function ID (see IFSFN_* above)
; * (ifn) - provider function being called
; * Exit return code from provider
;
;int IFSMgr_CallProvider(pioreq pir, int fnID, pIFSFunc ifn);
;
; These definitions are used by MSNET32 for
; making DeviceIOControl calls to ifsmgr
;
;#define IFS_IOCTL_21 100
;#define IFS_IOCTL_2F 101
;#define IFS_IOCTL_GET_RES 102
;#define IFS_IOCTL_GET_NETPRO_NAME_A 103
;
;struct win32apireq {
; unsigned long ar_proid;
; unsigned long ar_eax;
; unsigned long ar_ebx;
; unsigned long ar_ecx;
; unsigned long ar_edx;
; unsigned long ar_esi;
; unsigned long ar_edi;
; unsigned long ar_ebp;
; unsigned short ar_error;
; unsigned short ar_pad;
;}; ; win32apireq
;
; This structure is passed to IFSMgr_UseAdd and
; IFSMgr_UseDel
;
;typedef struct netuse_info netuse_info;
;struct netuse_info {
; void *nu_data;
; int nu_info; ; del use only
; unsigned long nu_flags;
; unsigned long nu_rsvd;
;}; ; netuse_info
;
; values for nu_flags
;
;#define FSD_NETAPI_USEOEM 0x00000001 ; strings are OEM
;#define FSD_NETAPI_STATIC 0x00000002 ; drive redirection can
; ; only be removed at shutdown
;#define FSD_NETAPI_USELFN 0x00000004 ; treat remote name as lfn
;INC
ifdef MASM ; vireo
fmode_t struc ; File mode information
fm_uid dd ? ; User ID
% fm_cookie0 $P ? ; Caller-supplied cookie
% fm_cookie1 $P ? ; Caller-supplied cookie
fm_mode dw ? ; File sharing mode and access
fm_attr dw ? ; File attributes
fmode_t ends
endif ; vireo
;typedef struct fmode_t fmode_t; ; Type definition
;
; These flags are used on the Win32 service to duplicate an extended handle
;
;
DUP_NORMAL_HANDLE equ 000h ; dup handle for normal file io
DUP_MEMORY_MAPPED equ 001h ; dup handle for memory-mapping
DUP_MEM_MAPPED_WRITE equ 002h ; mem mapping is for write if set,
; is for read if clear.
;
; These constants for the different subfunctions on NameTrans (7160h)
;
;
NAMTRN_NORMALQUERY equ 000h ; normal LFN NameTrans operation
NAMTRN_DO83QUERY equ 001h ; NameTrans to return full 8.3 name
NAMTRN_DOLFNQUERY equ 002h ; NameTrans to return full LFN name
;
; These constants are used for the different subfunctions on Get List Of
; Open Files (440dh, 086Dh)
;
;
ENUM_ALL_FILES equ 000h ; enumerate all open files
ENUM_UNMOVEABLE_FILES equ 001h ; enumerate only unmoveable files
;* Structure for the open file information from DOS to take over open files.
;
;typedef struct SFTOpenInfo SFTOpenInfo;
;typedef struct SFTOpenInfo *pSFTOpenInfo;
SFTOpenInfo struc
soi_dirclus dw ? ; cluster # for directory
soi_dirind dw ? ; directory index of dir entry
soi_dirname db 11 dup (?) ; directory entry name
soi_pad db ? ; pad out for dword boundary
SFTOpenInfo ends
;NOINC
;
; Win32DupHandle service and associated constants.
;
;
;;;extern int _cdecl Win32DupHandle( pid_t srcpid,
;; pid_t duppid,
;; unsigned long *phandle,
;; unsigned char flag,
;; unsigned long globNWHandle,
;; unsigned long *fReturnFlags );
;
; Values for fReturnFlags:
;#define WDUP_RMM_DRIVE 0x01 ; file mapped on a RMM drive
;#define WDUP_NETWARE_HANDLE 0x02 ; handle belongs to Netware
;
;#endif ; IFS_INC
;INC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -