microsoft / win32metadata

Tooling to generate metadata for Win32 APIs in the Windows SDK.
Other
1.32k stars 113 forks source link

Create a newtype to handle Pdh* functions #1962

Closed GuillaumeGomez closed 4 weeks ago

GuillaumeGomez commented 1 month ago

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 commented 1 month ago

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.

riverar commented 1 month ago

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

GuillaumeGomez commented 1 month ago

It would be very welcome. :)

GuillaumeGomez commented 4 weeks ago

Awesome, thanks!