|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] Add AutoRebootTimeout configuration
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@xxxxxxxxxx>
---
src/monitor/monitor.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 7d8689f..9adfb79 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -463,6 +463,7 @@ TryAutoReboot(
DWORD AutoReboot;
DWORD RebootCount;
DWORD Length;
+ DWORD Timeout;
PTCHAR DisplayName;
PTCHAR Description;
PTCHAR Text;
@@ -516,6 +517,16 @@ TryAutoReboot(
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;
@@ -544,7 +555,7 @@ TryAutoReboot(
free(DisplayName);
- DoReboot(Text, 60);
+ DoReboot(Text, Timeout);
free(Text);
--
2.28.0.windows.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |