From f5d8e20a1a297c12bfc9b5e2a59770faf592a8f0 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 2 Feb 2021 10:44:52 -0800 Subject: [PATCH] remove pendingfilerename check for reboot --- agent/wua_windows.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/agent/wua_windows.go b/agent/wua_windows.go index 8ba6add..e9f7f2a 100644 --- a/agent/wua_windows.go +++ b/agent/wua_windows.go @@ -457,23 +457,6 @@ func (s *IUpdateSession) GetWUAUpdateCollection(query string) (*IUpdateCollectio // SystemRebootRequired checks whether a system reboot is required. func (a *WindowsAgent) SystemRebootRequired() (bool, error) { - // https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw#remarks - k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\CurrentControlSet\Control\Session Manager`, registry.QUERY_VALUE) - if err == nil { - val, _, err := k.GetStringsValue("PendingFileRenameOperations") - if err == nil { - k.Close() - - if len(val) > 0 { - return true, nil - } - } else if err != registry.ErrNotExist { - return false, err - } - } else if err != registry.ErrNotExist { - return false, err - } - regKeys := []string{ `SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired`, }