/[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/06/06 03:17:53	557
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/06 03:54:38	560
@@ -1102,9 +1102,10 @@
 
                     if (SearchArgs.IsFirstSearch)
                     {
+                        #region FirstSearch
                         provider.OpenProvider();
                         int count = (int)((MemoryRangeSize - MemoryRangeStart) / STEP_SIZE);
-                        SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);                                             
+                        SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);
                         int Last_Whole_Percent_Done = 0;
                         uint size = 0;
                         const uint MB_SIZE = 16; /* MEM_1MB * MB_SIZE = MB_SIZE in megabytes */
@@ -1116,16 +1117,16 @@
                             case SearchDataTypes._64bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
                         }
                         //uint size = STEP_SIZE * 4096;
-                        for (uint i = MemoryRangeStart; i < MemoryRangeSize; i+=size)
+                        for (uint i = MemoryRangeStart; i < MemoryRangeSize; i += size)
                         {
-                           
-                            int bytesRead=0;
+
+                            int bytesRead = 0;
                             byte[] data = new byte[size];
                             provider.ReadProcessMemoryAtOnce(i, size, out bytesRead, out data);
                             string message = string.Format(" -> Reading Address: 0x{0:x8}", (i + MemoryRangeStart));
                             double double_percent_done = 100.0 * (double)((double)i / (double)MemoryRangeSize);
                             int int_percent_done = (int)double_percent_done;
-                            if ( (int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
+                            if ((int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
                             {
                                 UpdateProgress((int)double_percent_done, message);
                                 Last_Whole_Percent_Done = int_percent_done;
@@ -1223,82 +1224,82 @@
                                     {
                                         #region 16bits - unsigned
                                         var t_data = BitTools.ConvertByteArray<ushort>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                          foreach (var Value in t_data)
-                                          {
-                                              if (SearchWorkerThread.CancellationPending) { break; }
-                                              using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
-                                              {
-                                                  ushort value = 0;
-                                                  if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                                  {
-                                                      using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                                      {
-                                                          try
-                                                          {
-                                                              gmp.OpenProvider();
-                                                              gmp.ReadMemory(address_index, out value);
-                                                              gmp.CloseProvider();
-                                                          }
-                                                          catch (Exception ex)
-                                                          {
-                                                              logger.VerboseError.WriteLine(ex.ToString());
-                                                          }
-                                                      }
-                                                      comparer.Value = value;
-                                                  }
-                                                  else
-                                                  {
-                                                      value = Convert.ToUInt16(SearchArgs.CompareStartValue);
-                                                      comparer.Value = value;
-                                                  }
-                                                  if (comparer.Compare(Convert.ToUInt16(Value), value))
-                                                  {
-                                                      writer.WriteResult<ushort>(comparer.Address, comparer.Value);
-                                                  }
-                                              }
-                                              address_index += STEP_SIZE;
-                                          }
+                                        foreach (var Value in t_data)
+                                        {
+                                            if (SearchWorkerThread.CancellationPending) { break; }
+                                            using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
+                                            {
+                                                ushort value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address_index, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToUInt16(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToUInt16(Value), value))
+                                                {
+                                                    writer.WriteResult<ushort>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            address_index += STEP_SIZE;
+                                        }
                                         #endregion
                                     }
                                     else
                                     {
                                         #region 16bits - signed
                                         var t_data = BitTools.ConvertByteArray<short>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                         foreach (var Value in t_data)
-                                         {
-                                             if (SearchWorkerThread.CancellationPending) { break; }
-                                             using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
-                                             {
-                                                 short value = 0;
-                                                 if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                                 {
-                                                     using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                                     {
-                                                         try
-                                                         {
-                                                             gmp.OpenProvider();
-                                                             gmp.ReadMemory(address_index, out value);
-                                                             gmp.CloseProvider();
-                                                         }
-                                                         catch (Exception ex)
-                                                         {
-                                                             logger.VerboseError.WriteLine(ex.ToString());
-                                                         }
-                                                     }
-                                                     comparer.Value = value;
-                                                 }
-                                                 else
-                                                 {
-                                                     value = Convert.ToInt16(SearchArgs.CompareStartValue);
-                                                     comparer.Value = value;
-                                                 }
-                                                 if (comparer.Compare(Convert.ToSByte(Value), value))
-                                                 {
-                                                     writer.WriteResult<short>(comparer.Address, comparer.Value);
-                                                 }
-                                             }
-                                             address_index += STEP_SIZE;
-                                         }
+                                        foreach (var Value in t_data)
+                                        {
+                                            if (SearchWorkerThread.CancellationPending) { break; }
+                                            using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
+                                            {
+                                                short value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address_index, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToInt16(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToSByte(Value), value))
+                                                {
+                                                    writer.WriteResult<short>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            address_index += STEP_SIZE;
+                                        }
                                         #endregion
                                     } break;
                                 case SearchDataTypes._32bits:
@@ -1306,82 +1307,82 @@
                                     {
                                         #region 32bits - unsigned
                                         var t_data = BitTools.ConvertByteArray<uint>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                         foreach (var Value in t_data)
-                                         {
-                                             if (SearchWorkerThread.CancellationPending) { break; }
-                                             using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
-                                             {
-                                                 uint value = 0;
-                                                 if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                                 {
-                                                     using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                                     {
-                                                         try
-                                                         {
-                                                             gmp.OpenProvider();
-                                                             gmp.ReadMemory(address_index, out value);
-                                                             gmp.CloseProvider();
-                                                         }
-                                                         catch (Exception ex)
-                                                         {
-                                                             logger.VerboseError.WriteLine(ex.ToString());
-                                                         }
-                                                     }
-                                                     comparer.Value = value;
-                                                 }
-                                                 else
-                                                 {
-                                                     value = Convert.ToUInt32(SearchArgs.CompareStartValue);
-                                                     comparer.Value = value;
-                                                 }
-                                                 if (comparer.Compare(Convert.ToUInt32(Value), value))
-                                                 {
-                                                     writer.WriteResult<uint>(comparer.Address, comparer.Value);
-                                                 }
-                                             }
-                                             address_index += STEP_SIZE;
-                                         }
+                                        foreach (var Value in t_data)
+                                        {
+                                            if (SearchWorkerThread.CancellationPending) { break; }
+                                            using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
+                                            {
+                                                uint value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address_index, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToUInt32(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToUInt32(Value), value))
+                                                {
+                                                    writer.WriteResult<uint>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            address_index += STEP_SIZE;
+                                        }
                                         #endregion
                                     }
                                     else
                                     {
                                         #region 32bits - signed
                                         var t_data = BitTools.ConvertByteArray<int>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                         foreach (var Value in t_data)
-                                         {
-                                             if (SearchWorkerThread.CancellationPending) { break; }
-                                             using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
-                                             {
-                                                 int value = 0;
-                                                 if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                                 {
-                                                     using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                                     {
-                                                         try
-                                                         {
-                                                             gmp.OpenProvider();
-                                                             gmp.ReadMemory(address_index, out value);
-                                                             gmp.CloseProvider();
-                                                         }
-                                                         catch (Exception ex)
-                                                         {
-                                                             logger.VerboseError.WriteLine(ex.ToString());
-                                                         }
-                                                     }
-                                                     comparer.Value = value;
-                                                 }
-                                                 else
-                                                 {
-                                                     value = Convert.ToInt32(SearchArgs.CompareStartValue);
-                                                     comparer.Value = value;
-                                                 }
-                                                 if (comparer.Compare(Convert.ToInt32(Value), value))
-                                                 {
-                                                     writer.WriteResult<int>(comparer.Address, comparer.Value);
-                                                 }
-                                             }
-                                             address_index += STEP_SIZE;
-                                         }
+                                        foreach (var Value in t_data)
+                                        {
+                                            if (SearchWorkerThread.CancellationPending) { break; }
+                                            using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
+                                            {
+                                                int value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address_index, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToInt32(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToInt32(Value), value))
+                                                {
+                                                    writer.WriteResult<int>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            address_index += STEP_SIZE;
+                                        }
                                         #endregion
                                     } break;
                                 case SearchDataTypes._64bits:
@@ -1389,85 +1390,85 @@
                                     {
                                         #region 64bits - unsigned
                                         var t_data = BitTools.ConvertByteArray<ulong>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                         foreach (var Value in t_data)
-                                         {
-                                             if (SearchWorkerThread.CancellationPending) { break; }
-                                             using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
-                                             {
-                                                 ulong value = 0;
-                                                 if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                                 {
-                                                     using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                                     {
-                                                         try
-                                                         {
-                                                             gmp.OpenProvider();
-                                                             gmp.ReadMemory(address_index, out value);
-                                                             gmp.CloseProvider();
-                                                         }
-                                                         catch (Exception ex)
-                                                         {
-                                                             logger.VerboseError.WriteLine(ex.ToString());
-                                                         }
-                                                     }
-                                                     comparer.Value = value;
-                                                 }
-                                                 else
-                                                 {
-                                                     value = Convert.ToUInt64(SearchArgs.CompareStartValue);
-                                                     comparer.Value = value;
-                                                 }
-                                                 if (comparer.Compare(Convert.ToUInt64(Value), value))
-                                                 {
-                                                     writer.WriteResult<ulong>(comparer.Address, comparer.Value);
-                                                 }
-                                             }
-                                             address_index += STEP_SIZE;
-                                         }
+                                        foreach (var Value in t_data)
+                                        {
+                                            if (SearchWorkerThread.CancellationPending) { break; }
+                                            using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
+                                            {
+                                                ulong value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address_index, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToUInt64(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToUInt64(Value), value))
+                                                {
+                                                    writer.WriteResult<ulong>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            address_index += STEP_SIZE;
+                                        }
                                         #endregion
                                     }
                                     else
                                     {
                                         #region 64bits - signed
                                         var t_data = BitTools.ConvertByteArray<long>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                         foreach (var Value in t_data)
-                                         {
-                                             if (SearchWorkerThread.CancellationPending) { break; }
-                                             using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
-                                             {
-                                                 long value = 0;
-                                                 if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                                 {
-                                                     using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                                     {
-                                                         try
-                                                         {
-                                                             gmp.OpenProvider();
-                                                             gmp.ReadMemory(address_index, out value);
-                                                             gmp.CloseProvider();
-                                                         }
-                                                         catch (Exception ex)
-                                                         {
-                                                             logger.VerboseError.WriteLine(ex.ToString());
-                                                         }
-                                                     }
-                                                     comparer.Value = value;
-                                                 }
-                                                 else
-                                                 {
-                                                     value = Convert.ToInt64(SearchArgs.CompareStartValue);
-                                                     comparer.Value = value;
-                                                 }
-                                                 if (comparer.Compare(Convert.ToInt64(Value), value))
-                                                 {
-                                                     writer.WriteResult<long>(comparer.Address, comparer.Value);
-                                                 }
-                                             }
-                                             address_index += STEP_SIZE;
-                                         }
+                                        foreach (var Value in t_data)
+                                        {
+                                            if (SearchWorkerThread.CancellationPending) { break; }
+                                            using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
+                                            {
+                                                long value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address_index, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToInt64(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToInt64(Value), value))
+                                                {
+                                                    writer.WriteResult<long>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            address_index += STEP_SIZE;
+                                        }
                                         #endregion
                                     } break;
-                                    
+
                             }
                             #endregion
 
@@ -1498,23 +1499,26 @@
                         writer.Dispose();
                         writer = null;
                         provider.CloseProvider();
+                        #endregion
                     }
                     else
                     {
-                        Guid new_SearchGuid = SearchGuid;
+                        #region SubsequentSearch
+                        Guid new_SearchGuid = GuidTools.IncrementGuid(SearchGuid);
                         int Last_Whole_Percent_Done = 0;
                         // need to get the address list
-                        using (SearchResultReader reader = new SearchResultReader(SearchGuid, true,SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation))) // delete the file on dispose
+                        uint[] reader_addresses = new uint[0];
+                        #region Address pre-population
+                        using (SearchResultReader reader = new SearchResultReader(SearchGuid, true, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation))) // delete the file on dispose
                         {
-                            uint[] reader_addresses = new uint[reader.ResultCount];
-
+                            reader_addresses = new uint[reader.ResultCount];
                             // pre-populate the addresses array
                             Stopwatch st_profiler_reader_addresses = new Stopwatch();
                             st_profiler_reader_addresses.Start();
                             int reader_address_index = 0;
                             foreach (var k in reader)
                             {
-                                
+
                                 if (SearchWorkerThread.CancellationPending) { st_profiler_reader_addresses.Stop(); break; }
                                 reader_addresses[reader_address_index] = k.Address;
 
@@ -1532,898 +1536,436 @@
                             }
                             st_profiler_reader_addresses.Stop();
                             logger.Profiler.WriteLine("It took a total of {0} seconds to pre-populate the address array.", st_profiler_reader_addresses.Elapsed.TotalSeconds);
-                            new_SearchGuid = GuidTools.IncrementGuid(SearchGuid);
-                            using (SearchResultWriter writer = new SearchResultWriter(0, new_SearchGuid))
+                        }
+                        GC.Collect(); // force gc collection
+                        #endregion
+
+                        #region result writing
+                        using (SearchResultWriter writer = new SearchResultWriter(0, new_SearchGuid))
+                        {
+                            Last_Whole_Percent_Done = 0;
+                            //int index = 0;
+
+                            provider.OpenProvider();
+                            //int count = (int)((MemoryRangeSize - MemoryRangeStart) / STEP_SIZE);
+                            //SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);                                
+                            uint size = 0;
+                            const uint MB_SIZE = 16; /* MEM_1MB * MB_SIZE = MB_SIZE in megabytes */
+                            switch (sdt)
+                            {
+                                case SearchDataTypes._8bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._16bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._32bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._64bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            }
+                            //size = STEP_SIZE * 4096;
+                            for (uint i = MemoryRangeStart; i < MemoryRangeSize; i += size)
                             {
-                                Last_Whole_Percent_Done = 0;
-                                //int index = 0;
 
-                                provider.OpenProvider();
-                                //int count = (int)((MemoryRangeSize - MemoryRangeStart) / STEP_SIZE);
-                                //SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);                                
-                                uint size = 0;
-                                const uint MB_SIZE = 16; /* MEM_1MB * MB_SIZE = MB_SIZE in megabytes */
-                                switch (sdt)
+                                int bytesRead = 0;
+                                byte[] data = new byte[size];
+                                provider.ReadProcessMemoryAtOnce(i, size, out bytesRead, out data);
+                                string message = string.Format(" -> Reading Address: 0x{0:x8}", (i + MemoryRangeStart));
+                                double double_percent_done = 100.0 * (double)((double)i / (double)MemoryRangeSize);
+                                int int_percent_done = (int)double_percent_done;
+                                if ((int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
                                 {
-                                    case SearchDataTypes._8bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                                    case SearchDataTypes._16bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                                    case SearchDataTypes._32bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                                    case SearchDataTypes._64bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                    UpdateProgress((int)double_percent_done, message);
+                                    Last_Whole_Percent_Done = int_percent_done;
                                 }
-                                //size = STEP_SIZE * 4096;
-                                for (uint i = MemoryRangeStart; i < MemoryRangeSize; i += size)
-                                {
 
-                                    int bytesRead = 0;
-                                    byte[] data = new byte[size];
-                                    provider.ReadProcessMemoryAtOnce(i, size, out bytesRead, out data);
-                                    string message = string.Format(" -> Reading Address: 0x{0:x8}", (i + MemoryRangeStart));
-                                    double double_percent_done = 100.0 * (double)((double)i / (double)MemoryRangeSize);
-                                    int int_percent_done = (int)double_percent_done;
-                                    if ((int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
-                                    {
-                                        UpdateProgress((int)double_percent_done, message);
-                                        Last_Whole_Percent_Done = int_percent_done;
-                                    }
-
-                                    uint address_index = i;
-                                    #region comparison and serialization
-                                    switch (sdt)
-                                    {
-                                        case SearchDataTypes._8bits:
-                                            if (unsigned)
+                                uint address_index = i;
+                                #region comparison and serialization
+                                switch (sdt)
+                                {
+                                    case SearchDataTypes._8bits:
+                                        if (unsigned)
+                                        {
+                                            #region 8bits - unsigned
+                                            var t_data = data;
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 8bits - unsigned
-                                                var t_data = data;
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index))
+                                                {
+                                                    byte value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        byte value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToByte(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToByte(Value), value))
-                                                        {
-                                                            writer.WriteResult<byte>(comparer.Address, comparer.Value);                                                           
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToByte(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToByte(Value), value))
+                                                    {
+                                                        writer.WriteResult<byte>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
+                                                address_index += STEP_SIZE;
                                             }
-                                            else
+                                            #endregion
+                                        }
+                                        else
+                                        {
+                                            #region 8bits - signed
+                                            var t_data = data;
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 8bits - signed
-                                                var t_data = data;
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index))
+                                                {
+                                                    sbyte value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        sbyte value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToSByte(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToSByte(Value), value))
-                                                        {
-                                                            writer.WriteResult<sbyte>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToSByte(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToSByte(Value), value))
+                                                    {
+                                                        writer.WriteResult<sbyte>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
-                                            } break;
-                                        case SearchDataTypes._16bits:
-                                            if (unsigned)
+                                                address_index += STEP_SIZE;
+                                            }
+                                            #endregion
+                                        } break;
+                                    case SearchDataTypes._16bits:
+                                        if (unsigned)
+                                        {
+                                            #region 16bits - unsigned
+                                            var t_data = BitTools.ConvertByteArray<ushort>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 16bits - unsigned
-                                                var t_data = BitTools.ConvertByteArray<ushort>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
+                                                {
+                                                    ushort value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        ushort value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToUInt16(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToUInt16(Value), value))
-                                                        {
-                                                            writer.WriteResult<ushort>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToUInt16(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToUInt16(Value), value))
+                                                    {
+                                                        writer.WriteResult<ushort>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
+                                                address_index += STEP_SIZE;
                                             }
-                                            else
+                                            #endregion
+                                        }
+                                        else
+                                        {
+                                            #region 16bits - signed
+                                            var t_data = BitTools.ConvertByteArray<short>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 16bits - signed
-                                                var t_data = BitTools.ConvertByteArray<short>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
+                                                {
+                                                    short value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        short value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToInt16(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToSByte(Value), value))
-                                                        {
-                                                            writer.WriteResult<short>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToInt16(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToSByte(Value), value))
+                                                    {
+                                                        writer.WriteResult<short>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
-                                            } break;
-                                        case SearchDataTypes._32bits:
-                                            if (unsigned)
+                                                address_index += STEP_SIZE;
+                                            }
+                                            #endregion
+                                        } break;
+                                    case SearchDataTypes._32bits:
+                                        if (unsigned)
+                                        {
+                                            #region 32bits - unsigned
+                                            var t_data = BitTools.ConvertByteArray<uint>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 32bits - unsigned
-                                                var t_data = BitTools.ConvertByteArray<uint>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
+                                                {
+                                                    uint value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        uint value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToUInt32(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToUInt32(Value), value))
-                                                        {
-                                                            writer.WriteResult<uint>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToUInt32(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToUInt32(Value), value))
+                                                    {
+                                                        writer.WriteResult<uint>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
+                                                address_index += STEP_SIZE;
                                             }
-                                            else
+                                            #endregion
+                                        }
+                                        else
+                                        {
+                                            #region 32bits - signed
+                                            var t_data = BitTools.ConvertByteArray<int>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 32bits - signed
-                                                var t_data = BitTools.ConvertByteArray<int>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
+                                                {
+                                                    int value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        int value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToInt32(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToInt32(Value), value))
-                                                        {
-                                                            writer.WriteResult<int>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToInt32(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToInt32(Value), value))
+                                                    {
+                                                        writer.WriteResult<int>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
-                                            } break;
-                                        case SearchDataTypes._64bits:
-                                            if (unsigned)
+                                                address_index += STEP_SIZE;
+                                            }
+                                            #endregion
+                                        } break;
+                                    case SearchDataTypes._64bits:
+                                        if (unsigned)
+                                        {
+                                            #region 64bits - unsigned
+                                            var t_data = BitTools.ConvertByteArray<ulong>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 64bits - unsigned
-                                                var t_data = BitTools.ConvertByteArray<ulong>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
+                                                {
+                                                    ulong value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        ulong value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToUInt64(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToUInt64(Value), value))
-                                                        {
-                                                            writer.WriteResult<ulong>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToUInt64(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToUInt64(Value), value))
+                                                    {
+                                                        writer.WriteResult<ulong>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
+                                                address_index += STEP_SIZE;
                                             }
-                                            else
+                                            #endregion
+                                        }
+                                        else
+                                        {
+                                            #region 64bits - signed
+                                            var t_data = BitTools.ConvertByteArray<long>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                            foreach (var Value in t_data)
                                             {
-                                                #region 64bits - signed
-                                                var t_data = BitTools.ConvertByteArray<long>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                                foreach (var Value in t_data)
+                                                if (SearchWorkerThread.CancellationPending) { break; }
+                                                if (!reader_addresses.Contains(address_index))
                                                 {
-                                                    if (SearchWorkerThread.CancellationPending) { break; }
-                                                    if (!reader_addresses.Contains(address_index))
-                                                    {
-                                                        continue;
-                                                    }
-                                                    using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
+                                                    continue;
+                                                }
+                                                using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
+                                                {
+                                                    long value = 0;
+                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                     {
-                                                        long value = 0;
-                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                         {
-                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                            try
                                                             {
-                                                                try
-                                                                {
-                                                                    gmp.OpenProvider();
-                                                                    gmp.ReadMemory(address_index, out value);
-                                                                    gmp.CloseProvider();
-                                                                }
-                                                                catch (Exception ex)
-                                                                {
-                                                                    logger.VerboseError.WriteLine(ex.ToString());
-                                                                }
+                                                                gmp.OpenProvider();
+                                                                gmp.ReadMemory(address_index, out value);
+                                                                gmp.CloseProvider();
+                                                            }
+                                                            catch (Exception ex)
+                                                            {
+                                                                logger.VerboseError.WriteLine(ex.ToString());
                                                             }
-                                                            comparer.Value = value;
-                                                        }
-                                                        else
-                                                        {
-                                                            value = Convert.ToInt64(SearchArgs.CompareStartValue);
-                                                            comparer.Value = value;
-                                                        }
-                                                        if (comparer.Compare(Convert.ToInt64(Value), value))
-                                                        {
-                                                            writer.WriteResult<long>(comparer.Address, comparer.Value);
                                                         }
+                                                        comparer.Value = value;
+                                                    }
+                                                    else
+                                                    {
+                                                        value = Convert.ToInt64(SearchArgs.CompareStartValue);
+                                                        comparer.Value = value;
+                                                    }
+                                                    if (comparer.Compare(Convert.ToInt64(Value), value))
+                                                    {
+                                                        writer.WriteResult<long>(comparer.Address, comparer.Value);
                                                     }
-                                                    address_index += STEP_SIZE;
                                                 }
-                                                #endregion
-                                            } break;
-
-                                    }
-                                    #endregion
+                                                address_index += STEP_SIZE;
+                                            }
+                                            #endregion
+                                        } break;
 
-                                    if (SearchWorkerThread.CancellationPending)
-                                    {
-                                        provider_st.Stop();
-                                        st.Stop();
-                                        writer.CancelRequest();
-                                        writer.Dispose();
-                                        e.Result = true;
-                                        provider.CloseProvider();
-                                        return;
-                                    }
                                 }
-                                #region old-code2
-                                //const int ChunkCount = 0x100;
-                                //for (int ResultIndex = 0; ResultIndex < reader.ResultCount; ResultIndex += ChunkCount)
-                                //{
-                                //    StructResultType<ulong>[] ChunkResults = new StructResultType<ulong>[ChunkCount];
-                                //    for (int ChunkIndex = 0; ChunkIndex < ChunkCount; ChunkIndex++)
-                                //    {
-                                //        int ResultChunkIndex = (ResultIndex + ChunkIndex);
-                                //        StructResultType<ulong> result = StructResultType<ulong>.Empty;
-                                //        reader.GetResultAtIndex(ResultChunkIndex, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), out result, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //        ChunkResults[ChunkIndex] = result;
-                                //        if (SearchWorkerThread.CancellationPending)
-                                //        {
-                                //            provider_st.Stop();
-                                //            st.Stop();
-                                //            writer.CancelRequest();
-                                //            writer.Dispose();
-                                //            e.Result = true;
-                                //            break;
-                                //        }
-                                //    }
-                                //    // Get update value(s) for each chunk result
-                                //    ISerializedResult sr = (reader as ISerializedResult);
-                                //    if(sr == null)
-                                //    {
-                                //        throw new ArgumentNullException("sr",string.Format("Unable to cast: '{0}' to '{1}'", reader.GetType().Name,typeof(ISerializedResult).Name));
-                                //    }
-                                //    Stopwatch st_memory_results_updater = new Stopwatch();
-                                //    st_memory_results_updater.Start();
-                                //    sr.UpdateResultValuesFromMemory(ref ChunkResults, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation), (IAcceptsProcessAndConfig)this);
-                                //    if (SearchWorkerThread.CancellationPending) // catch a cancelled operation from UpdateResultValuesFromMemory
-                                //    {
-                                //        provider_st.Stop();
-                                //        st.Stop();
-                                //        writer.CancelRequest();
-                                //        writer.Dispose();
-                                //        e.Result = true;
-                                //        break;
-                                //    }
-                                //    st_memory_results_updater.Stop();
-                                //    logger.Profiler.WriteLine("sr.UpdateResultValuesFromMemory [ResultIndex=0x{0} ChunkCount=0x{1}] took a total of {2} seconds to complete", ResultIndex.ToString("X"), ChunkCount.ToString("X"), st_memory_results_updater.Elapsed.TotalSeconds.ToString());
-                                //    // ChunkResults should have had thier values updated from memory
-                                //    string message = string.Format(" -> Updateing Values [ResultIndex=0x{0} of Total=0x{1}]", ResultIndex.ToString("X"), reader.ResultCount.ToString("X"));
-                                //    double double_percent_done = 100.0 * (double)((double)ResultIndex / (double)reader.ResultCount);
-                                //    int int_percent_done = (int)double_percent_done;
-                                //    //if ((int_percent_done != Last_Whole_Percent_Done) && (index % 1000) == 0)
-                                //    //{
-                                //    //    UpdateProgress((int)double_percent_done, message);
-                                //    //    Last_Whole_Percent_Done = int_percent_done;
-                                //    //}
-                                //    if (((double)ResultIndex % ((double)reader.ResultCount) * 0.25) == 0)
-                                //    //if ((ResultIndex % 10000) == 0)
-                                //    {
-                                //        UpdateProgress((int)double_percent_done, message);
-                                //        Last_Whole_Percent_Done = int_percent_done;
-                                //    }
-                                //    if (SearchWorkerThread.CancellationPending)
-                                //    {
-                                //        provider_st.Stop();
-                                //        st.Stop();
-                                //        writer.CancelRequest();
-                                //        writer.Dispose();
-                                //        e.Result = true;
-                                //        break;
-                                //    }
-                                //}
-                                #endregion
-
-                                #region old-code1
-                                //foreach (var k in reader.GetResults(SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
-                                //{
-                                //    if (SearchWorkerThread.CancellationPending)
-                                //    {
-                                //        provider_st.Stop();
-                                //        st.Stop();
-                                //        writer.CancelRequest();
-                                //        writer.Dispose();
-                                //        e.Result = true;
-                                //        return;
-                                //    }
-                                //    //int Last_Whole_Percent_Done = 0;
-                                //    provider.OpenProvider();
-                                //    int bytesRead = 0;
-                                //    byte[] data = new byte[STEP_SIZE];
-                                //    provider.ReadProcessMemory(k.Address, STEP_SIZE, out bytesRead, out data);
-                                //    provider.CloseProvider();
-                                //    if (SearchWorkerThread.CancellationPending)
-                                //    {
-                                //        provider_st.Stop();
-                                //        st.Stop();
-                                //        writer.CancelRequest();
-                                //        writer.Dispose();
-                                //        e.Result = true;
-                                //        return;
-                                //    }
-                                //    uint address_index = k.Address;
-                                //    string message = string.Format(" -> Reading Address 0x{0:x8} from index 0x{1}", k.Address, index.ToString("X"));
-                                //    double double_percent_done = 100.0 * (double)((double)index / (double)reader.ResultCount);
-                                //    int int_percent_done = (int)double_percent_done;
-                                //    //if ((int_percent_done != Last_Whole_Percent_Done) && (index % 1000) == 0)
-                                //    //{
-                                //    //    UpdateProgress((int)double_percent_done, message);
-                                //    //    Last_Whole_Percent_Done = int_percent_done;
-                                //    //}
-                                //    if ((index % 10000) == 0)
-                                //    {
-                                //        UpdateProgress((int)double_percent_done, message);
-                                //        //Last_Whole_Percent_Done = int_percent_done;
-                                //    }
-                                //    #region comparison and serialization
-                                //    switch (sdt)
-                                //    {
-                                //        case SearchDataTypes._8bits:
-                                //            if (unsigned)
-                                //            {
-                                //                #region 8bits - unsigned
-                                //                var t_data = data;
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        byte value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToByte(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToByte(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<byte>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            }
-                                //            else
-                                //            {
-                                //                #region 8bits - signed
-                                //                var t_data = data;
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        sbyte value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToSByte(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToSByte(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<sbyte>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            } break;
-                                //        case SearchDataTypes._16bits:
-                                //            if (unsigned)
-                                //            {
-                                //                #region 16bits - unsigned
-                                //                var t_data = BitTools.ConvertByteArray<ushort>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        ushort value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToUInt16(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToUInt16(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<ushort>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            }
-                                //            else
-                                //            {
-                                //                #region 16bits - signed
-                                //                var t_data = BitTools.ConvertByteArray<short>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        short value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToInt16(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToSByte(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<short>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            } break;
-                                //        case SearchDataTypes._32bits:
-                                //            if (unsigned)
-                                //            {
-                                //                #region 32bits - unsigned
-                                //                var t_data = BitTools.ConvertByteArray<uint>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        uint value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToUInt32(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToUInt32(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<uint>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            }
-                                //            else
-                                //            {
-                                //                #region 32bits - signed
-                                //                var t_data = BitTools.ConvertByteArray<int>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        int value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToInt32(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToInt32(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<int>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            } break;
-                                //        case SearchDataTypes._64bits:
-                                //            if (unsigned)
-                                //            {
-                                //                #region 64bits - unsigned
-                                //                var t_data = BitTools.ConvertByteArray<ulong>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        ulong value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToUInt64(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToUInt64(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<ulong>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            }
-                                //            else
-                                //            {
-                                //                #region 64bits - signed
-                                //                var t_data = BitTools.ConvertByteArray<long>(data, new Func<bool>(ShouldCancelAnySearchOperation));
-                                //                foreach (var Value in t_data)
-                                //                {
-                                //                    if (SearchWorkerThread.CancellationPending) { break; }
-                                //                    using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
-                                //                    {
-                                //                        long value = 0;
-                                //                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
-                                //                        {
-                                //                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
-                                //                            {
-                                //                                try
-                                //                                {
-                                //                                    gmp.OpenProvider();
-                                //                                    gmp.ReadMemory(address_index, out value);
-                                //                                    gmp.CloseProvider();
-                                //                                }
-                                //                                catch (Exception ex)
-                                //                                {
-                                //                                    logger.VerboseError.WriteLine(ex.ToString());
-                                //                                }
-                                //                            }
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        else
-                                //                        {
-                                //                            value = Convert.ToInt64(SearchArgs.CompareStartValue);
-                                //                            comparer.Value = value;
-                                //                        }
-                                //                        if (comparer.Compare(Convert.ToInt64(Value), value))
-                                //                        {
-                                //                            writer.WriteResult<long>(comparer.Address, comparer.Value);
-                                //                        }
-                                //                    }
-                                //                    address_index += STEP_SIZE;
-                                //                }
-                                //                #endregion
-                                //            } break;
-                                //    }
-                                //    #endregion
-                                //    index++;
-                                //}
                                 #endregion
 
-                                #region reference-code (can be deleted - later)
-                                //ISerializedResult sr = (reader as ISerializedResult);
-                                //if (sr == null)
-                                //{
-                                //    throw new ArgumentNullException("sr", string.Format("Unable to cast: '{0}' to '{1}'", reader.GetType().Name, typeof(ISerializedResult).Name));
-                                //}
-                                //int sr_index = 0;
-                                //try
-                                //{
-                                //    if (sr.ContainsAddress(obre_CurrentIndex, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out sr_index))
-                                //    {
-                                //        StructResultType<ulong> result = StructResultType<ulong>.Empty;
-                                //        sr.GetResultAtIndex(sr_index, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out result);
-                                //        if (Debugger.IsAttached)
-                                //        {
-                                //            Debugger.Break();
-                                //        }
-                                //    }
-                                //}
-                                #endregion
+                                if (SearchWorkerThread.CancellationPending)
+                                {
+                                    provider_st.Stop();
+                                    st.Stop();
+                                    writer.CancelRequest();
+                                    writer.Dispose();
+                                    e.Result = true;
+                                    provider.CloseProvider();
+                                    return;
+                                }
                             }
-
                         }
+                        #endregion
+
                         SearchGuid = new_SearchGuid; // update with out new guid
+                        reader_addresses = null; // free memory used by address array
+                        GC.Collect(); // force gc collection
+                        #endregion
                     }
+                                                               
                 }
                 provider_st.Stop();
                 logger.Profiler.WriteLine("It took a total of {0} seconds for the memory provider to complete it's operation(s).", provider_st.Elapsed.TotalSeconds);
@@ -2634,7 +2176,7 @@
                     lstResults.Items.AddRange(items.ToArray());
                 }
             }
-            GC.Collect();
+            GC.Collect(); // force gc collection
             this.DoSearchDoneSpecific();
             //System.Threading.Thread.Sleep(100);
             //if (_SEARCH_MODE != SearchMode.SEARCH_MODE_NORMAL_WITH_JOKER)

 

  ViewVC Help
Powered by ViewVC 1.1.22