EnsureProcessIsClosed function missing correct access rights and does not close handle
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 58/100
Research direction
Start at SampleApps/WebView2APISample/ProcessComponent.cpp around line 554 and inspect EnsureProcessIsClosed, including the adjacent OpenProcess call and WaitForSingleObject usage. Confirm the process handle requests the required rights, OpenProcess failure is handled, and the handle is closed on every path; validate the behavior by building and exercising the sample's process-cleanup flow.
Written by the indexing model from the issue text.
Description
The process handle that gets passed to WaitForSingleObject in this line is missing the SYNCHRONIZE access right as specified here. This needs to be requested in the adjacent OpenProcess call alongside the PROCESS_TERMINATE access right.
This results in the WaitForSingleObject call to always immediately return with a result that always leads to the explicit forceful termination code path. This fact hides the other issue with this function that the opened process handle is only closed in this code path when it should be closed outside the if.
Furthermore, the result of OpenProcess should be evaluated as it might be NULL.
Nothing breaking, just caused some confusion on our side as we took this function as an example on how to wait for the web view process to finish before doing some clean up on our side.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 521
- Avg merge
- 13m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MicrosoftEdge/WebView2Samples
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
MicrosoftEdge/WebView2Samples#5 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MicrosoftEdge/WebView2Samples#283 ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
MicrosoftEdge/WebView2Samples#282 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MicrosoftEdge/WebView2Samples#277 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MicrosoftEdge/WebView2Samples#273 ·
All issues in MicrosoftEdge/WebView2Samples
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·