HyperVSwitch icon indicating copy to clipboard operation
HyperVSwitch copied to clipboard

Restart code does not work properly

Open ygoe opened this issue 8 years ago • 1 comments

The restart code with ExitWindowsEx as in v1.0 worked fine in Windows 7. In Windows 10 is logs off the user but does not restart the computer. This has been changed in v1.1 but now it always fails with error 1314 (“A Required Privilege Is Not Held by the Client”). A fallback method (call shutdown.exe) is in place. This needs proper testing on all systems and cleaning up. Maybe only the current fallback method should be used everywhere.

ygoe avatar Aug 13 '16 07:08 ygoe

You need to acquire your token and then AdjustTokenPrivileges before the system will honor your reboot request. Here's an example in C but converting it to C# should be super easy.

ziggythehamster avatar Sep 28 '20 06:09 ziggythehamster