struct DefragDataStruct { int Phase; /* The current Phase (1...3). */ int Zone; /* The current Zone (0..2) for Phase 3. */ int *Running; /* If not RUNNING then stop defragging. */ int *RedrawScreen; /* If YES then redraw complete screen. */ WCHAR *Path; /* Example: "c:\t1\" */ WCHAR *MountPoint; /* Example: "c:" */ WCHAR *MountPointSlash; /* Example: "c:\" */ WCHAR VolumeName[51]; /* Example: "\\?\Volume{08439462-3004-11da-bbca-806d6172696f}" */ HANDLE VolumeHandle; /* Handle to the volume. */ BOOL IsNtfs; /* True if it's an NTFS volume. */ double FreeSpace; /* Percentage of total disk size 0..100. */ /* Tree in memory with information about all the files. */ struct ItemStruct *ItemTree; int BalanceCount; WCHAR **Excludes; /* Array with exclude masks. */ WCHAR **SpaceHogs; /* Array with SpaceHog masks. */ ULONG64 Zones[3]; /* Begin of Directory, Regular, and SpaceHog zones. */ /* List of clusters reserved for the MFT. */ struct ExcludesStruct MftExcludes[3]; /* Counters filled before Phase 1. */ ULONG64 TotalClusters; /* Size of the volume, in clusters. */ ULONG64 BytesPerCluster; /* Number of bytes per cluster. */ /* Counters updated before/after every Phase. */ ULONG64 CountFreeClusters; /* Number of free clusters. */ ULONG64 CountGaps; /* Number of gaps. */ ULONG64 BiggestGap; /* Size of biggest gap, in clusters. */ ULONG64 CountGapsLess16; /* Number of gaps smaller than 16 clusters. */ ULONG64 CountClustersLess16; /* Number of clusters in gaps that are smaller than 16 clusters. */ /* Counters updated after every Phase, but not before Phase 1 (analyze). */ ULONG64 CountDirectories; /* Number of analysed subdirectories. */ ULONG64 CountAllFiles; /* Number of analysed files. */ ULONG64 CountFragmentedItems; /* Number of fragmented files. */ ULONG64 CountAllBytes; /* Bytes in analysed files. */ ULONG64 CountFragmentedBytes; /* Bytes in fragmented files. */ ULONG64 CountAllClusters; /* Clusters in analysed files. */ ULONG64 CountFragmentedClusters; /* Clusters in fragmented files. */ /* Counters used to calculate the percentage of work done. */ ULONG64 PhaseTodo; /* Number of items to do in this Phase. */ ULONG64 PhaseDone; /* Number of items already done in this Phase. */ /* Variables used to throttle the speed. */ int Speed; /* Speed as a percentage 1..100. */ LONG64 StartTime; LONG64 RunningTime; LONG64 LastCheckpoint; /* The callback subroutines. */ void (__cdecl *ShowStatus)(struct DefragDataStruct *Data); void (__cdecl *ShowMove)(struct ItemStruct *Item, ULONG64 Clusters, ULONG64 FromLcn, ULONG64 ToLcn, ULONG64 FromVcn); void (__cdecl *ShowAnalyze)(struct DefragDataStruct *Data, struct ItemStruct *Item); void (__cdecl *ShowDebug)(int Level, struct ItemStruct *Item, char *Message, ...); void (__cdecl *DrawCluster)(struct DefragDataStruct *Data, ULONG64 ClusterStart, ULONG64 ClusterEnd, int Color); void (__cdecl *ClearScreen)(char *Format, ...); /* The array with error messages. */ char **DebugMsg; };