mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
2.1 KiB
116 lines
2.1 KiB
|
|
#include <mytypes.h>
|
|
#include <partio.h>
|
|
#include <msgfile.h>
|
|
#include <misclib.h>
|
|
#include <partimag.h>
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <dos.h>
|
|
|
|
|
|
extern FPVOID IoBuffer;
|
|
|
|
extern char *textPartOpenError;
|
|
extern char *textFileWriteError;
|
|
extern char *textFileReadFailed;
|
|
extern char *textReadFailedAtSector;
|
|
extern char *textOOM;
|
|
extern char *textScanningFat;
|
|
extern char *textNtfsUnsupportedConfig;
|
|
extern char *textNtfsCorrupt;
|
|
extern char *textInitNtfsDataStruct;
|
|
extern char *textNtfsBuildingBitmap;
|
|
extern char *textProcessingNtfsBitmap;
|
|
extern char *textUnsupportedFs;
|
|
|
|
|
|
typedef enum {
|
|
FilesystemFat,
|
|
FilesystemNtfs,
|
|
FilesystemOther
|
|
} FilesystemType;
|
|
|
|
|
|
BOOL
|
|
BuildClusterBitmap(
|
|
IN FilesystemType FsType,
|
|
IN HPARTITION PartitionHandle,
|
|
IN UINT FileHandle,
|
|
IN PARTITION_IMAGE *PartitionImage
|
|
);
|
|
|
|
VOID
|
|
InitClusterBuffer(
|
|
IN FPBYTE _512ByteBuffer,
|
|
IN UINT FileHandle
|
|
);
|
|
|
|
BOOL
|
|
MarkClusterUsed(
|
|
IN ULONG Cluster
|
|
);
|
|
|
|
BOOL
|
|
FlushClusterBuffer(
|
|
VOID
|
|
);
|
|
|
|
BOOL
|
|
InitClusterMap(
|
|
OUT FPBYTE _512ByteBuffer,
|
|
IN UINT FileHandle,
|
|
IN ULONG LastUsedCluster
|
|
);
|
|
|
|
BOOL
|
|
GetNextClusterRun(
|
|
OUT ULONG *StartCluster,
|
|
OUT ULONG *ClusterCount
|
|
);
|
|
|
|
|
|
|
|
BOOL
|
|
FatIsFat(
|
|
IN HPARTITION PartitionHandle
|
|
);
|
|
|
|
BOOL
|
|
FatInitializeVolumeData(
|
|
IN HPARTITION PartitionHandle,
|
|
OUT ULONG *TotalSectorCount,
|
|
OUT ULONG *NonClusterSectors,
|
|
OUT ULONG *ClusterCount,
|
|
OUT BYTE *SectorsPerCluster
|
|
);
|
|
|
|
BOOL
|
|
FatBuildClusterBitmap(
|
|
IN HPARTITION PartitionHandle,
|
|
IN UINT FileHandle,
|
|
IN OUT PARTITION_IMAGE *PartitionImage
|
|
);
|
|
|
|
|
|
BOOL
|
|
NtfsIsNtfs(
|
|
IN HPARTITION PartitionHandle
|
|
);
|
|
|
|
BOOL
|
|
NtfsInitializeVolumeData(
|
|
IN HPARTITION PartitionHandle,
|
|
OUT ULONG *TotalSectorCount,
|
|
OUT ULONG *NonClusterSectors,
|
|
OUT ULONG *ClusterCount,
|
|
OUT BYTE *SectorsPerCluster
|
|
);
|
|
|
|
BOOL
|
|
NtfsBuildClusterBitmap(
|
|
IN HPARTITION PartitionHandle,
|
|
IN UINT FileHandle,
|
|
IN OUT PARTITION_IMAGE *PartitionImage
|
|
);
|