As people in comments said, the problem wasn't with IsProcessCritical (which works as intended), but with OpenProcess, that cannot open processes created by anybody other than User, therefore creating an invalid handle. Running .exe as asministrator partly solves the problem (only few really important system processes cannot be opened, like dwm.exe, fontdrvhost.exe etc.) It's interesting that only a few processes are considered critical by IsProcessCritical (like smss.exe, services.exe or wininit.exe), but not the "System" process for whatever reason