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

Create a newtype to handle Pdh* functions #1962

Closed
GuillaumeGomez opened this issue Aug 14, 2024 · 4 comments
Closed

Create a newtype to handle Pdh* functions #1962

GuillaumeGomez opened this issue Aug 14, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@GuillaumeGomez
Copy link

GuillaumeGomez commented Aug 14, 2024

Since the 0.58 version, functions like PdhCollectQueryData take a isize instead of a HANDLE. This is pretty bad as we there is no method available on isize to check if its value is correct or basically any helper. In addition, it makes it much harder when reading code what we're actually manipulating.

Would you be open in adding such a newtype to address these two problems?

Thanks in advance!

@kennykerr
Copy link
Contributor

The PDH functions definitely have "handle types" like PDH_HQUERY and PDH_HCOUNTER. I'm not sure why they're not showing up in the Win32 metadata. @riverar may have some idea. I'll forward to the Win32 metadata repo for resolution.

@kennykerr kennykerr transferred this issue from microsoft/windows-rs Aug 14, 2024
@riverar
Copy link
Collaborator

riverar commented Aug 14, 2024

I don't see any indication this API ever took a specialized handle (from a metadata perspective). Happy to add it though.

@GuillaumeGomez
Copy link
Author

It would be very welcome. :)

@GuillaumeGomez
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants