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

📄 dosformt.h

📁 电子盘DEMO板程序
💻 H
📖 第 1 页 / 共 2 页
字号:
  /* First partition entry starts here. We do not map it as a	*/
  /* separate structure because it is not longword aligned	*/
  FLByte	activeFlag;	/* 80h = bootable */
  FLByte        startingHead;
  LEushort	startingCylinderSector;
  FLSByte       type;
  FLByte	endingHead;
  LEushort	endingCylinderSector;
  Unaligned4	startingSectorOfPartition;
  Unaligned4	sectorsInPartition;
  /* Partition entries 2,3 and 4 are structured as the 1st partition */
} Partition;
#else /* FL_NO_PACKED_STRUCTS_SUPPORTED */

#define FL_PARTITION_ACTIVE_FLAG_OFFSET				0	/* size 1 */
#define FL_PARTITION_STARTING_HEAD_OFFSET			1	/* size 1 */
#define FL_PARTITION_STARTING_CYLINDER_SECTOR_OFFSET		2	/* size 2 */
#define FL_PARTITION_TYPE_OFFSET				4	/* size 1 */
#define FL_PARTITION_ENDING_HEAD_OFFSET				5	/* size 1 */
#define FL_PARTITION_ENDING_CYLINDER_SECTOR_OFFSET		6	/* size 2 */
#define FL_PARTITION_STARTING_SECTOR_OF_PARTITION_OFFSET	8	/* size 4 */
#define FL_PARTITION_SECTORS_IN_PARTITION_OFFSET		12	/* size 4 */
#define FL_PARTITION_SIZE					16

typedef FLByte Partition[FL_PARTITION_SIZE];
#endif /* FL_NO_PACKED_STRUCTS_SUPPORTED */


#ifndef FL_NO_PACKED_STRUCTS_SUPPORTED

typedef FL_PACKED_STRUCTURES_BEFORE struct FL_PACKED_STRUCTURES_AFTER {
  FLSByte       reserved1[0x1A6];
  Unaligned4    passwordInfo[3];  /* M-Systems proprietary */
  FLSByte       reserved2[0xC];   /* NT4 or NT5 signature place */

  /* First partition entry starts here. We do not map it as a	*/
  /* separate structure because it is not longword aligned	*/
  Partition     ptEntry[4];
  LEushort      signature;	/* = PARTITION_SIGNATURE */
} PartitionTable;
#else /* FL_NO_PACKED_STRUCTS_SUPPORTED */

#define FL_PARTITION_TABLE_RESERVED1_OFFSET			0	/* size 0x1A6 */
#define FL_PARTITION_TABLE_PASSWORD_INFO_OFFSET			422	/* size 12, unaligned array of 4 */
#define FL_PARTITION_TABLE_RESERVED2_OFFSET			434	/* size 12, array */
#define FL_PARTITION_TABLE_PT_ENTRY_OFFSET			446	/* size 4x16, array of partition entries */
#define FL_PARTITION_TABLE_SIGNATURE_OFFSET			510	/* size 2 */
#define FL_PARTITION_TABLE_SIZE					512

typedef FLByte PartitionTable[FL_PARTITION_TABLE_SIZE];
#endif /* FL_NO_PACKED_STRUCTS_SUPPORTED */

#ifndef FL_NO_PACKED_STRUCTS_SUPPORTED

#ifdef FL_WINDOWS_PACKING
#pragma pack(pop)
#endif /* FL_WINDOWS_PACKING */

#endif /* FL_NO_PACKED_STRUCTS_SUPPORTED */

#define PARTITION_ENTRIES	4


/** Values of irFlags for flOpenFile: */

#define ACCESS_MODE_MASK   3 /* Mask for access mode bits */

/* Individual flags */

#define FL_ACCESS_CREATE      2 /* Create new file      */

/* commands to flGetSetFileInfo (in addition to above) */
#define FL_GET_DATETIME        -1 /* Get date/time                        */
#define FL_GET_ATTRIBUTES      -2 /* Get attributes                       */
#define FL_GET_CREATE_DATETIME -8 /* Get creation date/time               */


#ifndef LFN_NAME_MAX_CHARACTERS
#define LFN_NAME_MAX_CHARACTERS			255
#endif /* LFN_NAME_MAX_CHARACTERS */

#ifndef PATH_SEGMENTS_MAX_NUM
#define PATH_SEGMENTS_MAX_NUM			10
#endif /* PATH_SEGMENTS_MAX_NUM */

#ifndef PATH_CHARACTERS_MAX_NUM
#define PATH_CHARACTERS_MAX_NUM			LFN_NAME_MAX_CHARACTERS
#endif  /* PATH_CHARACTERS_MAX_NUM */

#ifndef FL_MAX_TREE_LEVELS
#define FL_MAX_TREE_LEVELS	  ( PATH_CHARACTERS_MAX_NUM / 2 + 1 )
#endif  /* FL_MAX_TREE_LEVELS */

#ifndef FL_ROOT_DIR_ENTRIES
#define FL_ROOT_DIR_ENTRIES(socket,partition) 512
#endif /* FL_ROOT_DIR_ENTRIES */

