Beispiel #1
0
        public void UnsetProcess()
        {
            if (AttachmentWorker != null)
            {
                AttachmentWorker.StopScanning();
                AttachmentWorker.Dispose();
            }

            try
            {
                if (IsAttached)
                {
                    UnsafeNativeMethods.CloseHandle(Instance.ProcessHandle);
                }
            }
            catch (Exception)
            {
                // IGNORED
            }
            finally
            {
                Constants.ProcessHandle = ProcessHandle = IntPtr.Zero;
                IsAttached = false;
            }
        }
Beispiel #2
0
 public void Dispose()
 {
     try {
         if (this.IsAttached)
         {
             UnsafeNativeMethods.CloseHandle(this.ProcessHandle);
         }
     }
     catch (Exception ex) {
         // IGNORED
     }
     finally {
         this.IsAttached = false;
         this.RaiseMemoryHandlerDisposed();
     }
 }