IsSETEnabled

Go to Home Page

Determines whether the Shutdown Event Tracker is enabled

Syntax

BOOL WINAPI IsSETEnabled ( )

Return Value

Nonzero if the tracker is enabled, FALSE otherwise

Remarks

The function tries to open the key HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability. If it does exist, the 'ShutdownReasonUI' value is queried. If its value is 1 (the 'always' value when Shutdown Tracker is configured via gpedit.msc), the function returns TRUE. If it is set to anything else, a TRUE return is determined by this:

OSVERSIONIFOEX osver;
GetVersionEx(&osver);
return osver.wProductType == ShutdownReasonUIValue;

If the key doesn't exist, or if it has a 'ShutdownReasonOn' value but not a 'ShutdownReasonUI' value, success is determined by:

OSVERSIONIFOEX osver;
GetVersionEx(&osver);
return osver.wProductType != VER_NT_WORKSTATION;