Add registry value AutoRebootTimeout, which if set, is used as the
Timeout value passed to InitiateSystemShutdownEx. If not set, use the
default value of 60 seconds.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
DWORD AutoReboot;
DWORD RebootCount;
DWORD Length;
+ DWORD Timeout;
PTCHAR DisplayName;
PTCHAR Description;
PTCHAR Text;
Context->RebootPending = TRUE;
+ Error = RegQueryValueEx(Context->ParametersKey,
+ "AutoRebootTimeout",
+ NULL,
+ &Type,
+ (LPBYTE)&Timeout,
+ &Length);
+ if (Error != ERROR_SUCCESS ||
+ Type != REG_DWORD)
+ Timeout = 60;
+
DisplayName = GetDisplayName(DriverName);
if (DisplayName == NULL)
goto fail1;
free(DisplayName);
- DoReboot(Text, 60);
+ DoReboot(Text, Timeout);
free(Text);