c++wuapi

Where to report bug for wuapi.h in Windows 11?


I found a bug in Windows 11's ISystemInformation::get_RebootRequired(). Where can I report it?

Environment: Windows 11

Steps to reproduce

  1. Setup a Windows 11 machine so that Windows updates are downloaded but a reboot is needed to complete installation.
  2. Compile the code in appendix A for 32-bit and run it on the machine configured in step 1.

Expected behavior: The application prints "-1" (VARIANT_TRUE).

Observed behavior: The application prints "0" (VARIANT_FALSE).

Appendix A: Code sample

#include <iostream>
#include <Windows.h>
#include <wuapi.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlcomcli.h>


int IsWindowsUpdateRebootPending()
{
    VARIANT_BOOL isWindowsRebootPending = VARIANT_FALSE;
    std::string errorMessage;
    
    CComPtr<ISystemInformation> systemInformation(nullptr);
    HRESULT result = CoCreateInstance(CLSID_SystemInformation, NULL, CLSCTX_INPROC_SERVER,
        IID_PPV_ARGS(&systemInformation));
    
    if (FAILED(result) || systemInformation == nullptr)
    {
        errorMessage = "CoCreateInstance(CLSID_SystemInformation) failed.";
    }
    else if (systemInformation->get_RebootRequired(&isWindowsRebootPending) != S_OK)
    {
        errorMessage = "get_RebootRequired failed.";
    }
    
    if (!errorMessage.empty())
    {
        throw std::runtime_error(errorMessage);
    }

    return (int)isWindowsRebootPending;
}

int main()
{
    ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
    try
    {
        std::cout << IsWindowsUpdateRebootPending() << std::endl;
    }
    catch (std::exception e)
    {
        std::cout << e.what() << std::endl;
    }
    ::CoUninitialize();
    
    return 0;
}

Update 1: @SimonMourier suggested another way to test ISystemInformation::get_RebootRequired() in the comments below. The observed behavior is the same.


Solution

  • I ended up submitting a ticket through Feedback Hub. Here is how I did it: Windows Start > Feedback hub > Sign In > Report a problem. After describing the problem I classified it as "Developer Platform, API Feedback".