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

Method OpenWindowsUpdateSettings

LegacyUpdate/LegacyUpdateCtrl.cpp:568–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568STDMETHODIMP CLegacyUpdateCtrl::OpenWindowsUpdateSettings(void) {
569 DoIsPermittedCheck();
570
571 HRESULT hr = StartLauncher(L"/options", FALSE);
572 if (!SUCCEEDED(hr)) {
573 CHECK_HR(L"OpenWindowsUpdateSettings() failed, falling back");
574
575 // Might happen if the site isn't trusted, and the user rejected the IE medium integrity prompt.
576 // Use the basic Automatic Updates dialog directly from COM.
577 CComPtr<IAutomaticUpdates> automaticUpdates;
578 hr = automaticUpdates.CoCreateInstance(CLSID_AutomaticUpdates, NULL, CLSCTX_INPROC_SERVER);
579 CHECK_HR_OR_RETURN(L"CoCreateInstance CLSID_AutomaticUpdates");
580
581 hr = automaticUpdates->ShowSettingsDialog();
582 CHECK_HR_OR_RETURN(L"ShowSettingsDialog");
583 }
584
585 return hr;
586}
587
588STDMETHODIMP CLegacyUpdateCtrl::get_IsUsingWsusServer(VARIANT_BOOL *retval) {
589 DoIsPermittedCheck();

Callers

nothing calls this directly

Calls 2

StartLauncherFunction · 0.85
CoCreateInstanceMethod · 0.80

Tested by

no test coverage detected