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
calling Windows.Win32.PInvoke.AttachConsole(-1) will result in error because of the source generation: internal static extern winmdroot.Foundation.BOOL AttachConsole(uint dwProcessId);
Thank you for the doc reference. As the docs point out, a cast is required even in C. You can do this in C# too.
We generally hesitate to add custom overloads to arbitrary functions in Win32 to the generated code because it makes CsWin32 significantly more complex rather than being a transformation of winmd to C#. But you're always welcome to write your own method into the emitted partial class that does the cast for you if you want the syntax sugar of it.
Actual behavior
calling
Windows.Win32.PInvoke.AttachConsole(-1)
will result in error because of the source generation:internal static extern winmdroot.Foundation.BOOL AttachConsole(uint dwProcessId);
Expected behavior
-1 Should probably be allowed as an overload based on documentation here:
https://learn.microsoft.com/en-us/windows/console/attachconsole#parameters
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Context
0.3.106
net9.0-windows10.0.26100.0
LangVersion
(if explicitly set by project): [e.g.9
]The text was updated successfully, but these errors were encountered: