Пример #1
0
        /// <summary>
        ///     Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.
        /// </summary>
        /// <param name="moduleName">The name of module to eject.</param>
        public void Eject(string moduleName)
        {
            // Fint the module to eject
            var module = RemoteModules.FirstOrDefault(m => m.Name == moduleName);

            // Eject the module is it's valid
            if (module != null)
            {
                ARemoteModule.InternalEject(ProcessPlus, module);
            }
        }
Пример #2
0
        /// <summary>
        ///     Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.
        /// </summary>
        /// <param name="module">The module to eject.</param>
        public void Eject(AProcessSharpModule module)
        {
            // If the module is valid
            if (!module.IsValid)
            {
                return;
            }

            // Find if the module is an injected one
            var injected = InternalInjectedModules.FirstOrDefault(m => m.Equals(module));

            if (injected != null)
            {
                InternalInjectedModules.Remove(injected);
            }

            // Eject the module
            ARemoteModule.InternalEject(ProcessPlus, module);
        }