Esempio n. 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;
            }
        }
Esempio n. 2
0
 public void Dispose()
 {
     try {
         if (this.IsAttached)
         {
             UnsafeNativeMethods.CloseHandle(this.ProcessHandle);
         }
     }
     catch (Exception ex) {
         // IGNORED
     }
     finally {
         this.IsAttached = false;
         this.RaiseMemoryHandlerDisposed();
     }
 }