Actual behavior
Below is the generated source. I believe this buffer will be left with a dangling pointer to the SourceStringLocal pointer within this wrapper.
/// <inheritdoc cref="RtlInitUnicodeString(winmdroot.Foundation.UNICODE_STRING*, winmdroot.Foundation.PCWSTR)"/>
[OverloadResolutionPriority(1)]
internal static unsafe void RtlInitUnicodeString(ref winmdroot.Foundation.UNICODE_STRING DestinationString, string SourceString)
{
fixed (char* SourceStringLocal = SourceString)
{
fixed (winmdroot.Foundation.UNICODE_STRING* DestinationStringLocal = &DestinationString)
{
PInvoke.RtlInitUnicodeString(DestinationStringLocal, SourceStringLocal);
}
}
}
Expected behavior
That this friendly overload simply not exist.
Repro steps
NativeMethods.txt content:
-
NativeMethods.json content (if present): N/A
-
Any of your own code that should be shared? N/A
Context
- CsWin32 version: 0.3.269
- Win32Metadata version: N/A
- Target Framework: net472
LangVersion: N/A
Actual behavior
Below is the generated source. I believe this buffer will be left with a dangling pointer to the
SourceStringLocalpointer within this wrapper.Expected behavior
That this friendly overload simply not exist.
Repro steps
NativeMethods.txtcontent:NativeMethods.jsoncontent (if present): N/AAny of your own code that should be shared? N/A
Context
LangVersion: N/A