Skip to content
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

WSL-Helper: Fix getting MSI version #6601

Conversation

mook-as
Copy link
Contributor

@mook-as mook-as commented Mar 12, 2024

When getting the MSI version, we initially supply no buffer to get the total buffer size required. This can return success instead of ERROR_MORE_DATA as previously expected; the actual result is the same, and we need to allocate a buffer large enough.

When getting the MSI version, we initially supply no buffer to get the
total buffer size required.  This can return success instead of
ERROR_MORE_DATA as previously expected; the actual result is the same, and
we need to allocate a buffer large enough.

Signed-off-by: Mark Yen <mark.yen@suse.com>
Fixes: b7aa9dd
@mook-as mook-as requested a review from jandubois March 12, 2024 22:14
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

I suspect the call returns ERROR_SUCCESS because you passed a NULL pointer, so obviously didn't expect to receive the string, but just the size. And the size was delivered successfully, so not a failure.

@jandubois jandubois merged commit 92abdb1 into rancher-sandbox:release-1.13 Mar 12, 2024
13 checks passed
@mook-as mook-as deleted the win32/installer/wsl-msi-version-no-buffer branch March 14, 2024 20:34
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.

2 participants