Ignore:
Timestamp:
10/12/07 09:51:16 (7 years ago)
Author:
lowjoel
Message:

-Refactored the File Lock Resolver code a bit
-The Launcher must terminate if the erase-on-restart failed
-Fixed a few stuff in the README

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EraserDll/FileLockResolver.cpp

    r35 r46  
    2323#include "stdafx.h" 
    2424#include "FileLockResolver.h" 
     25#include "..\Launcher\Launcher.h" 
    2526#include <fstream> 
    2627#include <string> 
     
    124125        || ERROR_SHARING_VIOLATION == dwErrorCode) 
    125126    { 
    126         bool needResolve = true; 
    127         if (TRUE == m_bAskUser ) 
     127        if (TRUE == m_bAskUser) 
    128128        { 
    129              needResolve = (IDYES == AfxGetMainWnd()->MessageBox(CString("The file ") + 
    130                  szFileName + "is locked by another process. Do you want to Erase the file after " + 
    131                  "you restart your computer?", "File Access Denied", MB_YESNO | MB_ICONQUESTION));           
    132         } 
    133  
    134         if (needResolve) 
    135         { 
    136             static PathHelper   path(m_strLockFileList); 
    137             std::ofstream os(m_strLockFileList, std::ios_base::out | std::ios_base::app);        
    138             os << FileData(szFileName, em, passes); 
     129            if (IDYES == AfxGetMainWnd()->MessageBox(CString("The file ") + 
     130                szFileName + "\nis locked by another process. Do you want to Erase the file after " + 
     131                "you restart your computer?", "File Access Denied", MB_YESNO | MB_ICONQUESTION)) 
     132            { 
     133                static PathHelper path(m_strLockFileList); 
     134                std::ofstream os(m_strLockFileList, std::ios_base::out | std::ios_base::app);        
     135                os << FileData(szFileName, em, passes); 
     136            } 
    139137        } 
    140138    } 
     
    175173    CString strPath; 
    176174    PathHelper(strPath, true); 
    177     strPath = CString("\"") + strPath ; 
    178     strPath += LAUNCHER; 
    179     strPath += "\" -rl \""; 
    180     strPath += m_strLockFileList + "\""; 
     175    strPath = CString("\"") + strPath + LAUNCHER + "\" " + szResolveLock; 
     176    strPath += " \"" + m_strLockFileList + "\""; 
    181177 
    182178    extern bool no_registry; 
Note: See TracChangeset for help on using the changeset viewer.