-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
Update to windows 0.58 #1338
Open
Jasper-Bekkers
wants to merge
1
commit into
GuillaumeGomez:master
Choose a base branch
from
Traverse-Research:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update to windows 0.58 #1338
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code in particular is pretty bad. :-/
Do you know if there is a wrapper type instead of just handling an
isize
directly? That's very error-prone... The previousHANDLE
wasn't great, but at least it was obvious what we were manipulating.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's not great, it just duplicates the
is_invalid
code but I wasn't sure even /that/ was actually correct in this case. Usually these windows functions are already hardened against invalid handles so it might just be OK to always callPdhCloseQuery
instead of checking on our side.Ideally there'd be a
PDH_HQUERY
as used by the Pdh* functions but no such type exists in windows-rs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened https://github.com/microsoft/windows-rs/issues/3200 for this. I'm really not sure what to do here... Is there any internals improvements in
windows
crate worth merging this PR as is even with the new code?If not, would you be open to create a newtype which would wrap this value so we at least know what we're manipulating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if this were merged so that my dependency tree doesn't use 4 or 5 different versions of windows-rs. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was merged. Just need to wait for
windows-rs
0.59 version to be released now I suppose. :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be a better idea to merge this and make the code look like 0.59 in the meantime. windows-rs upgrades are infrequent and (by us) kind of unwanted too since they're a massive ecosystem wide upgrade that needs to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. The code is much less good with the 0.58 version and I'd prefer to avoid having "bad code" until next windows-rs release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. You say it was merged, but the PR is still open.
in master (why is it not called "main"?) you have
windows = { version = ">=0.54, <=0.57", optional = true }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue I opened was merged in microsoft/win32metadata@ff991cf. Now I'm waiting for windows-rs to update their dependency.
It was created with the branch named
master
so don't see a reason to change it.