📄 ifs.h
字号:
/*****************************************************************/
/** Microsoft DOS IFS Manager **/
/** Copyright(c) Microsoft Corp., 1990-1993 **/
/*****************************************************************/
/* :ts=4 */
/*NOINC*/
#ifndef IFS_INC
#define IFS_INC 1
/*INC*/
/*** ifs.h - Installable File System definitions
*
* This file contains the C function prototypes, structure declarations,
* type names, and constants which define the DOS installable file system
* interface.
*
* All of these routines take a pointer to an IO request structure that
* is filled in with the parameters relevant for the request. The routines
* return some result info in the IO request struct. The particulars
* for each routine are given below the function prototype. All of the
* requests use ir_pid as the ID of the requesting process and return
* success/failure info in ir_error.
*/
/*NOINC*/
#ifndef FAR
#if defined(M_I386) || _M_IX86 >= 300
#define FAR
#else
#define FAR _far
#endif
#endif
/*INC*/
#ifndef IFSMgr_Device_ID
#define IFSMgr_Device_ID 0x00040 /* Installable File System Manager */
#define IFSMgr_Init_Order 0x10000 + V86MMGR_Init_Order
#define FSD_Init_Order 0x00100 + IFSMgr_Init_Order
#else
/* ASM
ifdef MASM
.errnz IFSMgr_Device_ID - 0040h
endif
*/
#endif
/* ASM
ifdef MASM
;* Equ's for types that h2inc script cannot convert.
; BUGBUG: These are kept here only because there are other ifsmgr include
; files that still use the SED script and they depend on these definitions.
; Ifs.h itself doesn't use them any more. Once the other include files have
; been converted to use h2inc, these definitions will be removed.
ubuffer_t equ <dd>
pos_t equ <dd>
uid_t equ <db>
sfn_t equ <dw>
$F equ <dd>
path_t equ <dd>
string_t equ <dd>
pid_t equ <dd>
rh_t equ <dd>
fh_t equ <dd>
vfunc_t equ <dd>
$P equ <dd>
$I equ <dd>
fsdwork struc
dd 16 dup (?)
fsdwork ends
endif
*/
#define IFS_VERSION 0x030A
#define IFS_REVISION 0x10
/** Maximum path length - excluding nul */
#define MAX_PATH 260 /* Maximum path length - including nul */
/* Maximum length for a LFN name element - excluding nul */
#define LFNMAXNAMELEN 255
#define MAXIMUM_USERID 2 /* max. # of users that can be logged */
/* on at the same time. Ir_user must */
/* always be less than MAXIMUM_USERID. */
#define NULL_USER_ID 0 /* special user id for operations when */
/* not logged on. */
/* Status indications returned as errors: */
#define STATUS_PENDING -1 /* request is pending */
#define STATUS_RAWLOCK -2 /* rawlock active on session */
/* (only returned for async requests, */
/* sync requests will wait for the raw */
/* lock to be released) */
#define STATUS_BUSY -3 /* request can't be started because of */
/* serialization. */
/** ANYPROID - Any Provider ID
*/
#define ANYPROID -1
/** Common function defintions for NetFunction */
#define NF_PROCEXIT 0x111D /* Process Exit sent (ID = ANYPROID) */
#define NF_DRIVEUSE 0x0001 /* Drive Use Created (ID = ID of owner FSD) */
#define NF_DRIVEUNUSE 0x0002 /* Drive Use Broken (ID = ID of owner FSD) */
#define NF_GETPRINTJOBID 0x0003 /* Get Print Job ID */
/* ir_fh - ptr to master file info */
/* ir_data - ptr to data buffer */
/* ir_length - IN: buffer size */
/* OUT: amount transfered*/
/* ir_SFN - SFN of file handle */
#define NF_PRINTERUSE 0x0004 /* Printer Use Created (ID = ID of owner FSD) */
#define NF_PRINTERUNUSE 0x0005 /* Printer Use Broken (ID = ID of owner FSD) */
#define NF_NetSetUserName 0x1181
/** Flags passed to NetFunction */
#define WIN32_CALLFLAG 0x04 /* call is Win32 api */
/** Values for the different types of FSDs that can be registered: */
#define FSTYPE_LOCAL_FSD 0 // a local FSD
#define FSTYPE_NET_FSD 1 // a network FSD
#define FSTYPE_MAILSLOT_FSD 2 // a mailslot provider
#define FSTYPE_CHARACTER_FSD 3 // a character FSD
/** Force levels that can be specified on IFSMgr_DeregisterFSD apis. A
* description of the actions performed at the various levels as well as
* which FSD types can use which levels is given below. Note that if the
* api is called with a force level that is not valid for its FSD type,
* the call will be failed.
*
* Level FSD Type Action
* ----- -------- ------
* 0 Only net Clean only UNC with no open handles.
*
* 1 Only net Clean up UNC & net drives with no open handles.
*
* 2 Net, local Close open files. For net FSD, get rid of UNC, and
* net drives that are not current drives in a VM. For
* local FSD, get rid of drive if no errors closing files.
* It is irrelevant if it is the current drive in a VM.
*
* 3 Net, local Does everything at level 2. In addition, for CFSD and
* and CFSD local FSD, blast resources ignoring all errors. For net
* FSD, ignore if drive is current drive in VM.
*
* 4 Net only Do everything at level 3. In addition, get rid of
* static connections also.
*/
#define FORCE_LEV_UNC 0 // clean up UNC connections only
#define FORCE_LEV_USE 1 // clean up any net uses to drives
// provided there are no open files
#define FORCE_LEV_CLOSE_FILES 2 // close any open files and clean up
#define FORCE_LEV_CLEANUP 3 // ignore errors closing open files, or
// for net drives, if it is current drive
#define FORCE_LEV_BLAST 4 // only for net, clean up static
// connections also
/** Priority levels that can be specifed for FSDs while registering.
* Priority levels can only be passed in on the new service
* IFSMgr_RegisterFSDWithPriority. A priority level of zero cannot be
* passed in, the IFSMgr automatically converts this to a default
* priority level.
*
* For reference, the filesystem components have the following
* priorities:
*
* VDEF: FS_PRIORITY_LOWEST
* VFAT: FS_PRIORITY_DEFAULT
* CDFS: FS_PRIORITY_LOW
*/
#define FS_PRIORITY_LOWEST 0x00 // lowest value, only for default FSD
#define FS_PRIORITY_LOW 0x20 // low priority FSD
#define FS_PRIORITY_DEFAULT 0x40 // default value for priority
#define FS_PRIORITY_MEDIUM 0x80 // medium value of priority
#define FS_PRIORITY_HIGH 0xC0 // high priority FSD
#define FS_PRIORITY_HIGHEST 0x100 // max value of priority
/** Attributes that describe the level of support provided by the FSD.
* The ifsmgr uses these attributes to determine what kinds of functions
* are supported by the FSD. Currently, it is used to indicate that the
* FSD supports large-disk access i.e. disks > 2Gb in size.
*/
#define FS_ATTRIB_WIN95COMPAT 0x00000000 // Win95 level of support
#define FS_ATTRIB_LARGE_MEDIA 0x00000001 // Supports media > 2Gb
#define FS_ATTRIB_ACCESS_METHOD_HINTS 0x00000002 // Supports random\sequential
// access-method hints passed
// in on open file calls.
#define FS_SUPPRESS_MRU_MOUNT_ORDER 0x00000004 // Suppress IFS' MRU mount
// order for this FSD.
/*NOINC*/
/** Macros for handling status indications when returned as errors
*
* REAL_ERROR - returns TRUE if there is a real error
* returns FALSE for NO_ERROR or STATUS_????
* STATUS_ERROR - returns TRUE if error is actually a status indication
*/
#define REAL_ERROR(err) ((err) > 0)
#define STATUS_ERROR(err) ((err) < 0)
/*INC*/
/**
* The types for resource handles (rh_t), file handles (fh_t),
* and the file system driver work space (fsdwork_t) can be defined
* by the FSD. The FSD's version of the type must be exactly the
* same size as the types defined below. To declare your own
* version of these types: define a macros of the same name as
* any of the three types before including ifs.h.
*/
#ifndef rh_t
typedef void *rh_t; /* resource handle */
#endif
#ifndef fh_t
typedef void *fh_t; /* file handle */
#endif
#ifndef fsdwork_t
typedef int fsdwork_t[16]; /* provider work space */
#endif
typedef unsigned short *string_t; /* character string */
typedef unsigned short sfn_t; /* system file number */
typedef unsigned long pos_t; /* file position */
typedef unsigned int pid_t; /* process ID of requesting task */
typedef void FAR *ubuffer_t; /* ptr to user data buffer */
typedef unsigned char uid_t; /* user ID for this request */
/* Parsed path structures are defined later in this file. */
typedef struct PathElement PathElement;
typedef struct ParsedPath ParsedPath;
typedef ParsedPath *path_t;
typedef struct ioreq ioreq;
typedef struct ioreq *pioreq;
/** dos_time - DOS time & date format */
typedef struct dos_time dos_time;
struct dos_time {
unsigned short dt_time;
unsigned short dt_date;
}; /* dos_time */
/** dos_time_rounded - DOS date/time returned by ifsgmr_GetDosTimeRounded */
typedef struct dos_time_rounded dos_time_rounded;
struct dos_time_rounded {
unsigned short dtr_time_rounded;
unsigned short dtr_date_rounded;
unsigned short dtr_time;
unsigned short dtr_date;
unsigned char dtr_time_msec;
}; /* dos_time_rounded */
typedef struct volfunc volfunc;
typedef struct volfunc *vfunc_t;
typedef struct hndlfunc hndlfunc;
typedef struct hndlfunc *hfunc_t;
typedef union aux_t {
ubuffer_t aux_buf;
unsigned long aux_ul;
dos_time aux_dt;
vfunc_t aux_vf;
hfunc_t aux_hf;
void *aux_ptr;
string_t aux_str;
path_t aux_pp;
unsigned int aux_ui;
} aux_t;
/* ASM
ifdef MASM
aux_data struc
aux_dword dd ?
aux_data ends
if @Version ge 600
aux_ul textequ <aux_data.aux_dword>
aux_ui textequ <aux_data.aux_dword>
aux_vf textequ <aux_data.aux_dword>
aux_hf textequ <aux_data.aux_dword>
aux_ptr textequ <aux_data.aux_dword>
aux_str textequ <aux_data.aux_dword>
aux_pp textequ <aux_data.aux_dword>
aux_buf textequ <aux_data.aux_dword>
aux_dt textequ <aux_data.aux_dword>
else
aux_ul equ aux_dword
aux_ui equ aux_dword
aux_vf equ aux_dword
aux_hf equ aux_dword
aux_ptr equ aux_dword
aux_str equ aux_dword
aux_pp equ aux_dword
aux_buf equ aux_dword
aux_dt equ aux_dword
endif
endif
*/
typedef struct event event;
typedef struct event *pevent;
struct ioreq {
unsigned int ir_length; /* length of user buffer (eCX) */
unsigned char ir_flags; /* misc. status flags (AL) */
uid_t ir_user; /* user ID for this request */
sfn_t ir_sfn; /* System File Number of file handle */
pid_t ir_pid; /* process ID of requesting task */
path_t ir_ppath; /* unicode pathname */
aux_t ir_aux1; /* secondary user data buffer (CurDTA) */
ubuffer_t ir_data; /* ptr to user data buffer (DS:eDX) */
unsigned short ir_options; /* request handling options */
short ir_error; /* error code (0 if OK) */
rh_t ir_rh; /* resource handle */
fh_t ir_fh; /* file (or find) handle */
pos_t ir_pos; /* file position for request */
aux_t ir_aux2; /* misc. extra API parameters */
aux_t ir_aux3; /* misc. extra API parameters */
pevent ir_pev; /* ptr to IFSMgr event for async requests */
fsdwork_t ir_fsd; /* Provider work space */
}; /* ioreq */
/* misc. fields overlayed with other ioreq members: */
#define ir_size ir_pos
#define ir_conflags ir_pos /* flags for connect */
#define ir_attr2 ir_pos /* destination attributes for Rename */
#define ir_attr ir_length /* DOS file attribute info */
#define ir_pathSkip ir_length /* # of path elements consumed by Connect */
#define ir_lananum ir_sfn /* LanA to Connect on (0xFF for any net) */
#define ir_tuna ir_sfn /* Mount: FSD authorises IFSMGR tunneling */
#define ir_ptuninfo ir_data /* Rename/Create: advisory tunneling info ptr */
/* Fields overlayed with ir_options: */
#define ir_namelen ir_options
#define ir_sectors ir_options /* sectors per cluster */
#define ir_status ir_options /* named pipe status */
/* Fields overlayed with ir_aux1: */
#define ir_data2 ir_aux1.aux_buf /* secondary data buffer */
#define ir_vfunc ir_aux1.aux_vf /* volume function vector */
#define ir_hfunc ir_aux1.aux_hf /* file handle function vector */
#define ir_ppath2 ir_aux1.aux_pp /* second pathname for Rename */
#define ir_volh ir_aux1.aux_ul /* VRP address for Mount */
/* Fields overlayed with ir_aux2: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -