You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 11中ISystemInformation::get_RebootRequired() Bug上报渠道咨询

关于Windows 11中ISystemInformation::get_RebootRequired()的Bug上报渠道问题

我在Windows 11的ISystemInformation::get_RebootRequired()接口中发现了一个Bug,请问可以在哪里上报?

环境:

  • Windows 11

复现步骤:

  • 配置Windows 11设备,使Windows更新已下载但需重启完成安装。
  • 将附录A中的代码编译为32位程序,在步骤1配置的设备上运行。

预期行为:
应用程序输出"-1"(VARIANT_TRUE)。

实际行为:
应用程序输出"0"(VARIANT_FALSE)。

附录A:代码示例

#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;
}

更新1:@SimonMourier在评论中提出了另一种测试ISystemInformation::get_RebootRequired()的方法,实际行为仍相同。


内容的提问来源于stack exchange,提问作者GunnarTrollson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 07:38:24