?? ifs.inc
字號:
;****************************************************************************
; *
; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY *
; KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE *
; IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR *
; PURPOSE. *
; *
; Copyright (C) 1993-95 Microsoft Corporation. All Rights Reserved. *
; *
;****************************************************************************
;NOINC
;#ifndef IFS_INC
;#define IFS_INC 1
;INC
;* Define these flags if they are not already defined. This way, anyone who
; directly includes this file will not have to bother defining them.
;
ifndef DOS_VXD
DOS_VXD equ 1
endif
ifndef WIN32_APIS
WIN32_APIS equ 1
endif
;** 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
IFSMgr_Device_ID equ 000040h ; Installable File System Manager
IFSMgr_Init_Order equ 010000h + V86MMGR_Init_Order
FSD_Init_Order equ 000100h + IFSMgr_Init_Order
else
ifdef MASM
.errnz IFSMgr_Device_ID - 0040h
endif
endif
ifdef MASM
;* Equ's for types that h2inc script cannot convert.
ubuffer_t equ <dd>
pos_t equ <dd>
uid_t equ <db>
sfn_t equ <dw>
$F equ <dd>
if DOS_VXD eq 0
path_t equ <dd>
string_t equ <dw>
pid_t equ <dw>
rh_t equ <dw>
fh_t equ <dw>
vfunc_t equ <dw>
$P equ <dw>
$I equ <dw>
fsdwork struc
dw 16 dup (?)
fsdwork ends
else ; 32bit
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 ; @WordSize
endif
ifdef WIN32_APIS
IFS_VERSION equ 0030Ah
IFS_REVISION equ 010h
else
IFS_VERSION equ 00314h
IFS_REVISION equ 020h
endif
;* Maximum path length - excluding nul
MAX_PATH equ 260 ; Maximum path length - including nul
; Maximum length for a LFN name element - excluding nul
LFNMAXNAMELEN equ 255
MAXIMUM_USERID equ 2 ; max. # of users that can be logged
; on at the same time. Ir_user must
; always be less than MAXIMUM_USERID.
NULL_USER_ID equ 0 ; special user id for operations when
; not logged on.
; Status indications returned as errors:
STATUS_PENDING equ -1 ; request is pending
STATUS_RAWLOCK equ -2 ; rawlock active on session
; (only returned for async requests,
; sync requests will wait for the raw
; lock to be released)
STATUS_BUSY equ -3 ; request can't be started because of
; serialization.
;* ANYPROID - Any Provider ID
;
ANYPROID equ -1
;* Common function defintions for NetFunction
NF_PROCEXIT equ 0111Dh ; Process Exit sent (ID = ANYPROID)
NF_DRIVEUSE equ 00001h ; Drive Use Created (ID = ID of owner FSD)
NF_DRIVEUNUSE equ 00002h ; Drive Use Broken (ID = ID of owner FSD)
NF_GETPRINTJOBID equ 00003h ; 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
NF_PRINTERUSE equ 00004h ; Printer Use Created (ID = ID of owner FSD)
NF_PRINTERUNUSE equ 00005h ; Printer Use Broken (ID = ID of owner FSD)
NF_NetSetUserName equ 01181h
;* Flags passed to NetFunction
WIN32_CALLFLAG equ 004h ; call is Win32 api
;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)
;
;
;
; * 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
;
;INC
;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, *pioreq;
;* dos_time - DOS time & date format
;typedef struct dos_time dos_time;
dos_time struc
dt_time dw ?
dt_date dw ?
dos_time ends
;typedef struct volfunc volfunc, *vfunc_t;
;typedef struct hndlfunc hndlfunc, *hfunc_t;
;NOINC
;typedef union {
; 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;
;INC
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 ; MASM
;typedef struct event event, *pevent;
ifdef MASM ; vireo
ioreq struc
% ir_length $I ? ; length of user buffer (eCX)
ir_flags db ? ; misc. status flags (AL)
% ir_user uid_t ? ; user ID for this request
% ir_sfn sfn_t ? ; System File Number of file handle
% ir_pid pid_t ? ; process ID of requesting task
% ir_ppath path_t ? ; unicode pathname
ir_aux1 dd ? ; secondary user data buffer (CurDTA)
% ir_data ubuffer_t ? ; ptr to user data buffer (DS:eDX)
ir_options dw ? ; request handling options
ir_error dw ? ; error code (0 if OK)
% ir_rh rh_t ? ; resource handle
% ir_fh fh_t ? ; file (or find) handle
% ir_pos pos_t ? ; file position for request
ir_aux2 dd ? ; misc. extra API parameters
ir_aux3 dd ? ; misc. extra API parameters
% ir_pev $P ? ; ptr to IFSMgr event for async requests
ir_fsd db (size fsdwork) dup (?); ; Provider work space
ioreq ends
endif ; vireo
; misc. fields overlayed with other ioreq members:
ir_size equ ir_pos
ir_conflags equ ir_pos ; flags for connect
ir_attr2 equ ir_pos ; destination attributes for Rename
ir_attr equ ir_length ; DOS file attribute info
ir_pathSkip equ ir_length ; # of path elements consumed by Connect
ir_lananum equ ir_sfn ; LanA to Connect on (0xFF for any net)
ir_tuna equ ir_sfn ; Mount: FSD authorises IFSMGR tunneling
ir_ptuninfo equ ir_data ; Rename/Create: advisory tunneling info ptr
; Fields overlayed with ir_options:
ir_namelen equ ir_options
ir_sectors equ ir_options ; sectors per cluster
ir_status equ ir_options ; named pipe status
; Fields overlayed with ir_aux1:
ir_data2 equ <ir_aux1.aux_buf> ; secondary data buffer
ir_vfunc equ <ir_aux1.aux_vf> ; volume function vector
ir_hfunc equ <ir_aux1.aux_hf> ; file handle function vector
ir_ppath2 equ <ir_aux1.aux_pp> ; second pathname for Rename
ir_volh equ <ir_aux1.aux_ul> ; VRP address for Mount
; Fields overlayed with ir_aux2:
ir_numfree equ <ir_aux2.aux_ul> ; number of free clusters
ir_locklen equ <ir_aux2.aux_ul> ; length of lock region
ir_msglen equ <ir_aux2.aux_ui> ; length of current message (peek pipe)
; next msg length for mailslots
ir_dostime equ <ir_aux2.aux_dt> ; DOS file date & time stamp
ir_timeout equ <ir_aux2.aux_ul> ; timeout value in milliseconds
ir_password equ <ir_aux2.aux_ptr> ; password for Connect
ir_drvh equ <ir_aux2.aux_ptr> ; drive handle for Mount
ir_prtlen equ <ir_aux2.aux_dt.dt_time> ; length of printer setup string
ir_prtflag equ <ir_aux2.aux_dt.dt_date> ; printer flags
ir_firstclus equ <ir_aux2.aux_ui> ; First cluster of file
ir_mntdrv equ <ir_aux2.aux_ul> ; driveletter for Mount
ir_cregptr equ <ir_aux2.aux_ptr> ; pointer to client registers
ir_uFName equ <ir_aux2.aux_str> ; case preserved filename
; Fields overlayed with ir_aux3:
ir_upath equ <ir_aux3.aux_str> ; pointer to unparsed pathname
ir_scratch equ <ir_aux3.aux_ptr> ; scratch buffer for NetFunction calls
; Fields overlayed with ir_user:
ir_drivenum equ ir_user ; Logical drive # (when mounting)
;NOINC
; IFSFunc - general IFS functions
;
;typedef int _cdecl IFSFunc(pioreq pir);
;typedef IFSFunc *pIFSFunc;
;INC
;* hndlfunc - I/O functions for file handles
;
ifdef WIN32_APIS
NUM_HNDLMISC equ 8
else
NUM_HNDLMISC equ 8
endif
;NOINC
; IFSFileHookFunc - IFS file hook function
;
;typedef int _cdecl IFSFileHookFunc( pIFSFunc pfn, int fn, int Drive, int ResType, int CodePage, pioreq pir );
;typedef IFSFileHookFunc *pIFSFileHookFunc;
;typedef pIFSFileHookFunc *ppIFSFileHookFunc;
;INC
;typedef struct hndlmisc hndlmisc;
ifdef MASM ; vireo
hndlfunc struc
% hf_read $P ? ; file read handler function
% hf_write $P ? ; file write handler function
% hf_misc $P ? ; ptr to misc. function vector
hndlfunc ends
hndlmisc struc
hm_version dw ? ; IFS version #
hm_revision db ? ; IFS interface revision #
hm_size db ? ; # of entries in table
% hm_func $P NUM_HNDLMISC dup (?)
hndlmisc ends
endif ; vireo
HM_SEEK equ 0 ; Seek file handle
HM_CLOSE equ 1 ; close handle
HM_COMMIT equ 2 ; commit buffered data for handle
HM_FILELOCKS equ 3 ; lock/unlock byte range
HM_FILETIMES equ 4 ; get/set file modification time
HM_PIPEREQUEST equ 5 ; named pipe operations
HM_HANDLEINFO equ 6 ; get/set file information
HM_ENUMHANDLE equ 7 ; enum filename from handle, lock info
;* volfunc - volume based api fucntions
;
ifdef WIN32_APIS
NUM_VOLFUNC equ 15
else
NUM_VOLFUNC equ 13
endif
ifdef MASM ; vireo
volfunc struc
vfn_version dw ? ; IFS version #
vfn_revision db ? ; IFS interface revision #
vfn_size db ? ; # of entries in table
% vfn_func $P NUM_VOLFUNC dup (?); volume base function handlers
volfunc ends
endif ; vireo
VFN_DELETE equ 0 ; file delete
VFN_DIR equ 1 ; directory manipulation
VFN_FILEATTRIB equ 2 ; DOS file attribute manipulation
VFN_FLUSH equ 3 ; flush volume
VFN_GETDISKINFO equ 4 ; query volume free space
VFN_OPEN equ 5 ; open file
VFN_RENAME equ 6 ; rename path
VFN_SEARCH equ 7 ; search for names
VFN_QUERY equ 8 ; query resource info (network only)
VFN_DISCONNECT equ 9 ; disconnect from resource (net only)
VFN_UNCPIPEREQ equ 10 ; UNC path based named pipe operations
VFN_IOCTL16DRIVE equ 11 ; drive based 16 bit IOCTL requests
VFN_GETDISKPARMS equ 12 ; get DPB
VFN_FINDOPEN equ 13 ; open an LFN file search
VFN_DASDIO equ 14 ; direct volume access
;* IFS Function IDs passed to IFSMgr_CallProvider
IFSFN_READ equ 0 ; read a file
IFSFN_WRITE equ 1 ; write a file
IFSFN_FINDNEXT equ 2 ; LFN handle based Find Next
IFSFN_FCNNEXT equ 3 ; Find Next Change Notify
IFSFN_SEEK equ 10 ; Seek file handle
IFSFN_CLOSE equ 11 ; close handle
IFSFN_COMMIT equ 12 ; commit buffered data for handle
IFSFN_FILELOCKS equ 13 ; lock/unlock byte range
IFSFN_FILETIMES equ 14 ; get/set file modification time
IFSFN_PIPEREQUEST equ 15 ; named pipe operations
IFSFN_HANDLEINFO equ 16 ; get/set file information
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -