Пример #1
0
        /// <summary>
        /// Shuts down DISM API. Shutdown must be called once per process. Other DISM API function calls will fail after Shutdown has been called.
        /// </summary>
        public static void Shutdown()
        {
            lock (InitializeShutDownLock)
            {
                if (_isInitialized)
                {
                    if (CurrentDismGeneration != DismGeneration.NotFound)
                    {
                        DismUtilities.UnloadDismGenerationLibrary();
                        CurrentDismGeneration = DismGeneration.NotFound;
                    }

                    int hresult = NativeMethods.DismShutdown();

                    DismUtilities.ThrowIfFail(hresult);

                    _isInitialized = false;
                }
            }
        }