]> xenbits.xensource.com Git - people/pauldu/xennet.git/commitdiff
Remove reboot request from the co-installer
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 21 Jul 2016 11:04:31 +0000 (12:04 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 21 Jul 2016 11:04:31 +0000 (12:04 +0100)
This is now taken care of by XENVIF by way of the XENBUS_MONITOR service.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/coinst/coinst.c

index d38d90d7158167f9864f811134be646df42d0892..cdf61c0f14d518b09d79afb565984dbc2e8eef77 100644 (file)
@@ -55,12 +55,6 @@ __user_code;
 
 #define SERVICES_KEY "SYSTEM\\CurrentControlSet\\Services"
 
-#define SERVICE_KEY(_Driver)    \
-        SERVICES_KEY ## "\\" ## #_Driver
-
-#define STATUS_KEY  \
-        SERVICE_KEY(XENVIF) ## "\\Status"
-
 static VOID
 #pragma prefast(suppress:6262) // Function uses '1036' bytes of stack: exceeds /analyze:stacksize'1024'
 __Log(
@@ -315,124 +309,6 @@ fail1:
     return FALSE;
 }
 
-static BOOLEAN
-CheckStatus(
-    OUT PBOOLEAN    NeedReboot
-    )
-{
-    HKEY            StatusKey;
-    HRESULT         Error;
-    DWORD           ValueLength;
-    DWORD           Value;
-    DWORD           Type;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         STATUS_KEY,
-                         0,
-                         KEY_READ,
-                         &StatusKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    ValueLength = sizeof (Value);
-
-    Error = RegQueryValueEx(StatusKey,
-                            "NeedReboot",
-                            NULL,
-                            &Type,
-                            (LPBYTE)&Value,
-                            &ValueLength);
-    if (Error != ERROR_SUCCESS) {
-        if (Error == ERROR_FILE_NOT_FOUND) {
-            Type = REG_DWORD;
-            Value = 0;
-        } else {
-            SetLastError(Error);
-            goto fail2;
-        }
-    }
-
-    if (Type != REG_DWORD) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail3;
-    }
-
-    *NeedReboot = (Value != 0) ? TRUE : FALSE;
-
-    if (*NeedReboot)
-        Log("NeedReboot");
-
-    RegCloseKey(StatusKey);
-
-    return TRUE;
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(StatusKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = __GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-RequestReboot(
-    IN  HDEVINFO            DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA    DeviceInfoData
-    )
-{
-    SP_DEVINSTALL_PARAMS    DeviceInstallParams;
-    HRESULT                 Error;
-
-    DeviceInstallParams.cbSize = sizeof (DeviceInstallParams);
-
-    if (!SetupDiGetDeviceInstallParams(DeviceInfoSet,
-                                       DeviceInfoData,
-                                       &DeviceInstallParams))
-        goto fail1;
-
-    DeviceInstallParams.Flags |= DI_NEEDREBOOT;
-
-    Log("Flags = %08x", DeviceInstallParams.Flags);
-
-    if (!SetupDiSetDeviceInstallParams(DeviceInfoSet,
-                                       DeviceInfoData,
-                                       &DeviceInstallParams))
-        goto fail2;
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = __GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
 static BOOLEAN
 OpenSoftwareKey(
     IN  HDEVINFO            DeviceInfoSet,
@@ -670,20 +546,11 @@ __DifInstallPostProcess(
     IN  PCOINSTALLER_CONTEXT_DATA   Context
     )
 {
-    BOOLEAN                         NeedReboot;
-
+    UNREFERENCED_PARAMETER(DeviceInfoSet);
+    UNREFERENCED_PARAMETER(DeviceInfoData);
     UNREFERENCED_PARAMETER(Context);
 
-    Log("====>");
-
-    NeedReboot = FALSE;
-
-    (VOID) CheckStatus(&NeedReboot);
-
-    if (NeedReboot)
-        (VOID) RequestReboot(DeviceInfoSet, DeviceInfoData);
-
-    Log("<====");
+    Log("<===>");
 
     return NO_ERROR;
 }