microsoft / win32metadata

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

Create a newtype to handle Pdh* functions #1962

Closed GuillaumeGomez closed 3 months ago

GuillaumeGomez commented 3 months 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 3 months 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 3 months 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 3 months ago

It would be very welcome. :)

GuillaumeGomez commented 3 months ago

Awesome, thanks!