#define UNICODE_CHAR_PER_LFN_ENTRY		13

#define SHORT_NAME_MAX_LENGTH	        8
#define EXTENSION_MAX_LENGTH	        3
#define NAME_8_3_MAX_LENGTH	            12		/* "tttttttt.xxx" */

/* Directory entry attribute bits for internal use */
#define ATTR_SUREFS_GEN_ATTENTION_FLAG	0x40
#define ATTR_SUREFS_REN_ATTENTION_FLAG	0x80
#define ATTR_SUREFS_ATTENTION_FLAG_MASK	(ATTR_SUREFS_GEN_ATTENTION_FLAG |	\
										ATTR_SUREFS_REN_ATTENTION_FLAG)

#define ATTR_MASK	((unsigned char)(FL_ATTR_READ_ONLY | FL_ATTR_HIDDEN | FL_ATTR_SYSTEM | \
                                     FL_ATTR_VOL_LABEL | FL_ATTR_DIRECTORY | FL_ATTR_ARCHIVE))
#define LFN_ATTRIBUTES	((unsigned char)(FL_ATTR_READ_ONLY | FL_ATTR_HIDDEN | \
                                         FL_ATTR_SYSTEM | FL_ATTR_VOL_LABEL))

#define DIRECTORY_ENTRY_SIZE	         32

#define DIRECTORY_ENTRIES_PER_SECTOR	 (FL_SECTOR_SIZE / DIRECTORY_ENTRY_SIZE)
#define MAX_ROOT_DIR_SECTORS		((0x10000/DIRECTORY_ENTRIES_PER_SECTOR) - 1)

#define SET_GLOBAL_ATTENTION_FLAG        0
#define RESET_GLOBAL_ATTENTION_FLAG	     0xffff
#define GLOBAL_ATT_FLAG_FAT_ENTRY        1

#define	NEVER_USED_DIR_ENTRY             0

#ifndef FL_NO_PACKED_STRUCTS_SUPPORTED
#define	DELETED_DIR_ENTRY                ((FLSByte) 0xe5)
#else /*FL_NO_PACKED_STRUCTS_SUPPORTED*/
#define	DELETED_DIR_ENTRY                ((FLByte) 0xe5)
#endif /*FL_NO_PACKED_STRUCTS_SUPPORTED*/

/* FAT definitions */

#define	FAT_FREE                         0
#define	FAT_BAD_CLUSTER	                 0xfff7
#define	FAT_LAST_CLUSTER                 0xffff  /* actually any of 0xfff8-0xffff */

/* Partition table definitions */

#define PARTITION_SIGNATURE	             0xaa55

#define CYLINDER_SECTOR(cylinder,sector) ((sector) + ((cylinder & 0xff) << 8) + ((cylinder & 0x300) >> 2))


#ifndef FL_MAX_PARTITION_DEPTH
#define FL_MAX_PARTITION_DEPTH           0x08
#endif /* FL_MAX_PARTITION_DEPTH */

#define LFN_SHORT_NAME			0		/* for 8.3 short file name	*/
#define LFN_LONG_NAME			1		/* for long file name		*/
#define LFN_INVALID_SET			2		/* found invalid file name characters				*/
#define SFN_LOWERCASE_NAME8		0x08		/* these 2 bit-flags are to support */
#define SFN_LOWERCASE_EXT3		0x10		/* NT VFAT lowercase bits */

/*-------------------------------------------------------------------------------------------
*				F L P a t h S e g m e n t
* The structure is used when analyzing path string.
* Parameters:	name - address of first character of the path segment (unicode null terminated
*						string. For example, for first segment of /first/second/third.ext it 
*						will point on "first".
*				length - number of characters of the path segment
*				buffSize - in case of retrieving file name this field contains size of supplied buffer
*										in characters.
*				get - if TRUE, this structure is used to retrieve found file name 
*						(getFirstFileName()). If FALSE, this structure contains file name to 
*						be opened/created/found	(findFileName()).
*------------------------------------------------------------------------------------------*/
typedef struct {
	FLWchar FAR1	*name;
	short           length;
	short           buffSize;
	FLBoolean       get;
	FLBoolean       reserved;
} FLPathSegment;

/*--------------------------------------------------------------------------
*				F L L f n S e a r c h
* The FLLfnSearch structer is used when searching directory by specified	
* file name.																
* Parameters:	
*		neverUsed - indicates that found at least one directory entry in sector
*					that was never used.
*		verifiedChars - Number of characters that successfully compared	with	
*						file name or found in free entries in previous sector	
*		checksum - LFN checksum found in previous sector							
*		lastNum - LFN order number of last LFN entry found in previous sector		
*		idx - directory entry index of found entry								
*		status - LFN_SHORT_NAME, LFN_LONG_NAME, LFN_UPPERCASE_FOR_SHORT,
*					LFN_INVALID_SET
*---------------------------------------------------------------------------*/
typedef struct {
	unsigned	verifiedChars;		
	unsigned	lastNum;
	unsigned	idx;
	int		status;
	unsigned char	checksum;
	FLBoolean	neverUsed;
} FLLfnSearch;



#endif /* DOSFORMT_H */

⌨️ 快捷键说明

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