mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 18:22:35 +00:00
- fix a few issues to make it compilable with current RosBE
- does not yet link svn path=/trunk/; revision=32436
This commit is contained in:
parent
cdf837bb71
commit
793ebfdd18
10 changed files with 59 additions and 20 deletions
|
@ -78,7 +78,6 @@ int FitName (wchar_t *destination, const wchar_t *path, const wchar_t *filename,
|
|||
return (1);
|
||||
}
|
||||
|
||||
|
||||
Defragment::Defragment (wstring Name, DefragType DefragMethod)
|
||||
{
|
||||
Method = DefragMethod;
|
||||
|
@ -245,7 +244,7 @@ void Defragment::Start (void)
|
|||
|
||||
Info = Volume.GetDBFile (j);
|
||||
|
||||
Report.FilesFragments += max (1, Info.Fragments.size()); // add 1 fragment even for 0 bytes/0 cluster files
|
||||
Report.FilesFragments += max ((size_t)1, Info.Fragments.size()); // add 1 fragment even for 0 bytes/0 cluster files
|
||||
|
||||
if (Info.Attributes.Process == 0)
|
||||
continue;
|
||||
|
|
|
@ -55,7 +55,7 @@ bool DriveVolume::Open (wstring Name)
|
|||
FILE_SHARE_READ | FILE_SHARE_WRITE, // share type
|
||||
NULL, // security descriptor
|
||||
OPEN_EXISTING, // open type
|
||||
NULL, // attributes (none)
|
||||
0, // attributes (none)
|
||||
NULL // template
|
||||
);
|
||||
|
||||
|
@ -222,7 +222,7 @@ bool DriveVolume::GetBitmap (void)
|
|||
NULL
|
||||
);
|
||||
|
||||
DWORD LastError = GetLastError ();
|
||||
//DWORD LastError = GetLastError ();
|
||||
|
||||
if (Result == FALSE)
|
||||
{
|
||||
|
@ -422,7 +422,7 @@ bool DriveVolume::ScanDirectory (wstring DirPrefix, ScanCallback Callback, void
|
|||
{
|
||||
uint64 TotalClusters = 0;
|
||||
|
||||
for (int i = 0; i < Info.Fragments.size(); i++)
|
||||
for (size_t i = 0; i < Info.Fragments.size(); i++)
|
||||
{
|
||||
TotalClusters += Info.Fragments[i].Length;
|
||||
}
|
||||
|
@ -597,9 +597,9 @@ bool DriveVolume::GetClusterInfo (FileInfo &Info, HANDLE &HandleResult)
|
|||
Extents = Retrieval->ExtentCount;
|
||||
|
||||
// Ok, we have the info. Now translate it. hrmrmr
|
||||
int i;
|
||||
|
||||
Info.Fragments.clear ();
|
||||
for (i = 0; i < Extents; i++)
|
||||
for (uint64 i = 0; i < Extents; i++)
|
||||
{
|
||||
Extent Add;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
*****************************************************************************/
|
||||
|
||||
#define NDEBUG
|
||||
|
||||
#include "Fraginator.h"
|
||||
#include "Mutex.h"
|
||||
|
@ -11,14 +12,15 @@
|
|||
#include "Defragment.h"
|
||||
#include "MainDialog.h"
|
||||
#include "resource.h"
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
|
||||
#endif
|
||||
|
||||
HINSTANCE GlobalHInstance = NULL;
|
||||
Defragment *Defrag = NULL;
|
||||
|
||||
|
||||
int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd)
|
||||
INT WINAPI
|
||||
wWinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPCWSTR CmdLine, INT ShowCmd)
|
||||
{
|
||||
INITCOMMONCONTROLSEX InitControls;
|
||||
|
||||
|
@ -56,3 +58,4 @@ int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine,
|
|||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
|
||||
#include "unfrag.h"
|
||||
#include <CommCtrl.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
|
||||
int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd);
|
||||
|
@ -20,5 +20,6 @@ Defragment *StartDefragBox (wstring Drive, DefragType Method);
|
|||
extern HINSTANCE GlobalHInstance;
|
||||
extern Defragment *Defrag;
|
||||
|
||||
extern INT PASCAL wWinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPCWSTR CmdLine, INT ShowCmd);
|
||||
|
||||
#endif // FRAGINATOR_H
|
||||
#endif // FRAGINATOR_H
|
||||
|
|
|
@ -21,7 +21,7 @@ LRESULT PriBelowNormID;
|
|||
LRESULT PriIdleID;
|
||||
|
||||
|
||||
void InitDialog (HWND Dlg);
|
||||
static void InitDialog (HWND Dlg);
|
||||
void UpdateDefragInfo (HWND Dlg);
|
||||
void UpdatePriority (HWND Dlg);
|
||||
wstring GetDefaultTitle (void);
|
||||
|
@ -35,7 +35,7 @@ static void InitDialog (HWND Dlg)
|
|||
// Make internal list
|
||||
DWORD DriveMask;
|
||||
HWND DlgItem;
|
||||
int d;
|
||||
size_t d;
|
||||
|
||||
// Clear out wisecracks line for now
|
||||
SetDlgItemText (Dlg, IDC_WISECRACKS, L"\"Defrag, baby!\"");
|
||||
|
|
|
@ -11,4 +11,4 @@
|
|||
INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam);
|
||||
|
||||
|
||||
#endif // MAINDIALOG_H
|
||||
#endif // MAINDIALOG_H
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
INT_PTR CALLBACK ReportDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam);
|
||||
|
||||
|
||||
#endif // REPORTDIALOG_H
|
||||
#endif // REPORTDIALOG_H
|
||||
|
|
|
@ -49,7 +49,7 @@ wchar_t *AddCommas (wchar_t *Result, uint64 Number)
|
|||
{
|
||||
wchar_t Temp[128];
|
||||
int TempLen;
|
||||
wchar_t *p = NULL;
|
||||
//wchar_t *p = NULL;
|
||||
int AddCommas = 0;
|
||||
wchar_t *StrPosResult = NULL;
|
||||
wchar_t *StrPosOrig = NULL;
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
|
||||
|
||||
// Blah blah blah your template name is too long ... SO WHAT
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable: 4786)
|
||||
|
||||
#endif
|
||||
|
||||
// I forget what this disables
|
||||
#ifdef __ICL
|
||||
|
@ -20,17 +21,19 @@
|
|||
|
||||
|
||||
// Hello Mr. Platform SDK, please let us use Windows 2000 only features
|
||||
#if 0
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x0500
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
//#include <initguid.h>
|
||||
#include <winioctl.h>
|
||||
|
||||
#define APPNAME_CLI L"Unfrag"
|
||||
#define APPNAME_GUI L"Fraginator"
|
||||
|
|
33
rosapps/fraginator/fraginator.rbuild
Normal file
33
rosapps/fraginator/fraginator.rbuild
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?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>
|
Loading…
Add table
Add a link
Reference in a new issue