You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be great to have helper functions for callbacks with nicer signatures in the windows crate, just like "normal function" wrappers. For starters, when doing this to Query (or QueryOptional) callbacks, code can be written as follows:
Without this we'd have to replace the last two lines with this atrocity (using transmute for lack of a non-verbose way to put together all the pointer casts):
There are currently 517 hits for pub type PFN_ and there must be some that behave like QueryInterface (i.e. D3D10/11/12 CREATE_DEVICE). I'd like to get #747 reopened for this to make it in, but one major blocker was not having any (test) code that actively practices this system.
Reasons to not do this
There currently doesn't seem to be any use of this "external symbol loading" for Windows, only when loading an external library like DXC (which can supposedly also be linked from "windows" directly if #[link = "windows"] on DxcCreateInstance is to be believed);
It'd be great to have helper functions for callbacks with nicer signatures in the
windowscrate, just like "normal function" wrappers. For starters, when doing this toQuery(orQueryOptional) callbacks, code can be written as follows:Without this we'd have to replace the last two lines with this atrocity (using
transmutefor lack of a non-verbose way to put together all the pointer casts):There are currently 517 hits for
pub type PFN_and there must be some that behave likeQueryInterface(i.e. D3D10/11/12CREATE_DEVICE). I'd like to get #747 reopened for this to make it in, but one major blocker was not having any (test) code that actively practices this system.Reasons to not do this
"windows"directly if#[link = "windows"]onDxcCreateInstanceis to be believed);windows-rsis now more strict in requiring_COM_Outptr_SAL before marking functions/callbacks asSignatureKind::Query. This has been worked around forDxcCreateInstance(2)in Add ComOutPtr attribute to additional params win32metadata#890, but not for the*Procfunction types (this will be PR'd to DXC soon™).Originally posted by @MarijnS95 in #747 (comment)