/[RomCheater]/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingMemorySearcher.cs

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

--- trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/05/28 20:44:13	443
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/02 18:56:41	444
@@ -132,6 +132,12 @@
                     this.AcceptedPlugin.SetMemorySearchReference(this);
             }
         }
+        private Guid _SearchGuid;
+        public Guid SearchGuid
+        {
+            get { return _SearchGuid; }
+            private set { _SearchGuid = value; }
+        }
         #endregion
 
         #region IAcceptsMemoryRange
@@ -1135,7 +1141,7 @@
                 {
                     provider.OpenProvider();
                     int count = (int)((MemoryRangeSize - MemoryRangeStart) / STEP_SIZE);
-                    SearchResultWriter writer = new SearchResultWriter((int)(count));
+                    SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);
                     provider.OnBytesRead += new BaseEventHandler<OnBytesReadEventArgs>(search_provider_OnBytesRead);
                     provider.ReadProcessMemoryAtOnce(MemoryRangeStart, (MemoryRangeSize - MemoryRangeStart), writer);
                     provider.CloseProvider();
@@ -1171,7 +1177,7 @@
                         ////second_tmp_Results.c
                         try
                         {
-                            using (SearchResultReader reader = new SearchResultReader())
+                            using (SearchResultReader reader = new SearchResultReader(SearchGuid))
                             {
                                 try
                                 {
@@ -1599,7 +1605,7 @@
 
                         start = SearchArgs.CompareStartValue;
                         end = SearchArgs.CompareEndValue;
-                        using (SearchResultReader reader = new SearchResultReader())
+                        using (SearchResultReader reader = new SearchResultReader(SearchGuid))
                         {
                             for (int i = 0; i < reader.ResultCount; i += 1)
                             {
@@ -1676,7 +1682,7 @@
                 {
                     // fix addresses when memory start is not zero
                     if (MemoryRangeStart > 0 && SearchArgs.IsFirstSearch) { for (int i = 0; i < second_tmp_Results.Count; i++) { second_tmp_Results[i].Address = second_tmp_Results[i].Address + MemoryRangeStart; } }
-                    using (SearchResultWriter writer = new SearchResultWriter(second_tmp_Results.Count))
+                    using (SearchResultWriter writer = new SearchResultWriter(second_tmp_Results.Count, SearchGuid))
                     {
                         for (int i = 0; i < second_tmp_Results.Count; i++)
                         {
@@ -1728,7 +1734,7 @@
             
             resultsprogress.Value = 100;
             bool unsigned = SearchArgs.IsUnsignedDataType;
-            using (SearchResultReader reader = new SearchResultReader())
+            using (SearchResultReader reader = new SearchResultReader(SearchGuid))
             {
                 logger.Info.WriteLine(string.Format("Found 0x{0:x8} results", reader.ResultCount));
 
@@ -1820,6 +1826,8 @@
         #region Search Button
         private void btnSearch_Click(object sender, EventArgs e)
         {
+            if (this.SearchGuid == Guid.Empty)
+                this.SearchGuid = Guid.NewGuid();
             this.SearchInProgess = true;
             //btnCancel.Enabled = true;
             //btnReset.Enabled = false;
@@ -1954,6 +1962,7 @@
         #endregion
         private void btnReset_Click(object sender, EventArgs e)
         {
+            this.SearchGuid = Guid.Empty;
             this.SearchInProgess = false;
             //btnSearch.Enabled = true;
             //btnCancel.Enabled = false;

 

  ViewVC Help
Powered by ViewVC 1.1.22