Esempio n. 1
0
 private bool Contains(ulong addr, AsyncMemoryReadResult m_result)
 {
     return m_result != null && Contains(addr, m_result.Address, m_result.BytesRequested);
 }
Esempio n. 2
0
        protected override bool MoveToPage(ulong addr)
        {
            if (Contains(addr, m_result))
            {
                m_result.Complete.WaitOne();

                m_data = m_result.Result;
                m_currPageSize = m_result.BytesRead;
                m_currPageStart = m_result.Address;

                if (m_result.BytesRequested == m_result.BytesRead)
                    ReadAsync(m_result.Address + (uint)m_result.BytesRead);
                else
                    m_result = null;

                return true;
            }

            bool res = ReadMemory(addr);
            if (m_cacheSize == m_currPageSize)
                ReadAsync(addr + (uint)m_cacheSize);
            return res;
        }
Esempio n. 3
0
 private void ReadAsync(ulong addr)
 {
     m_result = m_dataReader.ReadMemoryAsync(addr, m_cacheSize * 10);
 }
Esempio n. 4
0
 public AsyncMemoryReadResult ReadMemoryAsync(ulong address, int bytesRequested)
 {
     AsyncMemoryReadResult result = new AsyncMemoryReadResult(address, bytesRequested);
     ThreadPool.QueueUserWorkItem(QueueMemoryRead, result);
     return result;
 }