- deleted temporary files, generated files, binaries

- migrated project files to Visual C++ 2005 Express - the latest, the best, for free
 - converted to an Unicode application

svn path=/trunk/; revision=21432
This commit is contained in:
KJK::Hyperion 2006-04-01 15:02:38 +00:00
parent 7908ce58a8
commit 018539280c
21 changed files with 686 additions and 978 deletions

View file

@ -6,16 +6,16 @@
// and fits it to a given length. If it has to truncate it will first truncate from the path, // and fits it to a given length. If it has to truncate it will first truncate from the path,
// substituting in periods. So you might end up with something like: // substituting in periods. So you might end up with something like:
// C:\Program Files\Micro...\Register.exe // C:\Program Files\Micro...\Register.exe
int FitName (char *destination, const char *path, const char *filename, uint32 totalWidth) int FitName (wchar_t *destination, const wchar_t *path, const wchar_t *filename, uint32 totalWidth)
{ {
uint32 pathLen=0; uint32 pathLen=0;
uint32 fnLen=0; uint32 fnLen=0;
uint32 halfTotLen=0; uint32 halfTotLen=0;
uint32 len4fn=0; /* number of chars remaining for filename after path is applied */ uint32 len4fn=0; /* number of chars remaining for filename after path is applied */
uint32 len4path=0; /* number of chars for path before filename is applied */ uint32 len4path=0; /* number of chars for path before filename is applied */
char fmtStrPath[20]=""; wchar_t fmtStrPath[20]=L"";
char fmtStrFile[20]=""; wchar_t fmtStrFile[20]=L"";
char fmtString[40]=""; wchar_t fmtString[40]=L"";
/* /*
assert (destination != NULL); assert (destination != NULL);
@ -24,8 +24,8 @@ int FitName (char *destination, const char *path, const char *filename, uint32 t
assert (totalWidth != 0); assert (totalWidth != 0);
*/ */
pathLen = strlen(path); pathLen = wcslen(path);
fnLen = strlen(filename); fnLen = wcslen(filename);
if (!(totalWidth % 2)) if (!(totalWidth % 2))
halfTotLen=totalWidth / 2; halfTotLen=totalWidth / 2;
else else
@ -58,28 +58,28 @@ int FitName (char *destination, const char *path, const char *filename, uint32 t
} }
/* /*
if halfTotLen was adjusted above to avoid a rounding error, give the if halfTotLen was adjusted above to avoid a rounding error, give the
extra char to the filename extra wchar_t to the filename
*/ */
if (halfTotLen < (totalWidth/2)) len4path++; if (halfTotLen < (totalWidth/2)) len4path++;
if (pathLen > len4path) sprintf (fmtStrPath, "%%.%ds...\\", len4path-4); if (pathLen > len4path) swprintf (fmtStrPath, L"%%.%ds...\\", len4path-4);
else else
sprintf (fmtStrPath, "%%s"); swprintf (fmtStrPath, L"%%s");
if (fnLen > len4fn) sprintf (fmtStrFile, "%%.%ds...", len4fn-3); if (fnLen > len4fn) swprintf (fmtStrFile, L"%%.%ds...", len4fn-3);
else else
sprintf (fmtStrFile, "%%s"); swprintf (fmtStrFile, L"%%s");
strcpy (fmtString, fmtStrPath); wcscpy (fmtString, fmtStrPath);
strcat (fmtString, fmtStrFile); wcscat (fmtString, fmtStrFile);
/*sprintf (fmtString, "%s%s", fmtStrPath, fmtStrFile);*/ /*swprintf (fmtString, L"%s%s", fmtStrPath, fmtStrFile);*/
sprintf (destination, fmtString, path,filename); swprintf (destination, fmtString, path,filename);
return (1); return (1);
} }
Defragment::Defragment (string Name, DefragType DefragMethod) Defragment::Defragment (wstring Name, DefragType DefragMethod)
{ {
Method = DefragMethod; Method = DefragMethod;
DoLimitLength = true; DoLimitLength = true;
@ -91,10 +91,10 @@ Defragment::Defragment (string Name, DefragType DefragMethod)
StatusPercent = 0.0f; StatusPercent = 0.0f;
LastBMPUpdate = GetTickCount (); LastBMPUpdate = GetTickCount ();
SetStatusString ("Opening volume " + Name); SetStatusString (L"Opening volume " + Name);
if (!Volume.Open (Name)) if (!Volume.Open (Name))
{ {
SetStatusString ("Error opening volume " + Name); SetStatusString (L"Error opening volume " + Name);
Error = true; Error = true;
Done = true; Done = true;
StatusPercent = 100.0f; StatusPercent = 100.0f;
@ -111,7 +111,7 @@ Defragment::~Defragment ()
Stop (); Stop ();
while (!IsDoneYet() && !HasError()) while (!IsDoneYet() && !HasError())
{ {
SetStatusString ("Waiting for thread to stop ..."); SetStatusString (L"Waiting for thread to stop ...");
Sleep (150); Sleep (150);
} }
} }
@ -121,7 +121,7 @@ Defragment::~Defragment ()
} }
void Defragment::SetStatusString (string NewStatus) void Defragment::SetStatusString (wstring NewStatus)
{ {
Lock (); Lock ();
StatusString = NewStatus; StatusString = NewStatus;
@ -131,9 +131,9 @@ void Defragment::SetStatusString (string NewStatus)
} }
string Defragment::GetStatusString (void) wstring Defragment::GetStatusString (void)
{ {
string ReturnVal; wstring ReturnVal;
Lock (); Lock ();
ReturnVal = StatusString; ReturnVal = StatusString;
@ -161,17 +161,17 @@ void Defragment::Start (void)
uint64 FirstFreeLCN; uint64 FirstFreeLCN;
uint64 TotalClusters; uint64 TotalClusters;
uint64 ClustersProgress; uint64 ClustersProgress;
char PrintName[80]; wchar_t PrintName[80];
int Width = 70; int Width = 70;
if (Error) if (Error)
goto DoneDefrag; goto DoneDefrag;
// First thing: build a file list. // First thing: build a file list.
SetStatusString ("Getting volume bitmap"); SetStatusString (L"Getting volume bitmap");
if (!Volume.GetBitmap()) if (!Volume.GetBitmap())
{ {
SetStatusString ("Could not get volume " + DriveName + " bitmap"); SetStatusString (L"Could not get volume " + DriveName + L" bitmap");
Error = true; Error = true;
goto DoneDefrag; goto DoneDefrag;
} }
@ -181,10 +181,10 @@ void Defragment::Start (void)
if (PleaseStop) if (PleaseStop)
goto DoneDefrag; goto DoneDefrag;
SetStatusString ("Obtaining volume geometry"); SetStatusString (L"Obtaining volume geometry");
if (!Volume.ObtainInfo ()) if (!Volume.ObtainInfo ())
{ {
SetStatusString ("Could not obtain volume " + DriveName + " geometry"); SetStatusString (L"Could not obtain volume " + DriveName + L" geometry");
Error = true; Error = true;
goto DoneDefrag; goto DoneDefrag;
} }
@ -192,10 +192,10 @@ void Defragment::Start (void)
if (PleaseStop) if (PleaseStop)
goto DoneDefrag; goto DoneDefrag;
SetStatusString ("Building file database for volume " + DriveName); SetStatusString (L"Building file database for volume " + DriveName);
if (!Volume.BuildFileList (PleaseStop, StatusPercent)) if (!Volume.BuildFileList (PleaseStop, StatusPercent))
{ {
SetStatusString ("Could not build file database for volume " + DriveName); SetStatusString (L"Could not build file database for volume " + DriveName);
Error = true; Error = true;
goto DoneDefrag; goto DoneDefrag;
} }
@ -203,7 +203,7 @@ void Defragment::Start (void)
if (PleaseStop) if (PleaseStop)
goto DoneDefrag; goto DoneDefrag;
SetStatusString ("Analyzing database for " + DriveName); SetStatusString (L"Analyzing database for " + DriveName);
TotalClusters = 0; TotalClusters = 0;
for (i = 0; i < Volume.GetDBFileCount(); i++) for (i = 0; i < Volume.GetDBFileCount(); i++)
{ {
@ -287,7 +287,7 @@ void Defragment::Start (void)
// What? They want us to pause? Oh ok. // What? They want us to pause? Oh ok.
if (PleasePause) if (PleasePause)
{ {
SetStatusString ("Paused"); SetStatusString (L"Paused");
PleasePause = false; PleasePause = false;
while (PleasePause == false) while (PleasePause == false)
@ -300,7 +300,7 @@ void Defragment::Start (void)
if (PleaseStop) if (PleaseStop)
{ {
SetStatusString ("Stopping"); SetStatusString (L"Stopping");
break; break;
} }
@ -374,11 +374,11 @@ void Defragment::Start (void)
else else
if (!Result || Retry != 1) if (!Result || Retry != 1)
{ // hmm. Wait for a moment, then update the drive bitmap { // hmm. Wait for a moment, then update the drive bitmap
//SetStatusString ("(Reobtaining volume " + DriveName + " bitmap)"); //SetStatusString (L"(Reobtaining volume " + DriveName + L" bitmap)");
if (!DoLimitLength) if (!DoLimitLength)
{ {
SetStatusString (GetStatusString() + string (" .")); SetStatusString (GetStatusString() + wstring (L" ."));
} }
if (Volume.GetBitmap ()) if (Volume.GetBitmap ())
@ -394,7 +394,7 @@ void Defragment::Start (void)
} }
else else
{ {
SetStatusString ("Could not re-obtain volume " + DriveName + " bitmap"); SetStatusString (L"Could not re-obtain volume " + DriveName + L" bitmap");
Error = true; Error = true;
} }
} }
@ -407,22 +407,22 @@ void Defragment::Start (void)
} }
DoneDefrag: DoneDefrag:
string OldStatus; wstring OldStatus;
OldStatus = GetStatusString (); OldStatus = GetStatusString ();
StatusPercent = 99.999999f; StatusPercent = 99.999999f;
SetStatusString ("Closing volume " + DriveName); SetStatusString (L"Closing volume " + DriveName);
Volume.Close (); Volume.Close ();
StatusPercent = 100.0f; StatusPercent = 100.0f;
// If there was an error then the string has already been set // If there was an error then the wstring has already been set
if (Error) if (Error)
SetStatusString (OldStatus); SetStatusString (OldStatus);
else else
if (PleaseStop) if (PleaseStop)
SetStatusString ("Volume " + DriveName + " defragmentation was stopped"); SetStatusString (L"Volume " + DriveName + L" defragmentation was stopped");
else else
SetStatusString ("Finished defragmenting " + DriveName); SetStatusString (L"Finished defragmenting " + DriveName);
Done = true; Done = true;
@ -433,7 +433,7 @@ DoneDefrag:
void Defragment::TogglePause (void) void Defragment::TogglePause (void)
{ {
Lock (); Lock ();
SetStatusString ("Pausing ..."); SetStatusString (L"Pausing ...");
PleasePause = true; PleasePause = true;
Unlock (); Unlock ();
@ -444,7 +444,7 @@ void Defragment::TogglePause (void)
void Defragment::Stop (void) void Defragment::Stop (void)
{ {
Lock (); Lock ();
SetStatusString ("Stopping ..."); SetStatusString (L"Stopping ...");
PleaseStop = true; PleaseStop = true;
Unlock (); Unlock ();

View file

@ -14,12 +14,12 @@
#include "Mutex.h" #include "Mutex.h"
extern int FitName (char *destination, const char *path, const char *filename, uint32 totalWidth); extern int FitName (wchar_t *destination, const wchar_t *path, const wchar_t *filename, uint32 totalWidth);
typedef struct DefragReport typedef struct DefragReport
{ {
string RootPath; wstring RootPath;
uint64 DiskSizeBytes; uint64 DiskSizeBytes;
uint64 DirsCount; uint64 DirsCount;
uint64 FilesCount; uint64 FilesCount;
@ -41,7 +41,7 @@ typedef struct DefragReport
class Defragment class Defragment
{ {
public: public:
Defragment (string Name, DefragType DefragMethod); Defragment (wstring Name, DefragType DefragMethod);
~Defragment (); ~Defragment ();
// Commands // Commands
@ -52,7 +52,7 @@ public:
// Info // Info
bool IsDoneYet (void); bool IsDoneYet (void);
bool HasError (void); bool HasError (void);
string GetStatusString (void); wstring GetStatusString (void);
double GetStatusPercent (void); double GetStatusPercent (void);
DefragType GetDefragType (void) { return (Method); } DefragType GetDefragType (void) { return (Method); }
DefragReport &GetDefragReport (void) { return (Report); } DefragReport &GetDefragReport (void) { return (Report); }
@ -69,16 +69,16 @@ public:
private: private:
void FastDefrag (void); void FastDefrag (void);
void ExtensiveDefrag (void); void ExtensiveDefrag (void);
void SetStatusString (string NewStatus); void SetStatusString (wstring NewStatus);
DWORD LastBMPUpdate; // Last time volume bitmap was updated DWORD LastBMPUpdate; // Last time volume bitmap was updated
DefragReport Report; DefragReport Report;
bool DoLimitLength; bool DoLimitLength;
DefragType Method; DefragType Method;
string DriveName; wstring DriveName;
DriveVolume Volume; DriveVolume Volume;
string StatusString; wstring StatusString;
string ErrorString; wstring ErrorString;
double StatusPercent; double StatusPercent;
Mutex DefragMutex; Mutex DefragMutex;
bool Error; bool Error;

View file

@ -39,14 +39,14 @@ void DriveVolume::Close (void)
// "Name" should be the drive letter followed by a colon. ie, "c:" // "Name" should be the drive letter followed by a colon. ie, "c:"
// It's a string to allow for further expansion (ie, defragging over the network?) // It's a string to allow for further expansion (ie, defragging over the network?)
// or some other baloney reason // or some other baloney reason
bool DriveVolume::Open (string Name) bool DriveVolume::Open (wstring Name)
{ {
char FileName[100]; wchar_t FileName[100];
bool ReturnVal; bool ReturnVal;
sprintf (FileName, "\\\\.\\%s", Name.c_str()); swprintf (FileName, L"\\\\.\\%s", Name.c_str());
RootPath = Name.c_str(); RootPath = Name.c_str();
RootPath += "\\"; RootPath += L"\\";
Handle = CreateFile Handle = CreateFile
( (
@ -63,11 +63,11 @@ bool DriveVolume::Open (string Name)
ReturnVal = false; ReturnVal = false;
else else
{ {
char VolName[64]; wchar_t VolName[64];
DWORD VolSN; DWORD VolSN;
DWORD VolMaxFileLen; DWORD VolMaxFileLen;
DWORD FSFlags; DWORD FSFlags;
char FSName[64]; wchar_t FSName[64];
BOOL Result; BOOL Result;
ReturnVal = true; ReturnVal = true;
@ -85,24 +85,24 @@ bool DriveVolume::Open (string Name)
if (Result) if (Result)
{ {
char SerialText[10]; wchar_t SerialText[10];
VolInfo.FileSystem = FSName; VolInfo.FileSystem = FSName;
VolInfo.MaxNameLen = VolMaxFileLen; VolInfo.MaxNameLen = VolMaxFileLen;
VolInfo.Name = VolName; VolInfo.Name = VolName;
sprintf (SerialText, "%x-%x", (VolSN & 0xffff0000) >> 16, swprintf (SerialText, L"%x-%x", (VolSN & 0xffff0000) >> 16,
VolSN & 0x0000ffff); VolSN & 0x0000ffff);
strupr (SerialText); wcsupr (SerialText);
VolInfo.Serial = SerialText; VolInfo.Serial = SerialText;
} }
else else
{ {
VolInfo.FileSystem = "(Unknown)"; VolInfo.FileSystem = L"(Unknown)";
VolInfo.MaxNameLen = 255; VolInfo.MaxNameLen = 255;
VolInfo.Name = "(Unknown)"; VolInfo.Name = L"(Unknown)";
VolInfo.Serial = "(Unknown)"; VolInfo.Serial = L"(Unknown)";
} }
} }
@ -202,7 +202,7 @@ bool DriveVolume::GetBitmap (void)
// Bad result? // Bad result?
if (Result == FALSE && GetLastError () != ERROR_MORE_DATA) if (Result == FALSE && GetLastError () != ERROR_MORE_DATA)
{ {
//printf ("\nDeviceIoControl returned false, GetLastError() was not ERROR_MORE_DATA\n"); //wprintf ("\nDeviceIoControl returned false, GetLastError() was not ERROR_MORE_DATA\n");
free (Bitmap); free (Bitmap);
return (false); return (false);
} }
@ -226,12 +226,12 @@ bool DriveVolume::GetBitmap (void)
if (Result == FALSE) if (Result == FALSE)
{ {
printf ("\nCouldn't properly read volume bitmap\n"); wprintf (L"\nCouldn't properly read volume bitmap\n");
free (Bitmap); free (Bitmap);
return (false); return (false);
} }
// Convert to a 'quick use' bitmap // Convert to a L'quick use' bitmap
//const int BitShift[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; //const int BitShift[] = { 1, 2, 4, 8, 16, 32, 64, 128 };
VolInfo.ClusterCount = Bitmap->BitmapSize.QuadPart; VolInfo.ClusterCount = Bitmap->BitmapSize.QuadPart;
@ -331,7 +331,7 @@ bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData)
} }
string &DriveVolume::GetDBDir (uint32 Indice) wstring &DriveVolume::GetDBDir (uint32 Indice)
{ {
return (Directories[Indice]); return (Directories[Indice]);
} }
@ -365,17 +365,17 @@ uint32 DriveVolume::RemoveDBFile (uint32 Indice)
} }
bool DriveVolume::ScanDirectory (string DirPrefix, ScanCallback Callback, void *UserData) bool DriveVolume::ScanDirectory (wstring DirPrefix, ScanCallback Callback, void *UserData)
{ {
WIN32_FIND_DATA FindData; WIN32_FIND_DATA FindData;
HANDLE FindHandle; HANDLE FindHandle;
string SearchString; wstring SearchString;
uint32 DirIndice; uint32 DirIndice;
DirIndice = Directories.size() - 1; DirIndice = Directories.size() - 1;
SearchString = DirPrefix; SearchString = DirPrefix;
SearchString += "*.*"; SearchString += L"*.*";
ZeroMemory (&FindData, sizeof (FindData)); ZeroMemory (&FindData, sizeof (FindData));
FindHandle = FindFirstFile (SearchString.c_str(), &FindData); FindHandle = FindFirstFile (SearchString.c_str(), &FindData);
@ -393,8 +393,8 @@ bool DriveVolume::ScanDirectory (string DirPrefix, ScanCallback Callback, void *
// First copy over the easy stuff. // First copy over the easy stuff.
Info.Name = FindData.cFileName; Info.Name = FindData.cFileName;
// Don't ever include '.' and '..' // DonLL't ever include '.L' and '..'
if (Info.Name == "." || Info.Name == "..") if (Info.Name == L"." || Info.Name == L"..")
continue; continue;
//Info.FullName = DirPrefix + Info.Name; //Info.FullName = DirPrefix + Info.Name;
@ -450,11 +450,11 @@ bool DriveVolume::ScanDirectory (string DirPrefix, ScanCallback Callback, void *
// If directory, perform recursion // If directory, perform recursion
if (Info.Attributes.Directory == 1) if (Info.Attributes.Directory == 1)
{ {
string Dir; wstring Dir;
Dir = GetDBDir (Info.DirIndice); Dir = GetDBDir (Info.DirIndice);
Dir += Info.Name; Dir += Info.Name;
Dir += "\\"; Dir += L"\\";
Directories.push_back (Dir); Directories.push_back (Dir);
ScanDirectory (Dir, Callback, UserData); ScanDirectory (Dir, Callback, UserData);
@ -485,7 +485,7 @@ bool DriveVolume::GetClusterInfo (FileInfo &Info, HANDLE &HandleResult)
{ {
BOOL Result; BOOL Result;
HANDLE Handle; HANDLE Handle;
string FullName; wstring FullName;
BY_HANDLE_FILE_INFORMATION FileInfo; BY_HANDLE_FILE_INFORMATION FileInfo;
Info.Fragments.resize (0); Info.Fragments.resize (0);
@ -529,7 +529,7 @@ bool DriveVolume::GetClusterInfo (FileInfo &Info, HANDLE &HandleResult)
if (Result == FALSE) if (Result == FALSE)
{ {
Info.Attributes.AccessDenied = 1; Info.Attributes.AccessDenied = 1;
printf ("GetFileInformationByHandle ('%s%s') failed\n", GetDBDir (Info.DirIndice).c_str(), wprintf (L"GetFileInformationByHandle ('%s%s') failed\n", GetDBDir (Info.DirIndice).c_str(),
Info.Name.c_str()); Info.Name.c_str());
CloseHandle (Handle); CloseHandle (Handle);
@ -544,7 +544,7 @@ bool DriveVolume::GetClusterInfo (FileInfo &Info, HANDLE &HandleResult)
DWORD BytesReturned; DWORD BytesReturned;
// Grab info one extent at a time, until it's done grabbing all the extent data // Grab info one extent at a time, until it's done grabbing all the extent data
// Yeah, well it doesn't give us a way to ask "how many extents?" that I know of ... // Yeah, well it doesn't give us a way to ask L"how many extents?" that I know of ...
// btw, the Extents variable tends to only reflect memory usage, so when we have // btw, the Extents variable tends to only reflect memory usage, so when we have
// all the extents we look at the structure Win32 gives us for the REAL count! // all the extents we look at the structure Win32 gives us for the REAL count!
Extents = 10; Extents = 10;
@ -668,7 +668,7 @@ bool DriveVolume::MoveFileDumb (uint32 FileIndice, uint64 NewLCN)
bool ReturnVal = false; bool ReturnVal = false;
FileInfo Info; FileInfo Info;
HANDLE FileHandle; HANDLE FileHandle;
string FullName; wstring FullName;
MOVE_FILE_DATA MoveData; MOVE_FILE_DATA MoveData;
uint64 CurrentLCN; uint64 CurrentLCN;
uint64 CurrentVCN; uint64 CurrentVCN;
@ -724,7 +724,7 @@ bool DriveVolume::MoveFileDumb (uint32 FileIndice, uint64 NewLCN)
BOOL Result; BOOL Result;
DWORD BytesReturned; DWORD BytesReturned;
//printf ("%3u", i); //wprintf (L"%3u", i);
MoveData.ClusterCount = Info.Fragments[i].Length; MoveData.ClusterCount = Info.Fragments[i].Length;
MoveData.StartingLcn.QuadPart = CurrentLCN; MoveData.StartingLcn.QuadPart = CurrentLCN;
@ -733,15 +733,15 @@ bool DriveVolume::MoveFileDumb (uint32 FileIndice, uint64 NewLCN)
MoveData.FileHandle = FileHandle; MoveData.FileHandle = FileHandle;
/* /*
printf ("\n"); wprintf (L"\n");
printf ("StartLCN: %I64u\n", MoveData.StartingLcn.QuadPart); wprintf (L"StartLCN: %I64u\n", MoveData.StartingLcn.QuadPart);
printf ("StartVCN: %I64u\n", MoveData.StartingVcn.QuadPart); wprintf (L"StartVCN: %I64u\n", MoveData.StartingVcn.QuadPart);
printf ("Clusters: %u (%I64u-%I64u --> %I64u-%I64u)\n", MoveData.ClusterCount, wprintf (L"Clusters: %u (%I64u-%I64u --> %I64u-%I64u)\n", MoveData.ClusterCount,
Info.Fragments[i].StartLCN, Info.Fragments[i].StartLCN,
Info.Fragments[i].StartLCN + MoveData.ClusterCount, Info.Fragments[i].StartLCN + MoveData.ClusterCount,
MoveData.StartingLcn.QuadPart, MoveData.StartingLcn.QuadPart,
MoveData.StartingLcn.QuadPart + MoveData.ClusterCount - 1); MoveData.StartingLcn.QuadPart + MoveData.ClusterCount - 1);
printf ("\n"); wprintf (L"\n");
*/ */
Result = DeviceIoControl Result = DeviceIoControl
@ -756,7 +756,7 @@ bool DriveVolume::MoveFileDumb (uint32 FileIndice, uint64 NewLCN)
NULL NULL
); );
//printf ("\b\b\b"); //wprintf (L"\b\b\b");
if (Result == FALSE) if (Result == FALSE)
{ {

View file

@ -51,7 +51,7 @@ typedef struct
typedef struct typedef struct
{ {
string Name; wstring Name;
uint32 DirIndice; // indice into directory list uint32 DirIndice; // indice into directory list
uint64 Size; uint64 Size;
uint64 Clusters; uint64 Clusters;
@ -65,10 +65,10 @@ typedef vector<FileInfo> FileList;
typedef struct typedef struct
{ {
string Name; wstring Name;
string Serial; wstring Serial;
DWORD MaxNameLen; DWORD MaxNameLen;
string FileSystem; wstring FileSystem;
uint64 ClusterCount; uint64 ClusterCount;
uint32 ClusterSize; uint32 ClusterSize;
uint64 TotalBytes; uint64 TotalBytes;
@ -92,7 +92,7 @@ public:
DriveVolume (); DriveVolume ();
~DriveVolume (); ~DriveVolume ();
bool Open (string Name); // opens the volume bool Open (wstring Name); // opens the volume
void Close (void); void Close (void);
bool ObtainInfo (void); // retrieves drive geometry bool ObtainInfo (void); // retrieves drive geometry
bool GetBitmap (void); // gets drive bitmap bool GetBitmap (void); // gets drive bitmap
@ -108,7 +108,7 @@ public:
DISK_GEOMETRY GetGeometry (void) { return (Geometry); } DISK_GEOMETRY GetGeometry (void) { return (Geometry); }
VolumeInfo GetVolumeInfo (void) { return (VolInfo); } VolumeInfo GetVolumeInfo (void) { return (VolInfo); }
string GetRootPath (void) { return (RootPath); } wstring GetRootPath (void) { return (RootPath); }
// Scans drive starting from the root dir and calls a user defined function // Scans drive starting from the root dir and calls a user defined function
// for each file/directory encountered. void* UserData is passed to this // for each file/directory encountered. void* UserData is passed to this
@ -116,7 +116,7 @@ public:
bool Scan (ScanCallback Callback, void *UserData); bool Scan (ScanCallback Callback, void *UserData);
// Retrieve a directory string from the file database // Retrieve a directory string from the file database
string &GetDBDir (uint32 Indice); wstring &GetDBDir (uint32 Indice);
uint32 GetDBDirCount (void); uint32 GetDBDirCount (void);
// Retrieve file strings/info from the file database // Retrieve file strings/info from the file database
FileInfo &GetDBFile (uint32 Indice); FileInfo &GetDBFile (uint32 Indice);
@ -137,7 +137,7 @@ private:
friend bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData); friend bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData);
// DirPrefix should be in the form "drive:\\path\\" ie, C:\CRAP\ . // DirPrefix should be in the form "drive:\\path\\" ie, C:\CRAP\ .
bool ScanDirectory (string DirPrefix, ScanCallback Callback, void *UserData); bool ScanDirectory (wstring DirPrefix, ScanCallback Callback, void *UserData);
// given a file's attributes, should it be processed or not? // given a file's attributes, should it be processed or not?
bool ShouldProcess (FileAttr Attr); bool ShouldProcess (FileAttr Attr);
@ -146,8 +146,8 @@ private:
VolumeInfo VolInfo; VolumeInfo VolInfo;
FileList Files; FileList Files;
vector<string> Directories; // Directories[Files[x].DirIndice] vector<wstring> Directories; // Directories[Files[x].DirIndice]
string RootPath; // ie, C:\ . wstring RootPath; // ie, C:\ .
HANDLE Handle; HANDLE Handle;
DISK_GEOMETRY Geometry; DISK_GEOMETRY Geometry;
uint32 *BitmapDetail; uint32 *BitmapDetail;

View file

@ -42,7 +42,7 @@ int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine,
if (!CheckWinVer()) if (!CheckWinVer())
{ {
MessageBox (GetDesktopWindow(), "Sorry, this program requires Windows 2000.", "Error", MB_OK); MessageBox (GetDesktopWindow(), L"Sorry, this program requires Windows 2000.", L"Error", MB_OK);
return (0); return (0);
} }
@ -51,7 +51,7 @@ int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine,
#if 0 #if 0
AllocConsole (); AllocConsole ();
if (_CrtDumpMemoryLeaks ()) if (_CrtDumpMemoryLeaks ())
MessageBox (NULL, "Click OK to quit", "Leaks", MB_OK); MessageBox (NULL, L"Click OK to quit", L"Leaks", MB_OK);
#endif #endif
return (0); return (0);

Binary file not shown.

View file

@ -14,7 +14,7 @@
int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd); int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd);
Defragment *StartDefragBox (string Drive, DefragType Method); Defragment *StartDefragBox (wstring Drive, DefragType Method);
extern HINSTANCE GlobalHInstance; extern HINSTANCE GlobalHInstance;

View file

@ -1,224 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on Fraginator.dsp
!IF "$(CFG)" == ""
CFG=Fraginator - Win32 Debug
!MESSAGE No configuration specified. Defaulting to Fraginator - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "Fraginator - Win32 Release" && "$(CFG)" != "Fraginator - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Fraginator.mak" CFG="Fraginator - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Fraginator - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Fraginator - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=xicl6.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Fraginator - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
ALL : "$(OUTDIR)\Fraginator.exe"
CLEAN :
-@erase "$(INTDIR)\Defragment.obj"
-@erase "$(INTDIR)\DriveVolume.obj"
-@erase "$(INTDIR)\Fraginator.obj"
-@erase "$(INTDIR)\Fraginator.res"
-@erase "$(INTDIR)\MainDialog.obj"
-@erase "$(INTDIR)\ReportDialog.obj"
-@erase "$(INTDIR)\Unfrag.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\Fraginator.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /G6 /Gr /MT /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\Fraginator.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Fraginator.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Fraginator.bsc"
BSC32_SBRS= \
LINK32=xilink6.exe
LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"$(OUTDIR)\Fraginator.exe"
LINK32_OBJS= \
"$(INTDIR)\Defragment.obj" \
"$(INTDIR)\DriveVolume.obj" \
"$(INTDIR)\Fraginator.obj" \
"$(INTDIR)\MainDialog.obj" \
"$(INTDIR)\ReportDialog.obj" \
"$(INTDIR)\Unfrag.obj" \
"$(INTDIR)\Fraginator.res"
"$(OUTDIR)\Fraginator.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
SOURCE="$(InputPath)"
PostBuild_Desc=Copying to Program Files ...
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
ALL : $(DS_POSTBUILD_DEP)
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
$(DS_POSTBUILD_DEP) : "$(OUTDIR)\Fraginator.exe"
copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe"
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "Fraginator - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
ALL : "$(OUTDIR)\Fraginator.exe"
CLEAN :
-@erase "$(INTDIR)\Defragment.obj"
-@erase "$(INTDIR)\DriveVolume.obj"
-@erase "$(INTDIR)\Fraginator.obj"
-@erase "$(INTDIR)\Fraginator.res"
-@erase "$(INTDIR)\MainDialog.obj"
-@erase "$(INTDIR)\ReportDialog.obj"
-@erase "$(INTDIR)\Unfrag.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\Fraginator.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\Fraginator.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Fraginator.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\Fraginator.bsc"
BSC32_SBRS= \
LINK32=xilink6.exe
LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /debug /machine:I386 /out:"$(OUTDIR)\Fraginator.exe"
LINK32_OBJS= \
"$(INTDIR)\Defragment.obj" \
"$(INTDIR)\DriveVolume.obj" \
"$(INTDIR)\Fraginator.obj" \
"$(INTDIR)\MainDialog.obj" \
"$(INTDIR)\ReportDialog.obj" \
"$(INTDIR)\Unfrag.obj" \
"$(INTDIR)\Fraginator.res"
"$(OUTDIR)\Fraginator.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("Fraginator.dep")
!INCLUDE "Fraginator.dep"
!ELSE
!MESSAGE Warning: cannot find "Fraginator.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "Fraginator - Win32 Release" || "$(CFG)" == "Fraginator - Win32 Debug"
SOURCE=.\Defragment.cpp
"$(INTDIR)\Defragment.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\DriveVolume.cpp
"$(INTDIR)\DriveVolume.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\Fraginator.cpp
"$(INTDIR)\Fraginator.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\MainDialog.cpp
"$(INTDIR)\MainDialog.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\ReportDialog.cpp
"$(INTDIR)\ReportDialog.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\Unfrag.cpp
"$(INTDIR)\Unfrag.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\Fraginator.rc
"$(INTDIR)\Fraginator.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)
!ENDIF

View file

@ -7,7 +7,7 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include "windows.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
@ -40,17 +40,17 @@ BEGIN
PUSHBUTTON "Start",IDC_STARTSTOP,294,7,45,15 PUSHBUTTON "Start",IDC_STARTSTOP,294,7,45,15
PUSHBUTTON "Help",ID_MAIN_HELP,294,28,45,15 PUSHBUTTON "Help",ID_MAIN_HELP,294,28,45,15
PUSHBUTTON "Exit",IDC_QUIT,294,49,45,15 PUSHBUTTON "Exit",IDC_QUIT,294,49,45,15
CONTROL 110,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN | CONTROL 110,-1,"Static",SS_BITMAP | SS_SUNKEN |
WS_BORDER,7,7,63,58 WS_BORDER,7,7,63,58
LTEXT "Choose a drive:",IDC_STATIC,78,40,50,8 LTEXT "Choose a drive:",-1,78,40,50,8
LTEXT "Choose an action:",IDC_STATIC,135,40,58,8 LTEXT "Choose an action:",-1,135,40,58,8
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER | CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER |
0x1,7,71,299,10 0x1,7,71,299,10
CONTROL "Static",IDC_STATUS,"Static",SS_LEFTNOWORDWRAP | CONTROL "Static",IDC_STATUS,"Static",SS_LEFTNOWORDWRAP |
SS_SUNKEN | WS_GROUP,7,86,332,10 SS_SUNKEN | WS_GROUP,7,86,332,10
LTEXT "I am a monkey, hear me eeK",IDC_WISECRACKS,78,15,91,8 LTEXT "I am a monkey, hear me eeK",IDC_WISECRACKS,78,15,91,8
LTEXT "100.00%",IDC_PERCENT,311,71,28,8,0,WS_EX_RIGHT LTEXT "100.00%",IDC_PERCENT,311,71,28,8,0,WS_EX_RIGHT
LTEXT "Process Priority:",IDC_STATIC,223,40,51,8 LTEXT "Process Priority:",-1,223,40,51,8
END END
IDD_REPORT DIALOG 0, 0, 391, 169 IDD_REPORT DIALOG 0, 0, 391, 169
@ -63,50 +63,50 @@ BEGIN
DEFPUSHBUTTON "Megabytes",IDC_MEGABYTES,115,148,50,14 DEFPUSHBUTTON "Megabytes",IDC_MEGABYTES,115,148,50,14
DEFPUSHBUTTON "Gigabytes",IDC_GIGABYTES,169,148,50,14 DEFPUSHBUTTON "Gigabytes",IDC_GIGABYTES,169,148,50,14
DEFPUSHBUTTON "OK",IDC_REPORTOK,334,148,50,14 DEFPUSHBUTTON "OK",IDC_REPORTOK,334,148,50,14
RTEXT "Volume",IDC_STATIC,7,7,24,8 RTEXT "Volume",-1,7,7,24,8
LTEXT "Capacity",IDC_STATIC,7,51,28,8 LTEXT "Capacity",-1,7,51,28,8
RTEXT "(Drive Letter)",IDC_DRIVELETTER,63,7,117,10,SS_SUNKEN RTEXT "(Drive Letter)",IDC_DRIVELETTER,63,7,117,10,SS_SUNKEN
RTEXT "(Disk Size, Bytes)",IDC_DISKSIZEBYTES,63,51,117,10, RTEXT "(Disk Size, Bytes)",IDC_DISKSIZEBYTES,63,51,117,10,
SS_SUNKEN SS_SUNKEN
RTEXT "(Disk Size, Clusters)",IDC_DISKSIZECLUSTERS,63,73,117, RTEXT "(Disk Size, Clusters)",IDC_DISKSIZECLUSTERS,63,73,117,
10,SS_SUNKEN 10,SS_SUNKEN
LTEXT "Total clusters",IDC_STATIC,7,73,43,8 LTEXT "Total clusters",-1,7,73,43,8
RTEXT "(Cluster size)",IDC_DISKCLUSTERSIZE,63,84,117,10, RTEXT "(Cluster size)",IDC_DISKCLUSTERSIZE,63,84,117,10,
SS_SUNKEN SS_SUNKEN
LTEXT "Cluster size",IDC_STATIC,7,84,36,8 LTEXT "Cluster size",-1,7,84,36,8
RTEXT "(Files count)",IDC_FILESCOUNT,267,18,117,10,SS_SUNKEN RTEXT "(Files count)",IDC_FILESCOUNT,267,18,117,10,SS_SUNKEN
RTEXT "(Files size, bytes)",IDC_FILESSIZEBYTES,267,29,117,10, RTEXT "(Files size, bytes)",IDC_FILESSIZEBYTES,267,29,117,10,
SS_SUNKEN SS_SUNKEN
LTEXT "# of files",IDC_STATIC,194,18,28,8 LTEXT "# of files",-1,194,18,28,8
LTEXT "Total size",IDC_STATIC,194,29,31,8 LTEXT "Total size",-1,194,29,31,8
LTEXT "Size on disk",IDC_STATIC,194,40,39,8 LTEXT "Size on disk",-1,194,40,39,8
RTEXT "(Total size, bytes)",IDC_FILESSIZEONDISK,267,40,117,10, RTEXT "(Total size, bytes)",IDC_FILESSIZEONDISK,267,40,117,10,
SS_SUNKEN SS_SUNKEN
RTEXT "(Files slack bytes)",IDC_FILESSLACKBYTES,267,51,117,10, RTEXT "(Files slack bytes)",IDC_FILESSLACKBYTES,267,51,117,10,
SS_SUNKEN SS_SUNKEN
LTEXT "Wasted slack",IDC_STATIC,194,51,44,8 LTEXT "Wasted slack",-1,194,51,44,8
RTEXT "(Disk Free, Bytes)",IDC_DISKFREEBYTES,63,62,117,10, RTEXT "(Disk Free, Bytes)",IDC_DISKFREEBYTES,63,62,117,10,
SS_SUNKEN SS_SUNKEN
LTEXT "Free space",IDC_STATIC,7,62,36,8 LTEXT "Free space",-1,7,62,36,8
RTEXT "(Files fragmented, count)",IDC_FILESFRAGGED,267,62,117, RTEXT "(Files fragmented, count)",IDC_FILESFRAGGED,267,62,117,
10,SS_SUNKEN 10,SS_SUNKEN
LTEXT "Fragmented files",IDC_STATIC,194,62,52,8 LTEXT "Fragmented files",-1,194,62,52,8
RTEXT "(Dirs count)",IDC_DIRSCOUNT,267,7,117,10,SS_SUNKEN RTEXT "(Dirs count)",IDC_DIRSCOUNT,267,7,117,10,SS_SUNKEN
LTEXT "# of directories",IDC_STATIC,194,7,48,8 LTEXT "# of directories",-1,194,7,48,8
RTEXT "File System",IDC_STATIC,7,40,36,8 RTEXT "File System",-1,7,40,36,8
RTEXT "(File System Name)",IDC_FILESYSTEM,63,40,117,10, RTEXT "(File System Name)",IDC_FILESYSTEM,63,40,117,10,
SS_SUNKEN SS_SUNKEN
RTEXT "Volume Label",IDC_STATIC,7,18,44,8 RTEXT "Volume Label",-1,7,18,44,8
RTEXT "(Volume Name)",IDC_VOLUMELABEL,63,18,117,10,SS_SUNKEN RTEXT "(Volume Name)",IDC_VOLUMELABEL,63,18,117,10,SS_SUNKEN
RTEXT "Serial",IDC_STATIC,7,29,18,8 RTEXT "Serial",-1,7,29,18,8
RTEXT "(Volume Serial)",IDC_VOLUMESERIAL,63,29,117,10, RTEXT "(Volume Serial)",IDC_VOLUMESERIAL,63,29,117,10,
SS_SUNKEN SS_SUNKEN
RTEXT "(Average Frags Per File)",IDC_AVERAGEFRAGS,267,73,117, RTEXT "(Average Frags Per File)",IDC_AVERAGEFRAGS,267,73,117,
10,SS_SUNKEN 10,SS_SUNKEN
LTEXT "Average fragments per file",IDC_STATIC,194,73,60,20 LTEXT "Average fragments per file",-1,194,73,60,20
LTEXT "XX.X% of the files on this drive are fragmented. It is recommended that you perform a SSSSSSS defragmentation.", LTEXT "XX.X% of the files on this drive are fragmented. It is recommended that you perform a SSSSSSS defragmentation.",
IDC_RECOMMEND,7,106,377,38,SS_SUNKEN IDC_RECOMMEND,7,106,377,38,SS_SUNKEN
LTEXT "Recommendations:",IDC_STATIC,7,96,62,8 LTEXT "Recommendations:",-1,7,96,62,8
END END
@ -150,7 +150,7 @@ END
2 TEXTINCLUDE 2 TEXTINCLUDE
BEGIN BEGIN
"#include ""afxres.h""\r\n" "#include ""windows.h""\r\n"
"\0" "\0"
END END

View file

@ -1,27 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 7.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fraginator", "Fraginator.vcproj", "{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fraginator", "Fraginator.vcproj", "{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unfrag", "unfrag.vcproj", "{8E7E76C1-739B-46E5-99C2-A0504558164B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unfrag", "unfrag.vcproj", "{8E7E76C1-739B-46E5-99C2-A0504558164B}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
ConfigName.0 = Debug Debug|Win32 = Debug|Win32
ConfigName.1 = Release Release|Win32 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug|Win32.ActiveCfg = Debug|Win32
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug|Win32.Build.0 = Debug|Win32
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release|Win32.ActiveCfg = Release|Win32
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release|Win32.Build.0 = Release|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug|Win32.ActiveCfg = Debug|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug|Win32.Build.0 = Debug|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Release|Win32.ActiveCfg = Release|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(SolutionProperties) = preSolution
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug.ActiveCfg = Debug|Win32 HideSolutionNode = FALSE
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug.Build.0 = Debug|Win32
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release.ActiveCfg = Release|Win32
{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release.Build.0 = Release|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug.ActiveCfg = Debug|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug.Build.0 = Debug|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Release.ActiveCfg = Release|Win32
{8E7E76C1-739B-46E5-99C2-A0504558164B}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

Binary file not shown.

View file

@ -1,200 +1,292 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.00" Version="8,00"
Name="Fraginator" Name="Fraginator"
SccProjectName="" ProjectGUID="{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}"
SccLocalPath=""> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"
/>
</Platforms> </Platforms>
<ToolFiles>
</ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory=".\Release" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=".\Release" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"> ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
ManagedExtensions="0"
>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCPreBuildEventTool"
Optimization="3" />
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OptimizeForProcessor="2"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
ExceptionHandling="TRUE"
RuntimeLibrary="0"
StructMemberAlignment="5"
BufferSecurityCheck="FALSE"
PrecompiledHeaderFile=".\Release/Fraginator.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAsManaged="0"
CallingConvention="1"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"
/>
<Tool <Tool
Name="VCLinkerTool" Name="VCXMLDataGeneratorTool"
AdditionalOptions="/MACHINE:I386" />
AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib" <Tool
OutputFile=".\Release/Fraginator.exe" Name="VCWebServiceProxyGeneratorTool"
LinkIncremental="1" />
SuppressStartupBanner="TRUE"
SubSystem="2"/>
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE" MkTypLibCompatible="true"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
TargetEnvironment="1" TargetEnvironment="1"
TypeLibraryName=".\Release/Fraginator.tlb"/> TypeLibraryName=".\Release/Fraginator.tlb"
/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCCLCompilerTool"
Description="Copying to Program Files ..." Optimization="3"
CommandLine="copy Release\Fraginator.exe &quot;c:\Program Files\Fraginator\Fraginator.exe&quot;"/> InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
ExceptionHandling="1"
RuntimeLibrary="0"
StructMemberAlignment="5"
BufferSecurityCheck="false"
PrecompiledHeaderFile=".\Release/Fraginator.pch"
WarningLevel="3"
SuppressStartupBanner="true"
CallingConvention="1"
/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCManagedResourceCompilerTool"
<Tool />
Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
Culture="1033"/> Culture="1033"
/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCPreLinkEventTool"
/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="user32.lib advapi32.lib shell32.lib comctl32.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="2"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying to Program Files ..."
CommandLine="copy Release\Fraginator.exe &quot;c:\Program Files\Fraginator\Fraginator.exe&quot;"
/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory=".\Debug" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=".\Debug" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"> ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/Fraginator.tlb"
/>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
PrecompiledHeaderFile=".\Debug/Fraginator.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
DebugInformationFormat="4"/> DebugInformationFormat="4"
/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCManagedResourceCompilerTool"
<Tool />
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/Fraginator.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/Fraginator.pdb"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/Fraginator.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG" PreprocessorDefinitions="_DEBUG"
Culture="1033"/> Culture="1033"
/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCPreLinkEventTool"
/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="user32.lib advapi32.lib shell32.lib comctl32.lib"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="2"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References>
</References>
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File <File
RelativePath=".\Defragment.cpp"> RelativePath=".\Defragment.cpp"
>
</File> </File>
<File <File
RelativePath=".\DriveVolume.cpp"> RelativePath=".\DriveVolume.cpp"
>
</File> </File>
<File <File
RelativePath=".\Fraginator.cpp"> RelativePath=".\Fraginator.cpp"
>
</File> </File>
<File <File
RelativePath=".\MainDialog.cpp"> RelativePath=".\MainDialog.cpp"
>
</File> </File>
<File <File
RelativePath=".\ReportDialog.cpp"> RelativePath=".\ReportDialog.cpp"
>
</File> </File>
<File <File
RelativePath="Unfrag.cpp"> RelativePath="Unfrag.cpp"
>
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl"> Filter="h;hpp;hxx;hm;inl"
>
<File <File
RelativePath=".\Defragment.h"> RelativePath=".\Defragment.h"
>
</File> </File>
<File <File
RelativePath=".\DriveVolume.h"> RelativePath=".\DriveVolume.h"
>
</File> </File>
<File <File
RelativePath=".\Fraginator.h"> RelativePath=".\Fraginator.h"
>
</File> </File>
<File <File
RelativePath=".\MainDialog.h"> RelativePath=".\MainDialog.h"
>
</File> </File>
<File <File
RelativePath=".\Mutex.h"> RelativePath=".\Mutex.h"
>
</File> </File>
<File <File
RelativePath=".\ReportDialog.h"> RelativePath=".\ReportDialog.h"
>
</File> </File>
<File <File
RelativePath=".\Unfrag.h"> RelativePath=".\resource.h"
>
</File> </File>
<File <File
RelativePath=".\resource.h"> RelativePath=".\Unfrag.h"
>
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File <File
RelativePath=".\Fraginator Help - Fraginator Icon.bmp"> RelativePath=".\default1.bin"
>
</File> </File>
<File <File
RelativePath=".\Fraginator Motif Icon.bmp"> RelativePath=".\Fraginator Help - Fraginator Icon.bmp"
>
</File> </File>
<File <File
RelativePath=".\Fraginator.rc"> RelativePath=".\Fraginator Motif Icon.bmp"
>
</File> </File>
<File <File
RelativePath=".\default1.bin"> RelativePath=".\Fraginator.rc"
>
</File> </File>
<File <File
RelativePath=".\icon1.ico"> RelativePath=".\icon1.ico"
>
</File> </File>
</Filter> </Filter>
</Files> </Files>

View file

@ -6,7 +6,7 @@
#include "ReportDialog.h" #include "ReportDialog.h"
vector<string> DrivesList; vector<wstring> DrivesList;
LRESULT AnalyzeID; LRESULT AnalyzeID;
LRESULT FastID; LRESULT FastID;
LRESULT ExtensiveID; LRESULT ExtensiveID;
@ -24,8 +24,8 @@ LRESULT PriIdleID;
void InitDialog (HWND Dlg); void InitDialog (HWND Dlg);
void UpdateDefragInfo (HWND Dlg); void UpdateDefragInfo (HWND Dlg);
void UpdatePriority (HWND Dlg); void UpdatePriority (HWND Dlg);
string GetDefaultTitle (void); wstring GetDefaultTitle (void);
string GetDefragTitle (void); wstring GetDefragTitle (void);
void SetDisables (HWND Dlg); void SetDisables (HWND Dlg);
INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam); INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam);
@ -38,7 +38,7 @@ static void InitDialog (HWND Dlg)
int d; int d;
// Clear out wisecracks line for now // Clear out wisecracks line for now
SetDlgItemText (Dlg, IDC_WISECRACKS, "\"Defrag, baby!\""); SetDlgItemText (Dlg, IDC_WISECRACKS, L"\"Defrag, baby!\"");
// Make list of logical drives // Make list of logical drives
DrivesList.resize (0); DrivesList.resize (0);
@ -48,10 +48,10 @@ static void InitDialog (HWND Dlg)
{ {
if (DriveMask & (1 << d)) if (DriveMask & (1 << d))
{ {
string Name; wstring Name;
Name = (char)('A' + d); Name = (wchar_t)(L'A' + d);
Name += ':'; Name += L':';
DrivesList.push_back (Name); DrivesList.push_back (Name);
} }
} }
@ -67,23 +67,23 @@ static void InitDialog (HWND Dlg)
// Put in defrag methods // Put in defrag methods
DlgItem = GetDlgItem (Dlg, IDC_METHODS_LIST); DlgItem = GetDlgItem (Dlg, IDC_METHODS_LIST);
SendMessage (DlgItem, CB_RESETCONTENT, 0, 0); SendMessage (DlgItem, CB_RESETCONTENT, 0, 0);
AnalyzeID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Analyze Only"); AnalyzeID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Analyze Only");
FastID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Fast Defrag"); FastID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Fast Defrag");
ExtensiveID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Extensive Defrag"); ExtensiveID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Extensive Defrag");
// Set up process priorities // Set up process priorities
DlgItem = GetDlgItem (Dlg, IDC_PRIORITY_LIST); DlgItem = GetDlgItem (Dlg, IDC_PRIORITY_LIST);
SendMessage (Dlg, CB_RESETCONTENT, 0, 0); SendMessage (Dlg, CB_RESETCONTENT, 0, 0);
PriHighID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "High"); PriHighID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"High");
PriAboveNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Above Normal"); PriAboveNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Above Normal");
PriNormalID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Normal"); PriNormalID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Normal");
PriBelowNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Below Normal"); PriBelowNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Below Normal");
PriIdleID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Idle"); PriIdleID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) L"Idle");
UpdatePriority (Dlg); UpdatePriority (Dlg);
// Reset texts and progress meters // Reset texts and progress meters
SendDlgItemMessage (Dlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM) ""); SendDlgItemMessage (Dlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM) L"");
SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) ""); SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) L"");
SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM (0, 10000)); SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM (0, 10000));
SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, 0, 0); SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, 0, 0);
@ -93,10 +93,10 @@ static void InitDialog (HWND Dlg)
void UpdateDefragInfo (HWND Dlg) void UpdateDefragInfo (HWND Dlg)
{ {
char PercentText[100]; wchar_t PercentText[100];
static double OldPercent = 200.0f; static double OldPercent = 200.0f;
static string OldStatus = "Non"; static wstring OldStatus = L"Non";
string NewStatus; wstring NewStatus;
double NewPercent; double NewPercent;
if (Defrag == NULL) if (Defrag == NULL)
@ -109,7 +109,7 @@ void UpdateDefragInfo (HWND Dlg)
NewPercent = 0.0f; NewPercent = 0.0f;
if (NewPercent != OldPercent) if (NewPercent != OldPercent)
{ {
sprintf (PercentText, "%6.2f%%", NewPercent); swprintf (PercentText, L"%6.2f%%", NewPercent);
SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) PercentText); SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) PercentText);
SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS,
(WPARAM) (int)(NewPercent * 100.0f), 0); (WPARAM) (int)(NewPercent * 100.0f), 0);
@ -119,16 +119,16 @@ void UpdateDefragInfo (HWND Dlg)
NewStatus = Defrag->GetStatusString (); NewStatus = Defrag->GetStatusString ();
if (NewStatus != OldStatus) if (NewStatus != OldStatus)
{ // Change & characters to && to avoid underlining { // Change & characters to && to avoid underlining
string Status; wstring Status;
string::iterator it; wstring::iterator it;
Status = NewStatus; Status = NewStatus;
it = Status.begin (); it = Status.begin ();
while (it < Status.end()) while (it < Status.end())
{ {
if (*it == '&') if (*it == L'&')
{ {
Status.insert (it, 1, '&'); Status.insert (it, 1, L'&');
it++; it++;
} }
@ -145,29 +145,29 @@ void UpdateDefragInfo (HWND Dlg)
} }
string GetDefaultTitle (void) wstring GetDefaultTitle (void)
{ {
string DefaultText; wstring DefaultText;
DefaultText = string(string(APPNAME_GUI) + string(" v") + string(APPVER_STR) + DefaultText = wstring(wstring(APPNAME_GUI) + wstring(L" v") + wstring(APPVER_STR) +
string(" (C) 2000 by Rick Brewster")); wstring(L" (C) 2000 by Rick Brewster"));
return (DefaultText); return (DefaultText);
} }
string GetDefragTitle (void) wstring GetDefragTitle (void)
{ {
string DefragText; wstring DefragText;
char Percent[10]; wchar_t Percent[10];
sprintf (Percent, "%.2f%%", Defrag->GetStatusPercent()); swprintf (Percent, L"%.2f%%", Defrag->GetStatusPercent());
DefragText = GetDefaultTitle (); DefragText = GetDefaultTitle ();
if (Defrag != NULL) if (Defrag != NULL)
{ {
DefragText = string(Percent) + string (" - ") + Defrag->GetVolume().GetRootPath() + DefragText = wstring(Percent) + wstring (L" - ") + Defrag->GetVolume().GetRootPath() +
string (" - ") + DefragText; wstring (L" - ") + DefragText;
} }
return (DefragText); return (DefragText);
@ -176,17 +176,17 @@ string GetDefragTitle (void)
void SetDisables (HWND Dlg) void SetDisables (HWND Dlg)
{ {
// If a defrag is in process, set 'Start' button to say 'Stop' and disable // If a defrag is in process, set L'Start' button to say L'Stop' and disable
// the Select Drive and Select Action controls // the Select Drive and Select Action controls
if (Defrag != NULL && !Defrag->IsDoneYet() && !Defrag->HasError()) if (Defrag != NULL && !Defrag->IsDoneYet() && !Defrag->HasError())
{ {
SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) "Stop"); SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) L"Stop");
EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), FALSE); EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), FALSE);
EnableWindow (GetDlgItem (Dlg, IDC_METHODS_LIST), FALSE); EnableWindow (GetDlgItem (Dlg, IDC_METHODS_LIST), FALSE);
} }
else else
{ {
SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) "Start"); SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) L"Start");
EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), TRUE); EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), TRUE);
EnableWindow (GetDlgItem (Dlg, IDC_QUIT), TRUE); EnableWindow (GetDlgItem (Dlg, IDC_QUIT), TRUE);
EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), TRUE); EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), TRUE);
@ -235,7 +235,7 @@ bool GetRegKeys (HKEY *RegKeyResult)
Error = RegCreateKeyEx Error = RegCreateKeyEx
( (
HKEY_CURRENT_USER, HKEY_CURRENT_USER,
"Software\\Fraginator", L"Software\\Fraginator",
0, 0,
NULL, NULL,
REG_OPTION_NON_VOLATILE, REG_OPTION_NON_VOLATILE,
@ -303,7 +303,7 @@ void SaveSettings (HWND Dlg)
RegSetValueEx RegSetValueEx
( (
RegKey, RegKey,
"Default Action", L"Default Action",
0, 0,
REG_DWORD, REG_DWORD,
(CONST BYTE *)&DefragVal, (CONST BYTE *)&DefragVal,
@ -313,7 +313,7 @@ void SaveSettings (HWND Dlg)
RegSetValueEx RegSetValueEx
( (
RegKey, RegKey,
"Process Priority", L"Process Priority",
0, 0,
REG_DWORD, REG_DWORD,
(CONST BYTE *)&PriVal, (CONST BYTE *)&PriVal,
@ -346,7 +346,7 @@ void LoadSettings (HWND Dlg)
Error = RegQueryValueEx Error = RegQueryValueEx
( (
RegKey, RegKey,
"Default Action", L"Default Action",
0, 0,
&RegType, &RegType,
(BYTE *)&DTypeVal, (BYTE *)&DTypeVal,
@ -359,7 +359,7 @@ void LoadSettings (HWND Dlg)
Error = RegQueryValueEx Error = RegQueryValueEx
( (
RegKey, RegKey,
"Process Priority", L"Process Priority",
0, 0,
&RegType, &RegType,
(BYTE *)&PriVal, (BYTE *)&PriVal,
@ -419,7 +419,7 @@ void LoadSettings (HWND Dlg)
#define IDLETIME 25 #define IDLETIME 25
string OldWindowText = ""; wstring OldWindowText = L"";
INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam) INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam)
{ {
@ -443,7 +443,7 @@ INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPara
case WM_TIMER: case WM_TIMER:
if (Defrag != NULL && !ReEntrance) if (Defrag != NULL && !ReEntrance)
{ {
string NewTitle; wstring NewTitle;
SendMessage (Dlg, WM_UPDATEINFO, 0, 0); SendMessage (Dlg, WM_UPDATEINFO, 0, 0);
@ -503,7 +503,7 @@ INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPara
case ID_MAIN_HELP: case ID_MAIN_HELP:
ShellExecute (Dlg, "open", "Fraginator.chm", "", ".", SW_SHOW); ShellExecute (Dlg, L"open", L"Fraginator.chm", L"", L".", SW_SHOW);
return (1); return (1);
@ -524,8 +524,8 @@ INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPara
case IDC_STARTSTOP: case IDC_STARTSTOP:
if (Defrag == NULL) if (Defrag == NULL)
{ // "Start" { // L"Start"
char Drive[10]; wchar_t Drive[10];
LRESULT ID; LRESULT ID;
DefragType Method; DefragType Method;
HANDLE H; HANDLE H;
@ -536,7 +536,7 @@ INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPara
SendMessage (GetDlgItem (Dlg, IDC_DRIVES_LIST), WM_GETTEXT, SendMessage (GetDlgItem (Dlg, IDC_DRIVES_LIST), WM_GETTEXT,
sizeof (Drive) - 1, (LPARAM) Drive); sizeof (Drive) - 1, (LPARAM) Drive);
if (strlen(Drive) != 2 || Drive[1] != ':') if (wcslen(Drive) != 2 || Drive[1] != L':')
return (1); return (1);
ID = SendMessage (GetDlgItem (Dlg, IDC_METHODS_LIST), CB_GETCURSEL, 0, 0); ID = SendMessage (GetDlgItem (Dlg, IDC_METHODS_LIST), CB_GETCURSEL, 0, 0);
@ -559,7 +559,7 @@ INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPara
} }
} }
else else
{ // "Stop" { // L"Stop"
Stopping = true; Stopping = true;
Defrag->Stop (); Defrag->Stop ();
EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), FALSE); EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), FALSE);

View file

@ -6,11 +6,11 @@
#include "resource.h" #include "resource.h"
void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *BytesUnits, bool Fractional) void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, wchar_t *BytesUnits, bool Fractional)
{ {
char Text[1000]; wchar_t Text[1000];
char Text2[1000]; wchar_t Text2[1000];
char Text3[1000]; wchar_t Text3[1000];
memset (Text, 0, sizeof (Text)); memset (Text, 0, sizeof (Text));
@ -29,14 +29,14 @@ void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *B
// DiskSizeBytes // DiskSizeBytes
if (Fractional) if (Fractional)
{ {
sprintf (Text, "%.2f %s", (double)(signed)(Report.DiskSizeBytes / swprintf (Text, L"%.2f %s", (double)(signed)(Report.DiskSizeBytes /
(BytesDivisor / 1024)) / 1024.0, BytesUnits); (BytesDivisor / 1024)) / 1024.0, BytesUnits);
} }
else else
{ {
AddCommas (Text, Report.DiskSizeBytes / BytesDivisor); AddCommas (Text, Report.DiskSizeBytes / BytesDivisor);
strcat (Text, " "); wcscat (Text, L" ");
strcat (Text, BytesUnits); wcscat (Text, BytesUnits);
} }
SetDlgItemText (Dlg, IDC_DISKSIZEBYTES, Text); SetDlgItemText (Dlg, IDC_DISKSIZEBYTES, Text);
@ -44,24 +44,24 @@ void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *B
// DiskFreeBytes // DiskFreeBytes
if (Fractional) if (Fractional)
{ {
sprintf (Text, "%.2f %s", (double)(signed)(Defrag->GetVolume().GetVolumeInfo().FreeBytes / swprintf (Text, L"%.2f %s", (double)(signed)(Defrag->GetVolume().GetVolumeInfo().FreeBytes /
(BytesDivisor / 1024)) / 1024.0, BytesUnits); (BytesDivisor / 1024)) / 1024.0, BytesUnits);
} }
else else
{ {
AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().FreeBytes / BytesDivisor); AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().FreeBytes / BytesDivisor);
strcat (Text, " "); wcscat (Text, L" ");
strcat (Text, BytesUnits); wcscat (Text, BytesUnits);
} }
SetDlgItemText (Dlg, IDC_DISKFREEBYTES, Text); SetDlgItemText (Dlg, IDC_DISKFREEBYTES, Text);
// DiskSizeClusters // DiskSizeClusters
AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().ClusterCount); AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().ClusterCount);
strcat (Text, " clusters"); wcscat (Text, L" clusters");
SetDlgItemText (Dlg, IDC_DISKSIZECLUSTERS, Text); SetDlgItemText (Dlg, IDC_DISKSIZECLUSTERS, Text);
// DiskClusterSize // DiskClusterSize
sprintf (Text, "%u bytes", Defrag->GetVolume().GetVolumeInfo().ClusterSize); swprintf (Text, L"%u bytes", Defrag->GetVolume().GetVolumeInfo().ClusterSize);
SetDlgItemText (Dlg, IDC_DISKCLUSTERSIZE, Text); SetDlgItemText (Dlg, IDC_DISKCLUSTERSIZE, Text);
// DirsCount // DirsCount
@ -73,40 +73,40 @@ void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *B
SetDlgItemText (Dlg, IDC_FILESCOUNT, Text); SetDlgItemText (Dlg, IDC_FILESCOUNT, Text);
// FilesFragged // FilesFragged
sprintf (Text, "(%.2f%%)", Report.PercentFragged); swprintf (Text, L"(%.2f%%)", Report.PercentFragged);
AddCommas (Text2, Report.FraggedFiles.size()); AddCommas (Text2, Report.FraggedFiles.size());
sprintf (Text3, "%s %s", Text, Text2); swprintf (Text3, L"%s %s", Text, Text2);
SetDlgItemText (Dlg, IDC_FILESFRAGGED, Text3); SetDlgItemText (Dlg, IDC_FILESFRAGGED, Text3);
// Average Frags // Average Frags
sprintf (Text, "%.2f", Report.AverageFragments); swprintf (Text, L"%.2f", Report.AverageFragments);
SetDlgItemText (Dlg, IDC_AVERAGEFRAGS, Text); SetDlgItemText (Dlg, IDC_AVERAGEFRAGS, Text);
// FilesSizeBytes // FilesSizeBytes
if (Fractional) if (Fractional)
{ {
sprintf (Text, "%.2f %s", (double)(signed)(Report.FilesSizeBytes / swprintf (Text, L"%.2f %s", (double)(signed)(Report.FilesSizeBytes /
(BytesDivisor / 1024)) / 1024.0, BytesUnits); (BytesDivisor / 1024)) / 1024.0, BytesUnits);
} }
else else
{ {
AddCommas (Text, Report.FilesSizeBytes / (uint64)BytesDivisor); AddCommas (Text, Report.FilesSizeBytes / (uint64)BytesDivisor);
strcat (Text, " "); wcscat (Text, L" ");
strcat (Text, BytesUnits); wcscat (Text, BytesUnits);
} }
SetDlgItemText (Dlg, IDC_FILESSIZEBYTES, Text); SetDlgItemText (Dlg, IDC_FILESSIZEBYTES, Text);
// Files SizeOnDisk // Files SizeOnDisk
if (Fractional) if (Fractional)
{ {
sprintf (Text, "%.2f %s", (double)(signed)((Report.FilesSizeBytes + Report.FilesSlackBytes) / swprintf (Text, L"%.2f %s", (double)(signed)((Report.FilesSizeBytes + Report.FilesSlackBytes) /
(BytesDivisor / 1024)) / 1024.0, BytesUnits); (BytesDivisor / 1024)) / 1024.0, BytesUnits);
} }
else else
{ {
AddCommas (Text, (Report.FilesSizeBytes + Report.FilesSlackBytes) / (uint64)BytesDivisor); AddCommas (Text, (Report.FilesSizeBytes + Report.FilesSlackBytes) / (uint64)BytesDivisor);
strcat (Text, " "); wcscat (Text, L" ");
strcat (Text, BytesUnits); wcscat (Text, BytesUnits);
} }
SetDlgItemText (Dlg, IDC_FILESSIZEONDISK, Text); SetDlgItemText (Dlg, IDC_FILESSIZEONDISK, Text);
@ -114,17 +114,17 @@ void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *B
// FilesSlackBytes // FilesSlackBytes
if (Fractional) if (Fractional)
{ {
sprintf (Text, "%.2f %s", (double)(signed)(Report.FilesSlackBytes / swprintf (Text, L"%.2f %s", (double)(signed)(Report.FilesSlackBytes /
(BytesDivisor / 1024)) / 1024.0, BytesUnits); (BytesDivisor / 1024)) / 1024.0, BytesUnits);
} }
else else
{ {
AddCommas (Text, Report.FilesSlackBytes / BytesDivisor); AddCommas (Text, Report.FilesSlackBytes / BytesDivisor);
strcat (Text, " "); wcscat (Text, L" ");
strcat (Text, BytesUnits); wcscat (Text, BytesUnits);
} }
sprintf (Text2, "(%.2f%%)", Report.PercentSlack); swprintf (Text2, L"(%.2f%%)", Report.PercentSlack);
sprintf (Text3, "%s %s", Text2, Text); swprintf (Text3, L"%s %s", Text2, Text);
SetDlgItemText (Dlg, IDC_FILESSLACKBYTES, Text3); SetDlgItemText (Dlg, IDC_FILESSLACKBYTES, Text3);
// Recommendation // Recommendation
@ -137,55 +137,55 @@ void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *B
if (Report.AverageFragments >= 1.1f) if (Report.AverageFragments >= 1.1f)
AFRec = true; AFRec = true;
strcpy (Text, "* "); wcscpy (Text, L"* ");
if (PFRec) if (PFRec)
{ {
sprintf swprintf
( (
Text2, Text2,
"%.2f%% of the files on this volume are fragmented. ", L"%.2f%% of the files on this volume are fragmented. ",
Report.PercentFragged Report.PercentFragged
); );
strcat (Text, Text2); wcscat (Text, Text2);
} }
if (AFRec) if (AFRec)
{ {
sprintf swprintf
( (
Text2, Text2,
"The average fragments per file (%.2f) indicates a high degree of fragmentation. ", L"The average fragments per file (%.2f) indicates a high degree of fragmentation. ",
Report.AverageFragments Report.AverageFragments
); );
strcat (Text, Text2); wcscat (Text, Text2);
} }
if (Report.PercentFragged < 5.0f && Report.AverageFragments < 1.1f) if (Report.PercentFragged < 5.0f && Report.AverageFragments < 1.1f)
sprintf (Text, "* No defragmentation is necessary at this point."); swprintf (Text, L"* No defragmentation is necessary at this point.");
else else
if (Report.PercentFragged < 15.0f && Report.AverageFragments < 1.3f) if (Report.PercentFragged < 15.0f && Report.AverageFragments < 1.3f)
strcat (Text, "It is recommended that you perform a Fast Defrag."); wcscat (Text, L"It is recommended that you perform a Fast Defrag.");
else else
strcat (Text, "It is recommended that you perform an Extensive Defrag."); wcscat (Text, L"It is recommended that you perform an Extensive Defrag.");
// Should we recommend a smaller cluster size? // Should we recommend a smaller cluster size?
if (Report.PercentSlack >= 10.0f) if (Report.PercentSlack >= 10.0f)
{ {
sprintf swprintf
( (
Text2, Text2,
"\n* A large amount of disk space (%.2f%%) is being lost " L"\n* A large amount of disk space (%.2f%%) is being lost "
"due to a large (%u bytes) cluster size. It is recommended " L"due to a large (%u bytes) cluster size. It is recommended "
"that you use a disk utility such as Partition Magic to " L"that you use a disk utility such as Partition Magic to "
"reduce the cluster size of this volume.", L"reduce the cluster size of this volume.",
Report.PercentSlack, Report.PercentSlack,
Defrag->GetVolume().GetVolumeInfo().ClusterSize Defrag->GetVolume().GetVolumeInfo().ClusterSize
); );
strcat (Text, Text2); wcscat (Text, Text2);
} }
SetDlgItemText (Dlg, IDC_RECOMMEND, Text); SetDlgItemText (Dlg, IDC_RECOMMEND, Text);
@ -199,7 +199,7 @@ INT_PTR CALLBACK ReportDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPa
switch (Msg) switch (Msg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, "bytes", false); SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, L"bytes", false);
return (1); return (1);
case WM_COMMAND: case WM_COMMAND:
@ -210,19 +210,19 @@ INT_PTR CALLBACK ReportDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LPa
return (1); return (1);
case IDC_GIGABYTES: case IDC_GIGABYTES:
SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024*1024, "GB", true); SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024*1024, L"GB", true);
return (1); return (1);
case IDC_MEGABYTES: case IDC_MEGABYTES:
SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024, "MB", false); SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024, L"MB", false);
return (1); return (1);
case IDC_KILOBYTES: case IDC_KILOBYTES:
SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024, "KB", false); SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024, L"KB", false);
return (1); return (1);
case IDC_BYTES: case IDC_BYTES:
SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, "bytes", false); SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, L"bytes", false);
return (1); return (1);
} }
} }

View file

@ -27,7 +27,7 @@ bool CheckWinVer (void)
// Need Windows 2000! // Need Windows 2000!
// Check for NT first // Check for NT first
// Actually what we do is check that we're not on Win31+Win32s and that we're // Actually what we do is check that weLL're not on Win31+Win32s and that we're
// not in Windows 9x. It's possible that there could be more Windows "platforms" // not in Windows 9x. It's possible that there could be more Windows "platforms"
// in the future and there's no sense in claiming incompatibility. // in the future and there's no sense in claiming incompatibility.
if (OSVersion.dwPlatformId == VER_PLATFORM_WIN32s || if (OSVersion.dwPlatformId == VER_PLATFORM_WIN32s ||
@ -36,7 +36,7 @@ bool CheckWinVer (void)
return (false); return (false);
} }
// Ok we're in Windows NT, now make sure we're in 2000 // Ok weLL're in Windows NT, now make sure we're in 2000
if (OSVersion.dwMajorVersion < 5) if (OSVersion.dwMajorVersion < 5)
return (false); return (false);
@ -45,27 +45,27 @@ bool CheckWinVer (void)
} }
char *AddCommas (char *Result, uint64 Number) wchar_t *AddCommas (wchar_t *Result, uint64 Number)
{ {
char Temp[128]; wchar_t Temp[128];
int TempLen; int TempLen;
char *p = NULL; wchar_t *p = NULL;
int AddCommas = 0; int AddCommas = 0;
char *StrPosResult = NULL; wchar_t *StrPosResult = NULL;
char *StrPosOrig = NULL; wchar_t *StrPosOrig = NULL;
// we get the string form of the number, then we count down w/ AddCommas // we get the string form of the number, then we count down w/ AddCommas
// while copying the string from Temp1 to Result. when AddCommas % 3 == 1, // while copying the string from Temp1 to Result. when AddCommas % 3 == 1,
// slap in a commas as well, before the #. // slap in a commas as well, before the #.
sprintf (Temp, "%I64u", Number); swprintf (Temp, L"%I64u", Number);
AddCommas = TempLen = strlen (Temp); AddCommas = TempLen = wcslen (Temp);
StrPosOrig = Temp; StrPosOrig = Temp;
StrPosResult = Result; StrPosResult = Result;
while (AddCommas) while (AddCommas)
{ {
if ((AddCommas % 3) == 0 && AddCommas != TempLen) // avoid stuff like ",345" if ((AddCommas % 3) == 0 && AddCommas != TempLen) // avoid stuff like ",345"
{ {
*StrPosResult = ','; *StrPosResult = L',';
StrPosResult++; StrPosResult++;
} }
@ -84,9 +84,9 @@ char *AddCommas (char *Result, uint64 Number)
void PrintBanner (void) void PrintBanner (void)
{ {
printf ("%s v%s\n", APPNAME_CLI, APPVER_STR); wprintf (L"%s v%s\n", APPNAME_CLI, APPVER_STR);
printf ("%s\n", APPCOPYRIGHT); wprintf (L"%s\n", APPCOPYRIGHT);
printf ("\n"); wprintf (L"\n");
return; return;
} }
@ -94,23 +94,23 @@ void PrintBanner (void)
void FraggerHelp (void) void FraggerHelp (void)
{ {
printf ("Usage: unfrag drive: [...] <-f | -e>\n"); wprintf (L"Usage: unfrag drive: [...] <-f | -e>\n");
printf ("\n"); wprintf (L"\n");
printf ("drive: : The drive to defrag. Should be two characters long, ie 'c:' or 'd:'.\n"); wprintf (L"drive: : The drive to defrag. Should be two characters long, ie 'c:' or 'd:'.\n");
printf (" Multiple drives may be given, and all will be simultaneously\n"); wprintf (L" Multiple drives may be given, and all will be simultaneously\n");
printf (" defragmented using the same options.\n"); wprintf (L" defragmented using the same options.\n");
printf ("-f : Do a fast defragmentation. Files that are not fragmented will not be\n"); wprintf (L"-f : Do a fast defragmentation. Files that are not fragmented will not be\n");
printf (" moved. Only one pass is made over the file list. Using this option\n"); wprintf (L" moved. Only one pass is made over the file list. Using this option\n");
printf (" may result in not all files being defragmented, depending on\n"); wprintf (L" may result in not all files being defragmented, depending on\n");
printf (" available disk space.\n"); wprintf (L" available disk space.\n");
printf ("-e : Do an extensive defragmention. Files will be moved in an attempt to\n"); wprintf (L"-e : Do an extensive defragmention. Files will be moved in an attempt to\n");
printf (" defragment both files and free space.\n"); wprintf (L" defragment both files and free space.\n");
if (!CheckWinVer()) if (!CheckWinVer())
{ {
printf ("\n"); wprintf (L"\n");
printf ("NOTE: This program requires Windows 2000, which is not presently running on\n"); wprintf (L"NOTE: This program requires Windows 2000, which is not presently running on\n");
printf ("this system.\n"); wprintf (L"this system.\n");
} }
return; return;
@ -129,7 +129,7 @@ void __cdecl DefragThread (LPVOID parm)
} }
Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle) Defragment *StartDefragThread (wstring Drive, DefragType Method, HANDLE &Handle)
{ {
Defragment *Defragger; Defragment *Defragger;
unsigned long Thread; unsigned long Thread;
@ -143,12 +143,11 @@ Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle)
// Main Initialization // Main Initialization
int __cdecl main (int argc, char **argv) int wmain (int argc, wchar_t **argv)
{ {
vector<string> Drives; vector<wstring> Drives;
vector<Defragment *> Defrags; vector<Defragment *> Defrags;
DefragType DefragMode = DefragInvalid; DefragType DefragMode = DefragInvalid;
int d;
PrintBanner (); PrintBanner ();
@ -156,21 +155,21 @@ int __cdecl main (int argc, char **argv)
bool ValidCmdLine = false; bool ValidCmdLine = false;
for (int c = 0; c < argc; c++) for (int c = 0; c < argc; c++)
{ {
if (strlen(argv[c]) == 2 && argv[c][1] == ':') if (wcslen(argv[c]) == 2 && argv[c][1] == L':')
{ {
Drives.push_back (strupr(argv[c])); Drives.push_back (wcsupr(argv[c]));
} }
else else
if (argv[c][0] == '-' || argv[c][0] == '/' && strlen(argv[c]) == 2) if (argv[c][0] == L'-' || argv[c][0] == L'/' && wcslen(argv[c]) == 2)
{ {
switch (tolower(argv[c][1])) switch (tolower(argv[c][1]))
{ {
case '?' : case L'?' :
case 'h' : case L'h' :
FraggerHelp (); FraggerHelp ();
return (0); return (0);
case 'f' : case L'f' :
if (DefragMode != DefragInvalid) if (DefragMode != DefragInvalid)
{ {
ValidCmdLine = false; ValidCmdLine = false;
@ -180,7 +179,7 @@ int __cdecl main (int argc, char **argv)
ValidCmdLine = true; ValidCmdLine = true;
break; break;
case 'e' : case L'e' :
if (DefragMode != DefragInvalid) if (DefragMode != DefragInvalid)
{ {
ValidCmdLine = false; ValidCmdLine = false;
@ -199,25 +198,25 @@ int __cdecl main (int argc, char **argv)
if (!ValidCmdLine) if (!ValidCmdLine)
{ {
printf ("Invalid command-line options. Use '%s -?' for help.\n", argv[0]); wprintf (L"Invalid command-line options. Use '%s -?' for help.\n", argv[0]);
return (0); return (0);
} }
// Check OS requirements // Check OS requirements
if (!CheckWinVer()) if (!CheckWinVer())
{ {
printf ("Fatal Error: This program requires Windows 2000.\n"); wprintf (L"Fatal Error: This program requires Windows 2000.\n");
return (0); return (0);
} }
for (d = 0; d < Drives.size (); d++) for (size_t d = 0; d < Drives.size (); d++)
{ {
HANDLE TossMe; HANDLE TossMe;
Defrags.push_back (StartDefragThread (Drives[d], DefragMode, TossMe)); Defrags.push_back (StartDefragThread (Drives[d], DefragMode, TossMe));
} }
for (d = 0; d < Drives.size () - 1; d++) for (size_t d = 0; d < Drives.size () - 1; d++)
printf ("\n "); wprintf (L"\n ");
bool Continue = true; bool Continue = true;
HANDLE Screen; HANDLE Screen;
@ -237,14 +236,14 @@ int __cdecl main (int argc, char **argv)
ScreenInfo.dwCursorPosition.Y -= Drives.size(); ScreenInfo.dwCursorPosition.Y -= Drives.size();
SetConsoleCursorPosition (Screen, ScreenInfo.dwCursorPosition); SetConsoleCursorPosition (Screen, ScreenInfo.dwCursorPosition);
for (d = 0; d < Drives.size (); d++) for (size_t d = 0; d < Drives.size (); d++)
{ {
printf ("\n%6.2f%% %-70s", Defrags[d]->GetStatusPercent(), Defrags[d]->GetStatusString().c_str()); wprintf (L"\n%6.2f%% %-70s", Defrags[d]->GetStatusPercent(), Defrags[d]->GetStatusString().c_str());
} }
// Determine if we should keep going // Determine if we should keep going
Continue = false; Continue = false;
for (d = 0; d < Drives.size (); d++) for (size_t d = 0; d < Drives.size (); d++)
{ {
if (!Defrags[d]->IsDoneYet() && !Defrags[d]->HasError()) if (!Defrags[d]->IsDoneYet() && !Defrags[d]->HasError())
Continue = true; Continue = true;
@ -260,43 +259,43 @@ int __cdecl main (int argc, char **argv)
Drive = new DriveVolume; Drive = new DriveVolume;
// First thing: build a file list. // First thing: build a file list.
printf ("Opening volume %s ...", Drives[d].c_str()); wprintf (L"Opening volume %s ...", Drives[d].c_str());
if (!Drive->Open (Drives[d])) if (!Drive->Open (Drives[d]))
{ {
printf ("FAILED\n\n"); wprintf (L"FAILED\n\n");
delete Drive; delete Drive;
continue; continue;
} }
printf ("\n"); wprintf (L"\n");
printf (" Getting drive bitmap ..."); wprintf (L" Getting drive bitmap ...");
if (!Drive->GetBitmap ()) if (!Drive->GetBitmap ())
{ {
printf ("FAILED\n\n"); wprintf (L"FAILED\n\n");
delete Drive; delete Drive;
continue; continue;
} }
printf ("\n"); wprintf (L"\n");
printf (" Obtaining drive geometry ..."); wprintf (L" Obtaining drive geometry ...");
if (!Drive->ObtainInfo ()) if (!Drive->ObtainInfo ())
{ {
printf ("FAILED\n\n"); wprintf (L"FAILED\n\n");
delete Drive; delete Drive;
continue; continue;
} }
printf ("\n"); wprintf (L"\n");
printf (" Building file database for drive %s ...", Drives[d].c_str()); wprintf (L" Building file database for drive %s ...", Drives[d].c_str());
if (!Drive->BuildFileList ()) if (!Drive->BuildFileList ())
{ {
printf ("FAILED\n\n"); wprintf (L"FAILED\n\n");
delete Drive; delete Drive;
continue; continue;
} }
printf ("\n"); wprintf (L"\n");
printf (" %u files\n", Drive->GetDBFileCount ()); wprintf (L" %u files\n", Drive->GetDBFileCount ());
// Analyze only? // Analyze only?
if (DefragMode == DefragAnalyze) if (DefragMode == DefragAnalyze)
@ -306,9 +305,9 @@ int __cdecl main (int argc, char **argv)
uint64 SlackBytes = 0; // wasted space due to slack uint64 SlackBytes = 0; // wasted space due to slack
uint32 Fragged = 0; // fragmented files uint32 Fragged = 0; // fragmented files
printf (" Analyzing ..."); wprintf (L" Analyzing ...");
if (VerboseMode) if (VerboseMode)
printf ("\n"); wprintf (L"\n");
for (int i = 0; i < Drive->GetDBFileCount(); i++) for (int i = 0; i < Drive->GetDBFileCount(); i++)
{ {
@ -328,16 +327,16 @@ int __cdecl main (int argc, char **argv)
if (VerboseMode) if (VerboseMode)
{ {
printf (" %s%s, ", Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str()); wprintf (L" %s%s, ", Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str());
if (Info.Attributes.AccessDenied) if (Info.Attributes.AccessDenied)
printf ("access was denied\n"); wprintf (L"access was denied\n");
else else
{ {
if (Info.Attributes.Unmovable == 1) if (Info.Attributes.Unmovable == 1)
printf ("unmovable, "); wprintf (L"unmovable, ");
printf ("%I64u bytes, %I64u bytes on disk, %I64u bytes slack, %u fragments\n", wprintf (L"%I64u bytes, %I64u bytes on disk, %I64u bytes slack, %u fragments\n",
Info.Size, Used, Slack, Info.Fragments.size()); Info.Size, Used, Slack, Info.Fragments.size());
} }
} }
@ -347,23 +346,23 @@ int __cdecl main (int argc, char **argv)
} }
if (!VerboseMode) if (!VerboseMode)
printf ("\n"); wprintf (L"\n");
// TODO: Make it not look like ass // TODO: Make it not look like ass
printf ("\n"); wprintf (L"\n");
printf (" Overall Analysis\n"); wprintf (L" Overall Analysis\n");
printf (" ----------------\n"); wprintf (L" ----------------\n");
printf (" %u clusters\n", Drive->GetClusterCount ()); wprintf (L" %u clusters\n", Drive->GetClusterCount ());
printf (" %u bytes per cluster\n", Drive->GetClusterSize()); wprintf (L" %u bytes per cluster\n", Drive->GetClusterSize());
printf (" %I64u total bytes on drive\n", (uint64)Drive->GetClusterCount() * (uint64)Drive->GetClusterSize()); wprintf (L" %I64u total bytes on drive\n", (uint64)Drive->GetClusterCount() * (uint64)Drive->GetClusterSize());
printf ("\n"); wprintf (L"\n");
printf (" %u files\n", Drive->GetDBFileCount ()); wprintf (L" %u files\n", Drive->GetDBFileCount ());
printf (" %u contiguous files\n", Drive->GetDBFileCount () - Fragged); wprintf (L" %u contiguous files\n", Drive->GetDBFileCount () - Fragged);
printf (" %u fragmented files\n", Fragged); wprintf (L" %u fragmented files\n", Fragged);
printf ("\n"); wprintf (L"\n");
printf (" %I64u bytes\n", TotalBytes); wprintf (L" %I64u bytes\n", TotalBytes);
printf (" %I64u bytes on disk\n", UsedBytes); wprintf (L" %I64u bytes on disk\n", UsedBytes);
printf (" %I64u bytes slack\n", SlackBytes); wprintf (L" %I64u bytes slack\n", SlackBytes);
} }
// Fast defragment! // Fast defragment!
@ -371,14 +370,14 @@ int __cdecl main (int argc, char **argv)
{ {
uint32 i; uint32 i;
uint64 FirstFreeLCN; uint64 FirstFreeLCN;
char PrintName[80]; wchar_t PrintName[80];
int Width = 66; int Width = 66;
if (DefragMode == DefragFast) if (DefragMode == DefragFast)
printf (" Performing fast file defragmentation ...\n"); wprintf (L" Performing fast file defragmentation ...\n");
else else
if (DefragMode == DefragExtensive) if (DefragMode == DefragExtensive)
printf (" Performing extensive file defragmentation\n"); wprintf (L" Performing extensive file defragmentation\n");
// Find first free LCN for speedier searches ... // Find first free LCN for speedier searches ...
Drive->FindFreeRange (0, 1, FirstFreeLCN); Drive->FindFreeRange (0, 1, FirstFreeLCN);
@ -389,12 +388,12 @@ int __cdecl main (int argc, char **argv)
bool Result; bool Result;
uint64 TargetLCN; uint64 TargetLCN;
printf ("\r"); wprintf (L"\r");
Info = Drive->GetDBFile (i); Info = Drive->GetDBFile (i);
FitName (PrintName, Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str(), Width); FitName (PrintName, Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str(), Width);
printf (" %6.2f%% %-66s", (float)i / (float)Drive->GetDBFileCount() * 100.0f, PrintName); wprintf (L" %6.2f%% %-66s", (float)i / (float)Drive->GetDBFileCount() * 100.0f, PrintName);
// Can't defrag 0 byte files :) // Can't defrag 0 byte files :)
if (Info.Fragments.size() == 0) if (Info.Fragments.size() == 0)
@ -446,17 +445,17 @@ int __cdecl main (int argc, char **argv)
} }
if (!Success) if (!Success)
printf ("\n -> failed\n"); wprintf (L"\n -> failed\n");
Drive->FindFreeRange (0, 1, FirstFreeLCN); Drive->FindFreeRange (0, 1, FirstFreeLCN);
} }
} }
printf ("\n"); wprintf (L"\n");
} }
printf ("Closing volume %s ...", Drives[d].c_str()); wprintf (L"Closing volume %s ...", Drives[d].c_str());
delete Drive; delete Drive;
printf ("\n"); wprintf (L"\n");
} }
#endif #endif

View file

@ -32,12 +32,12 @@
#include <stdlib.h> #include <stdlib.h>
#define APPNAME_CLI "Unfrag" #define APPNAME_CLI L"Unfrag"
#define APPNAME_GUI "Fraginator" #define APPNAME_GUI L"Fraginator"
#define APPVER_STR "1.03" #define APPVER_STR L"1.03"
#define APPVER_NUM 1.03f #define APPVER_NUM 1.03f
#define APPAUTHOR "Rick Brewster" #define APPAUTHOR L"Rick Brewster"
#define APPCOPYRIGHT "Copyright 2000-2002 Rick Brewster" #define APPCOPYRIGHT L"Copyright 2000-2002 Rick Brewster"
#include <vector> #include <vector>
@ -73,10 +73,10 @@ extern bool CheckWinVer (void);
class Defragment; class Defragment;
extern Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle); extern Defragment *StartDefragThread (wstring Drive, DefragType Method, HANDLE &Handle);
extern char *AddCommas (char *Result, uint64 Number); extern wchar_t *AddCommas (wchar_t *Result, uint64 Number);
#endif // UNFRAG_H #endif // UNFRAG_H

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly <assembly
xmlns="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0"> manifestVersion="1.0">

Binary file not shown.

View file

@ -1,184 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on unfrag.dsp
!IF "$(CFG)" == ""
CFG=unfrag - Win32 Debug
!MESSAGE No configuration specified. Defaulting to unfrag - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "unfrag - Win32 Release" && "$(CFG)" != "unfrag - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "unfrag.mak" CFG="unfrag - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "unfrag - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "unfrag - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "unfrag - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
ALL : "$(OUTDIR)\unfrag.exe"
CLEAN :
-@erase "$(INTDIR)\Defragment.obj"
-@erase "$(INTDIR)\DriveVolume.obj"
-@erase "$(INTDIR)\Unfrag.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\unfrag.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\unfrag.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\unfrag.bsc"
BSC32_SBRS= \
LINK32=xilink6.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\unfrag.pdb" /machine:I386 /out:"$(OUTDIR)\unfrag.exe"
LINK32_OBJS= \
"$(INTDIR)\Defragment.obj" \
"$(INTDIR)\DriveVolume.obj" \
"$(INTDIR)\Unfrag.obj"
"$(OUTDIR)\unfrag.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
SOURCE="$(InputPath)"
PostBuild_Desc=Copying to Program Files ...
DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
ALL : $(DS_POSTBUILD_DEP)
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
$(DS_POSTBUILD_DEP) : "$(OUTDIR)\unfrag.exe"
copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe"
echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
!ELSEIF "$(CFG)" == "unfrag - Win32 Debug"
OUTDIR=.\unfrag___Win32_Debug
INTDIR=.\unfrag___Win32_Debug
# Begin Custom Macros
OutDir=.\unfrag___Win32_Debug
# End Custom Macros
ALL : "$(OUTDIR)\unfrag.exe"
CLEAN :
-@erase "$(INTDIR)\Defragment.obj"
-@erase "$(INTDIR)\DriveVolume.obj"
-@erase "$(INTDIR)\Unfrag.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\unfrag.exe"
-@erase "$(OUTDIR)\unfrag.ilk"
-@erase "$(OUTDIR)\unfrag.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\unfrag.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\unfrag.bsc"
BSC32_SBRS= \
LINK32=xilink6.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\unfrag.pdb" /debug /machine:I386 /out:"$(OUTDIR)\unfrag.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\Defragment.obj" \
"$(INTDIR)\DriveVolume.obj" \
"$(INTDIR)\Unfrag.obj"
"$(OUTDIR)\unfrag.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("unfrag.dep")
!INCLUDE "unfrag.dep"
!ELSE
!MESSAGE Warning: cannot find "unfrag.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "unfrag - Win32 Release" || "$(CFG)" == "unfrag - Win32 Debug"
SOURCE=.\Defragment.cpp
"$(INTDIR)\Defragment.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\DriveVolume.cpp
"$(INTDIR)\DriveVolume.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\Unfrag.cpp
"$(INTDIR)\Unfrag.obj" : $(SOURCE) "$(INTDIR)"
!ENDIF

View file

@ -1,48 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: unfrag - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\TEMP\RSP9D8.tmp" with contents
[
/nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"Release/" /Fd"Release/" /FD /c
"C:\src\Fraginator\Defragment.cpp"
"C:\src\Fraginator\DriveVolume.cpp"
"C:\src\Fraginator\Unfrag.cpp"
]
Creating command line "xicl6.exe @C:\TEMP\RSP9D8.tmp"
Creating temporary file "C:\TEMP\RSP9D9.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"Release/unfrag.pdb" /machine:I386 /out:"Release/unfrag.exe"
.\Release\Defragment.obj
.\Release\DriveVolume.obj
.\Release\Unfrag.obj
]
Creating command line "xilink6.exe @C:\TEMP\RSP9D9.tmp"
<h3>Output Window</h3>
Compiling...
Defragment.cpp
DriveVolume.cpp
Unfrag.cpp
Generating Code...
Linking...
xilink6: executing 'C:\PROGRA~1\MIAF9D~1\VC98\Bin\link.exe'
Creating temporary file "C:\TEMP\RSP9DB.bat" with contents
[
@echo off
copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe"
]
Creating command line "C:\TEMP\RSP9DB.bat"
Copying to Program Files ...
1 file(s) copied.
<h3>Results</h3>
unfrag.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View file

@ -1,158 +1,233 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.00" Version="8,00"
Name="unfrag" Name="unfrag"
SccProjectName="" ProjectGUID="{8E7E76C1-739B-46E5-99C2-A0504558164B}"
SccLocalPath=""> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"
/>
</Platforms> </Platforms>
<ToolFiles>
</ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory=".\Release" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=".\Release" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"> CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/unfrag.tlb"
/>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3" Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2" InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OptimizeForProcessor="2"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE" PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
RuntimeLibrary="0" RuntimeLibrary="0"
StructMemberAlignment="5" StructMemberAlignment="5"
BufferSecurityCheck="FALSE" BufferSecurityCheck="false"
PrecompiledHeaderFile=".\Release/unfrag.pch" PrecompiledHeaderFile=".\Release/unfrag.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
CallingConvention="1"/> CallingConvention="1"
/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCManagedResourceCompilerTool"
<Tool />
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile=".\Release/unfrag.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/unfrag.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/unfrag.tlb"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying to Program Files ..."
CommandLine="copy Release\unfrag.exe &quot;c:\Program Files\Fraginator\unfrag.exe&quot;"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
Culture="1033"/> Culture="1033"
/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCPreLinkEventTool"
/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying to Program Files ..."
CommandLine="copy Release\unfrag.exe &quot;c:\Program Files\Fraginator\unfrag.exe&quot;"
/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory=".\unfrag___Win32_Debug" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory=".\unfrag___Win32_Debug" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"> CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\unfrag___Win32_Debug/unfrag.tlb"
/>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE" PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
PrecompiledHeaderFile=".\unfrag___Win32_Debug/unfrag.pch"
AssemblerListingLocation=".\unfrag___Win32_Debug/"
ObjectFile=".\unfrag___Win32_Debug/"
ProgramDataBaseFileName=".\unfrag___Win32_Debug/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
DebugInformationFormat="4"/> DebugInformationFormat="4"
/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCManagedResourceCompilerTool"
<Tool />
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile=".\unfrag___Win32_Debug/unfrag.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\unfrag___Win32_Debug/unfrag.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\unfrag___Win32_Debug/unfrag.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG" PreprocessorDefinitions="_DEBUG"
Culture="1033"/> Culture="1033"
/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCPreLinkEventTool"
/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References>
</References>
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File <File
RelativePath=".\Defragment.cpp"> RelativePath=".\Defragment.cpp"
>
</File> </File>
<File <File
RelativePath=".\DriveVolume.cpp"> RelativePath=".\DriveVolume.cpp"
>
</File> </File>
<File <File
RelativePath=".\Unfrag.cpp"> RelativePath=".\Unfrag.cpp"
>
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl"> Filter="h;hpp;hxx;hm;inl"
>
<File <File
RelativePath=".\Defragment.h"> RelativePath=".\Defragment.h"
>
</File> </File>
<File <File
RelativePath=".\DriveVolume.h"> RelativePath=".\DriveVolume.h"
>
</File> </File>
<File <File
RelativePath=".\Mutex.h"> RelativePath=".\Mutex.h"
>
</File> </File>
<File <File
RelativePath=".\Unfrag.h"> RelativePath=".\Unfrag.h"
>
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>