MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / Reboot

Method Reboot

LegacyUpdate/ElevationHelper.cpp:174–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174STDMETHODIMP CElevationHelper::Reboot(void) {
175 // Calling Commit() is recommended on Windows 10, to ensure feature updates are properly prepared prior to the reboot.
176 // If IUpdateInstaller4 doesn't exist, we can skip this.
177 CComPtr<IUpdateInstaller4> installer;
178 HRESULT hr = installer.CoCreateInstance(CLSID_UpdateInstaller, NULL, CLSCTX_INPROC_SERVER);
179 if (SUCCEEDED(hr) && hr != REGDB_E_CLASSNOTREG) {
180 hr = installer->Commit(0);
181 CHECK_HR_OR_GOTO_END(L"Commit");
182 }
183
184end:
185 return ::Reboot();
186}
187
188STDMETHODIMP CElevationHelper::GetProcessId(DWORD *retval) {
189 if (retval == NULL) {

Callers 1

RebootIfRequiredMethod · 0.80

Calls 2

RebootFunction · 0.85
CoCreateInstanceMethod · 0.80

Tested by

no test coverage detected