February 16th, 2018

So what is a Windows “critical process” anyway?

I noted some time ago that Task Manager applies three somewhat arbitrary criteria for dividing processes into three categories: App, Background Process, and Windows Process. In particular, a Windows Process is one for which Is­Process­Critical reports TRUE.

SimonRev quite rightly calls out the documentation for being useless due to the fact that it merely states a tautology.

IsProcessCritical

Determines whether the specified process is considered critical.

BOOL WINAPI IsProcessCritical(
  _In_  HANDLE hProcess,
  _Out_ PBOOL  Critical
);

hProcess [in] A handle to the process to query. The process must have been opened with PROCESS_LIMITED_QUERYINFORMATION access.

Critical [out] A pointer to the BOOL value this function will use to indicate whether the process is considered critical.

Return value: This routine returns FALSE on failure. Any other value indicates success. Call GetLastError to query for the specific error reason on failure.

Great, so we learn that the Is­Process­Critical function tells you whether the process is critical. But nowhere does it say what it means for a process to be critical or how a process becomes critical in the first place.

A critical process is one that forces a system reboot if it terminates. (More precisely, it forces a bluescreen error, which captures a memory dump before rebooting, so that the cause for termination can be investigated.)

How does a process get itself marked critical?

A few system processes do this on their own. For example, processes related to enforcing system security do this so that if one of them crashes, it stops the system immediately before any more damage can occur.

But most of the time, the way this happens if you create a service and set its recovery option to Restart the Computer.

Bonus chatter: Wait a second, there are some processes in the Windows processes list that aren’t critical system processes. Like Console Window Host. How did they get there?

In addition to putting all critical system processes in the list, Task Manager also keeps a hard-coded list of processes that it puts in the Windows processes list whenever it sees them. That’s why you see things like Console Window Host and Desktop Window Manager. So a more accurate list of what goes into Windows processes is

  • A hard-coded list of specific processes, plus
  • Processes marked as critical.
Topics
Other

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.