Conversation
顺便改掉了一些原先不是很规范的包装
lhx077
requested changes
Feb 28, 2026
Contributor
lhx077
left a comment
There was a problem hiding this comment.
GetNamedPipeClientProcessId 的重构将错误处理内聚化,使调用侧的代码(PipeComm.cs 第 59 行)得以显著简化,此举是合适的。然而,AllocateConsole() 同样直接调用 _ThrowLastWin32Error(),但 AllocConsole 在进程已附加控制台时亦会返回 false,此时 GetLastError 返回 ERROR_ACCESS_DENIED(5),抛出异常并不是期望行为。建议在调用前先通过 GetConsoleWindow() 判断当前进程是否已拥有控制台,或至少对 ERROR_ACCESS_DENIED 进行显式处理,而非无条件抛出。
lhx077
approved these changes
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
顺便改掉了一些原先不是很规范的包装