/[RomCheater]/trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs	2012/06/03 13:21:51	243
+++ trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs	2012/06/22 08:21:18	414
@@ -1,4 +1,17 @@
-´╗┐using System;
+´╗┐#region Logging Defines
+// include this any class or method that required logging, and comment-out what is not needed
+#define LOGGING_ENABLED
+#region Enabled logging levels
+#define LOGGING_ENABLE_INFO
+#define LOGGING_ENABLE_WARN
+#define LOGGING_ENABLE_DEBUG
+#define LOGGING_ENABLE_VERBOSEDEBUG
+#define LOGGING_ENABLE_ERROR
+#define LOGGING_ENABLE_VERBOSEERROR
+#define LOGGING_ENABLE_PROFILER
+#endregion
+#endregion
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
@@ -483,28 +496,33 @@
                 {
                     iter = (ResultItem)this.Items[index];
                 }
-                GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);            
-                ResultDataType result = (ResultDataType)iter.Tag;
-                uint Address = result.Address;
-                byte[] bitData = new byte[] { };
-                switch (result.ValueType)
-                {
-                    case SearchDataTypes._8bits:
-                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToByte(result.Value)); }
-                        else { provider.PatchMemory(Address, Convert.ToSByte(result.Value)); }
-                        break;
-                    case SearchDataTypes._16bits:
-                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt16(result.Value)); }
-                        else { provider.PatchMemory(Address, Convert.ToInt16(result.Value)); }
-                        break;
-                    case SearchDataTypes._32bits:
-                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt32(result.Value)); }
-                        else { provider.PatchMemory(Address, Convert.ToInt32(result.Value)); }
-                        break;
-                    case SearchDataTypes._64bits:
-                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt64(result.Value)); }
-                        else { provider.PatchMemory(Address, Convert.ToInt64(result.Value)); }
-                        break;
+                using (GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                {
+                    provider.OpenProvider();
+                    ResultDataType result = (ResultDataType)iter.Tag;
+                    uint Address = result.Address;
+                    byte[] bitData = new byte[] { };
+                    switch (result.ValueType)
+                    {
+                        case SearchDataTypes._8bits:
+                            if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToByte(result.Value)); }
+                            else { provider.PatchMemory(Address, Convert.ToSByte(result.Value)); }
+                            break;
+                        case SearchDataTypes._16bits:
+                            if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt16(result.Value)); }
+                            else { provider.PatchMemory(Address, Convert.ToInt16(result.Value)); }
+                            break;
+                        case SearchDataTypes._32bits:
+                            if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt32(result.Value)); }
+                            else { provider.PatchMemory(Address, Convert.ToInt32(result.Value)); }
+                            break;
+                        case SearchDataTypes._64bits:
+                            if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt64(result.Value)); }
+                            else { provider.PatchMemory(Address, Convert.ToInt64(result.Value)); }
+                            break;
+                    }
+                    result = null;
+                    provider.CloseProvider();
                 }
             }
         }

 

  ViewVC Help
Powered by ViewVC 1.1.22