Changeset 1719 for branches/eraser6/6.0


Ignore:
Timestamp:
1/29/2010 12:40:49 AM (5 years ago)
Author:
lowjoel
Message:

Backported changes from trunk.

r1718: Author: lowjoel: When we have problems starting Eraser from the shell extension check the return code for ERROR_ELEVATION_REQUIRED; if we get that, then we should re-run the operation as an administrator.
r1717: Author: lowjoel: If the directory we are deleting does not exist, we should just return -- there's nothing to be deleted.
r1716: Author: lowjoel: Catch IOExceptions when we try to connect to other running instances and show a error message when one occurs.
r1715: Author: lowjoel: Set that files are not meant to be indexed when it is meant for deletion before we even set the file times.
r1714: Author: lowjoel: Fixed race condition potentially created by initialising the remote executor server thread immediately upon construction since Run is not yet called.
r1713: Author: lowjoel: Since we only force the creation of the SchedulerPanel?'s handle in the constructor, InvokeRequired? should be called on the panel itself, and not on subcontrols as they are still delay-constructed. Fixes crash when Eraser is started quietly and a task is created remotely.
r1712: Author: lowjoel: ThreadAbortExceptions? should not trigger BlackBox? report creation.

Location:
branches/eraser6/6.0
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/6.0

  • branches/eraser6/6.0/Eraser.DefaultPlugins/FileSystems/Windows.cs

    r1677 r1719  
    4040            //Set the date of the file to be invalid to prevent forensic 
    4141            //detection 
     42            info.Attributes = FileAttributes.NotContentIndexed; 
    4243            info.CreationTime = info.LastWriteTime = info.LastAccessTime = MinTimestamp; 
    43             info.Attributes = FileAttributes.Normal; 
    44             info.Attributes = FileAttributes.NotContentIndexed; 
    4544 
    4645            //Rename the file a few times to erase the entry from the file system 
     
    127126                throw new InvalidOperationException(S._("The folder {0} cannot be deleted as it is " + 
    128127                    "not empty.")); 
     128 
     129            //If the directory does not already exist, we should just return -- there's 
     130            //nothing to be done. 
     131            if (!info.Exists) 
     132                return; 
    129133 
    130134            //TODO: check for reparse points 
  • branches/eraser6/6.0/Eraser.Manager/DirectExecutor.cs

    r1699 r1719  
    278278                                throw; 
    279279                            } 
     280                            catch (ThreadAbortException) 
     281                            { 
     282                            } 
    280283                            catch (Exception e) 
    281284                            { 
  • branches/eraser6/6.0/Eraser.Manager/RemoteExecutor.cs

    r1677 r1719  
    100100            thread = new Thread(Main); 
    101101            serverLock = new Semaphore(maxServerInstances, maxServerInstances); 
    102  
    103             thread.Start(); 
    104             Thread.Sleep(0); 
    105102        } 
    106103 
     
    125122 
    126123            base.Dispose(disposing); 
     124        } 
     125 
     126        public override void Run() 
     127        { 
     128            thread.Start(); 
     129            Thread.Sleep(0); 
     130            base.Run(); 
    127131        } 
    128132 
  • branches/eraser6/6.0/Eraser/Program.cs

    r1677 r1719  
    392392                        MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 
    393393                        S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); 
     394                } 
     395                catch (IOException ex) 
     396                { 
     397                    MessageBox.Show(S._("Another instance of Eraser is already running but " + 
     398                        "cannot be connected to.\n\nThe error returned was: {0}", ex.Message, 
     399                        S._("Eraser"), MessageBoxButtons.OK, MessageBoxIcon.Error, 
     400                        MessageBoxDefaultButton.Button1, 
     401                        S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0)); 
    394402                } 
    395403                catch (TimeoutException) 
  • branches/eraser6/6.0/Eraser/SchedulerPanel.cs

    r1693 r1719  
    186186        void task_TaskStarted(object sender, TaskEventArgs e) 
    187187        { 
    188             if (scheduler.InvokeRequired) 
     188            if (InvokeRequired) 
    189189            { 
    190190                Invoke(new EventHandler<TaskEventArgs>(task_TaskStarted), sender, e); 
     
    212212            //Make sure we handle the event in the main thread as this requires 
    213213            //GUI calls. 
    214             if (scheduler.InvokeRequired) 
     214            if (InvokeRequired) 
    215215            { 
    216216                Invoke(new EventHandler<TaskProgressEventArgs>(task_ProgressChanged), sender, e); 
  • branches/eraser6/6.0/ShellExt/CtxMenu.cpp

    r1677 r1719  
    954954                NULL, NULL, &startupInfo, &processInfo)) 
    955955            { 
     956                //Why did we fail? Is it because we have too many files 
    956957                if (GetLastError() == ERROR_FILENAME_EXCED_RANGE) 
    957958                    throw FormatString(LoadString(IDS_ERROR_TOO_MANY_FILES)); 
     959                 
     960                //Or if elevation is required for this operation 
     961                else if (GetLastError() == ERROR_ELEVATION_REQUIRED) 
     962                    return RunEraser(action, parameters, true, parent, show); 
     963 
     964                //Or otherwise? 
    958965                else 
    959966                    throw FormatString(LoadString(IDS_ERROR_MISC), FormatError().c_str()); 
Note: See TracChangeset for help on using the changeset viewer.