838 references to GetLastWin32Error
mscorlib (114)
microsoft\win32\win32native.cs (1)
1060
if (lo == -1 && ((hr = Marshal.
GetLastWin32Error
()) != 0))
system\console.cs (4)
985
int errorCode = Marshal.
GetLastWin32Error
();
1136
int errorCode = Marshal.
GetLastWin32Error
();
1292
int errorCode = Marshal.
GetLastWin32Error
();
1575
int errorCode = Marshal.
GetLastWin32Error
();
system\environment.cs (4)
635
if (Marshal.
GetLastWin32Error
() == Win32Native.ERROR_ENVVAR_NOT_FOUND) {
914
int errorCode = Marshal.
GetLastWin32Error
();
1018
if (r == IntPtr.Zero) BCLDebug.Assert(false, "SetEnvironmentVariable failed: " + Marshal.
GetLastWin32Error
());
1583
int errorCode = Marshal.
GetLastWin32Error
();
system\globalization\idnmapping.cs (4)
187
lastError = Marshal.
GetLastWin32Error
();
201
lastError = Marshal.
GetLastWin32Error
();
276
lastError = Marshal.
GetLastWin32Error
();
290
lastError = Marshal.
GetLastWin32Error
();
system\io\__consolestream.cs (2)
223
int errorCode = Marshal.
GetLastWin32Error
();
277
int errorCode = Marshal.
GetLastWin32Error
();
system\io\__error.cs (2)
125
int errorCode = Marshal.
GetLastWin32Error
();
195
int errorCode = Marshal.
GetLastWin32Error
();
system\io\directory.cs (14)
331
int currentError = Marshal.
GetLastWin32Error
();
468
int errorCode = Marshal.
GetLastWin32Error
();
505
int errorCode = Marshal.
GetLastWin32Error
();
542
int errorCode = Marshal.
GetLastWin32Error
();
1120
int errorCode = Marshal.
GetLastWin32Error
();
1195
int errorCode = Marshal.
GetLastWin32Error
();
1265
int hr = Marshal.
GetLastWin32Error
();
1374
hr = Marshal.
GetLastWin32Error
();
1413
hr = Marshal.
GetLastWin32Error
();
1432
hr = Marshal.
GetLastWin32Error
();
1450
hr = Marshal.
GetLastWin32Error
();
1466
hr = Marshal.
GetLastWin32Error
();
1478
hr = Marshal.
GetLastWin32Error
();
1519
int hr = Marshal.
GetLastWin32Error
();
system\io\directoryinfo.cs (1)
679
int hr = Marshal.
GetLastWin32Error
();
system\io\driveinfo.cs (3)
128
int errorCode = Marshal.
GetLastWin32Error
();
245
int errorCode = Marshal.
GetLastWin32Error
();
269
int errorCode = Marshal.
GetLastWin32Error
();
system\io\file.cs (11)
171
int errorCode = Marshal.
GetLastWin32Error
();
305
int hr = Marshal.
GetLastWin32Error
();
332
int errorCode = Marshal.
GetLastWin32Error
();
363
int errorCode = Marshal.
GetLastWin32Error
();
501
int errorCode = Marshal.
GetLastWin32Error
();
565
int errorCode = Marshal.
GetLastWin32Error
();
629
int errorCode = Marshal.
GetLastWin32Error
();
711
int hr = Marshal.
GetLastWin32Error
();
1378
dataInitialised = Marshal.
GetLastWin32Error
();
1431
dataInitialised = Marshal.
GetLastWin32Error
();
1467
int hr = Marshal.
GetLastWin32Error
();
system\io\fileinfo.cs (1)
349
int hr = Marshal.
GetLastWin32Error
();
system\io\filestream.cs (6)
384
int errorCode = Marshal.
GetLastWin32Error
();
856
int errorCode = Marshal.
GetLastWin32Error
();
1184
int hr = Marshal.
GetLastWin32Error
();
1482
int hr = Marshal.
GetLastWin32Error
();
2517
hr = Marshal.
GetLastWin32Error
();
2574
hr = Marshal.
GetLastWin32Error
();
system\io\filesystemenumerable.cs (4)
277
int hr = Marshal.
GetLastWin32Error
();
432
int hr = Marshal.
GetLastWin32Error
();
481
int hr = Marshal.
GetLastWin32Error
();
537
int hr = Marshal.
GetLastWin32Error
();
system\io\filesysteminfo.cs (1)
316
int hr = Marshal.
GetLastWin32Error
();
system\io\isolatedstorage\isolatedstoragefile.cs (2)
2466
hr = Marshal.
GetLastWin32Error
();
2494
hr = Marshal.
GetLastWin32Error
();
system\io\longpath.cs (10)
219
int errorCode = Marshal.
GetLastWin32Error
();
266
int hr = Marshal.
GetLastWin32Error
();
568
int currentError = Marshal.
GetLastWin32Error
();
657
int hr = Marshal.
GetLastWin32Error
();
755
hr = Marshal.
GetLastWin32Error
();
800
hr = Marshal.
GetLastWin32Error
();
824
hr = Marshal.
GetLastWin32Error
();
848
hr = Marshal.
GetLastWin32Error
();
868
hr = Marshal.
GetLastWin32Error
();
881
hr = Marshal.
GetLastWin32Error
();
system\io\path.cs (1)
913
int errorCode = Marshal.
GetLastWin32Error
();
system\io\pathhelper.cs (2)
255
int lastErr = Marshal.
GetLastWin32Error
();
294
int lastErr = Marshal.
GetLastWin32Error
();
system\runtime\interopservices\criticalhandle.cs (1)
199
int lastError = Marshal.
GetLastWin32Error
();
system\runtime\interopservices\marshal.cs (1)
846
int dwLastError =
GetLastWin32Error
();
system\security\accesscontrol\privilege.cs (6)
121
int error = Marshal.
GetLastWin32Error
();
210
cachingError = Marshal.
GetLastWin32Error
();
263
error = Marshal.
GetLastWin32Error
();
528
error = Marshal.
GetLastWin32Error
();
530
else if ( Win32Native.ERROR_NOT_ALL_ASSIGNED == Marshal.
GetLastWin32Error
())
645
error = Marshal.
GetLastWin32Error
();
system\security\accesscontrol\securitydescriptor.cs (1)
655
error = Marshal.
GetLastWin32Error
();
system\security\accesscontrol\win32.cs (1)
40
errorCode = Marshal.
GetLastWin32Error
();
system\security\cryptography\capinative.cs (10)
294
throw new CryptographicException(Marshal.
GetLastWin32Error
());
310
throw new CryptographicException(Marshal.
GetLastWin32Error
());
325
throw new CryptographicException(Marshal.
GetLastWin32Error
());
344
throw new CryptographicException(Marshal.
GetLastWin32Error
());
371
int errorCode = Marshal.
GetLastWin32Error
();
380
throw new CryptographicException(Marshal.
GetLastWin32Error
());
408
int errorCode = Marshal.
GetLastWin32Error
();
417
throw new CryptographicException(Marshal.
GetLastWin32Error
());
433
throw new CryptographicException(Marshal.
GetLastWin32Error
());
479
int error = Marshal.
GetLastWin32Error
();
system\security\principal\win32.cs (3)
218
ErrorCode = Marshal.
GetLastWin32Error
();
280
return Marshal.
GetLastWin32Error
();
397
return Marshal.
GetLastWin32Error
();
system\security\principal\windowsidentity.cs (8)
178
if (Marshal.
GetLastWin32Error
() == Win32Native.ERROR_INVALID_HANDLE)
188
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
415
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
423
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
868
hr = GetHRForWin32Error(Marshal.
GetLastWin32Error
());
946
int dwErrorCode = Marshal.
GetLastWin32Error
();
965
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
1054
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
system\security\principal\windowsimpersonationcontext.cs (1)
55
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
system\security\principal\windowsprincipal.cs (2)
247
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
255
throw new SecurityException(Win32Native.GetMessage(Marshal.
GetLastWin32Error
()));
system\threading\eventwaithandle.cs (3)
81
int errorCode = Marshal.
GetLastWin32Error
();
140
int errorCode = Marshal.
GetLastWin32Error
();
250
int errorCode = Marshal.
GetLastWin32Error
();
system\threading\mutex.cs (3)
389
errorCode = Marshal.
GetLastWin32Error
();
440
errorCode = Marshal.
GetLastWin32Error
();
470
errorCode = Marshal.
GetLastWin32Error
();
system\threading\timer.cs (1)
90
throw Marshal.GetExceptionForHR(Marshal.
GetLastWin32Error
());
PresentationCore (14)
Core\CSharp\MS\Internal\AppModel\CookieHandler.cs (1)
142
if (!throwIfNoCookie && Marshal.
GetLastWin32Error
() == NativeMethods.ERROR_NO_MORE_ITEMS)
Core\CSharp\MS\Internal\FontCache\FontCacheUtil.cs (1)
1053
Util.ThrowWin32Exception(Marshal.
GetLastWin32Error
(), fileName);
Core\CSharp\MS\Internal\IO\Packaging\ByteRangeDownloader.cs (1)
568
throw new Win32Exception(Marshal.
GetLastWin32Error
());
Core\CSharp\System\Windows\DataObject.cs (8)
1174
int win32Error = Marshal.
GetLastWin32Error
();
1211
int win32Error = Marshal.
GetLastWin32Error
();
1228
int win32Error = Marshal.
GetLastWin32Error
();
1247
int win32Error = Marshal.
GetLastWin32Error
();
1266
int win32Error = Marshal.
GetLastWin32Error
();
1284
int win32Error = Marshal.
GetLastWin32Error
();
1407
int win32Error = Marshal.
GetLastWin32Error
();
1695
int win32Error = Marshal.
GetLastWin32Error
(); // Dance around FxCop
Core\CSharp\System\Windows\Input\Cursor.cs (1)
214
int errorCode = Marshal.
GetLastWin32Error
();
Core\CSharp\System\Windows\Input\TextCompositionManager.cs (1)
525
int win32Err = Marshal.
GetLastWin32Error
();
Shared\MS\Internal\SafeSecurityHelper.cs (1)
72
int win32Err = Marshal.
GetLastWin32Error
();
PresentationFramework (6)
src\Framework\System\windows\Documents\CaretElement.cs (4)
1021
int win32Error = Marshal.
GetLastWin32Error
();
1058
int win32Error = Marshal.
GetLastWin32Error
();
1118
int win32Error = Marshal.
GetLastWin32Error
();
1130
win32Error = Marshal.
GetLastWin32Error
();
src\Framework\System\Windows\Documents\TextFindEngine.cs (1)
599
int win32Error = System.Runtime.InteropServices.Marshal.
GetLastWin32Error
();
src\Framework\System\Windows\Standard\ErrorCodes.cs (1)
129
return new Win32Error(Marshal.
GetLastWin32Error
());
SMDiagnostics (1)
System\ServiceModel\Diagnostics\SafeEventLogWriteHandle.cs (1)
30
int error = Marshal.
GetLastWin32Error
();
System (153)
compmod\microsoft\win32\SystemEvents.cs (1)
463
} while (atom == 0 && Marshal.
GetLastWin32Error
() == NativeMethods.ERROR_CLASS_ALREADY_EXISTS);
compmod\system\codedom\compiler\Executor.cs (2)
307
throw new ExternalException(SR.GetString(SR.ExecCantGetRetCode, cmd), Marshal.
GetLastWin32Error
());
320
int err = Marshal.
GetLastWin32Error
();
compmod\system\componentmodel\Win32Exception.cs (4)
41
public Win32Exception() : this(Marshal.
GetLastWin32Error
()) {
64
public Win32Exception( string message ) : this(Marshal.
GetLastWin32Error
(), message) {
74
nativeErrorCode = Marshal.
GetLastWin32Error
();
110
else if (Marshal.
GetLastWin32Error
() == SafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) {
net\System\Net\_SafeNetHandles.cs (8)
2591
if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.
GetLastWin32Error
();
2607
if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.
GetLastWin32Error
();
2617
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" + handle.ToString("x") + ") WSAEventSelect():" + (errorCode == SocketError.SocketError ? (SocketError)Marshal.
GetLastWin32Error
() : errorCode).ToString());
2624
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" + handle.ToString("x") + ") ioctlsocket#2():" + (errorCode == SocketError.SocketError ? (SocketError)Marshal.
GetLastWin32Error
() : errorCode).ToString());
2635
if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.
GetLastWin32Error
();
2662
if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.
GetLastWin32Error
();
2676
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" + handle.ToString("x") + ") closesocket#3():" + (errorCode == SocketError.SocketError ? (SocketError)Marshal.
GetLastWin32Error
() : errorCode).ToString());
3003
error = (_WinInetCache.Status)Marshal.
GetLastWin32Error
();
net\System\Net\_SecureChannel.cs (1)
1266
throw new CryptographicException(Marshal.
GetLastWin32Error
());
net\System\Net\_WinHttpWebProxyDataBuilder.cs (1)
48
int errorCode = Marshal.
GetLastWin32Error
();
net\System\Net\Cache\WinInetCache.cs (5)
245
entry.Error = (Status)Marshal.
GetLastWin32Error
();
344
entry.Error = (Status) Marshal.
GetLastWin32Error
();
380
entry.Error = (Status)Marshal.
GetLastWin32Error
();
407
newEntry.Error = (Status)Marshal.
GetLastWin32Error
();
505
entry.Error = (Status)Marshal.
GetLastWin32Error
();
net\System\Net\HttpListener.cs (1)
1006
throw new HttpListenerException(Marshal.
GetLastWin32Error
());
net\System\Net\HttpListenerException.cs (1)
17
public HttpListenerException() : base(Marshal.
GetLastWin32Error
())
net\System\Net\NetworkInformation\NetworkInformationException.cs (1)
26
public NetworkInformationException() : base(Marshal.
GetLastWin32Error
()) {
net\System\Net\NetworkInformation\ping.cs (1)
701
error = (int)Marshal.
GetLastWin32Error
();
net\System\Net\SocketException.cs (2)
29
public SocketException() : base(Marshal.
GetLastWin32Error
()) {
33
internal SocketException(EndPoint endPoint) : base(Marshal.
GetLastWin32Error
()) {
net\System\Net\Sockets\_AcceptOverlappedAsyncResult.cs (1)
89
if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.
GetLastWin32Error
();
net\System\Net\Sockets\_BaseOverlappedAsyncResult.cs (1)
369
socketError = (SocketError)Marshal.
GetLastWin32Error
();
net\System\Net\Sockets\_ConnectOverlappedAsyncResult.cs (1)
47
if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.
GetLastWin32Error
();
net\System\Net\Sockets\Socket.cs (43)
1353
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
1461
errorCode = (SocketError) Marshal.
GetLastWin32Error
();
1565
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
1788
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
1889
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
2011
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
2894
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
3029
errorCode = (SocketError) Marshal.
GetLastWin32Error
();
3236
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
3286
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
3533
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
3649
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
3767
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
4039
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
4279
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
4395
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
4598
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
4859
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
5095
errorCode = acceptedSocketHandle.IsInvalid ? (SocketError) Marshal.
GetLastWin32Error
() : SocketError.Success;
5250
errorCode = acceptedSocket.IsInvalid ? (SocketError) Marshal.
GetLastWin32Error
() : SocketError.Success;
5428
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
5645
errorCode = errorCode!=SocketError.SocketError ? SocketError.Success : (SocketError)Marshal.
GetLastWin32Error
();
6002
errorCode = (SocketError) Marshal.
GetLastWin32Error
();
6018
errorCode = (SocketError) Marshal.
GetLastWin32Error
();
6316
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") ioctlsocket(FIONBIO):" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.
GetLastWin32Error
() : errorCode).ToString());
6329
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") shutdown():" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.
GetLastWin32Error
() : errorCode).ToString());
6338
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") setsockopt():" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.
GetLastWin32Error
() : errorCode).ToString());
6365
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") ioctlsocket(FIONREAD):" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.
GetLastWin32Error
() : errorCode).ToString());
6784
errorCode = (SocketError) Marshal.
GetLastWin32Error
();
6931
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
7245
errorCode = (SocketError)Marshal.
GetLastWin32Error
();
7735
socketError = (SocketError)Marshal.
GetLastWin32Error
();
7844
socketError = (SocketError)Marshal.
GetLastWin32Error
();
7944
socketError = (SocketError)Marshal.
GetLastWin32Error
();
8023
socketError = (SocketError)Marshal.
GetLastWin32Error
();
8115
socketError = (SocketError)Marshal.
GetLastWin32Error
();
8192
socketError = (SocketError)Marshal.
GetLastWin32Error
();
8265
socketError = (SocketError)Marshal.
GetLastWin32Error
();
8326
socketError = (SocketError)Marshal.
GetLastWin32Error
();
8421
socketError = (SocketError)Marshal.
GetLastWin32Error
();
9838
socketError = (SocketError)Marshal.
GetLastWin32Error
();
9873
socketError = (SocketError)Marshal.
GetLastWin32Error
();
10060
socketError = (SocketError)Marshal.
GetLastWin32Error
();
net\System\Net\UnsafeNativeMethods.cs (1)
243
GlobalLog.Print("RasHelper::RasHelper() RasConnectionNotification() Marshal.GetLastWin32Error():" + Marshal.
GetLastWin32Error
());
net\System\Net\WebSockets\WebSocketException.cs (1)
25
: this(Marshal.
GetLastWin32Error
())
net\System\Net\WinHttpWebProxyFinder.cs (1)
244
int errorCode = Marshal.
GetLastWin32Error
();
security\system\security\cryptography\cryptoapi.cs (7)
2966
throw new CryptographicException(Marshal.
GetLastWin32Error
());
2975
throw new CryptographicException(Marshal.
GetLastWin32Error
());
3029
if (!rc && Marshal.
GetLastWin32Error
() == CAPI.NTE_BAD_KEYSET) {
3428
int dwErrorCode = Marshal.
GetLastWin32Error
();
3459
int dwErrorCode = Marshal.
GetLastWin32Error
();
3461
throw new CryptographicException(Marshal.
GetLastWin32Error
());
3672
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x500Name.cs (2)
147
throw new CryptographicException(Marshal.
GetLastWin32Error
());
158
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x509certificate2.cs (11)
169
throw new CryptographicException(Marshal.
GetLastWin32Error
());
183
throw new CryptographicException(Marshal.
GetLastWin32Error
());
623
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1200
int dwErrorCode = Marshal.
GetLastWin32Error
();
1204
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1212
int dwErrorCode = Marshal.
GetLastWin32Error
();
1216
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1338
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1363
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1382
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1410
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x509certificate2collection.cs (11)
322
throw new CryptographicException(Marshal.
GetLastWin32Error
());
328
throw new CryptographicException(Marshal.
GetLastWin32Error
());
340
throw new CryptographicException(Marshal.
GetLastWin32Error
());
348
throw new CryptographicException(Marshal.
GetLastWin32Error
());
367
throw new CryptographicException(Marshal.
GetLastWin32Error
());
378
throw new CryptographicException(Marshal.
GetLastWin32Error
());
598
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1086
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1098
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1124
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1136
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x509chain.cs (1)
235
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x509extension.cs (9)
133
throw new CryptographicException(Marshal.
GetLastWin32Error
());
158
throw new CryptographicException(Marshal.
GetLastWin32Error
());
222
throw new CryptographicException(Marshal.
GetLastWin32Error
());
240
throw new CryptographicException(Marshal.
GetLastWin32Error
());
269
throw new CryptographicException(Marshal.
GetLastWin32Error
());
322
throw new CryptographicException(Marshal.
GetLastWin32Error
());
352
throw new CryptographicException(Marshal.
GetLastWin32Error
());
433
throw new CryptographicException(Marshal.
GetLastWin32Error
());
467
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x509store.cs (3)
163
throw new CryptographicException(Marshal.
GetLastWin32Error
());
202
throw new CryptographicException(Marshal.
GetLastWin32Error
());
294
throw new CryptographicException(Marshal.
GetLastWin32Error
());
security\system\security\cryptography\x509\x509utils.cs (2)
361
throw new CryptographicException(Marshal.
GetLastWin32Error
());
373
throw new CryptographicException(Marshal.
GetLastWin32Error
());
services\monitoring\system\diagnosticts\CounterSampleCalculator.cs (1)
237
throw new Win32Exception( Marshal.
GetLastWin32Error
() );
services\monitoring\system\diagnosticts\EventLog.cs (2)
1028
else if (Marshal.
GetLastWin32Error
() != 87) { // Windows returns ERROR_INVALID_PARAMETER for special keys which were added in RS5+ but do not represent actual event logs.
1316
lastError = Marshal.
GetLastWin32Error
();
services\monitoring\system\diagnosticts\EventLogInternal.cs (5)
636
int error = Marshal.
GetLastWin32Error
();
899
error = Marshal.
GetLastWin32Error
();
1092
int error = Marshal.
GetLastWin32Error
();
1305
if (Marshal.
GetLastWin32Error
() != 0) {
1335
if (Marshal.
GetLastWin32Error
() != 0) {
services\monitoring\system\diagnosticts\Process.cs (4)
1485
if (Marshal.
GetLastWin32Error
() != NativeMethods.ERROR_SUCCESS) {
2093
errorCode = Marshal.
GetLastWin32Error
();
2128
errorCode = Marshal.
GetLastWin32Error
();
2846
_errorCode = Marshal.
GetLastWin32Error
();
services\monitoring\system\diagnosticts\ProcessManager.cs (2)
265
int result = Marshal.
GetLastWin32Error
();
291
int result = Marshal.
GetLastWin32Error
();
services\monitoring\system\diagnosticts\SharedPerformanceCounter.cs (3)
1213
int error = Marshal.
GetLastWin32Error
();
1590
if ((Marshal.
GetLastWin32Error
() != NativeMethods.ERROR_ACCESS_DENIED) || !fileMappingHandle.IsInvalid) {
1598
if ((Marshal.
GetLastWin32Error
() != NativeMethods.ERROR_FILE_NOT_FOUND) || !fileMappingHandle.IsInvalid) {
sys\system\io\ports\InternalResources.cs (2)
84
int errorCode = Marshal.
GetLastWin32Error
();
93
int errorCode = Marshal.
GetLastWin32Error
();
sys\system\io\ports\SerialStream.cs (8)
700
int errorCode = Marshal.
GetLastWin32Error
();
807
int hr = Marshal.
GetLastWin32Error
();
1242
if (Marshal.
GetLastWin32Error
() == NativeMethods.ERROR_COUNTER_TIMEOUT)
1561
hr = Marshal.
GetLastWin32Error
();
1611
hr = Marshal.
GetLastWin32Error
();
1741
int hr = Marshal.
GetLastWin32Error
();
1757
Debug.Assert(success, "waitCommEventWaitHandle.WaitOne() returned error " + Marshal.
GetLastWin32Error
());
1762
error = Marshal.
GetLastWin32Error
();
sys\system\threading\semaphore.cs (3)
73
int errorCode = Marshal.
GetLastWin32Error
();
140
int errorCode = Marshal.
GetLastWin32Error
();
275
int errorCode = Marshal.
GetLastWin32Error
();
System.AddIn (1)
System\Addin\Hosting\AddInProcess.cs (1)
331
throw new System.ComponentModel.Win32Exception(Marshal.
GetLastWin32Error
()); // call failed
System.Configuration (1)
System\Configuration\ClientConfigPaths.cs (1)
119
&& Marshal.
GetLastWin32Error
() == ERROR_INSUFFICIENT_BUFFER
System.Core (119)
Microsoft\Win32\SafeHandles\CapiSafeHandles.cs (3)
126
error = Marshal.
GetLastWin32Error
();
300
throw new CryptographicException(Marshal.
GetLastWin32Error
());
393
error = Marshal.
GetLastWin32Error
();
Microsoft\Win32\UnsafeNativeMethods.cs (1)
227
if (lo == -1 && ((hr = Marshal.
GetLastWin32Error
()) != 0))
System\Diagnostics\Eventing\Reader\NativeWrapper.cs (58)
71
int win32Error = Marshal.
GetLastWin32Error
();
86
int win32Error = Marshal.
GetLastWin32Error
();
114
int win32Error = Marshal.
GetLastWin32Error
();
130
int win32Error = Marshal.
GetLastWin32Error
();
142
int win32Error = Marshal.
GetLastWin32Error
();
175
int win32Error = Marshal.
GetLastWin32Error
();
185
int win32Error = Marshal.
GetLastWin32Error
();
194
int win32Error = Marshal.
GetLastWin32Error
();
204
int win32Error = Marshal.
GetLastWin32Error
();
221
int win32Error = Marshal.
GetLastWin32Error
();
233
int win32Error = Marshal.
GetLastWin32Error
();
245
int win32Error = Marshal.
GetLastWin32Error
();
255
int win32Error = Marshal.
GetLastWin32Error
();
267
int win32Error = Marshal.
GetLastWin32Error
();
288
int win32Error = Marshal.
GetLastWin32Error
();
307
int win32Error = Marshal.
GetLastWin32Error
();
326
int win32Error = Marshal.
GetLastWin32Error
();
340
int win32Error = Marshal.
GetLastWin32Error
();
358
int win32Error = Marshal.
GetLastWin32Error
();
365
win32Error = Marshal.
GetLastWin32Error
();
379
int win32Error = Marshal.
GetLastWin32Error
();
391
int win32Error = Marshal.
GetLastWin32Error
();
400
int win32Error = Marshal.
GetLastWin32Error
();
414
int error = Marshal.
GetLastWin32Error
();
423
error = Marshal.
GetLastWin32Error
();
443
int error = Marshal.
GetLastWin32Error
();
450
error = Marshal.
GetLastWin32Error
();
471
int error = Marshal.
GetLastWin32Error
();
478
error = Marshal.
GetLastWin32Error
();
497
int error = Marshal.
GetLastWin32Error
();
504
error = Marshal.
GetLastWin32Error
();
534
int error = Marshal.
GetLastWin32Error
();
554
error = Marshal.
GetLastWin32Error
();
582
int error = Marshal.
GetLastWin32Error
();
590
error = Marshal.
GetLastWin32Error
();
609
int win32Error = Marshal.
GetLastWin32Error
();
616
win32Error = Marshal.
GetLastWin32Error
();
639
int win32Error = Marshal.
GetLastWin32Error
();
646
win32Error = Marshal.
GetLastWin32Error
();
733
int win32Error = Marshal.
GetLastWin32Error
();
745
int win32Error = Marshal.
GetLastWin32Error
();
758
win32Error = Marshal.
GetLastWin32Error
();
771
int win32Error = Marshal.
GetLastWin32Error
();
784
win32Error = Marshal.
GetLastWin32Error
();
798
int win32Error = Marshal.
GetLastWin32Error
();
805
win32Error = Marshal.
GetLastWin32Error
();
830
int error = Marshal.
GetLastWin32Error
();
837
int win32Error = Marshal.
GetLastWin32Error
();
928
int error = Marshal.
GetLastWin32Error
();
935
int win32Error = Marshal.
GetLastWin32Error
();
965
int error = Marshal.
GetLastWin32Error
();
988
error = Marshal.
GetLastWin32Error
();
1018
int error = Marshal.
GetLastWin32Error
();
1035
error = Marshal.
GetLastWin32Error
();
1077
int error = Marshal.
GetLastWin32Error
();
1085
error = Marshal.
GetLastWin32Error
();
1116
int error = Marshal.
GetLastWin32Error
();
1140
error = Marshal.
GetLastWin32Error
();
System\Diagnostics\PerformanceData\CounterSetInstance.cs (1)
47
int Status = (int) ((m_nativeInst != null) ? UnsafeNativeMethods.ERROR_SUCCESS : Marshal.
GetLastWin32Error
());
System\IO\__Error.cs (1)
139
int errorCode = Marshal.
GetLastWin32Error
();
System\IO\LogStream.cs (2)
129
int errorCode = Marshal.
GetLastWin32Error
();
285
hr = Marshal.
GetLastWin32Error
();
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (4)
398
Int32 errorCode = Marshal.
GetLastWin32Error
();
425
Int32 lastError = Marshal.
GetLastWin32Error
();
482
Int32 createErrorCode = Marshal.
GetLastWin32Error
();
500
Int32 openErrorCode = Marshal.
GetLastWin32Error
();
System\IO\MemoryMappedFiles\MemoryMappedView.cs (4)
119
__Error.WinIOError(Marshal.
GetLastWin32Error
(), String.Empty);
142
int lastError = Marshal.
GetLastWin32Error
();
198
Int32 error = Marshal.
GetLastWin32Error
();
214
error = Marshal.
GetLastWin32Error
();
System\IO\Pipes\IOCancellationHelper.cs (1)
92
int errorCode = Marshal.
GetLastWin32Error
();
System\IO\Pipes\Pipe.cs (14)
212
__Error.WinIOError(Marshal.
GetLastWin32Error
(), String.Empty);
223
__Error.WinIOError(Marshal.
GetLastWin32Error
(), String.Empty);
585
__Error.WinIOError(Marshal.
GetLastWin32Error
(), String.Empty);
607
int errorCode = Marshal.
GetLastWin32Error
();
677
int errorCode = Marshal.
GetLastWin32Error
();
782
__Error.WinIOError(Marshal.
GetLastWin32Error
(), String.Empty);
824
execHelper.m_impersonateErrorCode = Marshal.
GetLastWin32Error
();
841
execHelper.m_revertImpersonateErrorCode = Marshal.
GetLastWin32Error
();
873
WinIOError(Marshal.
GetLastWin32Error
());
1189
int errorCode = Marshal.
GetLastWin32Error
();
1215
int errorCode = Marshal.
GetLastWin32Error
();
1306
int errorCode = Marshal.
GetLastWin32Error
();
1340
int errorCode = Marshal.
GetLastWin32Error
();
1379
WinIOError(Marshal.
GetLastWin32Error
());
System\IO\Pipes\PipeStream.cs (8)
652
hr = Marshal.
GetLastWin32Error
();
702
hr = Marshal.
GetLastWin32Error
();
760
WinIOError(Marshal.
GetLastWin32Error
());
843
WinIOError(Marshal.
GetLastWin32Error
());
871
WinIOError(Marshal.
GetLastWin32Error
());
899
WinIOError(Marshal.
GetLastWin32Error
());
931
WinIOError(Marshal.
GetLastWin32Error
());
948
WinIOError(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\AesCryptoServiceProvider.cs (2)
380
throw new CryptographicException(Marshal.
GetLastWin32Error
());
408
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\BCryptNative.cs (3)
608
throw new CryptographicException(Marshal.
GetLastWin32Error
());
622
throw new CryptographicException(Marshal.
GetLastWin32Error
());
628
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\CapiHashAlgorithm.cs (2)
81
int error = Marshal.
GetLastWin32Error
();
128
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\CapiNative.cs (9)
523
int error = Marshal.
GetLastWin32Error
();
556
int error = Marshal.
GetLastWin32Error
();
570
throw new CryptographicException(Marshal.
GetLastWin32Error
());
618
throw new CryptographicException(Marshal.
GetLastWin32Error
());
624
throw new CryptographicException(Marshal.
GetLastWin32Error
());
654
int errorCode = Marshal.
GetLastWin32Error
();
682
throw new CryptographicException(Marshal.
GetLastWin32Error
());
761
throw new CryptographicException(Marshal.
GetLastWin32Error
());
793
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\CapiSymmetricAlgorithm.cs (2)
265
throw new CryptographicException(Marshal.
GetLastWin32Error
());
414
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\X509Certificates\RSACertificateExtensions.cs (1)
42
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System\Security\Cryptography\X509Certificates\X509Native.cs (3)
38
(ErrorCode)Marshal.
GetLastWin32Error
() == ErrorCode.MoreData;
128
ErrorCode errorCode = (ErrorCode)Marshal.
GetLastWin32Error
();
139
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System.Data (6)
fx\src\data\System\Data\Common\AdapterUtil.cs (2)
2085
getComputerNameExError = Marshal.
GetLastWin32Error
();
2094
throw ADP.ComputerNameEx(Marshal.
GetLastWin32Error
());
fx\src\data\System\Data\SqlClient\LocalDBAPI.cs (2)
123
int hResult=Marshal.
GetLastWin32Error
();
165
int hResult=Marshal.
GetLastWin32Error
();
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (1)
769
System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception ( Marshal.
GetLastWin32Error
() );
fx\src\data\System\Data\SQLTypes\UnsafeNativeMethods.cs (1)
92
int lastError = Marshal.
GetLastWin32Error
();
System.Drawing (4)
commonui\System\Drawing\BufferedGraphicsContext.cs (1)
492
ex = new Win32Exception(Marshal.
GetLastWin32Error
());
commonui\System\Drawing\Graphics.cs (1)
4620
int error = Marshal.
GetLastWin32Error
();
commonui\System\Drawing\Printing\DefaultPrintController.cs (1)
72
int error = Marshal.
GetLastWin32Error
();
misc\DbgUtil.cs (1)
237
err = Marshal.
GetLastWin32Error
();
System.IdentityModel (24)
System\IdentityModel\Claims\WindowsClaimSet.cs (2)
322
int dwErrorCode = Marshal.
GetLastWin32Error
();
334
dwErrorCode = Marshal.
GetLastWin32Error
();
System\IdentityModel\Privilege.cs (8)
78
return Marshal.
GetLastWin32Error
();
87
return Marshal.
GetLastWin32Error
();
116
int error = Marshal.
GetLastWin32Error
();
130
error = Marshal.
GetLastWin32Error
();
145
error = Marshal.
GetLastWin32Error
();
189
error = Marshal.
GetLastWin32Error
();
220
error = Marshal.
GetLastWin32Error
();
246
int error = Marshal.
GetLastWin32Error
();
System\IdentityModel\RijndaelCryptoServiceProvider.cs (1)
377
int err = Marshal.
GetLastWin32Error
();
System\IdentityModel\SafeCryptHandles.cs (1)
102
err = Marshal.
GetLastWin32Error
();
System\IdentityModel\Selectors\WindowsUserNameSecurityTokenAuthenticator.cs (1)
54
int error = Marshal.
GetLastWin32Error
();
System\IdentityModel\Selectors\X509CertificateChain.cs (5)
125
int error = Marshal.
GetLastWin32Error
();
195
int error = Marshal.
GetLastWin32Error
();
233
int error = Marshal.
GetLastWin32Error
();
252
int error = Marshal.
GetLastWin32Error
();
297
int error = Marshal.
GetLastWin32Error
();
System\IdentityModel\Selectors\X509CertificateStore.cs (1)
97
int error = Marshal.
GetLastWin32Error
();
System\IdentityModel\Selectors\X509SecurityTokenAuthenticator.cs (1)
216
int dwErrorCode = Marshal.
GetLastWin32Error
();
System\IdentityModel\Tokens\RsaSecurityToken.cs (1)
102
int error = Marshal.
GetLastWin32Error
();
System\IdentityModel\Tokens\SessionSecurityToken.cs (2)
1035
int errorCode = Marshal.
GetLastWin32Error
();
1042
errorCode = Marshal.
GetLastWin32Error
();
System\IdentityModel\Tokens\WindowsUserNameSecurityTokenHandler.cs (1)
97
int error = Marshal.
GetLastWin32Error
();
System.IdentityModel.Selectors (2)
infocard\Diagnostics\Managed\Microsoft\InfoCards\Diagnostics\InfocardTrace.cs (2)
131
int error = Marshal.
GetLastWin32Error
();
531
int error = Marshal.
GetLastWin32Error
();
System.IO.Log (49)
System\IO\Log\UnsafeNativeMethods.cs (49)
488
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
522
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
548
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
572
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
604
errorCode = (uint)Marshal.
GetLastWin32Error
();
649
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
680
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
704
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
730
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
762
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
803
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
852
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
904
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
957
errorCode = (uint)Marshal.
GetLastWin32Error
();
1005
errorCode = (uint)Marshal.
GetLastWin32Error
();
1030
errorCode = (uint)Marshal.
GetLastWin32Error
();
1069
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1108
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1148
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1194
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1237
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1262
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1294
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1349
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1385
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1409
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1441
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1461
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1486
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1502
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1518
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1534
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1550
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1566
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1582
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1598
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1609
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1620
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1631
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1642
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1653
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1664
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1675
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1686
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1697
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1733
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1753
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1769
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
1794
uint errorCode = (uint)Marshal.
GetLastWin32Error
();
System.Messaging (1)
System\Messaging\AccessControlList.cs (1)
146
int errval = Marshal.
GetLastWin32Error
();
System.Net (2)
net\PeerToPeer\Collaboration\CollaborationHelperFunctions.cs (2)
157
int win32ErrorCode = Marshal.
GetLastWin32Error
();
206
int win32ErrorCode = Marshal.
GetLastWin32Error
();
System.Runtime.Remoting (12)
channels\core\corechannel.cs (3)
924
int lastError = Marshal.
GetLastWin32Error
();
931
lastError = Marshal.
GetLastWin32Error
();
958
lastError = Marshal.
GetLastWin32Error
();
channels\http\httpserverchannel.cs (1)
459
Marshal.
GetLastWin32Error
().ToString(CultureInfo.InvariantCulture)));
channels\ipc\ipcport.cs (7)
103
int error = Marshal.
GetLastWin32Error
();
115
return status ? true : (Marshal.
GetLastWin32Error
() == NativePipe.ERROR_PIPE_CONNECTED);
159
int error = Marshal.
GetLastWin32Error
();
197
int error = Marshal.
GetLastWin32Error
();
211
int error = Marshal.
GetLastWin32Error
();
237
int error = Marshal.
GetLastWin32Error
();
306
int error = Marshal.
GetLastWin32Error
();
channels\tcp\tcpserverchannel.cs (1)
400
Marshal.
GetLastWin32Error
().ToString(CultureInfo.CurrentCulture)));
System.Security (84)
system\security\cryptography\cryptoapi.cs (2)
2506
if (!rc && Marshal.
GetLastWin32Error
() == CAPI.NTE_BAD_KEYSET) {
2697
int dwErrorCode = Marshal.
GetLastWin32Error
();
system\security\cryptography\dataprotection.cs (2)
73
int lastWin32Error = Marshal.
GetLastWin32Error
();
148
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\envelopedpkcs7.cs (10)
450
throw new CryptographicException(Marshal.
GetLastWin32Error
());
471
throw new CryptographicException(Marshal.
GetLastWin32Error
());
479
throw new CryptographicException(Marshal.
GetLastWin32Error
());
504
throw new CryptographicException(Marshal.
GetLastWin32Error
());
508
throw new CryptographicException(Marshal.
GetLastWin32Error
());
599
throw new CryptographicException(Marshal.
GetLastWin32Error
());
755
throw new CryptographicException(Marshal.
GetLastWin32Error
());
763
throw new CryptographicException(Marshal.
GetLastWin32Error
());
941
throw new CryptographicException(Marshal.
GetLastWin32Error
());
948
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\pkcs9attribute.cs (2)
114
throw new CryptographicException(Marshal.
GetLastWin32Error
());
132
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\pkcsmisc.cs (4)
349
throw new CryptographicException(Marshal.
GetLastWin32Error
());
379
throw new CryptographicException(Marshal.
GetLastWin32Error
());
545
throw new CryptographicException(Marshal.
GetLastWin32Error
());
548
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\pkcsutils.cs (28)
102
checkErr(Marshal.
GetLastWin32Error
());
116
checkErr(Marshal.
GetLastWin32Error
());
131
checkErr(Marshal.
GetLastWin32Error
());
140
checkErr(Marshal.
GetLastWin32Error
());
165
checkErr(Marshal.
GetLastWin32Error
());
175
checkErr(Marshal.
GetLastWin32Error
());
195
checkErr(Marshal.
GetLastWin32Error
());
206
checkErr(Marshal.
GetLastWin32Error
());
223
checkErr(Marshal.
GetLastWin32Error
());
235
throw new CryptographicException(Marshal.
GetLastWin32Error
());
288
checkErr(Marshal.
GetLastWin32Error
());
298
checkErr(Marshal.
GetLastWin32Error
());
308
checkErr(Marshal.
GetLastWin32Error
());
342
int lastWin32Error = Marshal.
GetLastWin32Error
();
344
checkErr(Marshal.
GetLastWin32Error
());
354
checkErr(Marshal.
GetLastWin32Error
());
371
throw new CryptographicException(Marshal.
GetLastWin32Error
());
380
throw new CryptographicException(Marshal.
GetLastWin32Error
());
401
throw new CryptographicException(Marshal.
GetLastWin32Error
());
424
throw new CryptographicException(Marshal.
GetLastWin32Error
());
453
throw new CryptographicException(Marshal.
GetLastWin32Error
());
749
throw new CryptographicException(Marshal.
GetLastWin32Error
());
805
throw new CryptographicException(Marshal.
GetLastWin32Error
());
814
throw new CryptographicException(Marshal.
GetLastWin32Error
());
853
throw new CryptographicException(Marshal.
GetLastWin32Error
());
995
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1062
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1107
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\recipientinfo.cs (2)
402
throw new CryptographicException(Marshal.
GetLastWin32Error
());
411
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\signedpkcs7.cs (9)
162
return Marshal.
GetLastWin32Error
();
229
throw new CryptographicException(Marshal.
GetLastWin32Error
());
238
throw new CryptographicException(Marshal.
GetLastWin32Error
());
336
throw new CryptographicException(Marshal.
GetLastWin32Error
());
341
throw new CryptographicException(Marshal.
GetLastWin32Error
());
387
throw new CryptographicException(Marshal.
GetLastWin32Error
());
420
throw new CryptographicException(Marshal.
GetLastWin32Error
());
424
throw new CryptographicException(Marshal.
GetLastWin32Error
());
436
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\pkcs\signerinfo.cs (14)
72
throw new CryptographicException(Marshal.
GetLastWin32Error
());
252
throw new CryptographicException(Marshal.
GetLastWin32Error
());
292
throw new CryptographicException(Marshal.
GetLastWin32Error
());
316
throw new CryptographicException(Marshal.
GetLastWin32Error
());
414
throw new CryptographicException(Marshal.
GetLastWin32Error
());
422
throw new CryptographicException(Marshal.
GetLastWin32Error
());
437
throw new CryptographicException(Marshal.
GetLastWin32Error
());
489
lastWin32Error = Marshal.
GetLastWin32Error
();
580
throw new CryptographicException(Marshal.
GetLastWin32Error
());
615
throw new CryptographicException(Marshal.
GetLastWin32Error
());
633
throw new CryptographicException(Marshal.
GetLastWin32Error
());
736
throw new CryptographicException(Marshal.
GetLastWin32Error
());
746
throw new CryptographicException(Marshal.
GetLastWin32Error
());
755
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\x509\x509ui.cs (5)
80
dwErrorCode = Marshal.
GetLastWin32Error
();
85
throw new CryptographicException(Marshal.
GetLastWin32Error
());
122
throw new CryptographicException(Marshal.
GetLastWin32Error
());
154
dwErrorCode = Marshal.
GetLastWin32Error
();
158
throw new CryptographicException(Marshal.
GetLastWin32Error
());
system\security\cryptography\x509\x509utils.cs (6)
150
int dwErrorCode = Marshal.
GetLastWin32Error
();
154
throw new CryptographicException(Marshal.
GetLastWin32Error
());
162
int dwErrorCode = Marshal.
GetLastWin32Error
();
166
throw new CryptographicException(Marshal.
GetLastWin32Error
());
204
throw new CryptographicException(Marshal.
GetLastWin32Error
());
230
throw new CryptographicException(Marshal.
GetLastWin32Error
());
System.ServiceModel (62)
System\ServiceModel\Activation\SharedMemory.cs (3)
40
errorCode = Marshal.
GetLastWin32Error
();
82
int errorCode = Marshal.
GetLastWin32Error
();
121
int errorCode = Marshal.
GetLastWin32Error
();
System\ServiceModel\Activation\Utility.cs (9)
64
int error = Marshal.
GetLastWin32Error
();
80
int error = Marshal.
GetLastWin32Error
();
95
int error = Marshal.
GetLastWin32Error
();
193
int error = Marshal.
GetLastWin32Error
();
219
int error = Marshal.
GetLastWin32Error
();
245
int errorCode = Marshal.
GetLastWin32Error
();
309
error = Marshal.
GetLastWin32Error
();
321
error = Marshal.
GetLastWin32Error
();
415
int errorCode = Marshal.
GetLastWin32Error
();
System\ServiceModel\Channels\AppContainerInfo.cs (3)
190
errorCode = Marshal.
GetLastWin32Error
();
204
errorCode = Marshal.
GetLastWin32Error
();
255
int error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Channels\PeerHelpers.cs (1)
736
return new Win32Exception(Marshal.
GetLastWin32Error
());
System\ServiceModel\Channels\PeerUnsafeNativeMethods.cs (1)
99
error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Channels\PipeConnection.cs (20)
281
int error = Marshal.
GetLastWin32Error
();
375
int error = Marshal.
GetLastWin32Error
();
645
CreatePipeDuplicationFailedException(Marshal.
GetLastWin32Error
()), ExceptionEventType);
654
CreatePipeDuplicationFailedException(Marshal.
GetLastWin32Error
()), ExceptionEventType);
661
CreatePipeDuplicationFailedException(Marshal.
GetLastWin32Error
()), ExceptionEventType);
869
error = Marshal.
GetLastWin32Error
();
937
error = Marshal.
GetLastWin32Error
();
1378
int error = Marshal.
GetLastWin32Error
();
1476
int error = Marshal.
GetLastWin32Error
();
1597
int error = Marshal.
GetLastWin32Error
();
1613
int error = Marshal.
GetLastWin32Error
();
1812
int error = Marshal.
GetLastWin32Error
();
1822
error = Marshal.
GetLastWin32Error
();
2083
error = Marshal.
GetLastWin32Error
();
2271
int error = Marshal.
GetLastWin32Error
();
2363
error = Marshal.
GetLastWin32Error
();
2559
error = Marshal.
GetLastWin32Error
();
2613
int error = Marshal.
GetLastWin32Error
();
2621
error = Marshal.
GetLastWin32Error
();
2731
int error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Channels\SelfSignedCertificate.cs (3)
118
int error = Marshal.
GetLastWin32Error
();
182
int error = Marshal.
GetLastWin32Error
();
194
int error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Channels\UnsafeNativeMethods.cs (4)
825
int errorCode = Marshal.
GetLastWin32Error
();
851
int error = Marshal.
GetLastWin32Error
();
875
int errorCode = Marshal.
GetLastWin32Error
();
893
int errorCode = Marshal.
GetLastWin32Error
();
System\ServiceModel\ComIntegration\ComPlusAuthorization.cs (10)
35
int error = Marshal.
GetLastWin32Error
();
46
int error = Marshal.
GetLastWin32Error
();
107
int error = Marshal.
GetLastWin32Error
();
115
int error = Marshal.
GetLastWin32Error
();
120
error = Marshal.
GetLastWin32Error
();
134
int error = Marshal.
GetLastWin32Error
();
153
int error = Marshal.
GetLastWin32Error
();
183
int error = Marshal.
GetLastWin32Error
();
315
int error = Marshal.
GetLastWin32Error
();
328
int error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Dispatcher\SecurityImpersonationBehavior.cs (5)
404
int errorCode = Marshal.
GetLastWin32Error
();
411
errorCode = Marshal.
GetLastWin32Error
();
495
int error = Marshal.
GetLastWin32Error
();
509
int error = Marshal.
GetLastWin32Error
();
538
int error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Security\Tokens\IssuedSecurityTokenProvider.cs (1)
1074
int error = Marshal.
GetLastWin32Error
();
System\ServiceModel\UpnEndpointIdentity.cs (2)
146
int errorCode = Marshal.
GetLastWin32Error
();
153
errorCode = Marshal.
GetLastWin32Error
();
System.ServiceModel.Activation (2)
System\ServiceModel\Activation\Interop\SafeNativeMethods.cs (1)
40
error = Marshal.
GetLastWin32Error
();
System\ServiceModel\Activation\ServiceMemoryGates.cs (1)
72
int error = Marshal.
GetLastWin32Error
();
System.ServiceModel.Internals (3)
System\Runtime\Interop\SafeEventLogWriteHandle.cs (1)
29
int error = Marshal.
GetLastWin32Error
();
System\Runtime\Interop\UnsafeNativeMethods.cs (2)
107
int error = Marshal.
GetLastWin32Error
();
123
int error = Marshal.
GetLastWin32Error
();
System.Web (10)
FileChangesMonitor.cs (1)
177
int hr = HttpException.HResultFromLastError(Marshal.
GetLastWin32Error
());
HttpException.cs (1)
63
return new HttpException(message, HResultFromLastError(Marshal.
GetLastWin32Error
()));
ImpersonationContext.cs (1)
115
if (Marshal.
GetLastWin32Error
() != UnsafeNativeMethods.ERROR_NO_TOKEN) {
StringResourceManager.cs (4)
51
"GetModuleHandle", HttpException.HResultFromLastError(Marshal.
GetLastWin32Error
()).ToString(CultureInfo.InvariantCulture)));
58
"FindResource", HttpException.HResultFromLastError(Marshal.
GetLastWin32Error
()).ToString(CultureInfo.InvariantCulture)));
66
"LoadResource", HttpException.HResultFromLastError(Marshal.
GetLastWin32Error
()).ToString(CultureInfo.InvariantCulture)));
72
"LockResource", HttpException.HResultFromLastError(Marshal.
GetLastWin32Error
()).ToString(CultureInfo.InvariantCulture)));
Util\FileUtil.cs (3)
445
int lastError = Marshal.
GetLastWin32Error
(); // FXCOP demands that this preceed the ==
504
int lastError = Marshal.
GetLastWin32Error
(); // FXCOP demands that this preceed the ==
587
return HttpException.HResultFromLastError(Marshal.
GetLastWin32Error
());
System.Windows.Forms (14)
misc\DbgUtil.cs (1)
237
err = Marshal.
GetLastWin32Error
();
parent\parent\parent\public\Internal\NDP\Inc\mansign2.cs (2)
1028
throw new CryptographicException(Marshal.
GetLastWin32Error
());
1810
throw new CryptographicException(Marshal.
GetLastWin32Error
());
winforms\Managed\System\WinForms\Control.cs (2)
1849
int lastWin32Error = Marshal.
GetLastWin32Error
();
4420
(!returnValue && Marshal.
GetLastWin32Error
() == NativeMethods.ERROR_INVALID_HANDLE) ||
winforms\Managed\System\WinForms\DataFormats.cs (1)
223
throw new Win32Exception(Marshal.
GetLastWin32Error
(), SR.GetString(SR.RegisterCFFailed));
winforms\Managed\System\WinForms\MessageBox.cs (1)
471
int lastWin32Error = Marshal.
GetLastWin32Error
();
winforms\Managed\System\WinForms\NativeWindow.cs (4)
767
lastWin32Error = Marshal.
GetLastWin32Error
();
1599
int error = Marshal.
GetLastWin32Error
();
1627
int err = Marshal.
GetLastWin32Error
();
1659
} while (atom == 0 && Marshal.
GetLastWin32Error
() == NativeMethods.ERROR_CLASS_ALREADY_EXISTS);
winforms\Managed\System\WinForms\RichTextBox.cs (1)
365
int lastWin32Error = Marshal.
GetLastWin32Error
();
winforms\Managed\System\WinForms\SystemInformation.cs (1)
1973
int error = Marshal.
GetLastWin32Error
();
winforms\Managed\System\WinForms\UnsafeNativeMethods.cs (1)
533
&& Marshal.
GetLastWin32Error
() == NativeMethods.ERROR_INSUFFICIENT_BUFFER
System.Workflow.Activities (2)
Common\CompModHelpers.cs (2)
546
int error = Marshal.
GetLastWin32Error
();
596
int error = Marshal.
GetLastWin32Error
();
System.Workflow.ComponentModel (23)
AuthoringOM\Design\DesignerHelpers.cs (21)
922
throw new Win32Exception(Marshal.
GetLastWin32Error
());
927
throw new Win32Exception(Marshal.
GetLastWin32Error
());
931
throw new Win32Exception(Marshal.
GetLastWin32Error
());
937
throw new Win32Exception(Marshal.
GetLastWin32Error
());
943
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1032
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1039
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1042
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1049
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1052
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1055
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1059
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1068
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1071
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1078
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1081
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1084
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1088
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1097
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1116
throw new Win32Exception(Marshal.
GetLastWin32Error
());
1407
int hr = Marshal.
GetLastWin32Error
();
Shared\CompModHelpers.cs (2)
544
int error = Marshal.
GetLastWin32Error
();
594
int error = Marshal.
GetLastWin32Error
();
System.Workflow.Runtime (2)
DebugEngine\DebugController.cs (2)
142
int lasterror = Marshal.
GetLastWin32Error
(); //#pragma warning disable 56523 doesnt recognize 56523
186
int lasterror = Marshal.
GetLastWin32Error
(); //#pragma warning disable 56523 doesnt recognize 56523
UIAutomationClient (32)
MS\Internal\Automation\HwndProxyElementProvider.cs (2)
1920
int lastWin32Error = Marshal.
GetLastWin32Error
();
1945
int lastWin32Error = Marshal.
GetLastWin32Error
();
MS\Internal\Automation\Misc.cs (28)
309
int lastWin32Error = Marshal.
GetLastWin32Error
();
322
int lastWin32Error = Marshal.
GetLastWin32Error
();
335
int lastWin32Error = Marshal.
GetLastWin32Error
();
348
int lastWin32Error = Marshal.
GetLastWin32Error
();
363
int lastWin32Error = Marshal.
GetLastWin32Error
();
383
int lastWin32Error = Marshal.
GetLastWin32Error
();
396
int lastWin32Error = Marshal.
GetLastWin32Error
();
409
int lastWin32Error = Marshal.
GetLastWin32Error
();
422
int lastWin32Error = Marshal.
GetLastWin32Error
();
443
error = Marshal.
GetLastWin32Error
();
450
error = Marshal.
GetLastWin32Error
();
465
int lastWin32Error = Marshal.
GetLastWin32Error
();
478
int lastWin32Error = Marshal.
GetLastWin32Error
();
491
int lastWin32Error = Marshal.
GetLastWin32Error
();
504
ThrowWin32ExceptionsIfError(Marshal.
GetLastWin32Error
());
515
lastWin32Error = Marshal.
GetLastWin32Error
();
526
lastWin32Error = Marshal.
GetLastWin32Error
();
553
int lastWin32Error = Marshal.
GetLastWin32Error
();
564
lastWin32Error = Marshal.
GetLastWin32Error
();
583
int lastWin32Error = Marshal.
GetLastWin32Error
();
596
int lastWin32Error = Marshal.
GetLastWin32Error
();
609
int lastWin32Error = Marshal.
GetLastWin32Error
();
626
int lastWin32Error = Marshal.
GetLastWin32Error
();
643
int lastWin32Error = Marshal.
GetLastWin32Error
();
660
int lastWin32Error = Marshal.
GetLastWin32Error
();
674
int lastWin32Error = Marshal.
GetLastWin32Error
();
687
int lastWin32Error = Marshal.
GetLastWin32Error
();
700
int lastWin32Error = Marshal.
GetLastWin32Error
();
MS\Internal\Automation\ProxyManager.cs (2)
241
int lastWin32Error = Marshal.
GetLastWin32Error
();
255
int lastWin32Error = Marshal.
GetLastWin32Error
();
UIAutomationClientsideProviders (59)
MS\Internal\AutomationProxies\Input.cs (2)
128
throw new Win32Exception(Marshal.
GetLastWin32Error
());
151
throw new Win32Exception(Marshal.
GetLastWin32Error
());
MS\Internal\AutomationProxies\Misc.cs (54)
135
int lastWin32Error = Marshal.
GetLastWin32Error
();
180
int lastWin32Error = Marshal.
GetLastWin32Error
();
193
int lastWin32Error = Marshal.
GetLastWin32Error
();
208
int lastWin32Error = Marshal.
GetLastWin32Error
();
232
int lastWin32Error = Marshal.
GetLastWin32Error
();
272
int lastWin32Error = Marshal.
GetLastWin32Error
();
289
int lastWin32Error = Marshal.
GetLastWin32Error
();
304
int lastWin32Error = Marshal.
GetLastWin32Error
();
318
int lastWin32Error = Marshal.
GetLastWin32Error
();
442
int lastWin32Error = Marshal.
GetLastWin32Error
();
455
int lastWin32Error = Marshal.
GetLastWin32Error
();
468
int lastWin32Error = Marshal.
GetLastWin32Error
();
481
int lastWin32Error = Marshal.
GetLastWin32Error
();
494
int lastWin32Error = Marshal.
GetLastWin32Error
();
508
int lastWin32Error = Marshal.
GetLastWin32Error
();
521
int lastWin32Error = Marshal.
GetLastWin32Error
();
534
int lastWin32Error = Marshal.
GetLastWin32Error
();
547
int lastWin32Error = Marshal.
GetLastWin32Error
();
567
int lastWin32Error = Marshal.
GetLastWin32Error
();
632
int lastWin32Error = Marshal.
GetLastWin32Error
();
689
int lastWin32Error = Marshal.
GetLastWin32Error
();
730
int lastWin32Error = Marshal.
GetLastWin32Error
();
741
ThrowWin32ExceptionsIfError(Marshal.
GetLastWin32Error
());
798
int lastWin32Error = Marshal.
GetLastWin32Error
();
899
int lastWin32Error = Marshal.
GetLastWin32Error
();
913
int lastWin32Error = Marshal.
GetLastWin32Error
();
938
int lastWin32Error = Marshal.
GetLastWin32Error
();
1005
lastWin32Error = Marshal.
GetLastWin32Error
();
1016
lastWin32Error = Marshal.
GetLastWin32Error
();
1036
int lastWin32Error = Marshal.
GetLastWin32Error
();
1047
lastWin32Error = Marshal.
GetLastWin32Error
();
1068
int lastWin32Error = Marshal.
GetLastWin32Error
();
1102
int lastWin32Error = Marshal.
GetLastWin32Error
();
1202
int lastWin32Error = Marshal.
GetLastWin32Error
();
1218
int lastWin32Error = Marshal.
GetLastWin32Error
();
1273
int lastWin32Error = Marshal.
GetLastWin32Error
();
1301
int lastWin32Error = Marshal.
GetLastWin32Error
();
1327
int lastWin32Error = Marshal.
GetLastWin32Error
();
1353
int lastWin32Error = Marshal.
GetLastWin32Error
();
1368
int lastWin32Error = Marshal.
GetLastWin32Error
();
1404
int lastWin32Error = Marshal.
GetLastWin32Error
();
1417
int lastWin32Error = Marshal.
GetLastWin32Error
();
1433
int lastWin32Error = Marshal.
GetLastWin32Error
();
1447
int lastWin32Error = Marshal.
GetLastWin32Error
();
1468
int lastWin32Error = Marshal.
GetLastWin32Error
();
1491
int lastWin32Error = Marshal.
GetLastWin32Error
();
1636
int lastWin32Error = Marshal.
GetLastWin32Error
();
1753
int lastWin32Error = Marshal.
GetLastWin32Error
();
1766
int lastWin32Error = Marshal.
GetLastWin32Error
();
1779
int lastWin32Error = Marshal.
GetLastWin32Error
();
1792
int lastWin32Error = Marshal.
GetLastWin32Error
();
1805
int lastWin32Error = Marshal.
GetLastWin32Error
();
1818
int lastWin32Error = Marshal.
GetLastWin32Error
();
1831
int lastWin32Error = Marshal.
GetLastWin32Error
();
MS\Internal\AutomationProxies\WindowsAltTab.cs (1)
266
int lastWin32Error = Marshal.
GetLastWin32Error
();
MS\Win32\UnsafeNativeMethods.cs (2)
393
error = Marshal.
GetLastWin32Error
();
400
error = Marshal.
GetLastWin32Error
();
WindowsBase (31)
Base\MS\Internal\Interop\ErrorCodes.cs (1)
109
return new Win32Error(Marshal.
GetLastWin32Error
());
Base\System\Windows\SplashScreen.cs (1)
196
if (Marshal.
GetLastWin32Error
() != 0x582) /* class already registered */
Shared\MS\Win32\HwndWrapper.cs (1)
98
throw new System.ComponentModel.Win32Exception(Marshal.
GetLastWin32Error
());
Shared\MS\Win32\SafeNativeMethodsCLR.cs (2)
87
int win32Err = Marshal.
GetLastWin32Error
();
293
int win32Err = Marshal.
GetLastWin32Error
(); // Dance around FxCop
Shared\MS\Win32\SafeNativeMethodsOther.cs (3)
183
int win32Error = Marshal.
GetLastWin32Error
();
251
throw new Win32Exception(Marshal.
GetLastWin32Error
());
264
throw new Win32Exception(Marshal.
GetLastWin32Error
());
Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (14)
275
int error = Marshal.
GetLastWin32Error
();
598
int error = Marshal.
GetLastWin32Error
();
674
int error = Marshal.
GetLastWin32Error
();
694
int win32Err = Marshal.
GetLastWin32Error
();
832
int win32Err = Marshal.
GetLastWin32Error
();
850
int win32Err = Marshal.
GetLastWin32Error
();
1079
int errorCode = Marshal.
GetLastWin32Error
();
1096
int errorCode = Marshal.
GetLastWin32Error
();
1789
int error = Marshal.
GetLastWin32Error
();
1819
int error = Marshal.
GetLastWin32Error
();
1854
int error = Marshal.
GetLastWin32Error
();
1878
int error = Marshal.
GetLastWin32Error
();
1903
int error = Marshal.
GetLastWin32Error
();
1926
int error = Marshal.
GetLastWin32Error
();
Shared\MS\Win32\UnsafeNativeMethodsOther.cs (9)
709
errorCode = Marshal.
GetLastWin32Error
();
715
errorCode = Marshal.
GetLastWin32Error
();
742
error = Marshal.
GetLastWin32Error
();
749
error = Marshal.
GetLastWin32Error
();
779
error = Marshal.
GetLastWin32Error
();
786
error = Marshal.
GetLastWin32Error
();
817
error = Marshal.
GetLastWin32Error
();
823
error = Marshal.
GetLastWin32Error
();
965
error = Marshal.
GetLastWin32Error
();
WsatConfig (2)
Configuration\CertificateManager.cs (1)
56
throw new WsatAdminException(WsatAdminErrorCode.CERT_STORE_ACCESS, SR.GetString(SR.ErrorAccessCertStore, Marshal.
GetLastWin32Error
()));
Configuration\ClusterRegistryConfigurationProvider.cs (1)
38
int lastError = Marshal.
GetLastWin32Error
();
WsatUI (3)
Configuration\CertificateManager.cs (2)
56
throw new WsatAdminException(WsatAdminErrorCode.CERT_STORE_ACCESS, SR.GetString(SR.ErrorAccessCertStore, Marshal.
GetLastWin32Error
()));
106
throw new WsatAdminException(WsatAdminErrorCode.CERT_STORE_ACCESS, SR.GetString(SR.ErrorAccessCertStore, Marshal.
GetLastWin32Error
()));
Configuration\ClusterRegistryConfigurationProvider.cs (1)
38
int lastError = Marshal.
GetLastWin32Error
();