Skip to content

Fix asynchronous WUA methods (BeginSearch, BeginDownload, BeginInstall) - #15

Closed
wisper-sabrina wants to merge 2 commits into
ceshihao:masterfrom
wisper-sabrina:Begin
Closed

Fix asynchronous WUA methods (BeginSearch, BeginDownload, BeginInstall)#15
wisper-sabrina wants to merge 2 commits into
ceshihao:masterfrom
wisper-sabrina:Begin

Conversation

@wisper-sabrina

Copy link
Copy Markdown
Contributor

The asynchronous WUA methods (BeginSearch, BeginDownload, BeginInstall) require a non-NULL IUnknown* callback argument. Passing NULL (VT_NULL) makes them fail with DISP_E_TYPEMISMATCH (0x80020005), so I fixed the functions

…l) require a non-NULL IUnknown* callback argument. Passing NULL (VT_NULL) makes them fail with DISP_E_TYPEMISMATCH (0x80020005), so I fixed the functions

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a dummy callback mechanism (newNoopDispatch) in a new file olecallback.go to prevent Windows Update Agent (WUA) asynchronous methods from failing due to null callback arguments. The review feedback highlights critical issues in this implementation, including a data race on the reference counter (ref) that requires atomic operations, and an unbounded memory leak caused by appending callbacks to a global slice that never gets cleared. The reviewer suggests using a thread-safe global singleton instance instead to resolve both the leak and synchronization issues.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread olecallback.go
Comment thread olecallback.go
Comment thread olecallback.go
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.55%. Comparing base (4e268b4) to head (d132acb).

Files with missing lines Patch % Lines
olecallback.go 79.16% 10 Missing ⚠️
iupdateinstaller.go 0.00% 2 Missing ⚠️
iupdatedownloader.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   43.89%   45.55%   +1.66%     
==========================================
  Files          34       35       +1     
  Lines        1392     1440      +48     
==========================================
+ Hits          611      656      +45     
+ Misses        562      561       -1     
- Partials      219      223       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant