private bool disposedValue = false; // To detect redundant calls

        private void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (TerminateOnDispose)
                {
                    try
                    {
                        Terminate(NtStatus.STATUS_WAIT_1);
                    }
                    catch (NtException)
                    {
                    }
                }

                Process.Close();
                Thread.Close();
                ImageFile.Close();
                SectionHandle.Close();
                if (IFEOKeyHandle != null)
                {
                    IFEOKeyHandle.Close();
                }
                disposedValue = true;
            }
        }
예제 #2
0
        /// <summary>
        /// Dispose
        /// </summary>
        public void Dispose()
        {
            if (TerminateOnDispose)
            {
                Process?.Terminate(NtStatus.STATUS_SUCCESS, false);
            }

            Process?.Close();
            Thread?.Close();
            ImageFile?.Close();
            SectionHandle?.Close();
            IFEOKeyHandle?.Close();
        }