Computer randomly shuts off and restarts with Reason Code: 0x500ff

My buddy's computer keeps randomly restarting. Usually when he's playing a game. It has randomly restarted just when he's on YouTube.  Event Viewer says:

The process C:\Windows\system32\winlogon.exe (SPENCER-DESKTOP) has initiated the power off of computer SPENCER-DESKTOP on behalf of user NT_AUTHORITY\SYSTEM for the following reason: No title for this reason could be found
Reason Code: 0x500ff
Shutdown Type: power off
Comment:

param1  C:\Windows\system32\winlogon.exe (SPENCER-DESKTOP)
param2  SPENCER-DESKTOP
param3  No title for this reason could be found
param4  0x500ff
param5  power off
param6
param7  NT_AUTHORITY\SYSTEM

Here is a screenshot of Event Viewer.  I think this event was it.  He has a prebuilt cyberpower gaming PC.  Any suggestions are good.


The KB article for this says that this may be a secondary Event Viewer entry while the real reason should be logged somewhere next to it (within seconds), with the same Event ID 1074: https://support.microsoft.com/en-us/help/2001061/on-a-computer-running-windows-vista-windows-7-windows-server-2008-and

The second entry, if you can find it, should have the real reason listed. For me, the second entry would be "The process Explorer.EXE has initiated the power off of computer..." to indicate that I used the desktop or start menu to ask for a shut down.

In your friend's case this may also be a short on the power button, or even a misbehaving program. In an extreme case, CPU overheating might be the issue, etc.

My custom-built system used to restart reliably on its own when I overclocked it a bit too much, for example. Windows 10 Pro here.

Good luck!