diff options
Diffstat (limited to 'src/engine/variable.cpp')
-rw-r--r-- | src/engine/variable.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/engine/variable.cpp b/src/engine/variable.cpp index fed23151..d0c67504 100644 --- a/src/engine/variable.cpp +++ b/src/engine/variable.cpp | |||
@@ -133,10 +133,6 @@ static HRESULT InitializeVariablePrivileged( | |||
133 | __in DWORD_PTR dwpData, | 133 | __in DWORD_PTR dwpData, |
134 | __inout BURN_VARIANT* pValue | 134 | __inout BURN_VARIANT* pValue |
135 | ); | 135 | ); |
136 | static HRESULT InitializeVariableRebootPending( | ||
137 | __in DWORD_PTR dwpData, | ||
138 | __inout BURN_VARIANT* pValue | ||
139 | ); | ||
140 | static HRESULT InitializeSystemLanguageID( | 136 | static HRESULT InitializeSystemLanguageID( |
141 | __in DWORD_PTR dwpData, | 137 | __in DWORD_PTR dwpData, |
142 | __inout BURN_VARIANT* pValue | 138 | __inout BURN_VARIANT* pValue |
@@ -247,7 +243,6 @@ extern "C" HRESULT VariableInitialize( | |||
247 | #endif | 243 | #endif |
248 | {L"ProgramFiles6432Folder", InitializeVariable6432Folder, CSIDL_PROGRAM_FILES}, | 244 | {L"ProgramFiles6432Folder", InitializeVariable6432Folder, CSIDL_PROGRAM_FILES}, |
249 | {L"ProgramMenuFolder", InitializeVariableCsidlFolder, CSIDL_PROGRAMS}, | 245 | {L"ProgramMenuFolder", InitializeVariableCsidlFolder, CSIDL_PROGRAMS}, |
250 | {L"RebootPending", InitializeVariableRebootPending, 0}, | ||
251 | {L"SendToFolder", InitializeVariableCsidlFolder, CSIDL_SENDTO}, | 246 | {L"SendToFolder", InitializeVariableCsidlFolder, CSIDL_SENDTO}, |
252 | {L"ServicePackLevel", InitializeVariableVersionNT, OS_INFO_VARIABLE_ServicePackLevel}, | 247 | {L"ServicePackLevel", InitializeVariableVersionNT, OS_INFO_VARIABLE_ServicePackLevel}, |
253 | {L"StartMenuFolder", InitializeVariableCsidlFolder, CSIDL_STARTMENU}, | 248 | {L"StartMenuFolder", InitializeVariableCsidlFolder, CSIDL_STARTMENU}, |
@@ -2031,44 +2026,6 @@ LExit: | |||
2031 | return hr; | 2026 | return hr; |
2032 | } | 2027 | } |
2033 | 2028 | ||
2034 | static HRESULT InitializeVariableRebootPending( | ||
2035 | __in DWORD_PTR dwpData, | ||
2036 | __inout BURN_VARIANT* pValue | ||
2037 | ) | ||
2038 | { | ||
2039 | UNREFERENCED_PARAMETER(dwpData); | ||
2040 | |||
2041 | HRESULT hr = S_OK; | ||
2042 | BOOL fRebootPending = FALSE; | ||
2043 | BOOL fComInitialized = FALSE; | ||
2044 | |||
2045 | // Do a best effort to ask WU if a reboot is required. If anything goes | ||
2046 | // wrong then let's pretend a reboot is not required. | ||
2047 | hr = ::CoInitialize(NULL); | ||
2048 | if (SUCCEEDED(hr) || RPC_E_CHANGED_MODE == hr) | ||
2049 | { | ||
2050 | fComInitialized = TRUE; | ||
2051 | |||
2052 | hr = WuaRestartRequired(&fRebootPending); | ||
2053 | if (FAILED(hr)) | ||
2054 | { | ||
2055 | fRebootPending = FALSE; | ||
2056 | hr = S_OK; | ||
2057 | } | ||
2058 | } | ||
2059 | |||
2060 | hr = BVariantSetNumeric(pValue, fRebootPending); | ||
2061 | ExitOnFailure(hr, "Failed to set reboot pending variant value."); | ||
2062 | |||
2063 | LExit: | ||
2064 | if (fComInitialized) | ||
2065 | { | ||
2066 | ::CoUninitialize(); | ||
2067 | } | ||
2068 | |||
2069 | return hr; | ||
2070 | } | ||
2071 | |||
2072 | static HRESULT InitializeSystemLanguageID( | 2029 | static HRESULT InitializeSystemLanguageID( |
2073 | __in DWORD_PTR dwpData, | 2030 | __in DWORD_PTR dwpData, |
2074 | __inout BURN_VARIANT* pValue | 2031 | __inout BURN_VARIANT* pValue |