[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XENBUS PATCH] Remove the entire StartOverride key



StartOverride may contain multiple values, resetting just the "0" value
is not enough.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/monitor/monitor.c | 31 ++-----------------------------
 1 file changed, 2 insertions(+), 29 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index c9cbcc8..c79915b 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1204,8 +1204,6 @@ RemoveStartOverride(
     )
 {
     TCHAR               KeyName[MAX_PATH];
-    HKEY                Key;
-    DWORD               Value;
     HRESULT             Error;
 
     Error = StringCbPrintf(KeyName,
@@ -1214,37 +1212,12 @@ RemoveStartOverride(
                            DriverName);
     assert(SUCCEEDED(Error));
 
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         KeyName,
-                         0,
-                         KEY_READ | KEY_WRITE,
-                         &Key);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
+    Error = RegDeleteKey(HKEY_LOCAL_MACHINE, KeyName);
+    if (Error != ERROR_SUCCESS)
         goto fail1;
-    }
-
-    Value = 0;
-    Error = RegSetValueEx(Key,
-                          "0",
-                          0,
-                          REG_DWORD,
-                          (const BYTE*)&Value,
-                          (DWORD) sizeof(Value));
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(Key);
 
     return TRUE;
 
-fail2:
-    Log("fail2");
-
-    RegCloseKey(Key);
-
 fail1:
     Error = GetLastError();
 
-- 
2.49.0.windows.1



Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.