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

Method get_IsWindowsUpdateDisabled

LegacyUpdate/LegacyUpdateCtrl.cpp:496–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496STDMETHODIMP CLegacyUpdateCtrl::get_IsWindowsUpdateDisabled(VARIANT_BOOL *retval) {
497 DoIsPermittedCheck();
498
499 if (retval == NULL) {
500 return E_POINTER;
501 }
502
503 // Future note: These are in HKCU on NT; HKLM on 9x.
504 // Remove links and access to Windows Update
505 DWORD value = 0;
506 HRESULT hr = GetRegistryDword(HKEY_CURRENT_USER, REGPATH_POLICIES_EXPLORER, L"NoWindowsUpdate", KEY_WOW64_64KEY, &value);
507 if (SUCCEEDED(hr) && value == 1) {
508 *retval = VARIANT_TRUE;
509 return S_OK;
510 }
511
512 // Remove access to use all Windows Update features
513 hr = GetRegistryDword(HKEY_CURRENT_USER, REGPATH_POLICIES_WU, L"DisableWindowsUpdateAccess", KEY_WOW64_64KEY, &value);
514 if (SUCCEEDED(hr) && value == 1) {
515 *retval = VARIANT_TRUE;
516 return S_OK;
517 }
518
519 *retval = VARIANT_FALSE;
520 return S_OK;
521}
522
523STDMETHODIMP CLegacyUpdateCtrl::RebootIfRequired(void) {
524 DoIsPermittedCheck();

Callers

nothing calls this directly

Calls 1

GetRegistryDwordFunction · 0.85

Tested by

no test coverage detected