Closed Sergio0694 closed 8 months ago
Actually this seems to happen with a bunch of APIs. Eg. IDxcLibrary.CreateIncludeHandler is also bugged.
I think the design is to automatically throw the exception for the HRESULT (see .ThrowOnFailure()
, it is not discarded) so that you only have one exception handling model in the loop in your C# code, I believe this is best addressed by your other issue #976
Also see PreserveSig
, allowing you to preserve the original signature rather than making it "csharp-y". Sources:
It sounds like, given you're used to TerraFX, you want to just use:
{
"comInterop": {
"preserveSigMethods": [
"*"
]
}
}
Ooops, missed that one, I thought disableMarshalling
would be enough to just get 1:1 blittable bindings 😅
Thank you!
I'm glad you found what you were looking for. Blittability applies to structs -- not COM interface method behavior.
Actual behavior
Code for `IDxcLibrary` (click to expand):
```csharp // ------------------------------------------------------------------------------ //
The IID guid for this interface.
///Note how
CreateBlobWithEncodingOnHeapCopy
returnsvoid
and notHRESULT
(which is just discarded implicitly).Expected behavior
The method should have the same signature as indicated in the docs.
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Any of your own code that should be shared?
Don't think so, but anyway all my code is at https://github.com/Sergio0694/ComputeSharp/tree/dev/reflection-tweaks.
Context
LangVersion
(if explicitly set by project): 11