324 writes to SetLastError
csc (3)
src\Compilers\Shared\NativeMethods.cs (3)
69[DllImport("kernel32.dll", SetLastError = true)] 76[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 93[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
Microsoft.Build.Framework (22)
NativeMethods.cs (22)
965[DllImport("kernel32.dll", SetLastError = true)] 969[DllImport("kernel32.dll", SetLastError = true)] 973[DllImport("kernel32.dll", SetLastError = true)] 1665[DllImport("libc", SetLastError = true)] 1669[DllImport("libc", SetLastError = true)] 1682[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 1687[DllImport("kernel32.dll", PreserveSig = true, SetLastError = true)] 1692[DllImport("kernel32.dll", PreserveSig = true, BestFitMapping = false, ThrowOnUnmappableChar = true, CharSet = CharSet.Ansi, SetLastError = true)] 1696[DllImport("kernel32.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true)] 1706[DllImport(kernel32Dll, SetLastError = true, CharSet = CharSet.Unicode)] 1725[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 1730[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "SetCurrentDirectory")] 1753[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 1766[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 1778[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 1782[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 1802SetLastError = true)] 1813[DllImport("kernel32.dll", SetLastError = true)] 1821[DllImport("kernel32.dll", SetLastError = true)] 1826[DllImport("kernel32.dll", SetLastError = true)] 1830[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 1835[DllImport("libc", SetLastError = true)]
Microsoft.Build.Tasks.CodeAnalysis (3)
src\Compilers\Shared\NativeMethods.cs (3)
69[DllImport("kernel32.dll", SetLastError = true)] 76[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 93[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
Microsoft.Build.Tasks.CodeAnalysis.Sdk (3)
src\Compilers\Shared\NativeMethods.cs (3)
69[DllImport("kernel32.dll", SetLastError = true)] 76[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 93[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
7759[DllImport("kernel32.dll", SetLastError = true)] 7761[DllImport("kernel32.dll", SetLastError = true)]
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Emit\ResourceTests.cs (2)
26[DllImport("kernel32.dll", SetLastError = true)] 28[DllImport("kernel32.dll", SetLastError = true)]
Microsoft.CodeAnalysis.Features (2)
SymbolSearch\Windows\NativePatching.cs (2)
50[DllImport("msdelta.dll", SetLastError = true)] 58[DllImport("msdelta.dll", SetLastError = true)]
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\BrokeredServiceBase.cs (1)
204[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
Microsoft.CodeAnalysis.Remote.Workspaces (1)
BrokeredServiceConnection.cs (1)
414[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
Microsoft.CodeAnalysis.Test.Utilities (3)
Win32Res.cs (3)
20[DllImport("kernel32.dll", SetLastError = true)] 22[DllImport("kernel32.dll", SetLastError = true)] 26[DllImport("kernel32.dll", SetLastError = true)]
Microsoft.DotNet.RemoteExecutor (2)
MiniDump.cs (1)
38[DllImport("DbgHelp.dll", SetLastError = true)]
RemoteInvokeHandle.cs (1)
82[DllImport("kernel32.dll", SetLastError = true, EntryPoint = "GlobalMemoryStatusEx")]
Microsoft.DotNet.SignCheckLibrary (5)
Interop\WinCrypt.cs (4)
172[DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] 186[DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] 194[DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] 214[DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)]
Interop\WinTrust.cs (1)
14[DllImport("wintrust.dll", SetLastError = true)]
Microsoft.Extensions.Diagnostics.ResourceMonitoring (8)
Windows\Interop\JobObjectInfo.cs (5)
329[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] 345[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] 363[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] 376[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] 390[DllImport("kernel32.dll", SetLastError = true)]
Windows\Interop\MemoryInfo.Native.cs (1)
24[DllImportAttr("kernel32.dll", SetLastError = true)]
Windows\Network\WindowsTcpStateInfo.cs (2)
211[DllImport("Iphlpapi.dll", SetLastError = true)] 222[DllImport("Iphlpapi.dll", SetLastError = true)]
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
349[DllImport("libc", SetLastError = true)]
Microsoft.VisualStudio.LanguageServices (2)
Utilities\ClipboardHelpers.cs (2)
30[DllImport("kernel32.dll", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)] 33[DllImport("kernel32.dll", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)]
PrepareTests (2)
MinimizeUtil.cs (2)
298[DllImport("Kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 302[DllImport("libc", SetLastError = true)]
PresentationCore (21)
MS\Win32\UnsafeNativeMethodsPointer.cs (17)
521[DllImport(DllImport.User32, EntryPoint = "GetPointerDevices", SetLastError = true)] 527[DllImport(DllImport.User32, EntryPoint = "GetPointerDeviceCursors", SetLastError = true)] 533[DllImport(DllImport.User32, EntryPoint = "GetPointerInfo", SetLastError = true)] 539[DllImport(DllImport.User32, EntryPoint = "GetPointerInfoHistory", SetLastError = true)] 545[DllImport(DllImport.User32, EntryPoint = "GetPointerDeviceProperties", SetLastError = true)] 551[DllImport(DllImport.User32, EntryPoint = "GetPointerDeviceRects", SetLastError = true)] 557[DllImport(DllImport.User32, EntryPoint = "GetPointerCursorId", SetLastError = true)] 563[DllImport(DllImport.User32, EntryPoint = "GetPointerPenInfo", SetLastError = true)] 569[DllImport(DllImport.User32, EntryPoint = "GetPointerTouchInfo", SetLastError = true)] 575[DllImport(DllImport.User32, EntryPoint = "GetRawPointerDeviceData", SetLastError = true)] 593[DllImport(DllImport.NInput, EntryPoint = "CreateInteractionContext", SetLastError = true)] 600[DllImport(DllImport.NInput, EntryPoint = "DestroyInteractionContext", SetLastError = true)] 609[DllImport(DllImport.NInput, EntryPoint = "SetInteractionConfigurationInteractionContext", SetLastError = true)] 618[DllImport(DllImport.NInput, EntryPoint = "RegisterOutputCallbackInteractionContext", SetLastError = true, PreserveSig = false)] 627[DllImport(DllImport.NInput, EntryPoint = "SetPropertyInteractionContext", SetLastError = true)] 636[DllImport(DllImport.NInput, EntryPoint = "BufferPointerPacketsInteractionContext", SetLastError = true, PreserveSig = false)] 643[DllImport(DllImport.NInput, EntryPoint = "ProcessBufferedPacketsInteractionContext", SetLastError = true, PreserveSig = false)]
System\Windows\Media\UnsafeNativeMethodsMilCoreApi.cs (4)
1060[DllImport(DllImport.Mscms, EntryPoint = "DeleteColorTransform", SetLastError = true)] 1069[DllImport(DllImport.Mscms, EntryPoint = "CloseColorProfile", SetLastError = true)] 1072[DllImport(DllImport.Mscms, EntryPoint = "GetColorProfileHeader", SetLastError = true)] 1081[DllImport(DllImport.Mscms, EntryPoint = "GetColorProfileFromHandle", SetLastError = true)]
PresentationFramework (48)
MS\Internal\WindowsRuntime\Generated\WinRT.cs (3)
35[DllImport("kernel32.dll", SetLastError = true)] 39[DllImport("kernel32.dll", SetLastError = true)] 52[DllImport("kernel32.dll", SetLastError = true)]
System\Windows\Standard\NativeMethods.cs (45)
1379[DllImport("gdi32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 2276[DllImport("user32.dll", EntryPoint = "AdjustWindowRectEx", SetLastError = true)] 2291[DllImport("user32.dll", EntryPoint = "ChangeWindowMessageFilter", SetLastError = true)] 2295[DllImport("user32.dll", EntryPoint = "ChangeWindowMessageFilterEx", SetLastError = true)] 2375[DllImport("gdi32.dll", EntryPoint = "CreateDIBSection", SetLastError = true)] 2378[DllImport("gdi32.dll", EntryPoint = "CreateDIBSection", SetLastError = true)] 2402[DllImport("gdi32.dll", EntryPoint = "CreateRoundRectRgn", SetLastError = true)] 2415[DllImport("gdi32.dll", EntryPoint = "CreateRectRgn", SetLastError = true)] 2428[DllImport("gdi32.dll", EntryPoint = "CreateRectRgnIndirect", SetLastError = true)] 2444[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CreateWindowExW")] 2493[DllImport("user32.dll", SetLastError = true)] 2591[DllImport("user32.dll", EntryPoint = "RemoveMenu", SetLastError = true)] 2603[DllImport("user32.dll", EntryPoint = "DrawMenuBar", SetLastError = true)] 2621[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 2625[DllImport("kernel32.dll", SetLastError = true)] 2629[DllImport("user32.dll", EntryPoint = "GetClientRect", SetLastError = true)] 2677[DllImport("kernel32.dll", EntryPoint = "GetModuleFileName", CharSet = CharSet.Unicode, SetLastError = true)] 2704[DllImport("kernel32.dll", EntryPoint = "GetModuleHandleW", CharSet = CharSet.Unicode, SetLastError = true)] 2717[DllImport("user32.dll", EntryPoint = "GetMonitorInfo", SetLastError = true)] 2731[DllImport("gdi32.dll", EntryPoint = "GetStockObject", SetLastError = true)] 2791[DllImport("user32.dll", SetLastError = true)] 2805[DllImport("user32.dll", EntryPoint = "GetWindowRect", SetLastError = true)] 2844[DllImport("kernel32.dll", EntryPoint = "LocalFree", SetLastError = true)] 2850[DllImport("user32.dll", EntryPoint = "PostMessage", SetLastError = true)] 2862[DllImport("user32.dll", SetLastError = true, EntryPoint = "RegisterClassExW")] 2879[DllImport("user32.dll", EntryPoint = "RegisterWindowMessage", SetLastError = true, CharSet = CharSet.Unicode)] 2892[DllImport("user32.dll", EntryPoint = "SetActiveWindow", SetLastError = true)] 2917[DllImport("user32.dll", EntryPoint = "SetClassLong", SetLastError = true)] 2920[DllImport("user32.dll", EntryPoint = "SetClassLongPtr", SetLastError = true)] 2923[DllImport("kernel32.dll", SetLastError = true)] 2926[DllImport("kernel32.dll", SetLastError = true, EntryPoint = "SetProcessWorkingSetSize")] 2948[DllImport("user32.dll", EntryPoint = "SetWindowRgn", SetLastError = true)] 2960[DllImport("user32.dll", EntryPoint = "SetWindowPos", SetLastError = true)] 2975[DllImport("shell32.dll", SetLastError = false)] 2982[DllImport("user32.dll", EntryPoint = "SystemParametersInfoW", SetLastError = true)] 2987[DllImport("user32.dll", EntryPoint = "SystemParametersInfoW", SetLastError = true, CharSet = CharSet.Unicode)] 2992[DllImport("user32.dll", EntryPoint = "SystemParametersInfoW", SetLastError = true, CharSet = CharSet.Unicode)] 3035[DllImport("gdi32.dll", EntryPoint = "SelectObject", SetLastError = true)] 3048[DllImport("gdi32.dll", EntryPoint = "SelectObject", SetLastError = true)] 3061[DllImport("user32.dll", SetLastError = true)] 3065[DllImport("user32.dll", SetLastError = true)] 3068[DllImport("user32.dll", EntryPoint = "UnregisterClass", SetLastError = true)] 3072[DllImport("user32.dll", EntryPoint = "UnregisterClass", CharSet = CharSet.Unicode, SetLastError = true)] 3092[DllImport("user32.dll", SetLastError = true, EntryPoint = "UpdateLayeredWindow")] 3105[DllImport("user32.dll", SetLastError = true, EntryPoint = "UpdateLayeredWindow")]
PresentationUI (1)
MS\Internal\Documents\Application\CommandEnforcer.cs (1)
201[DllImport("msdrm.dll", SetLastError = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
ReachFramework (12)
MS\Internal\Printing\Configuration\UnsafeNativeMethods.cs (11)
242[DllImport(ExternDll.Winspool, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 250[DllImport(ExternDll.Winspool, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 258[DllImport(ExternDll.Winspool, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 266[DllImport(ExternDll.Winspool, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 275[DllImport(ExternDll.Winspool, ExactSpelling = true, SetLastError = true)] 278[DllImport(ExternDll.Gdi32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 281[DllImport(ExternDll.Gdi32, ExactSpelling = true, SetLastError = true)] 284[DllImport(ExternDll.Gdi32, ExactSpelling = true, SetLastError = true)] 287[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 290[DllImport(ExternDll.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 293[DllImport(ExternDll.Kernel32, ExactSpelling = true, SetLastError = true)]
PrintSystemExceptions\InteropWin32ApiThunk.cs (1)
26SetLastError=true,
Replay (3)
src\Compilers\Shared\NativeMethods.cs (3)
69[DllImport("kernel32.dll", SetLastError = true)] 76[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 93[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
System.Drawing.Common.Tests (1)
System\Drawing\SystemFontsTests.cs (1)
102[DllImport("kernel32.dll", SetLastError = false, CharSet = CharSet.Auto)]
System.Private.CoreLib (1)
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
2220attribute.SetLastError = (flags & PInvokeAttributes.SupportsLastError) != 0;
System.Private.Windows.Core (6)
Windows\Win32\PInvokeCore.GetClassLong.cs (2)
12[DllImport(Libraries.User32, SetLastError = true)] 16[DllImport(Libraries.User32, SetLastError = true)]
Windows\Win32\PInvokeCore.GetWindowLong.cs (2)
10[DllImport(Libraries.User32, SetLastError = true)] 13[DllImport(Libraries.User32, SetLastError = true)]
Windows\Win32\PInvokeCore.SetWindowLong.cs (2)
10[DllImport(Libraries.User32, SetLastError = true)] 13[DllImport(Libraries.User32, SetLastError = true)]
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodDecoder.cs (1)
147SetLastError = (a & MethodImportAttributes.SetLastError) != 0,
System.Windows.Controls.Ribbon (3)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (3)
320[DllImport("user32.dll", EntryPoint = "GetMonitorInfo", CharSet = CharSet.Auto, SetLastError = true)] 347[DllImport("gdi32.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 350[DllImport("user32.dll", SetLastError = true, ExactSpelling = true, EntryPoint = "GetDC", CharSet = CharSet.Auto)]
System.Windows.Forms.Interop.Tests (1)
PropertyGridTests.cs (1)
146[DllImport("kernel32", SetLastError = true)]
System.Windows.Forms.Primitives.Tests (1)
System\Windows\Forms\DeviceContextScopeTests.cs (1)
12[DllImport(Libraries.Gdi32, SetLastError = true, ExactSpelling = true)]
System.Windows.Forms.Primitives.TestUtilities (3)
PlatformDetection.Windows.cs (3)
221[DllImport("advapi32.dll", SetLastError = true, ExactSpelling = true)] 240[DllImport("kernel32.dll", SetLastError = false)] 277[DllImport("advapi32.dll", SetLastError = true, ExactSpelling = true)]
TlsFeaturesObserve (2)
HttpSys\HttpSysConfigurator.cs (2)
109[DllImport("httpapi.dll", SetLastError = true)] 115[DllImport("httpapi.dll", SetLastError = true)]
UIAutomationClient (31)
MS\Win32\SafeNativeMethods.cs (8)
69[DllImport("user32.dll", SetLastError = true)] 136[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)] 139[DllImport("user32.dll", SetLastError = true)] 154[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 157[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 176[DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] 191[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 198[DllImport("Psapi.dll", CharSet = CharSet.Auto, SetLastError = true)]
MS\Win32\UnsafeNativeMethods.cs (16)
24[DllImport("kernel32.dll", SetLastError = true)] 36[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 92[DllImport("user32.dll", SetLastError = true)] 106[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 109[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 145[DllImport("oleacc.dll", SetLastError = true)] 187[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 191[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 197[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 217[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 233[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 300[DllImport("user32.dll", SetLastError = true)] 325[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 328[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 335[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 360[DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (7)
40[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongWrapper", CharSet=CharSet.Auto, SetLastError=true)] 43[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongPtrWrapper", CharSet=CharSet.Auto, SetLastError=true)] 46[DllImport(PresentationNativeDll, EntryPoint="GlobalDeleteAtomWrapper", ExactSpelling = true, SetLastError = true)] 51[DllImport(PresentationNativeDll, EntryPoint="GetMenuBarInfoWrapper", SetLastError = true)] 54[DllImport(PresentationNativeDll, EntryPoint="GetWindowWrapper", ExactSpelling = true, SetLastError = true)] 57[DllImport(PresentationNativeDll, EntryPoint="MapWindowPointsWrapper", SetLastError = true, ExactSpelling=true, CharSet=CharSet.Auto)] 60[DllImport(PresentationNativeDll, EntryPoint="MapWindowPointsWrapper", SetLastError = true, ExactSpelling=true, CharSet=CharSet.Auto)]
UIAutomationClientSideProviders (55)
MS\Win32\SafeNativeMethods.cs (3)
18[DllImport(ExternDll.User32, SetLastError = true)] 26[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 28[DllImport(ExternDll.User32, SetLastError = true)]
MS\Win32\UnsafeNativeMethods.cs (41)
19[DllImport(ExternDll.Gdi32, SetLastError = true)] 26[DllImport(ExternDll.Kernel32, SetLastError = true)] 28[DllImport(ExternDll.Kernel32, SetLastError = true)] 33[DllImport(ExternDll.Kernel32, SetLastError = true)] 45[DllImport(ExternDll.Kernel32, SetLastError = true)] 47[DllImport(ExternDll.Kernel32, SetLastError = true)] 49[DllImport(ExternDll.Kernel32, SetLastError = true)] 51[DllImport(ExternDll.Kernel32, SetLastError = true)] 61[DllImport(ExternDll.Kernel32, SetLastError = true)] 63[DllImport(ExternDll.Kernel32, SetLastError = true)] 65[DllImport(ExternDll.Kernel32, SetLastError = true)] 82[DllImport("oleacc.dll", SetLastError=true)] 120[DllImport(ExternDll.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] 126[DllImport(ExternDll.User32, ExactSpelling = true, SetLastError = true)] 142[DllImport(ExternDll.User32, SetLastError = true)] 146[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 148[DllImport(ExternDll.User32, SetLastError = true)] 158[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 162[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 164[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 166[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 168[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 170[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 172[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 190[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 192[DllImport(ExternDll.User32, SetLastError = true)] 196[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 225[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 231[DllImport(ExternDll.User32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)] 233[DllImport(ExternDll.User32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)] 245[DllImport(ExternDll.User32, SetLastError = true)] 247[DllImport(ExternDll.User32, SetLastError = true)] 253[DllImport(ExternDll.User32, ExactSpelling = true, SetLastError = true)] 259[DllImport(ExternDll.User32, ExactSpelling = true, SetLastError = true)] 261[DllImport(ExternDll.User32, SetLastError = true)] 263[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] 265[DllImport(ExternDll.User32, ExactSpelling = true, SetLastError = true)] 271[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 276[DllImport(ExternDll.User32, ExactSpelling = true, SetLastError = true)] 362[DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)] 426[DllImport(ExternDll.User32, ExactSpelling = true, SetLastError = true)]
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (11)
40[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongWrapper", CharSet=CharSet.Auto, SetLastError=true)] 43[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongPtrWrapper", CharSet=CharSet.Auto, SetLastError=true)] 46[DllImport(PresentationNativeDll, EntryPoint="GlobalDeleteAtomWrapper", ExactSpelling = true, SetLastError = true)] 68[DllImport(PresentationNativeDll, EntryPoint="FindWindowExWrapper", CharSet = CharSet.Unicode, SetLastError = true)] 71[DllImport(PresentationNativeDll, EntryPoint="GetMenuBarInfoWrapper", SetLastError = true)] 74[DllImport(PresentationNativeDll, EntryPoint="GetTextExtentPoint32Wrapper", SetLastError = true)] 77[DllImport(PresentationNativeDll, EntryPoint="GetWindowWrapper", ExactSpelling = true, SetLastError = true)] 80[DllImport(PresentationNativeDll, EntryPoint = "GetWindowTextWrapper", CharSet=CharSet.Auto, BestFitMapping = false, SetLastError = true)] 83[DllImport(PresentationNativeDll, EntryPoint="MapWindowPointsWrapper", ExactSpelling = true, SetLastError = true)] 86[DllImport(PresentationNativeDll, EntryPoint="MapWindowPointsWrapper", ExactSpelling = true, SetLastError = true)] 89[DllImport(PresentationNativeDll, EntryPoint="SetScrollPosWrapper", SetLastError = true)]
UIAutomationTypes (63)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
194[DllImport(ExternDll.Gdi32, ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)]
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (16)
95[DllImport(PresentationNativeDll, EntryPoint="EnableWindowWrapper", SetLastError = true, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] 101[DllImport(PresentationNativeDll, EntryPoint="GetKeyboardLayoutListWrapper", SetLastError = true, ExactSpelling=true, CharSet=CharSet.Auto)] 104[DllImport(PresentationNativeDll, EntryPoint="GetParentWrapper", SetLastError = true)] 107[DllImport(PresentationNativeDll, EntryPoint="GetWindowWrapper", ExactSpelling = true, SetLastError = true)] 110[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongWrapper", CharSet=CharSet.Auto, SetLastError=true)] 113[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongWrapper", CharSet=CharSet.Auto, SetLastError=true)] 116[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongWrapper", CharSet=CharSet.Auto, SetLastError=true)] 119[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongPtrWrapper", CharSet=CharSet.Auto, SetLastError=true)] 122[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongPtrWrapper", CharSet=CharSet.Auto, SetLastError=true)] 125[DllImport(PresentationNativeDll, EntryPoint="GetWindowLongPtrWrapper", CharSet=CharSet.Auto, SetLastError=true)] 128[DllImport(PresentationNativeDll, EntryPoint = "GetWindowTextWrapper", CharSet=CharSet.Auto, BestFitMapping = false, SetLastError = true)] 131[DllImport(PresentationNativeDll, EntryPoint = "GetWindowTextLengthWrapper", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] 134[DllImport(PresentationNativeDll, EntryPoint="MapWindowPointsWrapper", SetLastError = true, ExactSpelling=true, CharSet=CharSet.Auto)] 137[DllImport(PresentationNativeDll, EntryPoint="SetFocusWrapper", SetLastError = true)] 146[DllImport(PresentationNativeDll, EntryPoint="SetWindowLongWrapper", CharSet=CharSet.Auto, SetLastError=true)] 155[DllImport(PresentationNativeDll, EntryPoint="SetWindowLongPtrWrapper", CharSet=CharSet.Auto, SetLastError=true)]
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (46)
53[DllImport(ExternDll.User32, EntryPoint = "SetWindowPos", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)] 56[DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)] 59[DllImport(ExternDll.Shcore, CharSet = CharSet.Auto, SetLastError = true)] 62[DllImport(ExternDll.User32, EntryPoint = "IsProcessDPIAware", CharSet = CharSet.Auto, SetLastError = true)] 65[DllImport(ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)] 68[DllImport(ExternDll.User32, EntryPoint = "EnableNonClientDpiScaling", CharSet = CharSet.Auto, SetLastError = true)] 71[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 74[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 80[DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, EntryPoint = "CreateCompatibleBitmap", CharSet = CharSet.Auto)] 83[DllImport(ExternDll.Gdi32, EntryPoint = "GetStockObject", SetLastError = true, CharSet = CharSet.Auto)] 86[DllImport(ExternDll.User32, EntryPoint = "FillRect", SetLastError = true, CharSet = CharSet.Auto)] 89[DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 105[DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, EntryPoint = "DeleteObject", CharSet = CharSet.Auto)] 108[DllImport(ExternDll.Gdi32, EntryPoint = "SelectObject", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 111[DllImport(ExternDll.User32, EntryPoint = "PrintWindow", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 158[DllImport(ExternDll.Shell32, CharSet = CharSet.Unicode, SetLastError = true)] 164[DllImport(ExternDll.Kernel32, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] 235[DllImport(ExternDll.Ole32, ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)] 238[DllImport(ExternDll.Kernel32, EntryPoint = "CloseHandle", CharSet = CharSet.Auto, SetLastError = true)] 261[DllImport(ExternDll.Kernel32, EntryPoint = "UnmapViewOfFile", CharSet = CharSet.Auto, SetLastError = true)] 303[DllImport(ExternDll.Gdi32, SetLastError = true, CharSet = CharSet.Auto)] 309[DllImport(ExternDll.User32, EntryPoint = "GetCursorPos", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)] 492[DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 498[DllImport(ExternDll.Kernel32, EntryPoint = "GetModuleHandle", CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)] 517[DllImport(ExternDll.Kernel32, SetLastError = true, EntryPoint = "GetProcAddress", CharSet = CharSet.Ansi, BestFitMapping = false)] 707[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] 734[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] 741[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] 750[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 753[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 756[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 759[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 762[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] 768[DllImport(ExternDll.User32, EntryPoint = "ClientToScreen", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 835[DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, EntryPoint = "GetDC", CharSet = CharSet.Auto)] 857[DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] 867[DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)] 870[DllImport(ExternDll.User32, SetLastError = true)] 889[DllImport(ExternDll.User32, EntryPoint = "DestroyIcon", CharSet = CharSet.Auto, SetLastError = true)] 910[DllImport(ExternDll.Gdi32, EntryPoint = "DeleteObject", CharSet = CharSet.Auto, SetLastError = true)] 954[DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = "CreateBitmap")] 969[DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = "CreateIconIndirect")] 1041[DllImport(ExternDll.User32, EntryPoint = "CreateWindowEx", CharSet = CharSet.Auto, BestFitMapping = false, SetLastError = true)] 1060[DllImport(ExternDll.User32, SetLastError = true, EntryPoint = "DestroyWindow", CharSet = CharSet.Auto)] 2653[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)] 2659[DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
vbc (3)
src\Compilers\Shared\NativeMethods.cs (3)
69[DllImport("kernel32.dll", SetLastError = true)] 76[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 93[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
VBCSCompiler (4)
src\Compilers\Server\VBCSCompiler\MemoryHelper.cs (1)
61[DllImport("kernel32.dll", SetLastError = true)]
src\Compilers\Shared\NativeMethods.cs (3)
69[DllImport("kernel32.dll", SetLastError = true)] 76[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 93[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
WindowsFormsIntegration (2)
MS\Win32\UnsafeNativeMethods.cs (1)
32[DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (1)
35[DllImport(PresentationNativeDll, EntryPoint="EnableWindowWrapper", SetLastError = true, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
7 references to SetLastError
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionTests.cs (1)
285Assert.True(dllImport.SetLastError);
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (1)
155nameof(DllImportAttribute.SetLastError),
LibraryImportGenerator.cs (1)
507NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.SetLastError));
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
385NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.SetLastError));
System.Private.CoreLib (1)
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
330new CustomAttributeNamedArgument(type.GetField("SetLastError")!, dllImport.SetLastError),
System.Reflection.MetadataLoadContext (2)
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.DllImport.cs (2)
47attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.SetLastError), ct[CoreType.Boolean], dia.SetLastError),