Index: /trunk/Erasext/ErasextMenu.cpp
===================================================================
--- /trunk/Erasext/ErasextMenu.cpp	(revision 5)
+++ /trunk/Erasext/ErasextMenu.cpp	(revision 5)
@@ -0,0 +1,896 @@
+// ErasextMenu.cpp
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#include "stdafx.h"
+#include "resource.h"
+#include "..\EraserDll\eraserdll.h"
+#include "..\shared\FileHelper.h"
+#include "..\shared\key.h"
+
+#include "ConfirmDialog.h"
+#include "ConfirmReplaceDlg.h"
+#include "WipeProgDlg.h"
+
+#include <shlobj.h>
+
+#include "Erasext.h"
+#include "ErasextMenu.h"
+
+#define ResultFromShort(i)  MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, (i));
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+const LPCTSTR szAccelerKey = "Acceler";
+
+/////////////////////////////////////////////////////////////////////////////
+// CErasextMenu
+enum
+{
+	CMD_ERASE = 0, CMD_MOVE = 1
+};
+IMPLEMENT_DYNCREATE(CErasextMenu, CCmdTarget)
+
+static void DisplayError(DWORD dwError)
+{
+    LPVOID lpMsgBuf;
+
+    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                  NULL,
+                  dwError,
+                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                  (LPTSTR) &lpMsgBuf,
+                  0,
+                  NULL);
+
+    AfxMessageBox((LPCTSTR)lpMsgBuf, MB_ICONERROR);
+
+    // free the buffer
+    LocalFree(lpMsgBuf);
+}
+
+CErasextMenu::CErasextMenu() :
+m_bUseFiles(TRUE),
+m_dwItems(0),
+m_dwDirectories(0),
+m_bDragMenu(FALSE)
+{
+    EnableAutomation();
+
+    // To keep the application running as long as an OLE automation
+    // object is active, the constructor calls AfxOleLockApp.
+
+    AfxOleLockApp();
+
+    // NT or not
+    OSVERSIONINFO ov;
+
+    ZeroMemory(&ov, sizeof(OSVERSIONINFO));
+    ov.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+    GetVersionEx(&ov);
+    m_bNT = true;//(ov.dwPlatformId == VER_PLATFORM_WIN32_NT);
+}
+
+CErasextMenu::~CErasextMenu()
+{
+    // To terminate the application when all objects created with
+    // with OLE automation, the destructor calls AfxOleUnlockApp.
+
+    AfxOleUnlockApp();
+}
+
+
+void CErasextMenu::OnFinalRelease()
+{
+    // When the last reference for an automation object is released
+    // OnFinalRelease is called.  The base class will automatically
+    // deletes the object.  Add additional cleanup required for your
+    // object before calling the base class.
+
+    CCmdTarget::OnFinalRelease();
+}
+
+
+BEGIN_MESSAGE_MAP(CErasextMenu, CCmdTarget)
+    //{{AFX_MSG_MAP(CErasextMenu)
+        // NOTE - the ClassWizard will add and remove mapping macros here.
+    //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+BEGIN_DISPATCH_MAP(CErasextMenu, CCmdTarget)
+    //{{AFX_DISPATCH_MAP(CErasextMenu)
+        // NOTE - the ClassWizard will add and remove mapping macros here.
+    //}}AFX_DISPATCH_MAP
+END_DISPATCH_MAP()
+
+// Note: we add support for IID_IErasextMenu to support typesafe binding
+//  from VBA.  This IID must match the GUID that is attached to the
+//  dispinterface in the .ODL file.
+
+// {8BE13461-936F-11D1-A87D-444553540000}
+static const IID IID_IErasextMenu =
+{ 0x8be13461, 0x936f, 0x11d1, { 0xa8, 0x7d, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
+
+IMPLEMENT_OLECREATE(CErasextMenu, "ErasextMenu", 0x8be13461, 0x936f, 0x11d1, 0xa8, 0x7d, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+
+BEGIN_INTERFACE_MAP(CErasextMenu, CCmdTarget)
+    INTERFACE_PART(CErasextMenu, IID_IErasextMenu, Dispatch)
+    INTERFACE_PART(CErasextMenu, IID_IContextMenu, MenuExt)
+    INTERFACE_PART(CErasextMenu, IID_IShellExtInit, ShellInit)
+END_INTERFACE_MAP()
+
+// IUnknown for IContextMenu
+STDMETHODIMP CErasextMenu::XMenuExt::QueryInterface(REFIID riid, void** ppv)
+{
+    METHOD_PROLOGUE(CErasextMenu, MenuExt);
+    TRACE("CErasextMenu::XMenuExt::QueryInterface\n");
+    return pThis->ExternalQueryInterface(&riid, ppv);
+}
+
+STDMETHODIMP_(ULONG) CErasextMenu::XMenuExt::AddRef(void)
+{
+    METHOD_PROLOGUE(CErasextMenu, MenuExt);
+    TRACE("CErasextMenu::XMenuExt::AddRef\n");
+    return pThis->ExternalAddRef();
+}
+
+STDMETHODIMP_(ULONG) CErasextMenu::XMenuExt::Release(void)
+{
+    METHOD_PROLOGUE(CErasextMenu, MenuExt);
+    TRACE("CErasextMenu::XMenuExt::Release\n");
+    return pThis->ExternalRelease();
+}
+
+CString setShortcut(CString str)
+{
+	CKey kReg;
+	BOOL bEnabled = TRUE;
+	CString strPath(""), strKey(""), strRes("");
+	strPath.Format("%s\\%s", ERASER_REGISTRY_BASE, szAccelerKey);
+	int iPos;
+	if (kReg.Open(HKEY_CURRENT_USER, strPath,FALSE))
+	{
+		if ((iPos=str.Find('&'))!=-1) {
+			str = str.Left(iPos) + str.Right(str.GetLength()-iPos-1);
+		}
+		if (kReg.GetValue(strKey,str))
+		{			
+			CString strTmp(str);
+			strKey.MakeUpper();
+			strTmp.MakeUpper();
+			iPos=strTmp.Find(strKey[0]);
+			strRes = str.Left(iPos)+"&"+str.Right(str.GetLength()-iPos);
+		}
+		kReg.Close();
+	}	
+	else{
+		strRes = str;
+	}
+    return strRes;
+}
+
+STDMETHODIMP CErasextMenu::XMenuExt::QueryContextMenu(HMENU hMenu, UINT nIndex, UINT idCmdFirst, UINT /*idCmdLast*/, UINT uFlags)
+{
+    METHOD_PROLOGUE(CErasextMenu, MenuExt);
+
+    // do not show menu for shortcuts or when the shell
+    // wants only the default item, or if the user has disabled
+    // the shell extension
+
+    CKey kReg;
+    BOOL bEnabled = TRUE;
+	
+    if (kReg.Open(HKEY_CURRENT_USER, ERASER_REGISTRY_BASE))
+    {
+        kReg.GetValue(bEnabled, ERASEXT_REGISTRY_ENABLED, TRUE);
+        kReg.Close();
+    }
+
+    if (bEnabled && (uFlags & CMF_VERBSONLY) == 0 && (uFlags & CMF_DEFAULTONLY) == 0)
+    {
+        CString str;
+
+        try
+        {
+            if (pThis->m_bDragMenu)
+            {
+                if (pThis->m_bUseFiles)
+                    str.LoadString(IDS_MENU_TEXT_DRAG);
+                else
+                    return ResultFromShort(0);
+            }
+            else
+            {
+                if (!pThis->m_bUseFiles)
+                    str.LoadString(IDS_MENU_TEXT_DRIVE);
+                else
+                    str.LoadString(IDS_MENU_TEXT_FILE);
+            }
+
+			if (!InsertMenu(hMenu, nIndex++, MF_SEPARATOR| MF_BYPOSITION, idCmdFirst, ""))
+				return ResultFromShort(0);
+
+			
+			str = setShortcut(str);
+			if (!InsertMenu(hMenu, nIndex++ , MF_STRING | MF_BYPOSITION , idCmdFirst + CMD_ERASE, str))
+                return ResultFromShort(0);
+
+			CString moveStr;
+			//ASSERT(moveStr.LoadString(IDS_MENU_TEXT_DRAG));
+			moveStr.LoadString(IDS_MENU_TEXT_DRAG);
+			
+			moveStr = setShortcut(moveStr);
+			if (!InsertMenu(hMenu, nIndex++, MF_STRING | MF_BYPOSITION, idCmdFirst + CMD_MOVE, moveStr))
+				return ResultFromShort(0);
+
+
+			if (!InsertMenu(hMenu, nIndex++, MF_SEPARATOR| MF_BYPOSITION, idCmdFirst , ""))
+				return ResultFromShort(0);
+
+			return MAKE_HRESULT(SEVERITY_SUCCESS, 0, CMD_MOVE + 1);
+        }
+        catch (CException *e)
+        {
+            ASSERT(FALSE);
+
+            e->ReportError(MB_ICONERROR);
+            e->Delete();
+        }
+        catch (...)
+        {
+            ASSERT(FALSE);
+        }
+    }
+
+    return ResultFromShort(0);
+}
+
+BOOL GetFolder(HWND hParent, TCHAR* path)
+{
+
+	BROWSEINFO bi;
+	memset(&bi, 0, sizeof (bi));
+	bi.hwndOwner = hParent;
+	bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_EDITBOX;
+	bi.lpszTitle = "Select target folder";
+
+
+	LPITEMIDLIST pidlFolder, pidlTarget = NULL;
+	pidlFolder = SHBrowseForFolder(&bi);
+	if (!pidlFolder)
+		return FALSE;
+
+	//HRESULT hr = SHGetTargetFolderIDList(pidlFolder, &pidlTarget);
+
+
+
+	SHGetPathFromIDList(pidlFolder, path);   // Make sure it is a path
+	CoTaskMemFree(pidlFolder);
+
+	return TRUE;
+	
+}
+STDMETHODIMP CErasextMenu::XMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
+{
+    METHOD_PROLOGUE(CErasextMenu, MenuExt);
+    TRACE("CErasextMenu::XMenuExt::InvokeCommand\n");
+
+    if (!HIWORD(lpici->lpVerb) &&
+        CMD_ERASE == LOWORD((DWORD)lpici->lpVerb) || CMD_MOVE == LOWORD((DWORD)lpici->lpVerb) )
+    {
+        ASSERT(IsWindow(lpici->hwnd));
+
+        CWnd parent;
+        parent.Attach(lpici->hwnd);
+
+		if (CMD_MOVE == LOWORD((DWORD)lpici->lpVerb))
+		{
+			pThis->m_bDragMenu = TRUE;
+		}
+
+        try
+        {
+            CConfirmDialog cd(&parent);
+
+            cd.m_bSingleFile    = FALSE;
+            cd.m_strData        = "?";
+            cd.m_bUseFiles      = pThis->m_bUseFiles;
+            cd.m_bMove          = pThis->m_bDragMenu;
+            cd.m_strTarget      = pThis->m_szDropTarget;
+
+            CString strTemp;
+
+            if (pThis->m_bUseFiles)
+            {
+                CStringList strlSourceFolders;
+
+                // get source folders if moving
+                if (pThis->m_bDragMenu)
+                {
+                    CString strSourceFolder;
+                    int iSize = pThis->m_saData.GetSize(), i;
+
+                    for (i = 0; i < iSize; i++)
+                    {
+                        strSourceFolder = pThis->m_saData[i];
+                        strSourceFolder = strSourceFolder.Left(strSourceFolder.ReverseFind('\\') + 1);
+
+                        if (strlSourceFolders.Find(strSourceFolder) == NULL)
+                            strlSourceFolders.AddTail(strSourceFolder);
+                    }
+
+                    iSize = pThis->m_saFolders.GetSize();
+
+                    for (i = 0; i < iSize; i++)
+                    {
+                        strSourceFolder = pThis->m_saFolders[i];
+                        if (strSourceFolder[strSourceFolder.GetLength() - 1] == '\\')
+                            strSourceFolder.Left(strSourceFolder.GetLength() - 1);
+
+                        strSourceFolder = strSourceFolder.Left(strSourceFolder.ReverseFind('\\') + 1);
+
+                        if (strlSourceFolders.Find(strSourceFolder) == NULL)
+                            strlSourceFolders.AddTail(strSourceFolder);
+                    }
+
+                    ASSERT(!strlSourceFolders.IsEmpty());
+                }
+
+                // parse files from the folders
+                if (pThis->m_dwDirectories > 0)
+                {
+                    CStringArray saSubfolders;
+                    int iSize = pThis->m_saFolders.GetSize(), i;
+
+                    // parseDirectory will recount all directories for us
+                    pThis->m_dwDirectories = 0;
+
+                    for (i = 0; i < iSize; i++)
+                    {
+                        parseDirectory((LPCTSTR)pThis->m_saFolders[i],
+                                       pThis->m_saData,
+                                       saSubfolders,
+                                       TRUE,
+                                       &pThis->m_dwItems,
+                                       &pThis->m_dwDirectories);
+                    }
+
+                    // add found subfolders to the list for removal
+                    if (saSubfolders.GetSize() > 0)
+                        pThis->m_saFolders.InsertAt(0, &saSubfolders);
+                }
+
+                // done parsing, continue if there is something to erase
+
+                if (pThis->m_dwItems > 0 || pThis->m_dwDirectories > 0)
+                {
+                    // select which confirmation message to show
+
+                    if (pThis->m_dwDirectories > 0)
+                    {
+                        // at least one folder and zero or more files
+                        if (!pThis->m_bDragMenu)
+                            strTemp.LoadString(IDS_CONFIRM_FILES_AND_FOLDERS);
+                        else
+                            strTemp.LoadString(IDS_CONFIRM_MOVE_FILES_AND_FOLDERS);
+
+                        cd.m_strData.Format(strTemp, pThis->m_dwItems, pThis->m_dwDirectories);
+                    }
+                    else if (pThis->m_dwItems == 1)
+                    {
+                        // only one file
+                        cd.m_strData = pThis->m_saData[0];
+                        cd.m_bSingleFile = TRUE;
+                    }
+                    else if (pThis->m_dwItems > 1)
+                    {
+                        // more than one file and no folders
+                        if (!pThis->m_bDragMenu)
+                            strTemp.LoadString(IDS_CONFIRM_FILES);
+                        else
+                            strTemp.LoadString(IDS_CONFIRM_MOVE_FILES);
+
+                        cd.m_strData.Format(strTemp, pThis->m_dwItems);
+                    }
+
+                    // ask for confirmation
+					if (cd.m_bMove)
+					{
+						if ( !strlen(pThis->m_szDropTarget) 
+							&& !GetFolder(lpici->hwnd, pThis->m_szDropTarget))
+						{
+							parent.Detach();
+							return NOERROR;
+						}
+						cd.m_strTarget = pThis->m_szDropTarget;
+
+					}
+
+                    if (cd.DoModal() == IDOK)
+                    {
+                        if (pThis->m_bDragMenu)
+                        {
+                            // if there is data to copy
+                            CStringArray saFolders;
+                            if (pThis->m_saFolders.GetSize() > 0)
+                                saFolders.Copy(pThis->m_saFolders);
+							
+							
+								
+							
+                            if (!pThis->MoveFileList(&parent,                 // parent window
+                                                     pThis->m_saData,         // source files
+                                                     saFolders,               // source folders
+                                                     strlSourceFolders,       // source folders
+                                                     pThis->m_szDropTarget))  // destination folder
+                            {
+                                parent.Detach();
+                                return E_FAIL;
+                            }
+
+                            // the amount of items to erase
+                            pThis->m_dwItems = pThis->m_saData.GetSize();
+                        }
+
+                        if (pThis->m_dwItems > 0)
+                        {
+                            // if there are files to erase
+
+                            CEraserDlg dlgEraser(&parent);
+
+                            dlgEraser.m_bMove        = pThis->m_bDragMenu;
+                            dlgEraser.m_bShowResults = TRUE;
+                            dlgEraser.m_bUseFiles    = pThis->m_bUseFiles;
+                            dlgEraser.m_saData.Copy(pThis->m_saData);
+
+                            dlgEraser.DoModal();
+                        }
+
+                        if (pThis->m_dwDirectories > 0)
+                        {
+                            // if there are (empty) directories to remove
+
+                            int iSize = pThis->m_saFolders.GetSize(), i;
+                            for (i = 0; i < iSize; i++)
+                            {
+                                if (eraserOK(eraserRemoveFolder((LPVOID)(LPCTSTR)pThis->m_saFolders[i],
+                                        (E_UINT16)pThis->m_saFolders[i].GetLength(), ERASER_REMOVE_FOLDERONLY)))
+                                {
+                                    SHChangeNotify(SHCNE_RMDIR, SHCNF_PATH, (LPCTSTR)pThis->m_saFolders[i], NULL);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            else if (!pThis->m_bDragMenu)
+            {
+                // drive(s)
+
+                if (pThis->m_dwItems > 1)
+                    cd.m_strData.LoadString(IDS_CONFIRM_MULTI_DRIVE);
+                else if (pThis->m_dwItems == 1)
+                {
+                    strTemp.LoadString(IDS_CONFIRM_DRIVE);
+                    cd.m_strData.Format((LPCTSTR)strTemp, pThis->m_saData[0]);
+                }
+
+                if (cd.DoModal() == IDOK)
+                {
+                    CEraserDlg dlgEraser(&parent);
+
+                    dlgEraser.m_saData.Copy(pThis->m_saData);
+                    dlgEraser.m_bShowResults = TRUE;
+                    dlgEraser.m_bUseFiles = pThis->m_bUseFiles;
+
+                    dlgEraser.DoModal();
+                }
+            }
+        }
+        catch (CException *e)
+        {
+            ASSERT(FALSE);
+
+            e->ReportError(MB_ICONERROR);
+            e->Delete();
+        }
+        catch (...)
+        {
+            ASSERT(FALSE);
+        }
+
+        parent.Detach();
+
+        return NOERROR;
+    }
+
+    return E_INVALIDARG;
+}
+
+void 
+CErasextMenu::getstr_handle_erase(UINT nType, CString& cmdstr)
+{
+	if (m_bUseFiles)
+	{
+		if (m_dwDirectories > 0)
+			cmdstr.LoadString(IDS_COMMAND_STRING_DIRECTORIES);
+		else
+			cmdstr.LoadString(IDS_COMMAND_STRING_FILE);
+	}
+	else
+	{
+		cmdstr.LoadString(IDS_COMMAND_STRING_DRIVE);
+	}
+
+}
+void 
+CErasextMenu::getstr_handle_move(UINT nType, CString& cmdstr)
+{
+	
+	cmdstr = "Move";
+}
+
+STDMETHODIMP CErasextMenu::XMenuExt::GetCommandString(UINT_PTR  idCmd, UINT nType, UINT* /*pnReserved*/, LPSTR lpszName, UINT nMax)
+{
+    METHOD_PROLOGUE(CErasextMenu, MenuExt);
+    TRACE("CErasextMenu::XMenuExt::GetCommandString\n");
+
+	CString cmdstr;
+	ZeroMemory(lpszName, nMax);
+	try
+	{
+		if (0 == idCmd )
+			pThis->getstr_handle_erase(nType, cmdstr);
+		else
+			if (1 == idCmd)
+				pThis->getstr_handle_move(nType, cmdstr);
+			
+			
+	}
+	catch (CException *e)
+	{
+		ASSERT(FALSE);
+
+		e->ReportError(MB_ICONERROR);
+		e->Delete();
+
+		return E_OUTOFMEMORY;
+	}
+	catch (...)
+	{
+		ASSERT(FALSE);
+		return E_FAIL;
+	}
+
+	if (!pThis->m_bNT)
+		lstrcpyn(lpszName, (LPCTSTR) cmdstr, nMax);
+	else
+	{
+		MultiByteToWideChar(CP_ACP, 0, (LPCSTR)cmdstr, -1, (LPWSTR)lpszName,
+			nMax / sizeof(WCHAR));
+	}
+    return NOERROR;
+}
+
+// IUnknown for IShellExtInit
+STDMETHODIMP CErasextMenu::XShellInit::QueryInterface(REFIID riid, void** ppv)
+{
+    METHOD_PROLOGUE(CErasextMenu, ShellInit);
+    TRACE("CErasextMenu::XShellInit::QueryInterface\n");
+    return pThis->ExternalQueryInterface(&riid, ppv);
+}
+
+STDMETHODIMP_(ULONG) CErasextMenu::XShellInit::AddRef(void)
+{
+    METHOD_PROLOGUE(CErasextMenu, ShellInit);
+    TRACE("CErasextMenu::XShellInit::AddRef\n");
+    return pThis->ExternalAddRef();
+}
+
+STDMETHODIMP_(ULONG) CErasextMenu::XShellInit::Release(void)
+{
+    METHOD_PROLOGUE(CErasextMenu, ShellInit);
+    TRACE("CErasextMenu::XShellInit::Release\n");
+    return pThis->ExternalRelease();
+}
+
+STDMETHODIMP CErasextMenu::XShellInit::Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/)
+{
+    METHOD_PROLOGUE(CErasextMenu, ShellInit);
+    TRACE("CErasextMenu::XShellInit::Initialize\n");
+
+    HRESULT hres = E_FAIL;
+    STGMEDIUM medium;
+    FORMATETC fmte = {CF_HDROP,
+                      NULL,
+                      DVASPECT_CONTENT,
+                      -1,
+                      TYMED_HGLOBAL};
+
+    // duplicate the object pointer
+    if (lpdobj == NULL)
+    {
+        TRACE("CErasextMenu::XShellInit::Initialize() no data object\n");
+        return E_FAIL;
+    }
+
+    // Use the given IDataObject to get a list of filenames (CF_HDROP)
+    hres = lpdobj->GetData(&fmte, &medium);
+
+    if (FAILED(hres))
+    {
+        TRACE("CErasextMenu::XShellInit::Initialize() can't get data\n");
+        return E_FAIL;
+    }
+
+    // clear members
+    ZeroMemory(pThis->m_szDropTarget, MAX_PATH + 2);
+    pThis->m_saData.RemoveAll();
+    pThis->m_saFolders.RemoveAll();
+    pThis->m_dwItems = 0;
+    pThis->m_dwDirectories = 0;
+
+    if (pidlFolder != NULL &&
+        SHGetPathFromIDList(pidlFolder, pThis->m_szDropTarget))
+    {
+        TRACE1("Drop Target: %s\n", pThis->m_szDropTarget);
+        pThis->m_bDragMenu = TRUE;
+    }
+    else
+    {
+        pThis->m_bDragMenu = FALSE;
+        pThis->m_szDropTarget[0] = '\0';
+    }
+
+
+    BOOL bDrives = FALSE;
+    BOOL bFiles = FALSE;
+
+    UINT uAmount;
+    UINT uCount;
+    DWORD dwAttr;
+
+    TCHAR szFileName[MAX_PATH + 1];
+    ZeroMemory(szFileName, MAX_PATH + 1);
+
+    // Get the number of items selected.
+    uAmount = DragQueryFile(static_cast<HDROP>(medium.hGlobal),
+              static_cast<UINT>(-1), NULL, 0);
+
+    for (uCount = 0; uCount < uAmount; uCount++)
+    {
+        szFileName[0] = '\0';
+
+        DragQueryFile(static_cast<HDROP>(medium.hGlobal), uCount, szFileName, MAX_PATH);
+
+        if (!bFiles && lstrlen(szFileName) <= _MAX_DRIVE)
+        {
+            // drive
+            dwAttr = GetDriveType((LPCTSTR) szFileName);
+
+            if (dwAttr != DRIVE_UNKNOWN &&
+                dwAttr != DRIVE_NO_ROOT_DIR &&
+                dwAttr != DRIVE_CDROM &&
+                dwAttr != DRIVE_REMOTE)
+            {
+                pThis->m_saData.Add(szFileName);
+                bDrives = TRUE;
+
+                pThis->m_dwItems++;
+            }
+        }
+        else if (!bDrives)
+        {
+            dwAttr = GetFileAttributes(szFileName);
+
+            if (dwAttr != (DWORD)-1)
+            {
+                if (dwAttr & FILE_ATTRIBUTE_DIRECTORY)
+                {
+                    // folder - read files later
+                    pThis->m_saFolders.Add(szFileName);
+                    bFiles = TRUE;
+
+                    pThis->m_dwDirectories++;
+                }
+                else
+                {
+                    // file
+                    pThis->m_saData.Add(szFileName);
+                    bFiles = TRUE;
+
+                    pThis->m_dwItems++;
+                }
+            }
+        }
+    }
+
+    // Release the data.
+    ReleaseStgMedium(&medium);
+
+    if (bFiles)
+        pThis->m_bUseFiles = TRUE;
+    else if (bDrives)
+        pThis->m_bUseFiles = FALSE;
+    else
+        return E_FAIL;
+
+    return S_OK;
+}
+
+
+static inline void
+GetSourceFolderFromList(CString& strFolder, CString strFile, CStringList& strlList)
+{
+    POSITION pos = NULL;
+    int iPosition = -1;
+
+    if (strFile.IsEmpty())
+        return;
+
+    if (strFile[strFile.GetLength() - 1] == '\\')
+        strFile = strFile.Left(strFile.GetLength() - 1);
+
+    iPosition = strFile.ReverseFind('\\');
+
+    while (iPosition != -1)
+    {
+        strFile = strFile.Left(iPosition + 1);
+        pos = strlList.Find(strFile);
+
+        if (pos != NULL)
+        {
+            strFolder = strlList.GetAt(pos);
+            break;
+        }
+
+        strFile = strFile.Left(strFile.GetLength() - 1);
+        iPosition = strFile.ReverseFind('\\');
+    }
+}
+
+BOOL CErasextMenu::MoveFileList(CWnd *pParent, CStringArray& saList, CStringArray& saFolders,
+                                CStringList& strlSource, LPCTSTR szDestination)
+{
+    CStringArray saErase;
+    CString strFile;
+    CString strDestination(szDestination);
+    CString strTemp;
+    BOOL    bFailed = FALSE;
+    BOOL    bNoToAll = FALSE, bYesToAll = FALSE;
+    int     iSize, i;
+
+    if (strDestination.IsEmpty() || strlSource.IsEmpty())
+        return FALSE;
+
+    // folders
+    if (strDestination[strDestination.GetLength() - 1] != '\\')
+        strDestination += "\\";
+
+    // must reverse the order of folders on the list and
+    // convert pathnames to destination folder
+
+    iSize = saFolders.GetSize();
+    for (i = 0; i < iSize; i++)
+    {
+        GetSourceFolderFromList(strTemp, saFolders[i], strlSource);
+
+        // source and destination are same
+        if (strTemp.CompareNoCase(strDestination) == 0)
+        {
+            AfxMessageBox(IDS_ERROR_MOVE_SAMEFOLDER, MB_ICONERROR);
+            return FALSE;
+        }
+
+        strTemp = saFolders[i].Right(saFolders[i].GetLength() - strTemp.GetLength());
+        strTemp = strDestination + strTemp;
+        saErase.InsertAt(0, strTemp);
+    }
+
+    saFolders.RemoveAll();
+    if (saErase.GetSize() > 0)
+    {
+        saFolders.Copy(saErase);
+        saErase.RemoveAll();
+    }
+
+    // create destination folders
+
+    iSize = saFolders.GetSize();
+    for (i = 0; i < iSize; i++)
+    {
+        // don't care about the results; if the function fails,
+        // the folder either exists or then we'll catch the error
+        // when trying to copy files to this directory
+
+        CreateDirectory((LPCTSTR)saFolders[i], NULL);
+    }
+
+    // copy files
+
+    iSize = saList.GetSize();
+    for (i = 0; i < iSize; i++)
+    {
+        GetSourceFolderFromList(strTemp, saList[i], strlSource);
+        strTemp = saList[i].Right(saList[i].GetLength() - strTemp.GetLength());
+        strTemp = strDestination + strTemp;
+
+        if (!CopyFile((LPCTSTR)saList[i], (LPCTSTR)strTemp, TRUE))
+        {
+            if (GetLastError() == ERROR_FILE_EXISTS)
+            {
+                if (bNoToAll)
+                {
+                    // never overwrite the destination
+                    continue;
+                }
+                else
+                {
+                    CConfirmReplaceDlg crd(pParent);
+
+                    crd.SetExisting((LPCTSTR)strTemp);
+                    crd.SetSource((LPCTSTR)saList[i]);
+
+                    if (bYesToAll || crd.DoModal() == IDOK)
+                    {
+                        bFailed = (CopyFile((LPCTSTR)saList[i], (LPCTSTR)strTemp, FALSE) == FALSE);
+
+                        if (!bYesToAll)
+                            bYesToAll = crd.ApplyToAll();
+                    }
+                    else
+                    {
+                        if (!bYesToAll && !bNoToAll)
+                            bNoToAll = crd.ApplyToAll();
+
+                        // do not erase the source
+                        continue;
+                    }
+                }
+            }
+            else
+            {
+                bFailed = TRUE;
+            }
+        }
+
+        if (bFailed)
+        {
+            DisplayError(GetLastError());
+            return FALSE;
+        }
+
+        // if file was copied, set the source to be
+        // erased
+
+        saErase.Add(saList[i]);
+    }
+
+    // set the file list
+    saList.RemoveAll();
+    if (saErase.GetSize() > 0)
+        saList.Copy(saErase);
+
+    return TRUE;
+}
Index: /trunk/Erasext/ErasextMenu.h
===================================================================
--- /trunk/Erasext/ErasextMenu.h	(revision 5)
+++ /trunk/Erasext/ErasextMenu.h	(revision 5)
@@ -0,0 +1,101 @@
+// ErasextMenu.h
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#ifndef ERASEXTMENU_H
+#define ERASEXTMENU_H
+
+/////////////////////////////////////////////////////////////////////////////
+// CErasextMenu command target
+
+class CErasextMenu : public CCmdTarget
+{
+    DECLARE_DYNCREATE(CErasextMenu)
+
+    CErasextMenu();           // protected constructor used by dynamic creation
+
+// Attributes
+public:
+
+// Operations
+public:
+    BOOL MoveFileList(CWnd *pParent, CStringArray& saList, CStringArray& saFolders,
+                      CStringList& strlSource, LPCTSTR szDestination);
+
+// Overrides
+    // ClassWizard generated virtual function overrides
+    //{{AFX_VIRTUAL(CErasextMenu)
+    public:
+    virtual void OnFinalRelease();
+    //}}AFX_VIRTUAL
+
+// Implementation
+private:
+	void getstr_handle_erase(UINT nType, CString& );
+	void getstr_handle_move(UINT nType, CString& );
+protected:
+    BOOL        m_bNT;
+    DWORD       m_dwItems;
+    DWORD       m_dwDirectories;
+    BOOL        m_bUseFiles;
+
+    BOOL        m_bDragMenu;
+    TCHAR       m_szDropTarget[MAX_PATH + 2];
+	
+    CStringArray m_saData;
+    CStringArray m_saFolders;
+
+    virtual ~CErasextMenu();
+
+
+    // Generated message map functions
+    //{{AFX_MSG(CErasextMenu)
+        // NOTE - the ClassWizard will add and remove member functions here.
+    //}}AFX_MSG
+
+    DECLARE_MESSAGE_MAP()
+    // Generated OLE dispatch map functions
+    //{{AFX_DISPATCH(CErasextMenu)
+        // NOTE - the ClassWizard will add and remove member functions here.
+    //}}AFX_DISPATCH
+    DECLARE_DISPATCH_MAP()
+    DECLARE_INTERFACE_MAP()
+
+    DECLARE_OLECREATE(CErasextMenu)
+
+    // IContextMenu Interface 
+	BEGIN_INTERFACE_PART(MenuExt, IContextMenu)
+        STDMETHOD(QueryContextMenu)(HMENU hMenu, UINT nIndex, UINT idCmdFirst,
+            UINT idCmdLast, UINT uFlags);
+        STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici);
+        STDMETHOD(GetCommandString)(UINT_PTR  idCmd, UINT nType, UINT* pnReserved,
+            LPSTR lpszName, UINT nMax);
+    END_INTERFACE_PART(MenuExt)
+
+    // IShellExtInit interface
+    BEGIN_INTERFACE_PART(ShellInit, IShellExtInit)
+        STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj,
+            HKEY hkeyProgID);
+    END_INTERFACE_PART(ShellInit)
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#endif
Index: /trunk/Erasext/Erasext.odl
===================================================================
--- /trunk/Erasext/Erasext.odl	(revision 5)
+++ /trunk/Erasext/Erasext.odl	(revision 5)
@@ -0,0 +1,44 @@
+// Erasext.odl : type library source for Erasext.dll
+
+// This file will be processed by the Make Type Library (mktyplib) tool to
+// produce the type library (Erasext.tlb).
+
+[ uuid(8BE13460-936F-11D1-A87D-444553540000), version(1.0) ]
+library Erasext
+{
+	#ifdef _WIN64 
+	importlib("stdole64.tlb");
+	#else
+	importlib("stdole32.tlb");
+	#endif
+	
+
+	//  Primary dispatch interface for CErasextMenu
+	
+	[ uuid(8BE13461-936F-11D1-A87D-444553540000) ]
+	dispinterface IErasextMenu
+	{
+		properties:
+			// NOTE - ClassWizard will maintain property information here.
+			//    Use extreme caution when editing this section.
+			//{{AFX_ODL_PROP(CErasextMenu)
+			//}}AFX_ODL_PROP
+			
+		methods:
+			// NOTE - ClassWizard will maintain method information here.
+			//    Use extreme caution when editing this section.
+			//{{AFX_ODL_METHOD(CErasextMenu)
+			//}}AFX_ODL_METHOD
+
+	};
+
+	//  Class information for CErasextMenu
+
+	[ uuid(8BE13462-936F-11D1-A87D-444553540000) ]
+	coclass ERASEXTMENU
+	{
+		[default] dispinterface IErasextMenu;
+	};
+
+	//{{AFX_APPEND_ODL}}
+};
Index: /trunk/Erasext/Erasext.cpp
===================================================================
--- /trunk/Erasext/Erasext.cpp	(revision 5)
+++ /trunk/Erasext/Erasext.cpp	(revision 5)
@@ -0,0 +1,99 @@
+// Erasext.cpp
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+// Copyright © 2001-2006  Garrett Trant (support@heidi.ie).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#include "stdafx.h"
+#include "Erasext.h"
+
+#include "..\EraserDll\eraserdll.h"
+#include "ConfirmDialog.h"
+#include "WipeProgDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CErasextApp
+
+BEGIN_MESSAGE_MAP(CErasextApp, CWinApp)
+    //{{AFX_MSG_MAP(CErasextApp)
+        // NOTE - the ClassWizard will add and remove mapping macros here.
+        //    DO NOT EDIT what you see in these blocks of generated code!
+    //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CErasextApp construction
+
+CErasextApp::CErasextApp()
+{
+    _set_se_translator(SeTranslator);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CErasextApp object
+
+CErasextApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// Special entry points required for inproc servers
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+    AFX_MANAGE_STATE(AfxGetStaticModuleState());
+    TRACE("DllGetClassObject\n");
+    return AfxDllGetClassObject(rclsid, riid, ppv);
+}
+
+STDAPI DllCanUnloadNow(void)
+{
+    AFX_MANAGE_STATE(AfxGetStaticModuleState());
+    TRACE("DllCanUnloadNow\n");
+    return S_FALSE; //AfxDllCanUnloadNow();
+}
+
+// by exporting DllRegisterServer, you can use regsvr.exe
+STDAPI DllRegisterServer(void)
+{
+    AFX_MANAGE_STATE(AfxGetStaticModuleState());
+    TRACE("DllRegisterServer\n");
+    COleObjectFactory::UpdateRegistryAll();
+    return S_OK;
+}
+
+BOOL CErasextApp::InitInstance()
+{
+    TRACE("CErasextApp::InitInstance\n");
+    // Register all OLE server (factories) as running.  This enables the
+    // OLE libraries to create objects from other applications.
+    COleObjectFactory::RegisterAll();
+
+    eraserInit();
+    return CWinApp::InitInstance();
+}
+
+int CErasextApp::ExitInstance()
+{
+    eraserEnd();
+	return CWinApp::ExitInstance();
+}
Index: /trunk/Erasext/ConfirmDialog.cpp
===================================================================
--- /trunk/Erasext/ConfirmDialog.cpp	(revision 5)
+++ /trunk/Erasext/ConfirmDialog.cpp	(revision 5)
@@ -0,0 +1,224 @@
+// ConfirmDialog.cpp
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#include "stdafx.h"
+#include "erasext.h"
+#include "..\EraserDll\eraserdll.h"
+#include "..\shared\FitFileNameToScrn.h"
+#include "ConfirmDialog.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CConfirmDialog dialog
+
+
+CConfirmDialog::CConfirmDialog(CWnd* pParent /*=NULL*/) :
+CDialog(CConfirmDialog::IDD, pParent),
+m_bSingleFile(FALSE),
+m_bUseFiles(TRUE),
+m_bMove(FALSE),
+m_hAccel(NULL)
+{
+    //{{AFX_DATA_INIT(CConfirmDialog)
+    m_strLineOne = _T("");
+    m_strLineTwo = _T("");
+    //}}AFX_DATA_INIT
+}
+
+
+void CConfirmDialog::DoDataExchange(CDataExchange* pDX)
+{
+    CDialog::DoDataExchange(pDX);
+    //{{AFX_DATA_MAP(CConfirmDialog)
+    DDX_Text(pDX, IDC_STATIC_LINEONE, m_strLineOne);
+    DDX_Text(pDX, IDC_STATIC_LINETWO, m_strLineTwo);
+    //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CConfirmDialog, CDialog)
+    //{{AFX_MSG_MAP(CConfirmDialog)
+    ON_BN_CLICKED(IDOPTIONS, OnOptions)
+    ON_BN_CLICKED(IDOK, OnYes)
+    //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CConfirmDialog message handlers
+
+
+BOOL CConfirmDialog::OnInitDialog()
+{
+    try
+    {
+        if (!m_bMove)
+            m_strLineOne.LoadString(IDS_CONFIRM);
+        else
+        {
+            CString strTitle;
+
+            strTitle.LoadString(IDS_MOVE_TITLE);
+            m_strLineOne.LoadString(IDS_CONFIRM_MOVE);
+
+            SetWindowText(strTitle);
+        }
+
+        CWnd  *pWnd = GetDlgItem(IDC_STATIC_LINEONE);
+        CWnd  *pWnd2 = GetDlgItem(IDC_STATIC_LINETWO);
+        CRect rectWnd;
+        CSize sizeText;
+        int   iSaved;
+
+        // create a context for the window
+        CClientDC dc(pWnd);
+        iSaved = dc.SaveDC();
+
+        // select the used font
+        dc.SelectObject(pWnd->GetFont());
+
+        if (m_bSingleFile)
+        {
+            if (!m_bMove)
+            {
+                // the width required to display the whole string
+                sizeText = dc.GetTextExtent(m_strLineOne + "\'" + m_strData + "\'?");
+
+                // the width of the window
+                pWnd->GetClientRect(&rectWnd);
+
+                if (rectWnd.Width() >= sizeText.cx)
+                    m_strLineOne += "\'" + m_strData + "\'?";
+                else
+                {
+                    fitFileNameToScrn(pWnd2, m_strData, "\'", "\'?");
+                    m_strLineTwo = "\'" + m_strData + "\'?";
+                }
+            }
+            else
+            {
+                CString strTo;
+                strTo.LoadString(IDS_CONFIRM_MOVE_FILE);
+
+                // the width required to display the whole string
+                sizeText = dc.GetTextExtent(m_strLineOne + "\'" + m_strData + "\' " + strTo);
+
+                // the width of the window
+                pWnd->GetClientRect(&rectWnd);
+
+                if (rectWnd.Width() >= sizeText.cx)
+                {
+                    m_strLineOne += "\'" + m_strData + "\' " + strTo;
+
+                    sizeText = dc.GetTextExtent(m_strLineOne + " \'" + m_strTarget + "\'?");
+
+                    if (rectWnd.Width() >= sizeText.cx)
+                        m_strLineOne += " \'" + m_strTarget + "\'?";
+                    else
+                    {
+                        fitFileNameToScrn(pWnd2, m_strTarget, "\'", "\'?");
+                        m_strLineTwo = "\'" + m_strTarget + "\'?";
+                    }
+                }
+                else
+                {
+                    fitFileNameToScrn(pWnd, m_strData, m_strLineOne + "\'", "\'");
+                    m_strLineOne += "\'" + m_strData + "\'";
+
+                    fitFileNameToScrn(pWnd2, m_strTarget, strTo + " \'", "\'?");
+                    m_strLineTwo = strTo + " \'" + m_strTarget + "\'?";
+                }
+            }
+        }
+        else
+        {
+            m_strLineOne += m_strData;
+
+            if (m_bMove)
+            {
+                // the width required to display the whole string
+                sizeText = dc.GetTextExtent(m_strLineOne + "\'" + m_strTarget + "\'?");
+
+                // the width of the window
+                pWnd->GetClientRect(&rectWnd);
+
+                if (rectWnd.Width() >= sizeText.cx)
+                {
+                    m_strLineOne += "\'" + m_strTarget + "\'?";
+                }
+                else
+                {
+                    fitFileNameToScrn(pWnd2, m_strTarget, "\'", "\'?");
+                    m_strLineTwo = "\'" + m_strTarget + "\'?";
+                }
+            }
+        }
+
+        dc.RestoreDC(iSaved);
+
+        CDialog::OnInitDialog();
+
+        m_hAccel = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR_CONFIRM));
+    }
+    catch (CException *e)
+    {
+        ASSERT(FALSE);
+
+        e->ReportError(MB_ICONERROR);
+        e->Delete();
+    }
+    catch (...)
+    {
+        ASSERT(FALSE);
+    }
+
+    return TRUE;  // return TRUE unless you set the focus to a control
+                  // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+BOOL CConfirmDialog::PreTranslateMessage(MSG* pMsg)
+{
+    if (TranslateAccelerator(GetSafeHwnd(), m_hAccel, pMsg))
+        return TRUE;
+
+    return CDialog::PreTranslateMessage(pMsg);
+}
+
+void CConfirmDialog::OnOptions()
+{
+    if (m_bUseFiles)
+        eraserShowOptions(GetSafeHwnd(), ERASER_PAGE_FILES);
+    else
+        eraserShowOptions(GetSafeHwnd(), ERASER_PAGE_DRIVE);
+}
+
+void CConfirmDialog::OnYes()
+{
+    CDialog::OnOK();
+}
+
+void CConfirmDialog::OnCancel()
+{
+    CDialog::OnCancel();
+}
Index: /trunk/Erasext/ConfirmReplaceDlg.cpp
===================================================================
--- /trunk/Erasext/ConfirmReplaceDlg.cpp	(revision 5)
+++ /trunk/Erasext/ConfirmReplaceDlg.cpp	(revision 5)
@@ -0,0 +1,188 @@
+// ConfirmReplaceDlg.cpp
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#include "stdafx.h"
+#include "resource.h"
+#include "ConfirmReplaceDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+const LPCTSTR szHeaderFormat    = TEXT("This folder already contains a file called '%s'.");
+const LPCTSTR szKBInfoFormat    = TEXT("%I64u KB\r\nmodified on %s, %s");
+const LPCTSTR szMBInfoFormat    = TEXT("%I64u MB\r\nmodified on %s, %s");
+
+/////////////////////////////////////////////////////////////////////////////
+// CConfirmReplaceDlg dialog
+
+
+CConfirmReplaceDlg::CConfirmReplaceDlg(CWnd* pParent /*=NULL*/) :
+CDialog(CConfirmReplaceDlg::IDD, pParent),
+m_bApplyToAll(FALSE)
+{
+    //{{AFX_DATA_INIT(CConfirmReplaceDlg)
+    m_strSource = _T("");
+    m_strExisting = _T("");
+    m_strHeader = _T("");
+    //}}AFX_DATA_INIT
+}
+
+
+void CConfirmReplaceDlg::DoDataExchange(CDataExchange* pDX)
+{
+    CDialog::DoDataExchange(pDX);
+    //{{AFX_DATA_MAP(CConfirmReplaceDlg)
+    DDX_Control(pDX, IDI_ICON_SOURCE, m_stIconSource);
+    DDX_Control(pDX, IDI_ICON_EXISTING, m_stIconExisting);
+    DDX_Text(pDX, IDC_STATIC_SOURCE, m_strSource);
+    DDX_Text(pDX, IDC_STATIC_EXISTING, m_strExisting);
+    DDX_Text(pDX, IDC_STATIC_HEADER, m_strHeader);
+    //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CConfirmReplaceDlg, CDialog)
+    //{{AFX_MSG_MAP(CConfirmReplaceDlg)
+	ON_BN_CLICKED(IDC_BUTTON_NOTOALL, OnNoToAll)
+	ON_BN_CLICKED(IDC_BUTTON_YESTOALL, OnYesToAll)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CConfirmReplaceDlg message handlers
+
+BOOL CConfirmReplaceDlg::OnInitDialog()
+{
+    CString     strFile;
+    TCHAR       szFile[_MAX_FNAME];
+    TCHAR       szExt[_MAX_EXT];
+    SHFILEINFO  sfi;
+
+    ZeroMemory(szFile, _MAX_FNAME);
+    ZeroMemory(szExt, _MAX_EXT);
+    ZeroMemory(&sfi, sizeof(SHFILEINFO));
+
+    // filename to the header
+
+    _tsplitpath((LPCTSTR)m_strExistingFile, NULL, NULL, szFile, szExt);
+
+    strFile = szFile;
+    strFile += szExt;
+
+    m_strHeader.Format(szHeaderFormat, strFile);
+
+    // size and modified date to information sections
+
+    FormatInfo((LPCTSTR)m_strExistingFile, m_strExisting);
+    FormatInfo((LPCTSTR)m_strSourceFile, m_strSource);
+
+    CDialog::OnInitDialog();
+
+    // icons
+
+    SHGetFileInfo((LPCTSTR)m_strExistingFile,
+                   0,
+                   &sfi,
+                   sizeof(SHFILEINFO),
+                   SHGFI_ICON | SHGFI_LARGEICON);
+
+    m_stIconExisting.SetIcon(sfi.hIcon);
+
+    SHGetFileInfo((LPCTSTR)m_strSourceFile,
+                   0,
+                   &sfi,
+                   sizeof(SHFILEINFO),
+                   SHGFI_ICON | SHGFI_LARGEICON);
+
+    m_stIconSource.SetIcon(sfi.hIcon);
+
+    return TRUE;  // return TRUE unless you set the focus to a control
+                  // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+BOOL CConfirmReplaceDlg::GetFileSizeAndModifiedData(LPCTSTR szFile, ULARGE_INTEGER& uiSize, COleDateTime& odtModified)
+{
+    WIN32_FIND_DATA findFileData;
+    HANDLE          hFind = INVALID_HANDLE_VALUE;
+
+    hFind = FindFirstFile((LPTSTR)szFile, &findFileData);
+
+    if (hFind == INVALID_HANDLE_VALUE)
+        return FALSE;
+
+    VERIFY(FindClose(hFind));
+
+    uiSize.LowPart  = findFileData.nFileSizeLow;
+    uiSize.HighPart = findFileData.nFileSizeHigh;
+
+    odtModified = COleDateTime(findFileData.ftLastWriteTime);
+
+    return TRUE;
+}
+
+BOOL CConfirmReplaceDlg::FormatInfo(LPCTSTR szFile, CString& strInfo)
+{
+    ULARGE_INTEGER  uiSize;
+    COleDateTime    odtModified;
+
+    if (GetFileSizeAndModifiedData(szFile, uiSize, odtModified))
+    {
+        if (uiSize.QuadPart % 1024 > 0)
+        {
+            uiSize.QuadPart /= 1024;
+            uiSize.QuadPart += 1;
+        }
+        else
+            uiSize.QuadPart /= 1024;
+
+        if (uiSize.QuadPart > 100000) // > 100 000 KB ~ 97,7 MB
+        {
+            strInfo.Format(szMBInfoFormat, uiSize.QuadPart / 1024,
+                           odtModified.Format(VAR_DATEVALUEONLY),
+                           odtModified.Format(VAR_TIMEVALUEONLY));
+        }
+        else
+        {
+            strInfo.Format(szKBInfoFormat, uiSize.QuadPart,
+                           odtModified.Format(VAR_DATEVALUEONLY),
+                           odtModified.Format(VAR_TIMEVALUEONLY));
+        }
+
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+void CConfirmReplaceDlg::OnNoToAll()
+{
+	m_bApplyToAll = TRUE;
+    CDialog::OnCancel();
+}
+
+void CConfirmReplaceDlg::OnYesToAll()
+{
+	m_bApplyToAll = TRUE;
+    CDialog::OnOK();
+}
Index: /trunk/Erasext/Erasext.h
===================================================================
--- /trunk/Erasext/Erasext.h	(revision 5)
+++ /trunk/Erasext/Erasext.h	(revision 5)
@@ -0,0 +1,58 @@
+// Erasext.h
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#ifndef ERASEXT_H
+#define ERASEXT_H
+
+#ifndef __AFXWIN_H__
+    #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"       // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CErasextApp
+// See Erasext.cpp for the implementation of this class
+//
+
+class CErasextApp : public CWinApp
+{
+public:
+    CErasextApp();
+
+// Overrides
+    // ClassWizard generated virtual function overrides
+    //{{AFX_VIRTUAL(CErasextApp)
+	public:
+    virtual BOOL InitInstance();
+	virtual int ExitInstance();
+	//}}AFX_VIRTUAL
+
+    //{{AFX_MSG(CErasextApp)
+        // NOTE - the ClassWizard will add and remove member functions here.
+        //    DO NOT EDIT what you see in these blocks of generated code !
+    //}}AFX_MSG
+    DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#endif
Index: /trunk/Erasext/ConfirmDialog.h
===================================================================
--- /trunk/Erasext/ConfirmDialog.h	(revision 5)
+++ /trunk/Erasext/ConfirmDialog.h	(revision 5)
@@ -0,0 +1,70 @@
+// ConfirmDialog.h
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#ifndef CONFIRMDIALOG_H
+#define CONFIRMDIALOG_H
+
+/////////////////////////////////////////////////////////////////////////////
+// CConfirmDialog dialog
+
+class CConfirmDialog : public CDialog
+{
+// Construction
+public:
+    BOOL    m_bSingleFile;
+    BOOL    m_bUseFiles;
+    BOOL    m_bMove;
+    CString m_strData;
+    CString m_strTarget;
+
+    CConfirmDialog(CWnd* pParent = NULL);   // standard constructor
+
+// Dialog Data
+    //{{AFX_DATA(CConfirmDialog)
+    enum { IDD = IDD_DIALOG_CONFIRM };
+    CString m_strLineOne;
+    CString m_strLineTwo;
+    //}}AFX_DATA
+
+
+// Overrides
+    // ClassWizard generated virtual function overrides
+    //{{AFX_VIRTUAL(CConfirmDialog)
+    public:
+    virtual BOOL PreTranslateMessage(MSG* pMsg);
+    protected:
+    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+    //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+    HACCEL m_hAccel;
+
+    // Generated message map functions
+    //{{AFX_MSG(CConfirmDialog)
+    virtual BOOL OnInitDialog();
+    afx_msg void OnOptions();
+    afx_msg void OnYes();
+    virtual void OnCancel();
+    //}}AFX_MSG
+    DECLARE_MESSAGE_MAP()
+};
+
+#endif
Index: /trunk/Erasext/WipeProgDlg.cpp
===================================================================
--- /trunk/Erasext/WipeProgDlg.cpp	(revision 5)
+++ /trunk/Erasext/WipeProgDlg.cpp	(revision 5)
@@ -0,0 +1,413 @@
+// WipeProgDlg.cpp
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#include "stdafx.h"
+#include "Erasext.h"
+#include "..\EraserDll\eraserdll.h"
+#include "..\shared\FitFileNameToScrn.h"
+#include "..\shared\key.h"
+
+
+#include "resource.h"
+#include "WipeProgDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CEraserDlg dialog
+
+// General Preferences
+static BOOL getAskUserParam()
+{
+	BOOL bResolveAskUser = TRUE;
+	CKey kReg;
+	if (kReg.Open(HKEY_CURRENT_USER, ERASER_REGISTRY_BASE))
+	{
+		kReg.GetValue(bResolveAskUser, "EraserResolveLockAskUser", TRUE);	
+		kReg.Close();
+	}	
+	return bResolveAskUser; 
+}
+
+CEraserDlg::CEraserDlg(CWnd* pParent /*=NULL*/) :
+CDialog(CEraserDlg::IDD, pParent),
+m_hAccel(NULL),
+m_bUseFiles(TRUE),
+m_bMove(FALSE),
+m_bShowResults(TRUE),
+m_ehContext(ERASER_INVALID_CONTEXT),
+m_LockResolver(getAskUserParam())
+{
+    //{{AFX_DATA_INIT(CEraserDlg)
+    m_strPercent = _T("0%");
+    m_strPercentTotal = _T("0%");
+    m_strData = _T("");
+    m_strErasing = _T("");
+    m_strPass = _T("");
+    m_strTime = _T("");
+    m_strMessage = _T("");
+    m_bResults = FALSE;
+    //}}AFX_DATA_INIT
+
+}
+
+
+void CEraserDlg::DoDataExchange(CDataExchange* pDX)
+{
+    CDialog::DoDataExchange(pDX);
+    //{{AFX_DATA_MAP(CEraserDlg)
+    DDX_Control(pDX, IDC_PROGRESS, m_pcProgress);
+    DDX_Control(pDX, IDC_PROGRESS_TOTAL, m_pcProgressTotal);
+    DDX_Text(pDX, IDC_STATIC_PERCENT, m_strPercent);
+    DDX_Text(pDX, IDC_STATIC_PERCENT_TOTAL, m_strPercentTotal);
+    DDX_Text(pDX, IDC_STATIC_DATA, m_strData);
+    DDX_Text(pDX, IDC_STATIC_ERASING, m_strErasing);
+    DDX_Text(pDX, IDC_STATIC_PASS, m_strPass);
+    DDX_Text(pDX, IDC_STATIC_TIME, m_strTime);
+    DDX_Text(pDX, IDC_STATIC_MESSAGE, m_strMessage);
+    DDX_Check(pDX, IDC_CHECK_RESULTS, m_bResults);
+    //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CEraserDlg, CDialog)
+    //{{AFX_MSG_MAP(CEraserDlg)
+    ON_WM_DESTROY()
+	ON_BN_CLICKED(IDC_CHECK_RESULTS, OnCheckResults)
+	//}}AFX_MSG_MAP
+    ON_MESSAGE(WM_ERASERNOTIFY, OnEraserNotify)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CEraserDlg message handlers
+
+BOOL CEraserDlg::OnInitDialog()
+{
+    CDialog::OnInitDialog();
+
+    CKey kReg;
+
+    if (kReg.Open(HKEY_CURRENT_USER, ERASER_REGISTRY_BASE))
+    {
+        kReg.GetValue(m_bResults, ERASEXT_REGISTRY_RESULTS, TRUE);
+        kReg.GetValue(m_bResultsForFiles, ERASER_REGISTRY_RESULTS_FILES, TRUE);
+        kReg.GetValue(m_bResultsForUnusedSpace, ERASER_REGISTRY_RESULTS_UNUSEDSPACE, TRUE);
+        kReg.GetValue(m_bResultsOnlyWhenFailed, ERASER_REGISTRY_RESULTS_WHENFAILED, TRUE);
+        kReg.Close();
+    }
+
+    if (!m_bShowResults)
+    {
+        m_bResults = FALSE;
+        GetDlgItem(IDC_CHECK_RESULTS)->ShowWindow(SW_HIDE);
+    }
+
+    UpdateData(FALSE);
+
+    m_hAccel = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR_PROG));
+
+    m_pcProgress.SetRange(0, 100);
+    m_pcProgress.SetStep(1);
+    m_pcProgress.SetPos(0);
+
+    m_pcProgressTotal.SetRange(0, 100);
+    m_pcProgressTotal.SetStep(1);
+    m_pcProgressTotal.SetPos(0);
+
+    // starts the thread
+    Erase();
+
+    return TRUE;  // return TRUE unless you set the focus to a control
+                  // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void CEraserDlg::Erase()
+{
+    if (eraserError(eraserIsValidContext(m_ehContext)) && m_saData.GetSize() > 0)
+    {
+        if (eraserOK(eraserCreateContext(&m_ehContext)))
+        {
+			m_LockResolver.SetHandle(m_ehContext);
+
+            if (m_bUseFiles)
+                VERIFY(eraserOK(eraserSetDataType(m_ehContext, ERASER_DATA_FILES)));
+            else
+                VERIFY(eraserOK(eraserSetDataType(m_ehContext, ERASER_DATA_DRIVES)));
+
+            int iSize = m_saData.GetSize();
+            for (int i = 0; i < iSize; i++)
+            {
+                VERIFY(eraserOK(eraserAddItem(m_ehContext,
+                    (LPVOID)(LPCTSTR)m_saData[i], (E_UINT16)m_saData[i].GetLength())));
+            }
+            m_saData.RemoveAll();
+
+            // set notification window & message
+            VERIFY(eraserOK(eraserSetWindow(m_ehContext, GetSafeHwnd())));
+            VERIFY(eraserOK(eraserSetWindowMessage(m_ehContext, WM_ERASERNOTIFY)));
+
+            // start erasing (the library will launch a new thread for this)
+            VERIFY(eraserOK(eraserStart(m_ehContext)));
+        }
+    }
+}
+
+LRESULT CEraserDlg::OnEraserNotify(WPARAM wParam, LPARAM)
+{
+    switch (wParam)
+    {
+    case ERASER_WIPE_BEGIN:
+        EraserWipeBegin();
+        break;
+    case ERASER_WIPE_UPDATE:
+        EraserWipeUpdate();
+        break;
+    case ERASER_WIPE_DONE:
+        EraserWipeDone();
+        break;
+    }
+
+    return TRUE;
+}
+
+BOOL CEraserDlg::EraserWipeBegin()
+{
+    UpdateData(TRUE);
+
+    if (m_bUseFiles)
+    {
+        if (!m_bMove)
+            m_strErasing = "Files";
+        else
+            m_strErasing = "Source Files";
+    }
+    else
+        m_strErasing = "Unused disk space";
+
+    TCHAR    szValue[255];
+    E_UINT16 uSize = 255;
+    E_UINT8  uValue = 0;
+
+    // data
+    if (eraserOK(eraserProgGetCurrentDataString(m_ehContext, (LPVOID)szValue, &uSize)))
+        m_strData = szValue;
+    fitFileNameToScrn(GetDlgItem(IDC_STATIC_DATA), m_strData);
+
+    // message
+    if (eraserOK(eraserProgGetMessage(m_ehContext, (LPVOID)szValue, &uSize)))
+        m_strMessage = szValue;
+
+    // progress
+    if (eraserOK(eraserDispFlags(m_ehContext, &uValue)))
+    {
+        if (bitSet(uValue, eraserDispInit))
+        {
+            m_pcProgress.SetPos(0);
+            m_strPercent = "0%";
+        }
+
+        // pass
+        if (!bitSet(uValue, eraserDispPass))
+            m_strPass.Empty();
+
+        // time
+        if (!bitSet(uValue, eraserDispTime))
+            m_strTime.Empty();
+    }
+
+    UpdateData(FALSE);
+
+    return TRUE;
+}
+
+BOOL CEraserDlg::EraserWipeUpdate()
+{
+    TCHAR    szValue[255];
+    E_UINT16 uSize = 255;
+    E_UINT8  uValue = 0;
+    CString  strPercent, strPercentTotal, strTime, strPass, strMessage;
+
+    UpdateData(TRUE);
+
+    // percent
+    if (eraserOK(eraserProgGetPercent(m_ehContext, &uValue)))
+    {
+        strPercent.Format("%u%%", uValue);
+        m_pcProgress.SetPos(uValue);
+    }
+
+    // total percent
+    if (eraserOK(eraserProgGetTotalPercent(m_ehContext, &uValue)))
+    {
+        strPercentTotal.Format("%u%%", uValue);
+        m_pcProgressTotal.SetPos(uValue);
+    }
+
+    // pass
+    if (eraserOK(eraserDispFlags(m_ehContext, &uValue)))
+    {
+        if (bitSet(uValue, eraserDispPass))
+        {
+            E_UINT16 current = 0, passes = 0;
+            if (eraserOK(eraserProgGetCurrentPass(m_ehContext, &current)) &&
+                eraserOK(eraserProgGetPasses(m_ehContext, &passes)))
+            {
+                strPass.Format("%u of %u", current, passes);
+            }
+        }
+
+        // show time?
+        if (bitSet(uValue, eraserDispTime))
+        {
+            // time left
+            E_UINT32 uTimeLeft = 0;
+            if (eraserOK(eraserProgGetTimeLeft(m_ehContext, &uTimeLeft)))
+            {
+                if (uTimeLeft > 120)
+                {
+                    uTimeLeft = (uTimeLeft / 60) + 1;
+                    strTime.Format("%u minutes left", uTimeLeft);
+                }
+                else if (uTimeLeft > 0)
+                {
+                    if (uTimeLeft % 5)
+                        strTime = m_strTime;
+                    else
+                        strTime.Format("%u seconds left", uTimeLeft);
+                }
+            }
+        }
+    }
+
+    // message
+    if (eraserOK(eraserProgGetMessage(m_ehContext, (LPVOID)szValue, &uSize)))
+        strMessage = szValue;
+
+    // update only if necessary to minimize flickering
+    if (m_strPercent != strPercent || m_strPercentTotal != strPercentTotal ||
+        m_strPass != strPass || m_strTime != strTime || m_strMessage != strMessage)
+    {
+        m_strPercent = strPercent;
+        m_strPercentTotal = strPercentTotal;
+        m_strPass = strPass;
+        m_strTime = strTime;
+        m_strMessage = strMessage;
+
+        UpdateData(FALSE);
+    }
+
+    return TRUE;
+}
+
+BOOL CEraserDlg::EraserWipeDone()
+{
+    // clear display
+    m_strMessage.Empty();
+    m_strPercent.Empty();
+    m_strPercentTotal.Empty();
+    m_strPass.Empty();
+    m_strTime.Empty();
+    m_strData.Empty();
+    m_pcProgress.SetPos(0);
+    m_pcProgressTotal.SetPos(0);
+    UpdateData(FALSE);
+
+    // show results
+    E_UINT32 uFailed = 0;
+    E_UINT16 uErrors = 0;
+    eraserFailedCount(m_ehContext, &uFailed);
+    eraserErrorStringCount(m_ehContext, &uErrors);
+
+    if (m_bResults)
+    {
+        if (((m_bUseFiles && m_bResultsForFiles) ||
+             (!m_bUseFiles && m_bResultsForUnusedSpace)) &&
+            (!m_bResultsOnlyWhenFailed || (uFailed > 0 || uErrors > 0)))
+        {
+            eraserShowReport(m_ehContext, GetSafeHwnd());
+        }
+    }
+
+    // success
+    E_UINT8 uSuccess = 0;
+    if (eraserOK(eraserCompleted(m_ehContext, &uSuccess)) && uSuccess)
+        CDialog::OnOK();
+    else
+        CDialog::OnCancel();
+
+    return TRUE;
+}
+
+
+void CEraserDlg::OnDestroy()
+{
+    UpdateData(TRUE);
+
+    if (m_bShowResults)
+    {
+        CKey kReg;
+
+        if (kReg.Open(HKEY_CURRENT_USER, ERASER_REGISTRY_BASE))
+        {
+            kReg.SetValue(m_bResults, ERASEXT_REGISTRY_RESULTS);
+            kReg.Close();
+        }
+    }
+
+	m_LockResolver.Close();
+
+    eraserDestroyContext(m_ehContext);
+    m_ehContext = ERASER_INVALID_CONTEXT;
+
+    CDialog::OnDestroy();
+}
+
+BOOL CEraserDlg::PreTranslateMessage(MSG* pMsg)
+{
+    if (TranslateAccelerator(GetSafeHwnd(), m_hAccel, pMsg))
+        return TRUE;
+
+    return CDialog::PreTranslateMessage(pMsg);
+}
+
+void CEraserDlg::OnCancel()
+{
+    m_strMessage = "Terminating...";
+    m_strPercent.Empty();
+    m_strPercentTotal.Empty();
+    m_strPass.Empty();
+    m_strTime.Empty();
+    m_strData.Empty();
+    m_pcProgress.SetPos(0);
+    m_pcProgressTotal.SetPos(0);
+    UpdateData(FALSE);
+
+    GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
+    eraserStop(m_ehContext);
+}
+
+void CEraserDlg::OnCheckResults()
+{
+	UpdateData(TRUE);
+}
Index: /trunk/Erasext/ConfirmReplaceDlg.h
===================================================================
--- /trunk/Erasext/ConfirmReplaceDlg.h	(revision 5)
+++ /trunk/Erasext/ConfirmReplaceDlg.h	(revision 5)
@@ -0,0 +1,82 @@
+// ConfirmReplaceDlg.h
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#if !defined(AFX_CONFIRMREPLACEDLG_H__E1E50051_2FC1_11D3_8212_00105AAF62C4__INCLUDED_)
+#define AFX_CONFIRMREPLACEDLG_H__E1E50051_2FC1_11D3_8212_00105AAF62C4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/////////////////////////////////////////////////////////////////////////////
+// CConfirmReplaceDlg dialog
+
+class CConfirmReplaceDlg : public CDialog
+{
+// Construction
+public:
+    CConfirmReplaceDlg(CWnd* pParent = NULL);   // standard constructor
+    void SetExisting(LPCTSTR sz)    { m_strExistingFile = sz; }
+    void SetSource(LPCTSTR sz)      { m_strSourceFile = sz; }
+
+    BOOL ApplyToAll()               { return m_bApplyToAll; }
+
+// Dialog Data
+    //{{AFX_DATA(CConfirmReplaceDlg)
+    enum { IDD = IDD_DIALOG_REPLACE };
+    CStatic m_stIconSource;
+    CStatic m_stIconExisting;
+    CString m_strSource;
+    CString m_strExisting;
+    CString m_strHeader;
+    //}}AFX_DATA
+
+
+// Overrides
+    // ClassWizard generated virtual function overrides
+    //{{AFX_VIRTUAL(CConfirmReplaceDlg)
+    protected:
+    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+    //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+    BOOL FormatInfo(LPCTSTR szFile, CString& strInfo);
+    BOOL GetFileSizeAndModifiedData(LPCTSTR szFile, ULARGE_INTEGER& uiSize, COleDateTime& odtModified);
+
+    CString m_strExistingFile;
+    CString m_strSourceFile;
+
+    BOOL m_bApplyToAll;
+
+    // Generated message map functions
+    //{{AFX_MSG(CConfirmReplaceDlg)
+    virtual BOOL OnInitDialog();
+	afx_msg void OnNoToAll();
+	afx_msg void OnYesToAll();
+	//}}AFX_MSG
+    DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_CONFIRMREPLACEDLG_H__E1E50051_2FC1_11D3_8212_00105AAF62C4__INCLUDED_)
Index: /trunk/Erasext/WipeProgDlg.h
===================================================================
--- /trunk/Erasext/WipeProgDlg.h	(revision 5)
+++ /trunk/Erasext/WipeProgDlg.h	(revision 5)
@@ -0,0 +1,90 @@
+// WipeProgDlg.h
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#ifndef WIPEPROGDLG_H
+#define WIPEPROGDLG_H
+
+/////////////////////////////////////////////////////////////////////////////
+// CEraserDlg dialog
+#include "..\EraserDll\FileLockResolver.h"
+class CEraserDlg : public CDialog
+{
+// Construction
+public:
+    CEraserDlg(CWnd* pParent = NULL);   // standard constructor
+
+    BOOL    m_bShowResults;
+    BOOL    m_bUseFiles;
+    BOOL    m_bMove;
+    CStringArray m_saData;
+
+    BOOL    m_bResultsForFiles;
+    BOOL    m_bResultsForUnusedSpace;
+    BOOL    m_bResultsOnlyWhenFailed;
+	CFileLockResolver m_LockResolver;
+
+// Dialog Data
+    //{{AFX_DATA(CEraserDlg)
+    enum { IDD = IDD_DIALOG_WIPEPROG };
+    CProgressCtrl   m_pcProgress;
+    CProgressCtrl   m_pcProgressTotal;
+    CString m_strPercent;
+    CString m_strPercentTotal;
+    CString m_strData;
+    CString m_strErasing;
+    CString m_strPass;
+    CString m_strTime;
+    CString m_strMessage;
+    BOOL    m_bResults;
+    //}}AFX_DATA
+
+
+// Overrides
+    // ClassWizard generated virtual function overrides
+    //{{AFX_VIRTUAL(CEraserDlg)
+    public:
+    virtual BOOL PreTranslateMessage(MSG* pMsg);
+    protected:
+    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+    //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+    ERASER_HANDLE   m_ehContext;
+    HACCEL          m_hAccel;
+
+    // Generated message map functions
+    //{{AFX_MSG(CEraserDlg)
+    virtual BOOL OnInitDialog();
+    afx_msg void OnDestroy();
+    virtual void OnCancel();
+	afx_msg void OnCheckResults();
+	//}}AFX_MSG
+    afx_msg LRESULT OnEraserNotify(WPARAM wParam, LPARAM lParam);
+    DECLARE_MESSAGE_MAP()
+
+    void Erase();
+
+    BOOL EraserWipeBegin();
+    BOOL EraserWipeUpdate();
+    BOOL EraserWipeDone();
+};
+
+#endif
Index: /trunk/Erasext/StdAfx.cpp
===================================================================
--- /trunk/Erasext/StdAfx.cpp	(revision 5)
+++ /trunk/Erasext/StdAfx.cpp	(revision 5)
@@ -0,0 +1,23 @@
+// stdafx.cpp : source file that includes just the standard includes
+//  Erasext.pch will be the pre-compiled header
+//  stdafx.obj will contain the pre-compiled type information
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#include "stdafx.h"
Index: /trunk/Erasext/Erasext.vcproj
===================================================================
--- /trunk/Erasext/Erasext.vcproj	(revision 5)
+++ /trunk/Erasext/Erasext.vcproj	(revision 5)
@@ -0,0 +1,975 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Erasext"
+	ProjectGUID="{E3DBF6A6-475B-4BA8-AE20-73655A7D42D9}"
+	RootNamespace="Erasext"
+	Keyword="MFCProj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)\bin\80\$(ConfigurationName)"
+			IntermediateDirectory="$(SolutionDir)\tmp\80\$(ConfigurationName)\$(ProjectName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="1"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName="$(SolutionDir)\lib\$(ConfigurationName)\Erasext.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/GD "
+				Optimization="1"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="stdafx.h"
+				PrecompiledHeaderFile="$(IntDir)\Erasext.pch"
+				AssemblerListingLocation=""
+				ObjectFile="$(IntDir)/"
+				ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
+				WarningLevel="4"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\Erasext.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\Erasext.def"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				ImportLibrary="$(SolutionDir)\lib\80\$(ConfigurationName)\Eraserext.lib"
+				TargetMachine="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
+			Name="Release|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="1"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName="$(SolutionDir)\lib\$(ConfigurationName)\Erasext.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/GD "
+				Optimization="1"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="stdafx.h"
+				PrecompiledHeaderFile="$(IntDir)\Erasext.pch"
+				AssemblerListingLocation=""
+				ObjectFile="$(IntDir)/"
+				ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
+				WarningLevel="4"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\Erasext.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\Erasext.def"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				ImportLibrary="$(SolutionDir)\lib\80\$(ConfigurationName)\Eraserext.lib"
+				TargetMachine="17"
+			/>
+			<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
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)\bin\80\$(ConfigurationName)"
+			IntermediateDirectory="$(SolutionDir)\tmp\80\$(ConfigurationName)\$(ProjectName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="2"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName="$(SolutionDir)\lib\$(ConfigurationName)\Erasext.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/EHa"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
+				ExceptionHandling="0"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="stdafx.h"
+				PrecompiledHeaderFile="$(IntDir)\Erasext.pch"
+				AssemblerListingLocation=""
+				ObjectFile="$(IntDir)/"
+				ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\Erasext.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\Erasext.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\Erasext.pdb"
+				SubSystem="2"
+				ImportLibrary="$(SolutionDir)\lib\80\$(ConfigurationName)\Eraserext.lib"
+				TargetMachine="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
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="2"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName="$(SolutionDir)\lib\$(ConfigurationName)\Erasext.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/EHa"
+				Optimization="0"
+				PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
+				ExceptionHandling="0"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="stdafx.h"
+				PrecompiledHeaderFile="$(IntDir)\Erasext.pch"
+				AssemblerListingLocation=""
+				ObjectFile="$(IntDir)/"
+				ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\Erasext.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\Erasext.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\Erasext.pdb"
+				SubSystem="2"
+				ImportLibrary="$(SolutionDir)\lib\80\$(ConfigurationName)\Eraserext.lib"
+				TargetMachine="17"
+			/>
+			<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>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+			>
+			<File
+				RelativePath="ConfirmDialog.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="ConfirmReplaceDlg.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="res\Eraser.ico"
+				>
+			</File>
+			<File
+				RelativePath="Erasext.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Erasext.def"
+				>
+			</File>
+			<File
+				RelativePath="Erasext.odl"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCMIDLTool"
+						PreprocessorDefinitions=""
+						TargetEnvironment="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCMIDLTool"
+						PreprocessorDefinitions=""
+						TargetEnvironment="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCMIDLTool"
+						PreprocessorDefinitions=""
+						TargetEnvironment="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCMIDLTool"
+						PreprocessorDefinitions=""
+						TargetEnvironment="1"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Erasext.rc"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+						AdditionalIncludeDirectories="$(OUTDIR)"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+						AdditionalIncludeDirectories="$(OUTDIR)"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+						AdditionalIncludeDirectories="$(OUTDIR)"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+						AdditionalIncludeDirectories="$(OUTDIR)"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="ErasextMenu.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\shared\FileHelper.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\shared\FitFileNameToScrn.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\shared\key.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\shared\SeException.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="StdAfx.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="WipeProgDlg.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="1"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;fi;fd"
+			>
+			<File
+				RelativePath="ConfirmDialog.h"
+				>
+			</File>
+			<File
+				RelativePath="ConfirmReplaceDlg.h"
+				>
+			</File>
+			<File
+				RelativePath="..\EraserDll\EraserDll.h"
+				>
+			</File>
+			<File
+				RelativePath="Erasext.h"
+				>
+			</File>
+			<File
+				RelativePath="ErasextMenu.h"
+				>
+			</File>
+			<File
+				RelativePath="..\shared\FileHelper.h"
+				>
+			</File>
+			<File
+				RelativePath="..\shared\FitFileNameToScrn.h"
+				>
+			</File>
+			<File
+				RelativePath="..\shared\key.h"
+				>
+			</File>
+			<File
+				RelativePath="..\shared\SeException.h"
+				>
+			</File>
+			<File
+				RelativePath="StdAfx.h"
+				>
+			</File>
+			<File
+				RelativePath="..\version.h"
+				>
+			</File>
+			<File
+				RelativePath="WipeProgDlg.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="res\Erasext.rc2"
+				>
+			</File>
+			<File
+				RelativePath="res\icon_rep.ico"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /trunk/Erasext/resource.h
===================================================================
--- /trunk/Erasext/resource.h	(revision 5)
+++ /trunk/Erasext/resource.h	(revision 5)
@@ -0,0 +1,60 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Erasext.rc
+//
+#define IDS_MENU_TEXT_FILE              1
+#define IDS_MENU_TEXT_DRIVE             2
+#define IDS_COMMAND_STRING_FILE         3
+#define IDC_BUTTON_NOTOALL              3
+#define IDS_COMMAND_STRING_DRIVE        4
+#define IDS_CONFIRM_FILES               7
+#define IDS_CONFIRM_DRIVE               8
+#define IDOPTIONS                       9
+#define IDS_COMMAND_STRING_DIRECTORIES  9
+#define IDS_CONFIRM_FILES_AND_FOLDERS   10
+#define IDS_CONFIRM                     11
+#define IDS_MENU_TEXT_DRAG              12
+#define IDS_CONFIRM_MOVE                13
+#define IDS_CONFIRM_MOVE_FILES          14
+#define IDS_CONFIRM_MOVE_FILES_AND_FOLDERS 15
+#define IDS_CONFIRM_MULTI_DRIVE         16
+#define IDS_CONFIRM_MOVE_FILE           28
+#define IDS_MOVE_TITLE                  29
+#define IDS_ERROR_MOVE_SAMEFOLDER       30
+#define IDM_ERASEXT_MENU                101
+#define IDD_DIALOG_WIPEPROG             129
+#define IDI_ICON_ERASER                 130
+#define IDD_DIALOG_CONFIRM              131
+#define IDR_ACCELERATOR_CONFIRM         132
+#define IDR_ACCELERATOR_PROG            133
+#define IDD_DIALOG_REPLACE              136
+#define IDI_ICON_REPLACE                137
+#define IDC_STATIC_PERCENT              1002
+#define IDC_STATIC_LINETWO              1007
+#define IDC_STATIC_HEADER               1008
+#define IDC_STATIC_EXISTING             1009
+#define IDC_STATIC_SOURCE               1010
+#define IDC_BUTTON_YESTOALL             1011
+#define IDC_CHECK_RESULTS               1012
+#define IDC_STATIC_LINEONE              1013
+#define IDI_ICON_EXISTING               1014
+#define IDI_ICON_SOURCE                 1015
+#define IDC_PROGRESS                    1025
+#define IDC_STATIC_ERASING              1026
+#define IDC_STATIC_MESSAGE              1027
+#define IDC_STATIC_DATA                 1028
+#define IDC_STATIC_PASS                 1029
+#define IDC_STATIC_TIME                 1030
+#define IDC_PROGRESS_TOTAL              1032
+#define IDC_STATIC_PERCENT_TOTAL        1033
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        138
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1016
+#define _APS_NEXT_SYMED_VALUE           102
+#endif
+#endif
Index: /trunk/Erasext/Erasext.rc
===================================================================
--- /trunk/Erasext/Erasext.rc	(revision 5)
+++ /trunk/Erasext/Erasext.rc	(revision 5)
@@ -0,0 +1,259 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DIALOG_REPLACE DIALOG  0, 0, 280, 141
+STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | 
+    WS_CAPTION | WS_SYSMENU
+CAPTION "Confirm File Replace"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "&No",IDCANCEL,161,120,53,14
+    PUSHBUTTON      "N&o to All",IDC_BUTTON_NOTOALL,220,120,53,14
+    PUSHBUTTON      "&Yes",IDOK,45,120,53,14
+    PUSHBUTTON      "Yes to &All",IDC_BUTTON_YESTOALL,103,120,53,14
+    ICON            IDI_ICON_REPLACE,IDC_STATIC,10,10,20,20
+    LTEXT           "This folder already contains a file called '%s'.",
+                    IDC_STATIC_HEADER,41,10,222,22,SS_NOPREFIX
+    LTEXT           "Would you like to replace the existing file",IDC_STATIC,
+                    41,35,180,10
+    ICON            "",IDI_ICON_EXISTING,51,49,20,20
+    ICON            "",IDI_ICON_SOURCE,51,89,20,20
+    LTEXT           "with this one?",IDC_STATIC,41,75,180,10
+    LTEXT           "",IDC_STATIC_EXISTING,79,51,194,18,SS_NOPREFIX
+    LTEXT           "",IDC_STATIC_SOURCE,79,91,194,18,SS_NOPREFIX
+END
+
+IDD_DIALOG_CONFIRM DIALOG  0, 0, 273, 64
+STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | 
+    WS_CAPTION | WS_SYSMENU
+CAPTION "Confirm Erasing"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "&No",IDCANCEL,213,43,53,14
+    PUSHBUTTON      "&Yes",IDOK,155,43,53,14
+    PUSHBUTTON      "&Options...",IDOPTIONS,7,43,50,14
+    ICON            IDI_ICON_ERASER,IDC_STATIC,7,7,21,20
+    LTEXT           "",IDC_STATIC_LINEONE,38,9,228,8,SS_NOPREFIX
+    LTEXT           "",IDC_STATIC_LINETWO,38,18,228,8,SS_NOPREFIX
+END
+
+IDD_DIALOG_WIPEPROG DIALOG  0, 0, 243, 133
+STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | 
+    WS_CLIPCHILDREN | WS_CAPTION
+CAPTION "Eraser"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "&Stop",IDCANCEL,96,112,50,14
+    CONTROL         "Show results",IDC_CHECK_RESULTS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,116,53,10
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",0x1,7,58,
+                    201,12
+    LTEXT           "Erasing:",IDC_STATIC,7,7,37,8
+    LTEXT           "",IDC_STATIC_ERASING,48,7,188,8
+    LTEXT           "",IDC_STATIC_MESSAGE,48,16,188,8
+    LTEXT           "",IDC_STATIC_DATA,48,36,188,8,SS_NOPREFIX
+    LTEXT           "Item:",IDC_STATIC,7,36,37,8
+    LTEXT           "Pass:",IDC_STATIC,7,45,37,8
+    LTEXT           "",IDC_STATIC_PASS,48,45,54,8
+    LTEXT           "",IDC_STATIC_TIME,108,45,128,8
+    RTEXT           "",IDC_STATIC_PERCENT,211,58,25,8
+    CONTROL         "Progress1",IDC_PROGRESS_TOTAL,"msctls_progress32",0x1,7,
+                    94,201,9
+    RTEXT           "",IDC_STATIC_PERCENT_TOTAL,211,94,25,8
+    LTEXT           "Total:",IDC_STATIC,7,82,37,8
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,30,229,1
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,76,228,1
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO 
+BEGIN
+    IDD_DIALOG_CONFIRM, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 266
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 57
+    END
+
+    IDD_DIALOG_WIPEPROG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 126
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON_ERASER         ICON                    "res\\Eraser.ico"
+IDI_ICON_REPLACE        ICON                    "res\\icon_rep.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_ACCELERATOR_CONFIRM ACCELERATORS 
+BEGIN
+    "N",            IDCANCEL,               VIRTKEY, NOINVERT
+    "O",            IDOPTIONS,              VIRTKEY, NOINVERT
+    "Y",            IDOK,                   VIRTKEY, NOINVERT
+END
+
+IDR_ACCELERATOR_PROG ACCELERATORS 
+BEGIN
+    "S",            IDCANCEL,               VIRTKEY, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE 
+BEGIN
+    IDS_MENU_TEXT_FILE      "&Erase"
+    IDS_MENU_TEXT_DRIVE     "Erase Unused Space"
+    IDS_COMMAND_STRING_FILE "Erase file(s)"
+    IDS_COMMAND_STRING_DRIVE "Erase unused disk space"
+    IDS_CONFIRM_FILES       "these %d files?"
+    IDS_CONFIRM_DRIVE       "unused space on drive '%s'?"
+    IDS_COMMAND_STRING_DIRECTORIES "Erase file(s), folder(s) and subfolder(s)"
+    IDS_CONFIRM_FILES_AND_FOLDERS "these %d files and %d folders?"
+    IDS_CONFIRM             "Are you sure you want to erase "
+    IDS_MENU_TEXT_DRAG      "Eraser Secure &Move"
+    IDS_CONFIRM_MOVE        "Are you sure you want to move "
+    IDS_CONFIRM_MOVE_FILES  "these %d files to "
+    IDS_CONFIRM_MOVE_FILES_AND_FOLDERS "these %d files and %d folders to "
+END
+
+STRINGTABLE 
+BEGIN
+    AFX_IDS_APP_TITLE       "Eraser"
+END
+
+STRINGTABLE 
+BEGIN
+    IDS_CONFIRM_MULTI_DRIVE "unused space on the selected drives?"
+    IDS_CONFIRM_MOVE_FILE   "to"
+    IDS_MOVE_TITLE          "Confirm Secure Move"
+    IDS_ERROR_MOVE_SAMEFOLDER 
+                            "Cannot move selected items. The destination folder is the same as the source folder."
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Finnish resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
+#ifdef _WIN32
+LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif\r\n"
+    "#include ""res\\Erasext.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Finnish resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif
+#include "res\Erasext.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: /trunk/Erasext/StdAfx.h
===================================================================
--- /trunk/Erasext/StdAfx.h	(revision 5)
+++ /trunk/Erasext/StdAfx.h	(revision 5)
@@ -0,0 +1,84 @@
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+// Eraser. Secure data removal. For Windows.
+// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#pragma once
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN	// Exclude rarely-used items from Windows headers.
+#endif
+
+// Modify the following defines if you have to target an OS before the ones 
+// specified in the following code. See MSDN for the latest information
+// about corresponding values for different operating systems.
+#ifndef WINVER		// Permit use of features specific to Windows 95 and Windows NT 4.0 or later.
+#define WINVER 0x0400	// Change this to the appropriate value to target 
+#endif                     // Windows 98 and Windows 2000 or later.
+
+#ifndef _WIN32_WINNT	// Permit use of features specific to Windows NT 4.0 or later.
+#define _WIN32_WINNT 0x0400	// Change this to the appropriate value to target 
+#endif		         // Windows 98 and Windows 2000 or later.			
+
+#ifndef _WIN32_WINDOWS	      // Permit use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410    // Change this to the appropriate value to target 
+#endif			      // Windows Millennium Edition or later.
+
+#ifndef _WIN32_IE		// Permit use of features specific to Internet Explorer 4.0 or later.
+#define _WIN32_IE 0x0400   // Change this to the appropriate value to target 
+#endif			// Internet Explorer 5.0 or later.
+
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS  // Some CString constructors will be explicit.
+
+// Turns off MFC feature that hides of some common warning messages
+// that are frequently and safely ignored .
+#define _AFX_ALL_WARNINGS
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+
+#ifndef _AFX_NO_OLE_SUPPORT
+#include <afxole.h>         // MFC OLE classes
+#include <afxodlgs.h>       // MFC OLE dialog classes
+#include <afxdisp.h>        // MFC OLE automation classes
+#endif // _AFX_NO_OLE_SUPPORT
+
+
+#ifndef _AFX_NO_DB_SUPPORT
+#include <afxdb.h>          // MFC ODBC database classes
+#endif // _AFX_NO_DB_SUPPORT
+
+#ifndef _AFX_NO_DAO_SUPPORT
+#include <afxdao.h>         // MFC DAO database classes
+#endif // _AFX_NO_DAO_SUPPORT
+
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>         // MFC support for Windows 95 Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+#include <afxmt.h>
+#include <afxcoll.h>
+
+#ifndef _AFXDLL
+#define AfxLoadLibrary  ::LoadLibrary
+#define AfxFreeLibrary  ::FreeLibrary
+#endif
+
+#include <eh.h>                         // structured exception
+#include "..\shared\SeException.h"      // handling
