Is the computer safe to hibernate?

What exactly happens when you exit Windows or log off?

Windows does a lot of work in the background whenever you shut down, restart, or sign out of your PC. The process ensures that all work and application data is saved before the hardware is turned off.

Windows searches for logged-in users (on shutdown)

When you instruct your PC to shut down or restart, Windows first checks to see if other Windows user accounts have active sessions. This occurs when you lock your Windows session and log in with a different user account before logging out first.

If Windows detects that someone else has not done so, If the computer has not been properly logged off, the message “This PC is still in use by someone else” appears. That other user could lose unsaved data in open applications if you force a restart. It's usually a good idea to stop here and have the other user log in, save their work, and log out before they shut down.

In Windows, you can click "Shut Down Anyway" if you are sure that the other user has no open work to save. This will forcibly log out the other user account and close all open applications. Unsaved data will be lost.

If you are the only user logged on, you will not see this message and Windows will proceed directly to the next step.

Windows instructs programs to save their work and close

Before you actually log off your PC, Windows will instruct all open programs to save their work and close. This also occurs when you shut down or restart your PC, as logging out is a necessary part of the shutdown.

In particular, Windows sends the WM_QUERYENDSESSION message to every open window. Open programs are not just closed by force. The programs are instructed to save their work and close. This can take a moment. Because of this, it can sometimes take a while for your PC to shut down or log out.

Programs can "block" this process by saying that they need user input from you. For example, a program might have files open that you need to save. The message "This app is preventing shutdown" appears when an application requests input. An application can also display a user-defined message here using the ShutdownBlockReasonCreate function.

If you see this message, you should click "Cancel", check the application, save your data and close it on your own. If you are properly discarding the data, you can continue by clicking "Shut down anyway" or " Log out anyway "click.

Note that Windows closes other applications than you are ready. So if ten applications are open and only one is preventing shutdown, only that single application will be shown when you click Cancel here. Windows has already closed the other nine applications.

In Windows 10, Windows also remembers which application windows you had open and tries to open them again the next time you log on to your PC.

CONNECTED:How to prevent Windows 10 from reopening recently opened apps on startup

Windows will log you off

After you have instructed all of your open programs to save, Windows will log you out after shutting down the data. The entire Windows session belonging to your user account will be terminated and no more open programs will be executed as your user account.

Many individual actions run cleanly from Windows. For example, the contents of the Windows registry hives for your user account are usually stored in memory. When you log out, they are saved to the hard drive. They will be reloaded into memory the next time you log on.

If you are in the process of logging out, Windows will return to the login screen so you can log in as a different user. When you shut down or restart, Windows continues to shut down

CONNECTED:Windows registry demystified: what to do with it

Windows shuts down

After Windows has logged off all users, it will only need to shut itself down. Windows instructs all system services and their own processes to shut down properly and save all necessary data to the hard drive. In particular, the SERVICE_ACCEPT_PRESHUTDOWN message is sent to all running services. After the services have been warned, they receive a SERVICE_ACCEPT_SHUTDOWN message. The service then has 20 seconds to clean up and shut down before Windows forcibly shuts it down.

Windows 10 also saves the status of your Windows Kernel to disk. It's like a partial hibernation. The next time you start your PC, Windows can reload the saved kernel and boot faster, which skips the slower hardware initialization process. This feature is known as "quick start".

Windows is also working on applying any available Windows updates during the final parts of the shutdown. Windows performs various update tasks during shutdown, before the PC starts, and while it is running in the background.

When everything is done, Windows will clean unmount the solid-state drive or hard drive and wait for the all-clear signal that all system data has been saved to the physical hard drive. All software has shut down properly and all of your data is saved on the hard drive.

CONNECTED:Windows 10 does not shut down completely on shutdown (but does on restart)

Windows will shut down your PC

Finally, Windows sends an ACPI shutdown signal to your PC. This will tell your PC to turn itself off. The shutdown is complete.

If you've ever used Windows 95 you'll remember the days before the ACPI shutdown signal. Windows said that it is now safe to turn off your computer and you had to press the power button yourself. With the ACPI standard (Advanced Configuration and Power Interface) first published in 1996, Windows can switch off the PC.

CONNECTED:Yes, it is okay to use the power button to shut down the computer

This works differently than with sleep or hibernation. In energy-saving mode, your PC remains switched on in energy-saving mode. In hibernation, your PC saves the entire system status to the hard drive and restores it when you turn it on again.