YourDefrag  SVN
Defines | Functions | Variables
dll/src/JkDefragLib.cpp File Reference
#include <windows.h>
#include <stdio.h>
#include <sys/timeb.h>
#include "JkDefragLib.h"
#include "ScanNtfs.h"
#include "ScanFat.h"
#include "x64glue.h"

Defines

#define _WIN32_WINNT   0x0500

Functions

char * stristr (char *Haystack, char *Needle)
WCHAR * stristrW (WCHAR *Haystack, WCHAR *Needle)
void SystemErrorStr (DWORD ErrorCode, WCHAR *Out, size_t Width)
WCHAR LowerCase (WCHAR c)
void ShowHex (struct DefragDataStruct *Data, BYTE *Buffer, ULONG64 Count)
int MatchMask (WCHAR *String, WCHAR *Mask)
WCHAR ** AddArrayString (WCHAR **Array, WCHAR *NewString)
void AppendToShortPath (struct ItemStruct *Item, WCHAR *Path, size_t Length)
WCHAR * GetShortPath (struct DefragDataStruct *Data, struct ItemStruct *Item)
void AppendToLongPath (struct ItemStruct *Item, WCHAR *Path, size_t Length)
WCHAR * GetLongPath (struct DefragDataStruct *Data, struct ItemStruct *Item)
void SlowDown (struct DefragDataStruct *Data)
ULONG64 GetItemLcn (struct ItemStruct *Item)
struct ItemStructTreeSmallest (struct ItemStruct *Top)
struct ItemStructTreeBiggest (struct ItemStruct *Top)
struct ItemStructTreeFirst (struct ItemStruct *Top, int Direction)
struct ItemStructTreePrev (struct ItemStruct *Here)
struct ItemStructTreeNext (struct ItemStruct *Here)
struct ItemStructTreeNextPrev (struct ItemStruct *Here, int Direction)
void TreeInsert (struct DefragDataStruct *Data, struct ItemStruct *New)
void TreeDetach (struct DefragDataStruct *Data, struct ItemStruct *Item)
void DeleteItemTree (struct ItemStruct *Top)
ULONG64 FindFragmentBegin (struct ItemStruct *Item, ULONG64 Lcn)
struct ItemStructFindItemAtLcn (struct DefragDataStruct *Data, ULONG64 Lcn)
HANDLE OpenItemHandle (struct DefragDataStruct *Data, struct ItemStruct *Item)
int GetFragments (struct DefragDataStruct *Data, struct ItemStruct *Item, HANDLE FileHandle)
int FragmentCount (struct ItemStruct *Item)
int IsFragmented (struct ItemStruct *Item, ULONG64 Offset, ULONG64 Size)
void ColorizeItem (struct DefragDataStruct *Data, struct ItemStruct *Item, ULONG64 BusyOffset, ULONG64 BusySize, int UnDraw)
void ShowDiskmap (struct DefragDataStruct *Data)
int FindGap (struct DefragDataStruct *Data, ULONG64 MinimumLcn, ULONG64 MaximumLcn, ULONG64 MinimumSize, int MustFit, int FindHighestGap, ULONG64 *BeginLcn, ULONG64 *EndLcn, BOOL IgnoreMftExcludes)
void CalculateZones (struct DefragDataStruct *Data)
DWORD MoveItem1 (struct DefragDataStruct *Data, HANDLE FileHandle, struct ItemStruct *Item, ULONG64 NewLcn, ULONG64 Offset, ULONG64 Size)
DWORD MoveItem2 (struct DefragDataStruct *Data, HANDLE FileHandle, struct ItemStruct *Item, ULONG64 NewLcn, ULONG64 Offset, ULONG64 Size)
int MoveItem3 (struct DefragDataStruct *Data, struct ItemStruct *Item, HANDLE FileHandle, ULONG64 NewLcn, ULONG64 Offset, ULONG64 Size, int Strategy)
int MoveItem4 (struct DefragDataStruct *Data, struct ItemStruct *Item, HANDLE FileHandle, ULONG64 NewLcn, ULONG64 Offset, ULONG64 Size, int Direction)
int MoveItem (struct DefragDataStruct *Data, struct ItemStruct *Item, ULONG64 NewLcn, ULONG64 Offset, ULONG64 Size, int Direction)
struct ItemStructFindHighestItem (struct DefragDataStruct *Data, ULONG64 ClusterStart, ULONG64 ClusterEnd, int Direction, int Zone)
struct ItemStructFindBestItem (struct DefragDataStruct *Data, ULONG64 ClusterStart, ULONG64 ClusterEnd, int Direction, int Zone)
void CallShowStatus (struct DefragDataStruct *Data, int Phase, int Zone)
void CompareItems (struct DefragDataStruct *Data, struct ItemStruct *Item)
void ScanDir (struct DefragDataStruct *Data, WCHAR *Mask, struct ItemStruct *ParentDirectory)
void AnalyzeVolume (struct DefragDataStruct *Data)
void Fixup (struct DefragDataStruct *Data)
void Defragment (struct DefragDataStruct *Data)
void ForcedFill (struct DefragDataStruct *Data)
void Vacate (struct DefragDataStruct *Data, ULONG64 Lcn, ULONG64 Clusters, BOOL IgnoreMftExcludes)
int CompareItems (struct ItemStruct *Item1, struct ItemStruct *Item2, int SortField)
void OptimizeSort (struct DefragDataStruct *Data, int SortField)
void MoveMftToBeginOfDisk (struct DefragDataStruct *Data)
void OptimizeVolume (struct DefragDataStruct *Data)
void OptimizeUp (struct DefragDataStruct *Data)
void DefragOnePath (struct DefragDataStruct *Data, WCHAR *Path, int Mode)
void DefragMountpoints (struct DefragDataStruct *Data, WCHAR *MountPoint, int Mode)
void __cdecl DefaultClearScreen (WCHAR *Format,...)
void __cdecl DefaultShowMove (struct ItemStruct *Item, ULONG64 Clusters, ULONG64 FromLcn, ULONG64 ToLcn, ULONG64 FromVcn)
void __cdecl DefaultShowAnalyze (struct DefragDataStruct *Data, struct ItemStruct *Item)
void __cdecl DefaultShowDebug (int Level, struct ItemStruct *Item, WCHAR *Format,...)
void __cdecl DefaultDrawCluster (struct DefragDataStruct *Data, ULONG64 ClusterStart, ULONG64 ClusterEnd, int Color)
void __cdecl DefaultShowStatus (struct DefragDataStruct *Data)
void RunJkDefrag (WCHAR *Path, int Mode, int Speed, double FreeSpace, WCHAR **Excludes, WCHAR **SpaceHogs, int *Running, int *RedrawScreen, 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, WCHAR *Message,...), void(__cdecl *DrawCluster)(struct DefragDataStruct *Data, ULONG64 ClusterStart, ULONG64 ClusterEnd, int Color), void(__cdecl *ClearScreen)(WCHAR *Format,...), WCHAR **DebugMsg)
void StopJkDefrag (int *Running, int TimeOut)

Variables

WCHAR * DefaultDebugMsg []

Define Documentation

#define _WIN32_WINNT   0x0500

Function Documentation

WCHAR** AddArrayString ( WCHAR **  Array,
WCHAR *  NewString 
)
void AnalyzeVolume ( struct DefragDataStruct Data)
void AppendToLongPath ( struct ItemStruct Item,
WCHAR *  Path,
size_t  Length 
)
void AppendToShortPath ( struct ItemStruct Item,
WCHAR *  Path,
size_t  Length 
)
void CalculateZones ( struct DefragDataStruct Data)
void CallShowStatus ( struct DefragDataStruct Data,
int  Phase,
int  Zone 
)
void ColorizeItem ( struct DefragDataStruct Data,
struct ItemStruct Item,
ULONG64  BusyOffset,
ULONG64  BusySize,
int  UnDraw 
)
void CompareItems ( struct DefragDataStruct Data,
struct ItemStruct Item 
)
int CompareItems ( struct ItemStruct Item1,
struct ItemStruct Item2,
int  SortField 
)
void __cdecl DefaultClearScreen ( WCHAR *  Format,
  ... 
)
void __cdecl DefaultDrawCluster ( struct DefragDataStruct Data,
ULONG64  ClusterStart,
ULONG64  ClusterEnd,
int  Color 
)
void __cdecl DefaultShowAnalyze ( struct DefragDataStruct Data,
struct ItemStruct Item 
)
void __cdecl DefaultShowDebug ( int  Level,
struct ItemStruct Item,
WCHAR *  Format,
  ... 
)
void __cdecl DefaultShowMove ( struct ItemStruct Item,
ULONG64  Clusters,
ULONG64  FromLcn,
ULONG64  ToLcn,
ULONG64  FromVcn 
)
void __cdecl DefaultShowStatus ( struct DefragDataStruct Data)
void Defragment ( struct DefragDataStruct Data)
void DefragMountpoints ( struct DefragDataStruct Data,
WCHAR *  MountPoint,
int  Mode 
)
void DefragOnePath ( struct DefragDataStruct Data,
WCHAR *  Path,
int  Mode 
)
void DeleteItemTree ( struct ItemStruct Top)
struct ItemStruct* FindBestItem ( struct DefragDataStruct Data,
ULONG64  ClusterStart,
ULONG64  ClusterEnd,
int  Direction,
int  Zone 
) [read]
ULONG64 FindFragmentBegin ( struct ItemStruct Item,
ULONG64  Lcn 
)
int FindGap ( struct DefragDataStruct Data,
ULONG64  MinimumLcn,
ULONG64  MaximumLcn,
ULONG64  MinimumSize,
int  MustFit,
int  FindHighestGap,
ULONG64 *  BeginLcn,
ULONG64 *  EndLcn,
BOOL  IgnoreMftExcludes 
)
struct ItemStruct* FindHighestItem ( struct DefragDataStruct Data,
ULONG64  ClusterStart,
ULONG64  ClusterEnd,
int  Direction,
int  Zone 
) [read]
struct ItemStruct* FindItemAtLcn ( struct DefragDataStruct Data,
ULONG64  Lcn 
) [read]
void Fixup ( struct DefragDataStruct Data)
void ForcedFill ( struct DefragDataStruct Data)
int FragmentCount ( struct ItemStruct Item)
int GetFragments ( struct DefragDataStruct Data,
struct ItemStruct Item,
HANDLE  FileHandle 
)
ULONG64 GetItemLcn ( struct ItemStruct Item)
WCHAR* GetLongPath ( struct DefragDataStruct Data,
struct ItemStruct Item 
)
WCHAR* GetShortPath ( struct DefragDataStruct Data,
struct ItemStruct Item 
)
int IsFragmented ( struct ItemStruct Item,
ULONG64  Offset,
ULONG64  Size 
)
WCHAR LowerCase ( WCHAR  c)
int MatchMask ( WCHAR *  String,
WCHAR *  Mask 
)
int MoveItem ( struct DefragDataStruct Data,
struct ItemStruct Item,
ULONG64  NewLcn,
ULONG64  Offset,
ULONG64  Size,
int  Direction 
)
DWORD MoveItem1 ( struct DefragDataStruct Data,
HANDLE  FileHandle,
struct ItemStruct Item,
ULONG64  NewLcn,
ULONG64  Offset,
ULONG64  Size 
)
DWORD MoveItem2 ( struct DefragDataStruct Data,
HANDLE  FileHandle,
struct ItemStruct Item,
ULONG64  NewLcn,
ULONG64  Offset,
ULONG64  Size 
)
int MoveItem3 ( struct DefragDataStruct Data,
struct ItemStruct Item,
HANDLE  FileHandle,
ULONG64  NewLcn,
ULONG64  Offset,
ULONG64  Size,
int  Strategy 
)
int MoveItem4 ( struct DefragDataStruct Data,
struct ItemStruct Item,
HANDLE  FileHandle,
ULONG64  NewLcn,
ULONG64  Offset,
ULONG64  Size,
int  Direction 
)
void MoveMftToBeginOfDisk ( struct DefragDataStruct Data)
HANDLE OpenItemHandle ( struct DefragDataStruct Data,
struct ItemStruct Item 
)
void OptimizeSort ( struct DefragDataStruct Data,
int  SortField 
)
void OptimizeUp ( struct DefragDataStruct Data)
void OptimizeVolume ( struct DefragDataStruct Data)
void RunJkDefrag ( WCHAR *  Path,
int  Mode,
int  Speed,
double  FreeSpace,
WCHAR **  Excludes,
WCHAR **  SpaceHogs,
int *  Running,
int *  RedrawScreen,
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, WCHAR *Message,...)  ,
void(__cdecl *DrawCluster)(struct DefragDataStruct *Data,ULONG64 ClusterStart, ULONG64 ClusterEnd, int Color ,
void(__cdecl *ClearScreen)(WCHAR *Format,...)  ,
WCHAR **  DebugMsg 
)
void ScanDir ( struct DefragDataStruct Data,
WCHAR *  Mask,
struct ItemStruct ParentDirectory 
)
void ShowDiskmap ( struct DefragDataStruct Data)
void ShowHex ( struct DefragDataStruct Data,
BYTE *  Buffer,
ULONG64  Count 
)
void SlowDown ( struct DefragDataStruct Data)
void StopJkDefrag ( int *  Running,
int  TimeOut 
)
char* stristr ( char *  Haystack,
char *  Needle 
)
WCHAR* stristrW ( WCHAR *  Haystack,
WCHAR *  Needle 
)
void SystemErrorStr ( DWORD  ErrorCode,
WCHAR *  Out,
size_t  Width 
)
struct ItemStruct* TreeBiggest ( struct ItemStruct Top) [read]
void TreeDetach ( struct DefragDataStruct Data,
struct ItemStruct Item 
)
struct ItemStruct* TreeFirst ( struct ItemStruct Top,
int  Direction 
) [read]
void TreeInsert ( struct DefragDataStruct Data,
struct ItemStruct New 
)
struct ItemStruct* TreeNext ( struct ItemStruct Here) [read]
struct ItemStruct* TreeNextPrev ( struct ItemStruct Here,
int  Direction 
) [read]
struct ItemStruct* TreePrev ( struct ItemStruct Here) [read]
struct ItemStruct* TreeSmallest ( struct ItemStruct Top) [read]
void Vacate ( struct DefragDataStruct Data,
ULONG64  Lcn,
ULONG64  Clusters,
BOOL  IgnoreMftExcludes 
)

Variable Documentation

WCHAR* DefaultDebugMsg[]
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines