babalae/better-genshin-impact · error · COMException

RDP ActiveX 未返回 SecuredSettings2。

Error message

RDP ActiveX 未返回 SecuredSettings2。

What it means

Error "RDP ActiveX 未返回 SecuredSettings2。" thrown in babalae/better-genshin-impact.

Source

Thrown at BetterGenshinImpact/View/Controls/ChildSession/RdpActiveXHost.cs:84

        if (ConnectedState != 0)
        {
            return;
        }

        ChildSessionNativeMethods.ClearRdpInputWindowCache(Handle);
        var client = GetRequiredOcx();
        var width = Math.Clamp(desktopSize.Width, 200, 8192);
        var height = Math.Clamp(desktopSize.Height, 200, 8192);

        SetComProperty(client, "Server", "localhost");
        SetComProperty(client, "DesktopWidth", width);
        SetComProperty(client, "DesktopHeight", height);
        SetComProperty(client, "ColorDepth", 32);
        SetComProperty(client, "ConnectingText", "正在创建 BetterGI 桌面分身...");
        SetComProperty(client, "DisconnectedText", "BetterGI 桌面分身已断开");

        var securedSettings = GetComProperty(client, "SecuredSettings2")
            ?? throw new COMException("RDP ActiveX 未返回 SecuredSettings2。");
        RunComStep("设置系统组合键发送位置", () =>
            SetComProperty(
                securedSettings,
                "KeyboardHookMode",
                _sendSystemShortcutsToRemote ? 1 : 0));
        RunComStep("设置远程音频重定向", () =>
            SetComProperty(
                securedSettings,
                "AudioRedirectionMode",
                _audioMuted ? DisableRemoteAudio : RedirectAudioToClient));

        var advancedSettings = GetComProperty(client, "AdvancedSettings7")
            ?? throw new COMException("RDP ActiveX 未返回 AdvancedSettings7。");
        RunComStep("设置 RDP 连接端口", () =>
            SetComProperty(
                advancedSettings,
                "RDPPort",
                ChildSessionNativeMethods.GetConfiguredRdpPort()));

View on GitHub (pinned to a7cb36712d)

Solutions

  1. 确认系统已安装远程桌面 ActiveX 组件(mstscax.dll)
  2. 以兼容模式重启 BetterGI 后重试
  3. 检查系统组策略是否禁用了 RDP ActiveX 控件

Example fix

更新 Windows 系统补丁/远程桌面组件;以正常桌面环境运行(非精简系统),必要时重装系统 RDP 组件。

When it happens

Trigger: 连接桌面分身时通过 COM 反射读取 RDP ActiveX 的 SecuredSettings2 属性返回 null,无法配置键盘钩子/音频重定向时抛出。

Common situations: 系统 MsTscAx(远程桌面 ActiveX)组件版本过旧或损坏,不提供 SecuredSettings2 接口。


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/341608de40382e4e. Report an issue: GitHub.