/[RomCheater]/trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs
ViewVC logotype

Diff of /trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs

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

--- trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs	2013/06/03 18:22:20	476
+++ trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs	2013/06/03 18:35:45	477
@@ -27,7 +27,7 @@
     public abstract class BaseMemoryProvider :
         IPatchMemory,
         IReadMemory,
-        IAcceptsProcess,
+        IAcceptsProcess<Process>,
         IAcceptsPlugin<IConfigPlugin>,
         IMemoryReader,
         IMemoryWriter,
@@ -36,10 +36,10 @@
         IAcceptsBytesReadEvent
     {
         private ProcessMemoryReader provider;
-        public BaseMemoryProvider() { this.AcceptedPlugin = null; this.ProcessPID = 0; isClosed = true; isOpen = false; }
+        public BaseMemoryProvider() { this.AcceptedPlugin = null; this.AcceptedProcess = null; isClosed = true; isOpen = false; }
         public BaseMemoryProvider(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
-        public BaseMemoryProvider(IConfigPlugin config, int pid) : this() { this.AcceptedPlugin = config; this.ProcessPID = pid; }
-        public BaseMemoryProvider(IAcceptsProcessAndConfig pconfig) : this() { this.AcceptedPlugin = pconfig.AcceptedPlugin; this.ProcessPID = pconfig.ProcessPID; }
+        public BaseMemoryProvider(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }
+        public BaseMemoryProvider(IAcceptsProcessAndConfig pconfig) : this() { this.AcceptedPlugin = pconfig.AcceptedPlugin; this.AcceptedProcess = pconfig.AcceptedProcess; }
 
 
         public event BaseEventHandler<OnBytesReadEventArgs> OnBytesRead;
@@ -65,9 +65,9 @@
             try
             {
                 provider = new ProcessMemoryReader();
-                provider.ProcessPID = this.ProcessPID;
+                provider.ReadProcess = this.AcceptedProcess;
                 provider.OnBytesRead += new BaseEventHandler<OnBytesReadEventArgs>(provider_OnBytesRead);
-                if (provider.ProcessPID == 0) { logger.Error.WriteLine("{0}.OpenProvider() Could not attach to process: {1}", "", this.GetType().Name, this.ProcessPID.ToString()); return; }
+                if (provider.ReadProcess == null) { logger.Error.WriteLine("{0}.OpenProvider() Could not attach to process: {1}", "", this.GetType().Name, this.AcceptedProcess.ToString()); return; }
                 //provider.OpenProcess();
                 isOpen = true;
                 isClosed = false;
@@ -121,7 +121,7 @@
         #endregion
 
         #region  IAcceptsProcess<Process> Members
-        public int ProcessPID { get; set; }
+        public Process AcceptedProcess { get; set; }
         #endregion
         #region IAcceptsPlugin<IConfigPlugin> Members
         public IConfigPlugin AcceptedPlugin { get; set; }

 

  ViewVC Help
Powered by ViewVC 1.1.22