Windows restart window manager

Using Restart Manager

The following sections describe using the Restart Manager API. Your applications and services should also follow the Guidelines for Applications and Services.

Using the Microsoft Windows Installer

The Microsoft Windows Installer Version 4.0 is the application installation service of WindowsВ Vista or Windows ServerВ 2008. Applications that use the Windows Installer version 4.0 for installation and servicing automatically use the Restart Manager to reduce system restarts. Custom installers can also be designed to call the Restart Manager API to shut down and restart applications and services directly to avoid requiring a system restart. In cases where a system restart is unavoidable, installers can use the InitiateShutdown or ExitWindowsEx function to schedule it in such a way that it minimizes the disruption to the user. Interactive Windows Installer packages should implement a user interface that includes a MsiRMFilesInUse dialog box. For more information, see Using Windows Installer with Restart Manager in the Windows Installer SDK documentation.

Using the Restart Manager API with Custom Installers

Custom installers, or a Windows Installer package that contains custom actions that cause a system restart, can use the Restart Manager API to shut down and restart applications and services.

  • All operations that are performed using the Restart Manager API must be associated with a session. A maximum of 64 Restart Manager sessions per user session can be open on the system at the same time. The primary installer starts and ends the Restart Manager session. For more information about using Restart Manager with a single installer, see Using Restart Manager with a Primary Installer.
  • If necessary for the installation, one or more secondary installers can be joined to the Restart Manager session and can run either in-process or out-of-process of the primary installer. Secondary installers require that the session key be provided by the primary installer to join a session. For more information and an example of using secondary installers, see Using Restart Manager with a Secondary Installer.
  • Interactive installers should implement a user interface that includes an MsiRMFilesInUse dialog box that can ask users to close applications and services. For more information, see Using Windows Installer with Restart Manager in the Windows Installer SDK documentation.
  • Installers can call the Restart Manager API to change, cancel, and get the status of the current Restart Manager operation. For more information, see the following topics: Getting the Status of a Restart Manager Operation and Canceling the Current Restart Manager Operation.
  • Installers should not disable file system redirection before calling the Restart Manager API. Some 32-bit installers run on 64-bit Windows may be unable to register a file in the %windir%\system32 directory.
Читайте также:  Как уменьшить значок поиска windows 10

Restart Manager

Purpose

The Restart Manager API can eliminate or reduce the number of system restarts that are required to complete an installation or update. The primary reason software updates require a system restart during an installation or update is that some of the files that are being updated are currently being used by a running application or service. The Restart Manager enables all but the critical system services to be shut down and restarted. This frees files that are in use and allows installation operations to complete.

Where applicable

The Restart Manager DLL exports a public C interface that can be loaded by standard or custom installers. The installer can use the Restart Manager to register files that should be replaced during the installation of an application or update. Then during a subsequent update or installation, the installer can use the Restart Manager to determine which files cannot be updated because they are currently in use. Restart Manager can shut down and restart the non-critical services or applications that are currently using those files. Installers can direct the Restart Manager to shut down and restart applications or services based on the file in use, the process ID (PID), or the short-name of a Windows service.

Restart Manager is intended for the development of desktop style applications.

Developer audience

This documentation is intended for developers of installation applications who want to take advantage of the installer capabilities in Windows Vista or Windows Server 2008. Applications that use the Windows Installer version 4.0 for installation and servicing automatically use the Restart Manager to reduce system restarts. Custom installers can also be designed to call the Restart Manager API to shut down and restart applications and services. In cases where a system restart is unavoidable, installers can use the Restart Manager API to schedule restarts in such a way that it minimizes the disruption of the user’s work flow.

Run-time requirements

The Restart Manager API is available beginning with Windows Vista and Windows Server 2008. Restart Manager consists of a single DLL that applications can load to access the Restart Manager API.

Microsoft Windows Vista. Механизмы обеспечения надежности приложений

В предыдущей части данной статьи (см. КомпьютерПресс № 1’2007) мы начали рассмотрение ряда механизмов обеспечения надежности приложений, реализованных в новой версии операционной системы Microsoft — Windows Vista. Мы обсудили механизм Windows Feedback Platform, позволяющий компаниям-разработчикам централизованно получать данные о сбоях в приложениях и на основе анализа этих данных выпускать обновления, которые будут распространяться среди пользователей с помощью средств, реализованных в Windows Vista. Еще один механизм обеспечения надежности приложений — это набор программных интерфейсов и компонентов ядра операционной системы, известный под названием Restart Manager. Данный механизм может использоваться как программами установки (инсталляторами) для снижения необходимости перезагрузок операционной системы за счет отслеживания занятых приложениями ресурсов и перезапуска приложений, так и непосредственно прикладными программами для обеспечения возможности восстановления после сбоев и восстановления данных.

Читайте также:  Образ windows 10 lite 64 bit для флешки

Механизм Restart Manager

В основе механизма Restart Manager лежат две функции. Вызов функции RegisterApplicationRestart() позволяет вашему приложению перезапуститься после сбоя и отсылки отчета о произошедшем сбое (используя рассмотренные ранее механизмы Windows Feedback Platfrom), таким образом обеспечивая пользователю возможность продолжить работу. Вызов еще одной функции из состава Restart Manager — RegisterApplicationRecoveryCallback() — позволит вам указать ядру Windows Vista, какую функцию вашего приложения нужно вызывать перед непосредственным перезапуском приложения — следовательно, у вас появляется возможность сохранения данных с их последующим восстановлением после перезапуска приложения.

При вызове функции RegisterApplicationRestart() указывается командная строка, применяемая для повторного запуска приложения, — таким образом, используя опции командной строки, параметры или другие способы, вы можете указать приложению на то, что оно запускается после сбоя, и инициировать процесс восстановления данных.

Функция RegisterApplicationRecoveryCallback() задает точку входа в приложение, которая вызывается ядром операционной системы после сбора данных, необходимых для генерации отчета о произошедшем сбое. При получении управления приложение должно попытаться сохранить данные на диске. В процессе сохранения данных необходимо вызывать функцию RecoveryInProgress() приблизительно каждые 5 с для того, чтобы операционная система помнила о том, что приложение находится в процессе сохранения данных, — в противном случае ядро операционной системы сочтет приложение зависшим и принудительно завершит его выполнение. Это необходимо в тех случаях, когда попытка сохранения данных приводит к дополнительному сбою в приложении и появляется возможность «зацикливания» обработки сбоев. По завершении сохранения данных вызывается функция RecoveryFinished().

Сигналом для завершения работы Windows-приложения является получение сообщений WM_QUERYENDSESSION и WM_ENDSESSION со значением параметра LPARAM, равным ENDSESSION_CLOSEAPP (0x1).

Консольные приложения должны проверять нажатие комбинации клавиш Ctrl+C. Ниже показан пример обработчиков событий для Windows-приложения и консольного приложения.

hr = RegisterApplicationRestart(CommandLineParameter, NULL);

Restart Manager in Windows 10

Starting with Windows Vista, Microsoft has introduced a new application called as the Restart Manager to eliminate or reduce the number of system restarts that are required to complete an installation or update.

Windows Restart Manager

Let’s say, if an application or Windows 10/8/7/Vista itself, needs to update itself, the Installer calls upon the Restart Manager, to see if it can clear that part of the system so that it can be updated. If it can do that, it does so, and this happens without a reboot.

And if this cannot be done, then what it does is that it takes a snapshot of the system, together with the applications, at that very moment, and then it just updates and restarts the application, or in the case of an operating system update, it will bring the operating system back exactly where it was, after the reboot!

Let’s say a user is working on a Word document, say, winvistaclub.doc and the cursor was on coordinates, say col 5, line 7. And the system has to update either or both of them.

The Restart Manager does 5 things:

  1. It looks for all processes that are using this file.
  2. It then shuts down such processes
  3. Applies the updates
  4. Restarts those processes
  5. Preserves the exact state of each running process and then restores that state upon restarting the process.
Читайте также:  Что означает подсказка для пароля windows

Freeze Drying

This feature will re-open a closed document and restore the cursor to, say, col 5, line 7, the exact position it was, when the document was closed. This is called Freeze drying the program. The Restart Manager works in tandem with Microsoft Update, Windows Update, Microsoft Windows Server Update Services, Microsoft Software Installer and Microsoft Systems Management Server, to detect processes that have files in use and to stop and restart services without the need to restart the entire machine. The full functionality of ‘Restart Manager’ is presently available only to select applications written to take advantage of it. Microsoft Office is one of them.

Side-by-side compliant Dll files

For those programs which do not support Restart Manager, Windows has introduced what is called as the Side-by-side compliant dll’s. This enables a program to write a new version of a dll, to the hard disk, even if the old one is still in use. Only when you shut down the program does Windows replace the old version with the new one!

One, therefore, see’s fewer post-update reboots in Windows 10/8/7/Vista.

Windows 8 Restart Desktop Window Manager

Is there a way to restart the Desktop Window Manager in Windows 8? Note that this is not Explorer, but DWM itself (restarting Explorer didn’t do anything for me). Currently mine is using 4,352MB RAM and hovering in the 2% CPU range. I’ve tried doing net stop uxsms but apparently that service name doesn’t exist for Windows 8. Whenever DWM gets like this, my system starts acting weird even though Task Manager says I have 11.2GB RAM free (20.6 in use).

Restarting my system usually takes care of the issue, but I hate having to do that every few weeks just because of this.

3 Answers 3

Use Taskmanager or ProcessExplorer and simply kill/terminate the DWM process. Winlogon.exe automatically restarts the DWM.exe process.

Here is a nice way to do it: open the command prompt with administrative rights.

windows key -> type ‘cmd’ -> right click ‘command prompt’ and choose ‘run as administrator’

I’m not sure how to give Josh the credit for this (from the comments above), but the answer ultimately came from: Why does Desktop Window Manager leak memory or even crash?. By disabling hardware acceleration on Chrome and restarting it, then letting things sit overnight DWM went from 4.4GB to

446MB which is a dramatic difference. It looks like other things are still acting weird/slow (even after using magicandre1981’s answer — specifically doing a search in the Start area takes 5+ seconds to accept characters) which doesn’t feel right on a system with a Quad i7, 32GB DDR3 and 4GB video RAM, but maybe I’ll still just have to stick with the occasional restart still. Whenever I do a reboot everything is blazing fast again.

Оцените статью