return (1);\r
}\r
\r
-\r
Defragment::Defragment (wstring Name, DefragType DefragMethod)\r
{\r
Method = DefragMethod;\r
\r
Info = Volume.GetDBFile (j);\r
\r
- Report.FilesFragments += max (1, Info.Fragments.size()); // add 1 fragment even for 0 bytes/0 cluster files\r
+ Report.FilesFragments += max ((size_t)1, Info.Fragments.size()); // add 1 fragment even for 0 bytes/0 cluster files\r
\r
if (Info.Attributes.Process == 0)\r
continue;\r
FILE_SHARE_READ | FILE_SHARE_WRITE, // share type\r
NULL, // security descriptor\r
OPEN_EXISTING, // open type\r
- NULL, // attributes (none)\r
+ 0, // attributes (none)\r
NULL // template\r
);\r
\r
NULL\r
);\r
\r
- DWORD LastError = GetLastError ();\r
+ //DWORD LastError = GetLastError ();\r
\r
if (Result == FALSE)\r
{\r
{\r
uint64 TotalClusters = 0;\r
\r
- for (int i = 0; i < Info.Fragments.size(); i++)\r
+ for (size_t i = 0; i < Info.Fragments.size(); i++)\r
{\r
TotalClusters += Info.Fragments[i].Length;\r
}\r
Extents = Retrieval->ExtentCount;\r
\r
// Ok, we have the info. Now translate it. hrmrmr\r
- int i;\r
+ \r
Info.Fragments.clear ();\r
- for (i = 0; i < Extents; i++)\r
+ for (uint64 i = 0; i < Extents; i++)\r
{\r
Extent Add;\r
\r
\r
*****************************************************************************/\r
\r
+#define NDEBUG\r
\r
#include "Fraginator.h"\r
#include "Mutex.h"\r
#include "Defragment.h"\r
#include "MainDialog.h"\r
#include "resource.h"\r
+#ifdef _MSC_VER\r
#include <crtdbg.h>\r
-\r
+#endif\r
\r
HINSTANCE GlobalHInstance = NULL;\r
Defragment *Defrag = NULL;\r
\r
-\r
-int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd)\r
+INT WINAPI\r
+wWinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPCWSTR CmdLine, INT ShowCmd)\r
{\r
INITCOMMONCONTROLSEX InitControls;\r
\r
\r
return (0);\r
}\r
+\r
\r
\r
#include "unfrag.h"\r
-#include <CommCtrl.h>\r
+#include <commctrl.h>\r
\r
\r
int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd);\r
extern HINSTANCE GlobalHInstance;\r
extern Defragment *Defrag;\r
\r
+extern INT PASCAL wWinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPCWSTR CmdLine, INT ShowCmd);\r
\r
-#endif // FRAGINATOR_H
\ No newline at end of file
+#endif // FRAGINATOR_H\r
LRESULT PriIdleID;\r
\r
\r
-void InitDialog (HWND Dlg);\r
+static void InitDialog (HWND Dlg);\r
void UpdateDefragInfo (HWND Dlg);\r
void UpdatePriority (HWND Dlg);\r
wstring GetDefaultTitle (void);\r
// Make internal list\r
DWORD DriveMask;\r
HWND DlgItem;\r
- int d;\r
+ size_t d;\r
\r
// Clear out wisecracks line for now\r
SetDlgItemText (Dlg, IDC_WISECRACKS, L"\"Defrag, baby!\"");\r
INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam);\r
\r
\r
-#endif // MAINDIALOG_H
\ No newline at end of file
+#endif // MAINDIALOG_H\r
INT_PTR CALLBACK ReportDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam);\r
\r
\r
-#endif // REPORTDIALOG_H
\ No newline at end of file
+#endif // REPORTDIALOG_H\r
{\r
wchar_t Temp[128];\r
int TempLen;\r
- wchar_t *p = NULL;\r
+ //wchar_t *p = NULL;\r
int AddCommas = 0;\r
wchar_t *StrPosResult = NULL;\r
wchar_t *StrPosOrig = NULL;\r
\r
\r
// Blah blah blah your template name is too long ... SO WHAT\r
+#ifdef _MSC_VER\r
#pragma warning (disable: 4786)\r
-\r
+#endif\r
\r
// I forget what this disables\r
#ifdef __ICL\r
\r
\r
// Hello Mr. Platform SDK, please let us use Windows 2000 only features\r
+#if 0\r
#ifndef WINVER\r
#define WINVER 0x0500\r
#define _WIN32_WINNT 0x0500\r
#endif\r
-\r
+#endif\r
\r
#include <windows.h>\r
#include <string>\r
#include <stdio.h>\r
#include <stdlib.h>\r
-\r
+//#include <initguid.h>\r
+#include <winioctl.h>\r
\r
#define APPNAME_CLI L"Unfrag"\r
#define APPNAME_GUI L"Fraginator"\r
--- /dev/null
+<?xml version="1.0"?>
+<group xmlns:xi="http://www.w3.org/2001/XInclude">
+ <module name="frag" type="win32gui" installbase="system32" installname="frag.exe" unicode="yes">
+ <include base="frag">.</include>
+ <define name="__USE_W32API" />
+ <define name="WINVER">0x0501</define>
+ <define name="_WIN32_IE">0x0600</define>
+ <library>kernel32</library>
+ <library>advapi32</library>
+ <library>ntdll</library>
+ <library>comctl32</library>
+ <library>msvcrt</library>
+ <file>Fraginator.cpp</file>
+ <file>MainDialog.cpp</file>
+ <file>Defragment.cpp</file>
+ <file>DriveVolume.cpp</file>
+ <file>ReportDialog.cpp</file>
+ <file>Unfrag.cpp</file>
+ </module>
+
+ <module name="unfrag" type="win32cui" installbase="system32" installname="unfrag.exe" unicode="yes">
+ <include base="unfrag">.</include>
+ <define name="__USE_W32API" />
+ <define name="WINVER">0x0501</define>
+ <define name="_WIN32_IE">0x0600</define>
+ <library>kernel32</library>
+ <library>advapi32</library>
+ <library>ntdll</library>
+ <file>Unfrag.cpp</file>
+ <file>Defragment.cpp</file>
+ <file>DriveVolume.cpp</file>
+ </module>
+</group>