⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ifs.h

📁 用于查询PC机上的USB端口是否有设备挂接上
💻 H
📖 第 1 页 / 共 2 页
字号:

#define ir_numfree	ir_aux2.aux_ul	/* number of free clusters */
#define ir_locklen	ir_aux2.aux_ul	/* length of lock region */
#define ir_msglen	ir_aux2.aux_ui	/* length of current message (peek pipe) */
									/* next msg length for mailslots */
#define ir_dostime	ir_aux2.aux_dt	/* DOS file date & time stamp */
#define ir_timeout	ir_aux2.aux_ul	/* timeout value in milliseconds */
#define ir_password	ir_aux2.aux_ptr	/* password for Connect */
#define ir_drvh		ir_aux2.aux_ptr	/* drive handle for Mount */
#define ir_prtlen	ir_aux2.aux_dt.dt_time	/* length of printer setup string */
#define ir_prtflag	ir_aux2.aux_dt.dt_date	/* printer flags */
#define ir_firstclus ir_aux2.aux_ul	/* First cluster of file */
#define ir_mntdrv	ir_aux2.aux_ul	/* driveletter for Mount */
#define ir_cregptr	ir_aux2.aux_ptr	/* pointer to client registers */
#define ir_uFName	ir_aux2.aux_str	/* case preserved filename */

/* Fields overlayed with ir_aux3: */

#define ir_upath	ir_aux3.aux_str	/* pointer to unparsed pathname */
#define ir_scratch	ir_aux3.aux_ptr	/* scratch buffer for NetFunction calls */

/* Fields overlayed with ir_user: */

#define	ir_drivenum	ir_user		/* Logical drive # (when mounting) */


/**	IFSFunc - general IFS functions
 */
typedef	int	_cdecl IFSFunc(pioreq pir);
typedef IFSFunc *pIFSFunc;

/** hndlfunc - I/O functions for file handles
 */

#define NUM_HNDLMISC	8

/*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;

struct hndlfunc {
	pIFSFunc	hf_read;	/* file read handler function */
	pIFSFunc	hf_write;	/* file write handler function */
	hndlmisc	*hf_misc;	/* ptr to misc. function vector */
};	/* hndlfunc */


struct hndlmisc {
	short		hm_version;			/* IFS version # */
	char		hm_revision;		/* IFS interface revision # */
	char		hm_size;			/* # of entries in table */
	pIFSFunc	hm_func[NUM_HNDLMISC];
};	/* hndlmisc */

#define HM_SEEK			0			/* Seek file handle */
#define HM_CLOSE		1			/* close handle */
#define HM_COMMIT		2			/* commit buffered data for handle*/
#define HM_FILELOCKS	3			/* lock/unlock byte range */
#define HM_FILETIMES	4			/* get/set file modification time */
#define HM_PIPEREQUEST	5			/* named pipe operations */
#define HM_HANDLEINFO	6			/* get/set file information */
#define HM_ENUMHANDLE	7			/* enum filename from handle, lock info */

/**	volfunc - volume based api fucntions
 */

#define NUM_VOLFUNC	15

struct volfunc {
	short		vfn_version;		/* IFS version # */
	char		vfn_revision;		/* IFS interface revision # */
	char		vfn_size;			/* # of entries in table */
	pIFSFunc	vfn_func[NUM_VOLFUNC];/* volume base function handlers */
};	/* volfunc */

#define VFN_DELETE			0		/* file delete */
#define VFN_DIR				1		/* directory manipulation */
#define VFN_FILEATTRIB		2		/* DOS file attribute manipulation */
#define VFN_FLUSH			3		/* flush volume */
#define VFN_GETDISKINFO		4		/* query volume free space */
#define VFN_OPEN			5		/* open file */
#define VFN_RENAME			6		/* rename path */
#define VFN_SEARCH			7		/* search for names */
#define VFN_QUERY			8		/* query resource info (network only) */
#define VFN_DISCONNECT		9		/* disconnect from resource (net only) */
#define VFN_UNCPIPEREQ		10		/* UNC path based named pipe operations */
#define VFN_IOCTL16DRIVE	11		/* drive based 16 bit IOCTL requests */
#define VFN_GETDISKPARMS	12		/* get DPB */
#define VFN_FINDOPEN		13		/* open	an LFN file search */
#define VFN_DASDIO			14		/* direct volume access */


/** IFS Function IDs passed to IFSMgr_CallProvider */

#define IFSFN_READ			0		/* read a file */
#define IFSFN_WRITE			1		/* write a file */
#define IFSFN_FINDNEXT		2		/* LFN handle based Find Next */
#define IFSFN_FCNNEXT		3		/* Find Next Change Notify */

#define IFSFN_SEEK			10		/* Seek file handle */
#define IFSFN_CLOSE			11		/* close handle */
#define IFSFN_COMMIT		12		/* commit buffered data for handle*/
#define IFSFN_FILELOCKS		13		/* lock/unlock byte range */
#define IFSFN_FILETIMES		14		/* get/set file modification time */
#define IFSFN_PIPEREQUEST	15		/* named pipe operations */
#define IFSFN_HANDLEINFO	16		/* get/set file information */
#define IFSFN_ENUMHANDLE	17		/* enum file handle information */
#define IFSFN_FINDCLOSE		18		/* LFN find close */
#define IFSFN_FCNCLOSE		19		/* Find Change Notify Close */

#define IFSFN_CONNECT		30		/* connect or mount a resource */
#define IFSFN_DELETE		31		/* file delete */
#define IFSFN_DIR			32		/* directory manipulation */
#define IFSFN_FILEATTRIB	33		/* DOS file attribute manipulation */
#define IFSFN_FLUSH			34		/* flush volume */
#define IFSFN_GETDISKINFO	35		/* query volume free space */
#define IFSFN_OPEN			36		/* open file */
#define IFSFN_RENAME		37		/* rename path */
#define IFSFN_SEARCH		38		/* search for names */
#define IFSFN_QUERY			39		/* query resource info (network only) */
#define IFSFN_DISCONNECT	40		/* disconnect from resource (net only) */
#define IFSFN_UNCPIPEREQ	41		/* UNC path based named pipe operations */
#define IFSFN_IOCTL16DRIVE	42		/* drive based 16 bit IOCTL requests */
#define IFSFN_GETDISKPARMS	43		/* get DPB */
#define IFSFN_FINDOPEN		44		/* open	an LFN file search */
#define IFSFN_DASDIO		45		/* direct volume access */

/**	Resource types passed in on the File Hook: */
#define IFSFH_RES_UNC		0x01	/* UNC resource */
#define IFSFH_RES_NETWORK	0x08	/* Network drive connection */
#define IFSFH_RES_LOCAL		0x10	/* Local drive */
#define IFSFH_RES_CFSD		0x80	/* Character FSD */

/** values for ir_options to Connect:
 * Note that only one of RESOPT_UNC_REQUEST, RESOPT_DEV_ATTACH, and
 * RESOPT_UNC_CONNECT may be set at once.
 */

#define RESOPT_UNC_REQUEST	0x01	/* UNC-style path based request */
#define RESOPT_DEV_ATTACH	0x02	/* explicit redirection of a device */
#define RESOPT_UNC_CONNECT	0x04	/* explicit UNC-style use */
#define RESOPT_DISCONNECTED	0x08	/* Set up connection disconnected */
									/* (Don't touch net) */
#define RESOPT_NO_CREATE	0x10	/* don't create a new resource */
#define RESOPT_STATIC		0x20	/* don't allow ui to remove */

/** values for ir_flags to Connect:	*/
#define RESTYPE_WILD	0			/* wild card service type */
#define RESTYPE_DISK	1			/* disk resource */
#define RESTYPE_SPOOL	2			/* spooled printer */
#define RESTYPE_CHARDEV 3			/* character device */
#define RESTYPE_IPC		4			/* interprocess communication */

#define FIRST_RESTYPE	RESTYPE_DISK
#define LAST_RESTYPE	RESTYPE_IPC

/** values for ir_options to Close **/

#define RESOPT_NO_IO 0x01     /* no I/O allowed during the operation */

/** values for ir_flags for FSD operations */

#define IR_FSD_MOUNT		0		/* mount volume */
//OBSOLETE: #define IR_FSD_DISMOUNT 1			/* dismount volume */
#define IR_FSD_VERIFY		2		/* verify volume */
#define IR_FSD_UNLOAD		3		/* unload volume */
#define	IR_FSD_MOUNT_CHILD	4		/* mount child volume */
#define	IR_FSD_MAP_DRIVE	5		/* change drive mapping */
#define	IR_FSD_UNMAP_DRIVE	6		/* reset drive mapping */


/** Value for ir_error from IR_FSD_MOUNT if volume exists **/
#define ERROR_IFSVOL_EXISTS		284 /* mounted volume already exists */

/** Values returned in ir_tuna from IR_FSD_MOUNT (default IR_TUNA_NOTUNNEL) */
#define IR_TUNA_NOTUNNEL	0		/* Disable IFSMGR tunneling on volume */
#define IR_TUNA_FSDTUNNEL	0		/* FSD implements tunneling itself */
#define IR_TUNA_IFSTUNNEL	1		/* FSD requests IFSMGR tunneling support */

/** Values for IFSMgr_PNPVolumeEvent */
#define	PNPE_SUCCESS		0x00
#define PNPE_QUERY_ACCEPTED	0x00
#define PNPE_QUERY_REFUSED	0x01
#define PNPE_BAD_ARGS		0x02
#define PNPE_UNDEFINED		0xFF

/** Type values for IFSMgr_PNPEvent */
#define PNPT_VOLUME			0x10000000
#define PNPT_NET			0x20000000
#define PNPT_MASK	        0xF0000000

/** Values for ir_options returned from QueryResource:	*/
#define RESSTAT_OK		0			/* connection to resource is valid */
#define RESSTAT_PAUSED	1			/* paused by workstation */
#define RESSTAT_DISCONN 2			/* disconnected */
#define RESSTAT_ERROR	3			/* cannot be reconnected */
#define RESSTAT_CONN	4			/* first connection in progress */
#define RESSTAT_RECONN	5			/* reconnection in progress */



/** Values for ir_flags to HM_CLOSE:	*/

#define CLOSE_HANDLE		0		/* only closing a handle */
#define CLOSE_FOR_PROCESS	1		/* last close of SFN for this process */
#define CLOSE_FINAL			2		/* final close of SFN for system */

/** Values for ir_options to HM_CLOSE, HM_COMMIT, hf_read, hf_write:	*/
#define FILE_NO_LAST_ACCESS_DATE	0x01	/* do not update last access date */
#define FILE_CLOSE_FOR_LEVEL4_LOCK	0x02	/* special close on a level 4 lock */
#define FILE_COMMIT_ASYNC			0x04	/* commit async instead of sync */

#define FILE_FIND_RESTART	0x40	/* set for findnext w/key */
#define IOOPT_PRT_SPEC		0x80	/* ir_options flag for int17 writes */

/**	Values for ir_flags to VFN_DIR: */

#define CREATE_DIR	0
#define DELETE_DIR	1
#define CHECK_DIR	2
#define QUERY83_DIR	3
#define QUERYLONG_DIR	4


/**	ir_flags values for HM_FILELOCKS:	*/

#define LOCK_REGION		0			/* lock specified file region */
#define UNLOCK_REGION	1			/* unlock region */

/* Note: these values are also used by the sharing services */
/** ir_options values for HM_FILELOCKS:	*/

#define LOCKF_MASK_RDWR	0x01	/* Read / write lock flag */
#define LOCKF_WR		0x00	/* bit 0 clear - write lock */
#define LOCKF_RD		0x01	/* bit 0 set - read lock(NW only) */

#define LOCKF_MASK_DOS_NW	0x02	/* DOS/Netware style lock flag */
#define LOCKF_DOS			0x00	/* bit 1 clear - DOS-style lock */
#define LOCKF_NW			0x02	/* bit 1 set - Netware-style lock */

/** These values are used internally by the IFS manager only: */
#define LOCKF_MASK_INACTIVE	0x80	/* lock active/inactive flag */
#define LOCKF_ACTIVE		0x00	/* bit 7 clear - lock active */
#define LOCKF_INACTIVE		0x80	/* bit 7 set - lock inactive */

/** Values for ir_flags to VFN_PIPEREQUEST and HM_PIPEREQUEST:
 *	(NOTE: these values have been chosen to agree with the opcodes used
 *	by the TRANSACTION SMB for the matching operation.)
 */

#define PIPE_QHandState		0x21
#define PIPE_SetHandState	0x01
#define PIPE_QInfo			0x22
#define PIPE_Peek			0x23
#define PIPE_RawRead		0x11
#define PIPE_RawWrite		0x31
#define PIPE_Wait			0x53
#define PIPE_Call			0x54
#define PIPE_Transact		0x26


/** Values for ir_flags for HM_HANDLEINFO call: */

#define HINFO_GET			0		/* retrieve current buffering info */
#define HINFO_SETALL		1		/* set info (all parms) */
#define HINFO_SETCHARTIME	2		/* set handle buffer timeout */
#define HINFO_SETCHARCOUNT	3		/* set handle max buffer count */

/** Values for ir_flags for HM_ENUMHANDLE call: */
#define ENUMH_GETFILEINFO	0		/* get fileinfo by handle */
#define ENUMH_GETFILENAME	1		/* get filename associated with handle */
#define ENUMH_GETFINDINFO	2		/* get info for resuming */
#define ENUMH_RESUMEFIND	3		/* resume find operation */
#define ENUMH_RESYNCFILEDIR	4		/* resync dir entry info for file */
#ifdef	MAPCACHE
#define ENUMH_MAPCACHEBLOCK	5		/* map a cache block within a file */
#endif

/** Values for ir_options for HM_GETFILENAME call: */
#define GETFILENAME_FLAG_FILEDATA	0x0001	/* 1 == return file specific data    */
											/* otherwise do not return file data */

/** Values for ir_options for the ENUMH_RESYNCFILEDIR call: */
#define RESYNC_INVALIDATEMETACACHE	0x01	/* invalidate meta cache on resync */

/** Values for ir_flags for VFN_FILEATTRIB:				   	*/
/**														   	*/
/**	Note: All functions that modify the volume MUST be odd.	*/
/**       Callers rely on this & test the low order bit.   	*/

#define GET_ATTRIBUTES					0	/* get attributes of file/dir         */
#define SET_ATTRIBUTES					1	/* set attributes of file/dir         */

#define GET_ATTRIB_COMP_FILESIZE		2	/* get compressed size of file        */

#define SET_ATTRIB_MODIFY_DATETIME		3	/* set date last written of file/dir  */ 
#define GET_ATTRIB_MODIFY_DATETIME		4 	/* get date last written of file/dir  */ 
#define SET_ATTRIB_LAST_ACCESS_DATETIME	5 	/* set date last accessed of file/dir */   
#define GET_ATTRIB_LAST_ACCESS_DATETIME	6	/* get date last accessed of file/dir */  
#define SET_ATTRIB_CREATION_DATETIME	7	/* set create date of file/dir        */
#define GET_ATTRIB_CREATION_DATETIME	8	/* get create date of file/dir        */

#define GET_ATTRIB_FIRST_CLUST			9	/* get first cluster of a file        */

/** Values for ir_flags for VFN_FLUSH: */
#define GDF_NORMAL			0x00	/* walk disk, if needed, to get free space */
#define GDF_NO_DISK_HIT		0x01	/* return current "hint", don't walk disk */
#define GDF_R0_EXT_FREESPACE	0x80	/* extended free space call for Fat32 */

/** Values for ir_flags for HM_FILETIMES: */

#define GET_MODIFY_DATETIME		0	/* get last modification date/time */
#define SET_MODIFY_DATETIME		1	/* set last modification date/time */
#define GET_LAST_ACCESS_DATETIME 4	/* get last access date/time */
#define SET_LAST_ACCESS_DATETIME 5	/* set last access date/time */
#define GET_CREATION_DATETIME	6	/* get creation date/time */
#define SET_CREATION_DATETIME	7	/* set creation date/time */

/** Values for ir_flags for HM_SEEK: */

#define FILE_BEGIN	0				/* absolute posn from file beginning */
#define FILE_END	2				/* signed posn from file end */

/** Values for ir_flags for VFN_OPEN: */

#define ACCESS_MODE_MASK	0x0007	/* Mask for access mode bits */
#define ACCESS_READONLY		0x0000	/* open for read-only access */
#define ACCESS_WRITEONLY	0x0001	/* open for write-only access */
#define ACCESS_READWRITE	0x0002	/* open for read and write access */
#define ACCESS_EXECUTE		0x0003	/* open for execute access */

#define SHARE_MODE_MASK		0x0070	/* Mask for share mode bits */
#define SHARE_COMPATIBILITY 0x0000	/* open in compatability mode */
#define SHARE_DENYREADWRITE 0x0010	/* open for exclusive access */
#define SHARE_DENYWRITE		0x0020	/* open allowing read-only access */
#define SHARE_DENYREAD		0x0030	/* open allowing write-only access */
#define SHARE_DENYNONE		0x0040	/* open allowing other processes access */
#define SHARE_FCB			0x0070	/* FCB mode open */

/** Values for ir_options for VFN_OPEN: */

#define ACTION_MASK				0xff	/* Open Actions Mask */
#define ACTION_OPENEXISTING		0x01	/* open an existing file */
#define ACTION_REPLACEEXISTING	0x02	/* open existing file and set length */
#define ACTION_CREATENEW		0x10	/* create a new file, fail if exists */
#define ACTION_OPENALWAYS		0x11	/* open file, create if does not exist */
#define ACTION_CREATEALWAYS		0x12	/* create a new file, even if it exists */

/** Alternate method: bit assignments for the above values: */

#define ACTION_EXISTS_OPEN	0x01	// BIT: If file exists, open file
#define ACTION_TRUNCATE		0x02	// BIT: Truncate file
#define ACTION_NEXISTS_CREATE	0x10	// BIT: If file does not exist, create

//	These mode flags are passed in via ir_options to VFN_OPEN
//
//	For the most part, the OPEN_FLAGS correspond one-to-one with the 
//	extended-open mode flags that DOS defines and passes in BX.  There
//	are exceptions.  The DOS EXTENDED_SIZE_OK, OPEN_RAND_ACCESS_HINT, 
//	OPEN_SEQ_ACCESS_HINT conflict with other "special" flags the IFS 
//	uses or that are used in the ring-0 APIs.  The following 
//	correspondence diagram indicates the conflicts.
//
//								Ext-open flags (passed in BX)
//								哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
//		谀哪哪哪哪哪哪哪哪哪哪

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -