Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Annotate Windows interop declarations with [SupportedOSPlatform("windows")] by Copilot · Pull Request #132778 · dotnet/runtime · GitHub
Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Annotate Windows interop declarations with [SupportedOSPlatform("windows")] by Copilot · Pull Request #132778 · dotnet/runtime · GitHub
Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Annotate Windows interop declarations with [SupportedOSPlatform("windows")] by Copilot · Pull Request #132778 · dotnet/runtime · GitHub
Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Annotate Windows interop declarations with [SupportedOSPlatform("windows")] by Copilot · Pull Request #132778 · dotnet/runtime · GitHub
Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Annotate Windows interop declarations with [SupportedOSPlatform("windows")] by Copilot · Pull Request #132778 · dotnet/runtime · GitHub
Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Annotate Windows interop declarations with [SupportedOSPlatform("windows")] by Copilot · Pull Request #132778 · dotnet/runtime · GitHub
Skip to content

Annotate Windows interop declarations with [SupportedOSPlatform("windows")] - #132778

Draft
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support
Draft

Annotate Windows interop declarations with [SupportedOSPlatform("windows")]#132778
pavelsavara with Copilot wants to merge 20 commits into
mainfrom
copilot/annotate-dllimport-libraryimport-support

Conversation

CopilotAI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Annotates the platform-specific DllImport / LibraryImport / UnmanagedCallersOnly declarations under src/libraries/Common/src/Interop/Windows/** with [SupportedOSPlatform("windows")], and annotates or gates their callers accordingly.

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

Contributes to #132776

Scope

  • Windows interop only — all 38 modules under src/libraries/Common/src/Interop/Windows/. Unix/macOS interop is not part of this change.
  • The attribute is guarded with #if NET so the shared files still compile for netstandard/netfx consumers (e.g. TestUtilities on net481), where SupportedOSPlatformAttribute does not exist.

Approach

  • Declarations. Every Windows P/Invoke / UnmanagedCallersOnly declaration is annotated. Type-level (coarse) annotation is used on the Interop. partial class where safe; per-method annotation is used where a module's const/struct/enum members are consumed by cross-platform code — e.g. the public enums in System.Net.Primitives (SslProtocols, SocketError, …) whose values derive from Interop.SChannel.* / Interop.Winsock.* / Interop.Crypt32.* — so those members stay platform-neutral. Kernel32, Advapi32, Crypt32, BCrypt, and WinSock are per-method; the remaining modules are type-level.
  • Managed wrapper helpers. A helper that calls an annotated P/Invoke is itself annotated [SupportedOSPlatform("windows")] whenever all of its callers are Windows-only, rather than suppressing the warning with a pragma. A #pragma warning disable CA1416 is used only where the requirement cannot be expressed as an annotation: (1) Windows-only-compiled implementation files (*.Windows.cs) whose members are invoked by their cross-platform partial siblings, and (2) the few helpers whose managed entry point is genuinely cross-platform — Interop.GetRandomBytes (the platform-abstracted RNG) and Kernel32.GetMessage (reached through the portable Win32Marshal error path).
  • Callers. Cross-platform files in System.Private.CoreLib reach Windows-only interop only through compile-time gates (#if TARGET_WINDOWS, #if FEATURE_COMINTEROP, *.Windows.cs, *.Nls.cs) that CA1416 cannot observe; those files carry scoped or file-level suppressions where a Windows annotation would incorrectly propagate to portable code.

Validation

  • System.Private.CoreLib builds clean with no CA1416 diagnostics on Windows (CoreCLR and NativeAOT) and on browser/wasm.
  • Cross-platform consumers — System.Net.*, System.Security.Cryptography, System.Diagnostics.*, System.IO.*, System.Console, System.DirectoryServices.Protocols, and others — build clean across all target frameworks, including browser, wasi, unix, linux, osx, and android.
  • netstandard/net481 consumers of the shared interop build clean.

Note

This pull request was authored with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI changed the title [WIP] Annotate DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]Research: scope [SupportedOSPlatform] annotation of interop declarationsAug 26, 2026
CopilotAI requested a review from pavelsavaraAugust 26, 2026 13:22
@pavelsavara

This comment was marked as outdated.

…oreLib callers
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>

This comment was marked as outdated.

@pavelsavarapavelsavara changed the title Research: scope [SupportedOSPlatform] annotation of interop declarationsAnnotate Windows interop declarations with [SupportedOSPlatform("windows")]Aug 27, 2026
@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-extra-platforms

@pavelsavara
pavelsavara marked this pull request as ready for review August 28, 2026 21:45
CopilotAI lite review requested due to automatic review settings August 28, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR broadly annotates Windows-specific interop declarations with [SupportedOSPlatform("windows")] and updates/gates callers (primarily via CA1416 suppressions in Windows-only or Windows-gated code) so platform-compatibility analysis and wasm P/Invoke scanning can correctly skip Windows-only entrypoints.

Changes:

  • Add [SupportedOSPlatform("windows")] annotations across Windows interop declarations under src/libraries/Common/src/Interop/Windows/** (and select other Windows-only declarations).
  • Add #pragma warning disable CA1416 (and a few scoped disable/restore blocks) in Windows-only or Windows-gated call sites across CoreLib/Common/NativeAOT.
  • Add/adjust a few Windows-only managed helpers / callbacks to carry platform annotations.

Reviewed changes

Copilot reviewed 300 out of 758 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.WindowsThreadPool.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Security/SecureString.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/MemoryFailPoint.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/RuntimeInformation.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.csScoped CA1416 suppression around TARGET_WINDOWS interop call
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.csScoped CA1416 suppression around TARGET_WINDOWS COM interop
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystemInfo.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/IO/DriveInfoInternal.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/IO/Directory.Windows.csFile-level CA1416 suppression for Windows implementation called by cross-platform partial
src/libraries/System.Private.CoreLib/src/System/Guid.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/IdnMapping.Nls.csFile-level CA1416 suppression for Windows-only NLS interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSourceHelper.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/libraries/System.Private.CoreLib/src/System/AppDomain.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.csFile-level CA1416 suppression for Windows-only registry interop usage
src/libraries/System.Private.CoreLib/src/Internal/Console.Windows.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.csAdd SupportedOSPlatform to UnmanagedCallersOnly callback
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.csAdd SupportedOSPlatform to Windows-only LibraryImport
src/libraries/Common/src/System/Threading/AsyncOverSyncWithIoCancellation.csAdd SupportedOSPlatform to Windows-only helper type
src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.csFile-level CA1416 suppression for Windows implementation invoked by cross-platform partial
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.csFile-level CA1416 suppression for Windows-gated interop usage
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.csMark WtsApi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.Constants.csMark WtsApi32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.csMark Wldap32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.csMark Wkscli interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.csMark Winsock P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.csMark WinMM interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.csMark WinHTTP interop as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.csMark WinHTTP types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.SafeWinHttpHandle.csMark WinHTTP safe handle as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.csMark Windows WebSocket interop as Windows-only
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.Structs.csMark Windows WebSocket structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VSFixedFileInfo.csMark Version interop structs as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfoType.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/Version/Interop.FileVersionInfo.csMark Version interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WndProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Win32SystemColors.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.HIGHCONTRASTW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.csMark User32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/User32/Interop.Constants.csMark User32 constants as Windows-only
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.csMark ucrtbase interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/NegotiationInfoClass.csMark SspiCli helper as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TokenSource.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SecurityLogonType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.QuotaLimits.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbS4uLogin.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.KerbLogonSubmitType.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.AuthenticationPackageNames.csMark SspiCli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.csMark Shell32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaLogonProcessSafeHandle.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaFreeReturnBuffer.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaDeregisterLogonProcess.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaConnectUntrusted.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.LsaCallAuthenticationPackage.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.csMark Secur32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.csMark PerfCounter interop as Windows-only
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.csMark PDH interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantChangeTypeEx.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.GetErrorInfo.csMark OleAut32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetContextToken.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.csMark Ole32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_PROCESS_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.SYSTEM_LEAP_SECOND_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlInitUnicodeString.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.PROCESS_BASIC_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.csMark NtDll interop as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.IO_STATUS_BLOCK.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_INFORMATION_CLASS.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NtDll/Interop.FILE_FULL_DIR_INFORMATION.csMark NtDll interop types as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.csMark Normaliz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.csMark Netutils interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.NetApiBufferFree.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.I_NetLogonControl2.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleGetPrimaryDomainInformation.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsRoleFreeMemory.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetSiteName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcOpen.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcNext.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcName.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsGetDcClose.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DsEnumerateDomainTrustsW.csMark Netapi32 interop as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAINTRUST_FLAG.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/Netapi32/Interop.DS_DOMAIN_TRUSTS.csMark Netapi32 types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.UiPolicy.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.csMark NCrypt interop types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDecapsulateEncapsulate.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptBuffer.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.csMark NCrypt constants as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.ErrorCode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.csMark NCrypt interop as Windows-only
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.AsymmetricPaddingMode.csMark NCrypt types as Windows-only
src/libraries/Common/src/Interop/Windows/Mincore/Interop.WaitOnAddress.csMark Mincore interop as Windows-only
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.csMark Logoncli interop as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Sleep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResumeThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumberEx.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommandLine.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFile.csMark Kernel32 helper as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.csMark Kernel32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.csMark IpHlpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.IP_ADDR_STRING.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.csMark IpHlpApi types/constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.FIXED_INFO.csMark IpHlpApi structs as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ErrorCodes.csMark IpHlpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceNameToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToName.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceLuidToIndex.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ConvertInterfaceIndexToLuid.csMark IpHlpApi P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.csMark HttpApi interop as Windows-only
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.ErrorCodes.csMark HttpApi constants as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.csMark Dsrole types as Windows-only
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.csMark Dsrole P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsTypes.csMark Dnsapi types as Windows-only
src/libraries/Common/src/Interop/Windows/Dnsapi/Interop.DnsApi.csMark Dnsapi interop as Windows-only
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.csMark CryptUI interop as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.csMark Crypt32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.csMark Credui interop as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptVerifySignature.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSecretAgreement.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.csFile-level CA1416 suppression for cross-platform RNG entrypoint
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinalizeKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroySecret.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.csMark BCrypt P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.csMark Authz interop as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.csMark Advapi32 P/Invoke as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.FreeADsMem.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsSetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsGetLastError.csMark Activeds interop as Windows-only
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsEncodeBinaryData.csMark Activeds interop as Windows-only
src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.csFile-level CA1416 suppression for Windows-only OLE Automation interop
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Environment.NativeAot.Windows.csFile-level CA1416 suppression for Windows-only interop usage
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Windows.csFile-level CA1416 suppression for Windows-only interop usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings August 29, 2026 08:42

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details
  • Files reviewed: 300/758 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

#if TARGET_WINDOWS
private static unsafe IntPtr GetProcAddressWithMangling(IntPtr hModule, byte* methodName, MethodFixupCell* pCell)
{
#pragma warning disable CA1416 // Only reached on Windows via TARGET_WINDOWS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need suppressions like this? Is this a bug in the analyzer? Can you link the bug so we can delete these once the bug is fixed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform neutral CoreLib is compiled with MSBuild TargetOS set to the same platform as the machine doing the compilation.
Therefore TargetsWindows is true.
Therefore #if TARGET_WINDOWS is true, not false.

As a consequence, platform neutral CoreLib has those calls included and we get the CA1416.

Any idea what to do with that would be appreciated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is platform neutral corelib? Where/how do we build it and what's the purpose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, "neutral corelib" is wrong angle. And maybe I'm confused about TargetsWindows values.

It's those Windows P/Invokes sit in the unconditionally-compiled part of CoreLib, so they land in every CoreLib flavor including browser.

The NLS/Normaliz declarations aren't under TargetsWindows at all — they're unconditional.

@MichalStrehovsky

Copy link
Copy Markdown
Member

This lets the wasm CoreCLR P/Invoke scan (PInvokeCollector) skip these declarations on browser/wasi — removing WASM0066 noise at the source — and makes them visible to CA1416 platform-compatibility analysis.

How are we ending up with these DllImports under WASM in the first place? I would have expect us not to compile these in the first place under WASM. And why Windows specifically and not macOS/Linux?

@pavelsavara

Copy link
Copy Markdown
Member

How are we ending up with these DllImports under WASM in the first place?

Platform neutral CoreLib contains windows calls.

And why Windows specifically and not macOS/Linux?

I think we ship the runtime pack from windows machine.

This PR focuses on Windows only and I think we need to annotate OSX and Unix too (for consistency).

I just wanted to do that in a separate PRs.

@pavelsavara
pavelsavara marked this pull request as draft August 31, 2026 18:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate all DllImport/LibraryImport/UnmanagedCallersOnly with [SupportedOSPlatform]

4 participants

@pavelsavara@MichalStrehovsky