-
Notifications
You must be signed in to change notification settings - Fork 9k
fixed thread sync and fixed loop condition , also the pipelistener loop is fixed #19673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@ayush45-ui please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer. |
This comment has been minimized.
This comment has been minimized.
| DWMSBT_AUTO = 0, | ||
| DWMSBT_NONE = 1, | ||
| DWMSBT_MAINWINDOW = 2, | ||
| DWMSBT_TRANSIENTWINDOW = 3, |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| DWMSBT_NONE = 1, | ||
| DWMSBT_MAINWINDOW = 2, | ||
| DWMSBT_TRANSIENTWINDOW = 3, | ||
| DWMSBT_TABBEDWINDOW = 4 |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| - `Wtypes.PROPERTYKEY PKEY_Console_`. | ||
| - `NT_CONSOLE_PROPS`. | ||
| // Try modern method first (Windows 11 22H2+) | ||
| int backdropType = DWMSBT_TRANSIENTWINDOW; |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| if (hwnd == NULL) | ||
| return false; | ||
|
|
||
| int backdropType = DWMSBT_TABBEDWINDOW; |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| // Check if running Windows 11 or later | ||
| static bool IsWindows11OrGreater() | ||
| { | ||
| OSVERSIONINFOEXW osvi = { sizeof(osvi) }; |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| "DWMSBT_AUTO": 0, | ||
| "DWMSBT_NONE": 1, | ||
| "DWMSBT_MAINWINDOW": 2, | ||
| "DWMSBT_TRANSIENTWINDOW": 3, |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| "DWMSBT_NONE": 1, | ||
| "DWMSBT_MAINWINDOW": 2, | ||
| "DWMSBT_TRANSIENTWINDOW": 3, | ||
| "DWMSBT_TABBEDWINDOW": 4 |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| "steps": [ | ||
| "Get window handle (HWND)", | ||
| "Check if Windows 11 or greater", | ||
| "Call DwmSetWindowAttribute with DWMSBT_TRANSIENTWINDOW", |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
| "use_case": "Primary windows, main application windows" | ||
| }, | ||
| "mica_alt": { | ||
| "type": "DWMSBT_TRANSIENTWINDOW", |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error documentation
|
|
||
| 2. Add matching fields to Settings.hpp | ||
| - Add getters, setters, the whole drill. | ||
| #pragma comment(lib, "dwmapi.lib") |
Check warning
Code scanning / check-spelling
Candidate Pattern Warning documentation
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (4)osvi These words are not needed and should be removedcoordnewTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the git@github.com:ayush45-ui/terminal.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.25/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/20469585796/attempts/1' &&
git commit -m 'Update check-spelling metadata'Pattern suggestions ✂️ (1)You could add these patterns to Alternatively, if a pattern suggestion doesn't make sense for this project, add a Warnings and Notices
|
| Count | |
|---|---|
| ℹ️ candidate-pattern | 1 |
| 1 |
See
✏️ Contributor please read this
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
- ... misspelled, then please correct them instead of using the command.
- ... names, please add them to
.github/actions/spelling/allow/names.txt. - ... APIs, you can add them to a file in
.github/actions/spelling/allow/. - ... just things you're using, please add them to an appropriate file in
.github/actions/spelling/expect/. - ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in
.github/actions/spelling/patterns/.
See the README.md in each directory for more information.
🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉
If the flagged items are 🤯 false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it,
try adding it to thepatterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
Thread Handle Check---
cppHANDLE hPipeListenerThread{ reinterpret_cast(_beginthread(PipeListener, 0, hPipeIn)) };
_beginthread() returns (uintptr_t)-1 on error, but there's no error checking before proceeding.
Process Handle Cleanup---
The code closes piClient.hThread and piClient.hProcess even if CreateProcess failed, which could close invalid handles.
Thread Synchronization---
Using Sleep(500) is unreliable for thread synchronization. The listener thread may still be running when cleanup begins.
PipeListener Loop Condition---
dwBytesRead is DWORD (unsigned), so it's always >= 0. This should check for > 0 to detect EOF.
Missing Error Handling---
Several places lack proper error checking and cleanup on failure paths.
I have made the following changes to errors and issues ,
--Added thread creation error checking - Verifies _beginthread() didn't return -1
---Fixed process handle cleanup - Only closes handles if CreateProcess succeeded
--Improved thread synchronization - Closes output pipe to signal EOF, then waits for listener thread to complete
--Fixed loop condition - Changed dwBytesRead >= 0 to dwBytesRead > 0 to properly detect EOF
--Added null pointer check - Verifies lpAttributeList before cleanup