Skip to content

feat(interop): 添加分配终端的本地调用包装#2522

Merged
copytiao merged 2 commits intodevfrom
feat/alloc-console
Feb 28, 2026
Merged

feat(interop): 添加分配终端的本地调用包装#2522
copytiao merged 2 commits intodevfrom
feat/alloc-console

Conversation

@ruattd
Copy link
Contributor

@ruattd ruattd commented Feb 28, 2026

顺便改掉了一些原先不是很规范的包装

顺便改掉了一些原先不是很规范的包装
@ruattd ruattd requested a review from a team February 28, 2026 08:22
@pcl-ce-automation pcl-ce-automation bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: M PR 大小评估:中型 labels Feb 28, 2026
Copy link
Contributor

@lhx077 lhx077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetNamedPipeClientProcessId 的重构将错误处理内聚化,使调用侧的代码(PipeComm.cs 第 59 行)得以显著简化,此举是合适的。然而,AllocateConsole() 同样直接调用 _ThrowLastWin32Error(),但 AllocConsole 在进程已附加控制台时亦会返回 false,此时 GetLastError 返回 ERROR_ACCESS_DENIED(5),抛出异常并不是期望行为。建议在调用前先通过 GetConsoleWindow() 判断当前进程是否已拥有控制台,或至少对 ERROR_ACCESS_DENIED 进行显式处理,而非无条件抛出。

@ruattd ruattd requested a review from lhx077 February 28, 2026 09:15
Copy link
Member

@copytiao copytiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没看

@pcl-ce-automation pcl-ce-automation bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 labels Feb 28, 2026
@copytiao copytiao merged commit cb71509 into dev Feb 28, 2026
2 checks passed
@pcl-ce-automation pcl-ce-automation bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels Feb 28, 2026
@ruattd ruattd deleted the feat/alloc-console branch February 28, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M PR 大小评估:中型 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants