ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/UI/UIMemoryViewer.cs
(Generate patch)

Comparing trunk/RomCheater/Docking/UI/UIMemoryViewer.cs (file contents):
Revision 284 by william, Tue Jun 5 01:19:54 2012 UTC vs.
Revision 285 by william, Tue Jun 5 01:54:33 2012 UTC

--- trunk/RomCheater/Docking/UI/UIMemoryViewer.cs	2012/06/05 01:50:38	284
+++ trunk/RomCheater/Docking/UI/UIMemoryViewer.cs	2012/06/05 01:54:33	285
@@ -13,6 +13,7 @@ using RomCheater.Logging;
 using RomCheater.PluginFramework.Interfaces;
 using System.Diagnostics;
 using Sojaner.MemoryScanner.MemoryProviers;
+using System.Runtime.InteropServices;
 
 namespace RomCheater.Docking.UI
 {
@@ -205,8 +206,20 @@ namespace RomCheater.Docking.UI
                 provider.OpenProvider();
                 int bytesReadSize;
                 provider.ReadProcessMemory(CURRENT_TOP_ADDR, (uint)max_ram_view, out bytesReadSize, out data);
-                provider.CloseProvider();
-
+                try
+                {
+                    provider.CloseProvider();
+                }
+                catch (SEHException ex)
+                {
+                    logger.Error.WriteLine("UIMemoryViewer.GetMemory(): SEHException: (0x{0:x8} {1}", ex.ErrorCode, ex.Message);
+                    logger.Error.WriteLine(ex.ToString());
+                }
+                catch (Exception ex)
+                {
+                    logger.Error.WriteLine("UIMemoryViewer.GetMemory(): Exception: {0}", ex.Message);
+                    logger.Error.WriteLine(ex.ToString());
+                }
             }
             catch (Exception ex)
             {