{"record":{"id":"627ed21dcedfa920","repo":"babalae/better-genshin-impact","slug":"stepname-comexception-message","errorCode":null,"errorMessage":"{stepName}失败：{comException.Message}","messagePattern":"\\{stepName\\}失败：\\{comException\\.Message\\}","errorType":"exception","errorClass":"COMException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/View/Controls/ChildSession/RdpActiveXHost.cs","lineNumber":633,"sourceCode":"            BindingFlags.InvokeMethod,\n            binder: null,\n            target,\n            args,\n            CultureInfo.InvariantCulture);\n    }\n\n    private static void RunComStep(string stepName, Action action)\n    {\n        try\n        {\n            action();\n        }\n        catch (Exception exception)\n        {\n            var actualException = exception.GetBaseException();\n            if (actualException is COMException comException)\n            {\n                throw new COMException(\n                    $\"{stepName}失败：{comException.Message}\",\n                    comException.ErrorCode);\n            }\n\n            throw;\n        }\n    }\n\n    [ComImport]\n    [Guid(\"336D5562-EFA8-482E-8CB3-C5C0FC7A7DB6\")]\n    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]\n    [TypeLibType(TypeLibTypeFlags.FDispatchable)]\n    private interface IMsTscAxEvents\n    {\n        [DispId(1)]\n        void OnConnecting();\n\n        [DispId(2)]","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/View/Controls/ChildSession/RdpActiveXHost.cs#L615-L651","documentation":"Error \"{stepName}失败：{comException.Message}\" thrown in babalae/better-genshin-impact.","triggerScenarios":"RunComStep 包装的所有 RDP COM 配置/调用步骤中，底层抛出 COMException 时，以“{步骤名}失败”形式重新抛出，附带原始错误码。","commonSituations":"具体某一步（如设置端口、启用CredSSP、发送按键）被系统 COM 拒绝，多为组件版本不支持或会话状态异常。","solutions":["根据异常信息检查对应步骤的 RDP 配置与系统环境","确认远程桌面服务在系统中可用","查看详细日志定位具体失败步骤后重试"],"exampleFix":"根据消息中的步骤名和错误码定位；更新系统 RDP 组件，重启桌面分身，必要时反馈完整错误码。","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}