microsoft / win32metadata

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

Annotate missing `ComOutPtr` in `CompositionSwapchain` and `DirectCom… #1970

Closed MarijnS95 closed 3 months ago

MarijnS95 commented 3 months ago

…position`

dcomp.h and Presentation.h are missing some _COM_Outptr_ annotations, turning these functions in windows-rs to take a meaningless *mut *mut c_void. With this annotation the functions return a generic T: Interface and automatically pass its &T::IID to the riid parameter resulting in a much more ergonomic API.

Also annotate some return-only functions with RetVal to make it easier to retrieve these objects.

mikebattista commented 3 months ago

Thanks!

mikebattista commented 3 months ago

Thanks for the feedback. @MarijnS95 could you please file a separate PR to remove the RetVal changes?