Generate dxdiag.h bindings in DirectX.Diagnostics namespace#2073
Generate dxdiag.h bindings in DirectX.Diagnostics namespace#2073MarijnS95 wants to merge 1 commit intomicrosoft:mainfrom
dxdiag.h bindings in DirectX.Diagnostics namespace#2073Conversation
| IDxDiagContainer::EnumChildContainerNames::pwszContainer=[Out][NativeArrayInfo(CountFieldName = "cchContainer")] | ||
| IDxDiagContainer::EnumPropNames::pwszPropName=[Out][NativeArrayInfo(CountFieldName = "cchPropName")] |
There was a problem hiding this comment.
Noting to self that this needs to use CountParamIndex so that this special piece of code in windows-rs translates the function argument to &mut [u16] (unfortunately loosing the PWSTR type) to pass the "capacity" of the output string into cch* without users having to do so manually:
Since there are a few more functions with CountFieldName attributes, maybe those should be renamed or windows-rs needs to lookup by name as well?
(Bonus: PWSTR can't be used as function argument because it defines the length based on strlen() that searches for a NUL-terminator, which isn't defined for an arbitrary "output only" buffer. The transparent PWSTR pointer wrapper "newtype" doesn't behave like an "owned" Rust Vec which carries a length and capacity field)
No description provided.