📄 fs_type.h
字号:
UINT MaxDirEntries;
UINT BytesPerSector;
UINT SectorsPerCluster;
UINT TotalClusters;
UINT BadClusters;
UINT FreeClusters;
UINT Files;
UINT FileChains;
UINT FreeChains;
UINT LargestFreeChain;
}FS_DiskInfo;
//For Driver START
typedef ONE_BYTE_ALIGN_ADS struct
{
BYTE BootIndicator,
StartHead,
StartSector,
StartTrack,
OSType,
EndHead,
EndSector,
EndTrack;
UINT RelativeSector,
Sectors;
} FS_PartitionRecord;
typedef ONE_BYTE_ALIGN_ADS struct
{
BYTE BootCode[512-4*sizeof(FS_PartitionRecord)-sizeof(WORD)];
FS_PartitionRecord PTable[4];
WORD Signature;
} FS_MasterBootRecord;
typedef ONE_BYTE_ALIGN_ADS struct
{
BYTE PhysicalDiskNumber;
BYTE CurrentHead;
BYTE Signature;
UINT SerialNumber;
BYTE Label[11];
char SystemID[8];
}FS_ExtendedBIOSParameter;
typedef ONE_BYTE_ALIGN_ADS struct
{
char OEMName[8];
WORD BytesPerSector;
BYTE SectorsPerCluster;
WORD ReservedSectors;
BYTE NumberOfFATs;
WORD DirEntries;
WORD SectorsOnDisk;
BYTE MediaDescriptor;
WORD SectorsPerFAT;
WORD SectorsPerTrack;
WORD NumberOfHeads;
UINT NumberOfHiddenSectors;
UINT TotalSectors;
ONE_BYTE_ALIGN_ADS union
{
ONE_BYTE_ALIGN_ADS struct
{
FS_ExtendedBIOSParameter BPB;
} _16;
ONE_BYTE_ALIGN_ADS struct
{
UINT SectorsPerFAT;
WORD Flags;
WORD Version;
UINT RootDirCluster;
WORD FSInfoSector;
WORD BackupBootSector;
BYTE Reserved[12];
FS_ExtendedBIOSParameter BPB;
} _32;
} E;
}FS_BIOSParameter;
typedef ONE_BYTE_ALIGN_ADS struct
{
BYTE NearJump[3];
FS_BIOSParameter BP;
BYTE BootCode[512-3-sizeof(FS_BIOSParameter)-sizeof(WORD)];
WORD Signature;
}FS_BootRecord;
typedef struct fsdriver
{
int (* MountDevice) (void * DriveData, int DeviceNumber, int DeviceType, UINT Flags);
int (* ShutDown) (void * DriveData);
int (* ReadSectors) (void * DriveData, UINT Sector, UINT Sectors, void * Buffer);
int (* WriteSectors) (void * DriveData, UINT Sector, UINT Sectors, void * Buffer);
int (* MediaChanged) (void * DriveData);
int (* DiscardSectors) (void * DriveData, UINT Sector, UINT Sectors);
int (* GetDiskGeometry)(void * DriveData, FS_PartitionRecord * DiskGeometry, BYTE * MediaDescriptor);
int (* LowLevelFormat) (void * DriveData, const char * DeviceName, FS_FormatCallback Progress, UINT Flags);
int (* NonBlockWriteSectors) (void * DriveData, UINT Sector, UINT Sectors, void * Buffer);
int (* RecoverableWriteSectors)(void * DriveData, UINT Sector, UINT Sectors, void * Buffer);
int (* ResumeSectorStates) (void * DriveData);
int (* HighLevelFormat)(void * DriveData);
int (* FlushData) (void * DriveData);
int (* MessageAck) (void * DriveData, int AckType);
int (* CopySectors) (void * DriveData, UINT SrcSector, UINT DstSector, UINT Sectors);
int (* OTPAccess) (void * DriveData, int type, UINT Offset, void * BufferPtr, UINT Length);
int (* OTPQueryLength) (void * DriveData, UINT *Length);
}FS_Driver;
#ifndef MMI_ON_WIN32
typedef struct _fsMutex
{
kal_semid mt_sem;
kal_taskid mt_sem_owner;
kal_uint32 mt_lock_count;
int DeviceNum_1;
int DeviceNum_2;
}FS_Mutex;
#else
typedef UINT FS_Mutex;
#endif /* MMI_ON_WIN32 */
struct _fsDrive;
struct _fsBuffer;
typedef struct _fsDeviceData
{
FS_Mutex * Lock;
struct _fsDrive * FirstDrive;
BYTE MediaPresent;
BYTE MediaRemovedReported;
BYTE Reserved;
BYTE MountState;
int SectorSize;
FS_PartitionRecord Geometry;
UINT SectorShift;
UINT AccessCount;
struct _fsBuffer * B;
struct _fsBuffer * AltBuffer;
int ErrorCondition;
int PhysicalDiskIndex;
char FriendlyName[7];
BYTE MediaDescriptor;
}FS_DeviceData;
typedef struct _fsDevice
{
int DeviceType;
int DeviceNumber;
UINT DeviceFlags;
FS_Driver * Driver;
void * DriverData;
FS_DeviceData DevData;
}FS_Device;
typedef struct _fsDirEntry{
UINT DirCluster;
FS_FileLocationHint LongPos;
FS_FileLocationHint ShortPos;
FS_DOSDirEntry Dir;
}FS_DirEntry;
typedef struct _fsDrive
{
struct _fsDevice * Dev;
struct _fsDrive * NextDrive;
int MountState;
FS_PartitionRecord Geometry;
UINT Clusters;
UINT SectorsPerCluster;
UINT ClusterSize;
UINT ClusterShift;
UINT SPerCShift;
UINT FATType;
UINT FATCount;
UINT SectorsPerFAT;
UINT ClusterWatermark;
UINT FreeClusterCount;
UINT InfoSector;
UINT SerialNumber;
UINT FirstSector;
UINT FirstFATSector;
UINT FirstDirSector;
UINT FirstDataSector;
UINT RootDirEntries;
FS_DirEntry CurrDirEntry;
char CurrDir[FS_MAX_PATH];
#ifdef __FS_QM_SUPPORT__
BYTE QuotaMgt;
BYTE Reserved[3];
#endif
}FS_Drive;
typedef struct _fsBuffer
{
struct _fsBuffer * Next;
struct _fsBuffer * Prev;
FS_Device * Dev;
BYTE * Data;
UINT Sector;
struct _fsDrive * FATSectorInfo;
UINT Flags;
UINT FirstDirtyTime,
LastDirtyTime;
int Num;
BYTE recoverable_flag;
#define FS_RECOVERABLE_WRITE 1
#define FS_NORMAL_WRITE 0
}FS_Buffer;
//For Driver END
typedef struct
{
WCHAR Pattern[8];
}FS_Pattern_Struct;
typedef struct __fsQuotaStruct
{
BYTE Path[FS_MAX_PATH/2];
UINT Priority;
UINT Qmin;
UINT Qmax;
UINT Uint;
}FS_QuotaStruct;
typedef struct __fsInternQStruct
{
UINT Qmin;
UINT Qmax;
UINT Qnow;
}FS_InternQStruct;
typedef struct __fsFile
{
FS_Drive * Drive;
FS_Device * Dev;
int SpecialKind;
UINT Unique;
UINT Flags;
FS_DirEntry DirEntry;
UINT FilePointer;
UINT LastCluster;
UINT Cluster;
UINT Offset;
char FullName[FS_MAX_PATH];
void * Task;
UINT HintNum;
FS_FileLocationHint * Seek_Hint;
BYTE Lock;
BYTE Valid;
BYTE Reserved[sizeof(int) - 2*sizeof(BYTE)];
}FS_File;
typedef struct __fsTables
{
FS_Drive * DriveTable;
FS_File * FileTable;
FS_Buffer * BufferTable;
BYTE * BufferData;
}FS_Tables;
typedef struct __fsExceptionData
{
UINT * Next;
int Data[11];
int XValue;
int State;
int IsHandled;
}FS_ExceptionData;
/*------------------------- ENUM TYPE -----------------------*/
//For Driver only
typedef enum
{
FS_DEVICE_UNKNOWN,
FS_DEVICE_FLOPPY,
FS_DEVICE_FDISK
}FS_DRIVER_DEVICE_ENUM;
//For Driver->MessageAck only
typedef enum
{
FS_DEV_IN_ACK_ENUM = 1,
FS_DEV_SLOT_ACK_ENUM,
FS_DEV_OUT_ACK_ENUM
}FS_ACK_TYPE_ENUM;
typedef enum
{
FS_NO_WAIT,
FS_INFINITE
}FS_TIMEOUT_ENUM;
//FS_Seek Parameter
typedef enum
{
FS_FILE_BEGIN,
FS_FILE_CURRENT,
FS_FILE_END
}FS_SEEK_POS_ENUM;
//FS_GeneralFormat Callback Return Value
typedef enum
{
FS_FMT_PGS_DONE = -1,
FS_FMT_PGS_FAIL,
FS_FMT_PGS_LOW_FMT,
FS_FMT_PGS_HIGH_FMT
}FS_FORMAT_PGS_ENUM;
//FS_Move Callback Return Value
typedef enum
{
FS_MOVE_PGS_FAIL = -1,
FS_MOVE_PGS_PREPARE,
FS_MOVE_PGS_START,
FS_MOVE_PGS_ING,
FS_MOVE_PGS_DONE
}FS_MOVE_PGS_ENUM;
//Find Series Return Value
typedef enum
{
FS_NOT_MATCH,
FS_LFN_MATCH,
FS_SFN_MATCH
}FS_FIND_ENUM;
//FS_GetDevType Return Value
//FS_GetDevStatus Paramter, Cannot overlap with 'A'~'Z' 0x41~0x5f
typedef enum
{
FS_DEVICE_TYPE_NOR = 1,
FS_DEVICE_TYPE_NAND,
FS_DEVICE_TYPE_CARD,
FS_DEVICE_TYPE_EXTERNAL,
FS_DEVICE_TYPE_MAX_VALUE
}FS_DEVICE_TYPE_ENUM;
//FS_XFindStart, FS_FindFirstN, FS_FindNextN Parameter
typedef enum
{
FS_FIND_DEFAULT,
FS_FIND_LFN_TRUNC
}FS_GET_NAME_ENUM;
//Quota management
typedef enum
{
FS_QP_HIG_ENUM,
FS_QP_MID_ENUM,
FS_QP_LOW_ENUM,
FS_QP_DEL_ENUM
}FS_QP_ENUM;
//FS_GetDevStatus Parameter
typedef enum
{
FS_MOUNT_STATE_ENUM,
FS_FEATURE_STATE_ENUM,
FS_EXPORT_STATE_ENUM
}FS_GET_DEV_STATUS_ENUM;
//FS_LockFAT Parameter
typedef enum
{
FS_LOCK_USB_ENUM,
FS_UNLOCK_USB_ENUM,
FS_LOCK_BLOCK_ENUM,
FS_LOCK_NONBLOCK_ENUM,
FS_EXPORT_ENUM,
FS_REMOUNT_ENUM
}FS_LOCK_TYPE_ENUM;
//FS_CountUsedFH Parameter
typedef enum
{
FS_FH_COUNT_CURRENT_TASK = 0,
FS_FH_COUNT_AVAILABLE,
FS_FH_COUNT_USED,
FS_FH_COUNT_CONFIGURED
}FS_COUNT_USED_FH_ENUM;
//FDM OTPAccess Parameter
typedef enum
{
FS_OTP_READ = 1,
FS_OTP_WRITE,
FS_OTP_LOCK
}FS_OTPACCESS_TYPE_ENUM;
#endif //_FS_TYPE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -