/[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/05 22:00:27	544
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 22:08:38	545
@@ -1491,7 +1491,7 @@
                     else
                     {
                         Guid new_SearchGuid = SearchGuid;
-                        int Last_Whole_Percent_Done = 0;
+                        //int Last_Whole_Percent_Done = 0;
                         // need to get the address list
                         using (SearchResultReader reader = new SearchResultReader(SearchGuid, true)) // delete the file on dispose
                         {
@@ -1500,66 +1500,390 @@
                             {
                                 //int index = 0;
 
-                                const int ChunkCount = 0x100;
-                                for (int ResultIndex = 0; ResultIndex < reader.ResultCount; ResultIndex += ChunkCount)
+                                provider.OpenProvider();
+                                //int count = (int)((MemoryRangeSize - MemoryRangeStart) / STEP_SIZE);
+                                //SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);
+                                int Last_Whole_Percent_Done = 0;
+                                uint size = STEP_SIZE * 4096;
+                                for (uint i = MemoryRangeStart; i < MemoryRangeSize; i += size)
                                 {
-                                    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 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) && (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)
+                                    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)
+                                            {
+                                                #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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                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))
+                                                        {
+                                                            if (reader.ContainsAddress(address_index, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress), new Func<bool>(ShouldCancelAnySearchOperation)))
+                                                            {
+                                                                writer.WriteResult<long>(comparer.Address, comparer.Value);
+                                                            }
+                                                        }
+                                                    }
+                                                    address_index += STEP_SIZE;
+                                                }
+                                                #endregion
+                                            } break;
+
+                                    }
+                                    #endregion
+
                                     if (SearchWorkerThread.CancellationPending)
                                     {
                                         provider_st.Stop();
@@ -1567,11 +1891,79 @@
                                         writer.CancelRequest();
                                         writer.Dispose();
                                         e.Result = true;
-                                        break;
+                                        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-code
+                                #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)
@@ -1953,6 +2345,7 @@
                                 //}
                                 #endregion
 
+                                #region reference-code (can be deleted - later)
                                 //ISerializedResult sr = (reader as ISerializedResult);
                                 //if (sr == null)
                                 //{
@@ -1971,7 +2364,7 @@
                                 //        }
                                 //    }
                                 //}
-
+                                #endregion
                             }
 
                         }

 

  ViewVC Help
Powered by ViewVC 1.1.22