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

fix: Update windows to 0.54 #373

Merged
merged 2 commits into from
Mar 18, 2024
Merged

fix: Update windows to 0.54 #373

merged 2 commits into from
Mar 18, 2024

Conversation

DataTriny
Copy link
Member

The major highlight of this PR is that VariantFactory is replaced by a simpler Variant newtype. The VARIANT type from the windows crate is used directly whenever possible.

@mwcampbell
Copy link
Contributor

@DataTriny Are you sure that calling HRESULT::from_win32 on UIA_E_ELEMENTNOTAVAILABLE and UIA_E_INVALIDOPERATION is correct? Those constants are already HRESULT codes, not Win32 errors. I guess we need tests that cover those errors.

@mwcampbell
Copy link
Contributor

I think what we need to do is just directly construct the HRESULT struct, like this:

HRESULT(UIA_E_ELEMENTNOTAVAILABLE as _)

This is based on looking at how constants like windows::Win32::Foundation::E_NOTIMPL are written.

@DataTriny
Copy link
Member Author

@mwcampbell I tried printing a debug representation of those errors and I think you're right.

@DataTriny
Copy link
Member Author

I previously made sure that Error::empty() was equivalent to Error::OK.

@mwcampbell mwcampbell merged commit 50f112f into main Mar 18, 2024
10 checks passed
@mwcampbell mwcampbell deleted the bump-windows-rs branch March 18, 2024 01:07
@mwcampbell mwcampbell mentioned this pull request Mar 18, 2024
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.

None yet

2 participants