| 172 | } |
| 173 | |
| 174 | STDMETHODIMP 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 | |
| 184 | end: |
| 185 | return ::Reboot(); |
| 186 | } |
| 187 | |
| 188 | STDMETHODIMP CElevationHelper::GetProcessId(DWORD *retval) { |
| 189 | if (retval == NULL) { |
no test coverage detected