File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414using System . Runtime . InteropServices . Expando ;
1515using System . Collections . Generic ;
1616using System . Linq ;
17+ using System . Runtime . ExceptionServices ;
1718using System . Threading ;
1819using BHOUserScript . Properties ;
1920
@@ -424,6 +425,7 @@ private void TryInjectCss(int i, IHTMLWindow2 window)
424425 /// Exposes the IExtension interface to the browser window.
425426 /// </summary>
426427 /// <param name="window"></param>
428+ [ HandleProcessCorruptedStateExceptions ]
427429 private void SetupWindow ( IHTMLWindow2 window )
428430 {
429431 // Prevent multiple injections of API
@@ -447,6 +449,10 @@ private void SetupWindow(IHTMLWindow2 window)
447449 }
448450 catch ( Exception ex )
449451 {
452+ if ( ex is AccessViolationException ) // Exception: "Attempted to read or write protected memory. _
453+ return ; // This is often an indication that other memory is corrupt." _
454+ // This is thrown when the memory of the IE process is corrupted, _
455+ // and thus write protected.
450456 if ( LogAndCheckDebugger ( ex , "SetupWindow" ) )
451457 throw ;
452458 }
You can’t perform that action at this time.
0 commit comments