本帖最后由 银砾石 于 2010.10.3 17:19 编辑
http://bbs.kafan.cn/forum.php?mo ... DYwOTcyNDh8MjcxNzI5
console,fs.dll应用程序,包含源程序,里面有导出函数说明等
#define maxsize 255
#define commaxsize 4096
#define larmaxsize 65535
#define FS_NotExists 0x01
#define FS_NotDir 0x02
#define FS_Empty 0x03
#define FS_NotReady 0x04
#define FS_NotReg 0x05
#define FS_NotSupported 0x06
#define FS_DataChanged 0x07
#define FileSystem_FAT16 0x01
#define FileSystem_FAT32 0x02
#define FileSystem_NTFS 0x03
#define FileSystem_EXFAT 0x04
#define FileSystem_REG 0x1001
#define FileSystem_PARTITION 0x2001
#define REG_KEY 101
class FS_TIME{
public:
WORD year;
BYTE month;
BYTE day;
BYTE zero;
BYTE hour;
BYTE minute;
BYTE second;
};
typedef class FAT {
public:
WORD ErrorCode;
WORD fs;
WORD fstype;
BYTE filetype;
WCHAR shortname[13];
WCHAR longname[maxsize];
LARGE_INTEGER filesize;
LARGE_INTEGER base;
LARGE_INTEGER r_base;
DWORD offset;
DWORD clust;
FS_TIME ctime;
FS_TIME mtime;
FAT * head;
FAT * next;
FAT * pre;
}FS_FAT,*pFS_FAT;
typedef class NTFS {
public:
WORD ErrorCode; //错误信息
WORD fs; //FS标记
WORD fstype;
BYTE filetype;//文件类型--目录、文件
WCHAR shortname[13];//短文件名
WCHAR longname[maxsize];
// BYTE padding1;
LARGE_INTEGER filesize;//文件大小
DWORD mftnum;//MFT记录号
// BYTE padding2;
FILETIME ctime;//创建日期
FILETIME mtime;//修改日期
FILETIME mfttime;//MFT修改日期
NTFS * head;
NTFS * next;
NTFS * pre;
BYTE hardlinkname[commaxsize];
BYTE symboliclinkname[commaxsize];
BYTE streamname[commaxsize];
}FS_NTFS,*pFS_NTFS;
typedef class REG{
public:
WORD ErrorCode;
WORD fs;
WORD fstype;
WORD regtype;
DWORD base;
DWORD r_base;
WCHAR name[maxsize];
BYTE data[larmaxsize];
DWORD datalen;
FILETIME mtime;
REG * head;
REG * next;
REG * pre;
}FS_REG,*pFS_REG;
class Partition
{
public:
WORD ErrorCode;
WORD fs;
WORD fstype; //节点类型,期待值FileSystem_PARTITION
LARGE_INTEGER StartPos; //分区开始位置
LARGE_INTEGER Size; //分区大小
BYTE Active; //是否活动分区
BYTE Flag; //分区类型,参考MBR定义
Partition * head;//第一分区
Partition * next;//下一分区
Partition *pre;//上一分区
};
typedef BYTE * (* FSREAD)(LARGE_INTEGER base,DWORD size) ;
typedef bool (* FSWRITE)(LARGE_INTEGER base,DWORD size,BYTE * mem) ;
typedef USHORT (* FSCLEAR)(LARGE_INTEGER total,LARGE_INTEGER current,LARGE_INTEGER left) ;
typedef bool ( * FS_PRE_READ)(FSREAD FSIO_READ);
typedef bool ( * FS_PRE_WRITE)(FSWRITE FSIO_WRITE);
typedef void * (* FS_ENUMFILE)(const wchar_t * path,void * node) ;
typedef int (* FS_COPYFILE)(const wchar_t * path,const wchar_t * Stream);
typedef BYTE * (* FS_PRE_REG)(const wchar_t * path,const wchar_t * Stream);
typedef bool (* FS_REGFIRE)(const wchar_t * regcode);
typedef void * (* FS_ENUMREG)(const wchar_t * RegPath,BYTE * key,void * node);
typedef int (* FS_REL_REG)(BYTE * key);
typedef int (* FS_DELETEFILE)(const wchar_t * path,const wchar_t * Stream,BYTE Mode);
typedef int (* FS_GETERROR)();
typedef Partition * (* FS_ENUMPARTITION)(Partition * node);
typedef bool (* FS_DELETENODE)(void * node);//删除链表
typedef int (*FS_DELETEREG)(const wchar_t * RegPath,const wchar_t * DeleteReg,const wchar_t * FilePath,BYTE * key);//删除注册表
typedef int (* FS_RENAMEFILE)(const wchar_t * path,const wchar_t * NewName);//重命名文件
typedef USHORT (*FS_CLEAR)(FSCLEAR FSIO_CLEAR);//清除剩余空间函数
|