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 seems I can no longer use several functions (BCryptEnumContexts, BCryptEnumContextFunctions, BCryptResolveProviders) because of invalid signatures.
The DllImport now has an [Optional] attribute and seems to cause the overloads that previously were generated as ref STRUCT* now to be generated as STRUCT**.
I'm afraid this is by design, since the ppBuffer is in fact allowed to be NULL and the C# ref syntax doesn't make it intuitive as to how to pass NULL in. All such optional parameters are therefore declared as pointers instead of using ref, in or out.
This shouldn't block any of your scenarios, as far as we're aware. It does unfortunately mean you'll need to update your callers.
One thing you could do is add a partial class to declare your own overload of this method that doesacceptref, and internally obtain its pointer and pass it on to the extern` method. If you have a lot of callers of this method, this will allow you to avoid fixing them all up individually.
Actual behavior
It seems I can no longer use several functions (BCryptEnumContexts, BCryptEnumContextFunctions, BCryptResolveProviders) because of invalid signatures.
The
DllImport
now has an[Optional]
attribute and seems to cause the overloads that previously were generated asref STRUCT*
now to be generated asSTRUCT**
.Example below for BCryptEnumContexts ppBuffer.
0.2.206-beta generates:
Expected behavior
0.2.188-beta generates:
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Context
0.2.206-beta
net7.0
preview
The text was updated successfully, but these errors were encountered: