microsoft / CsWin32

A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project.
MIT License
2.07k stars 87 forks source link

Can't import Windows.Win32.System.Threading #1149

Closed mwisnicki closed 5 months ago

mwisnicki commented 7 months ago

Actual behavior

I can't get OpenProcess by referencing namespace Windows.Win32.System.Threading in NativeMethods.txt. It works with plain OpenProcess as well as fully qualified Windows.Win32.System.Threading.OpenProcess.

Expected behavior

Namespace reference should work as per readme.

Repro steps

  1. NativeMethods.txt content:

    Windows.Win32.System.Threading
  2. Any of your own code that should be shared?


Windows.Win32.PInvoke.OpenProcess(Windows.Win32.System.Threading.PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_INFORMATION, false, 1);

Context

AArnott commented 5 months ago

I can't reproduce this with 0.3.85-beta.