100+ results results for 'win32error' (320 ms)
79 if (NOT QPID_WINDOWS_DEFAULT_TEST_OUTPUTS) 80 set(platform_test_additions windows/DisableWin32ErrorWindows.cpp) 81 endif (NOT QPID_WINDOWS_DEFAULT_TEST_OUTPUTS)NativeMethods.cs https://github.com/mdavis/ravendb.git | C# | 421 lines
66 { 67 lastError = Marshal.GetLastWin32Error(); 68 if (lastError != 0) 73 { 74 lastError = Marshal.GetLastWin32Error(); 75setupapi.h https://bitbucket.org/barakianc/nvidia-physx-and-apex-in-gge.git | C Header | 1578 lines
229 PCSTR Source; // not used for delete operations 230 UINT Win32Error; 231 DWORD Flags; // such as SP_COPY_NOSKIP for copy errors 236 PCWSTR Source; // not used for delete operations 237 UINT Win32Error; 238 DWORD Flags; // such as SP_COPY_NOSKIP for copy errors 320 DWORD FileSize; 321 DWORD Win32Error; 322 WORD DosDate; 330 DWORD FileSize; 331 DWORD Win32Error; 332 WORD DosDate;setupapi.h https://gitlab.com/ubuntu-trusty/mingw-w64 | C Header | 1169 lines
237 PCSTR Source; 238 UINT Win32Error; 239 DWORD Flags; 244 PCWSTR Source; 245 UINT Win32Error; 246 DWORD Flags; 254 PCSTR Source; 255 UINT Win32Error; 256 DWORD Flags; 264 PCWSTR Source; 265 UINT Win32Error; 266 DWORD Flags; 317 DWORD FileSize; 318 DWORD Win32Error; 319 WORD DosDate;msrdc.h https://gitlab.com/ubuntu-trusty/mingw-w64 | C Header | 350 lines
40 RDC_Aborted = 9, 41 RDC_Win32Error = 10 42} RDC_ErrorCode;netlib.h https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk | C Header | 621 lines
311 312#define perror(text) PrintWin32Error(stderr, (text)) 313#define Print_errno(stream, text) PrintWin32Error((stream), (text)) 314 315extern void PrintWin32Error(FILE *stream, LPSTR text); 316win_main.c https://github.com/Lafriks/mupdf.git | C | 903 lines
114 115void win32error(pdfapp_t *app, char *msg) 116{ 187 if (code <= 0) 188 win32error(app, "cannot create password dialog"); 189 if (pd_okay) 284 if (code <= 0) 285 win32error(app, "cannot create info dialog"); 286} 307 if (code <= 0) 308 win32error(app, "cannot create help dialog"); 309} 335 if (!a) 336 win32error(app, "cannot register frame window class"); 337Debugger.cs https://github.com/jfcantin/monodevelop.git | C# | 1034 lines
59 if( ph.IsInvalid ) 60 throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); 61 int neededSize;WindowsConsoleDriver.cs https://github.com/iainlane/mono.git | C# | 633 lines
261 throw new InvalidOperationException ("Error in PeekConsoleInput " + 262 Marshal.GetLastWin32Error ()); 263 272 throw new InvalidOperationException ("Error in ReadConsoleInput " + 273 Marshal.GetLastWin32Error ()); 274 } 285 if (coord.X == 0 && coord.Y == 0) 286 throw new Exception ("GetLargestConsoleWindowSize" + Marshal.GetLastWin32Error ()); 287 295 if (coord.X == 0 && coord.Y == 0) 296 throw new Exception ("GetLargestConsoleWindowSize" + Marshal.GetLastWin32Error ()); 297 315 if (GetConsoleTitle (sb, 26000) == 0) 316 throw new Exception ("Got " + Marshal.GetLastWin32Error ()); 317 }ServiceControllerTest.cs https://github.com/iainlane/mono.git | C# | 1437 lines
77 Assert.AreEqual (typeof (Win32Exception), ex.InnerException.GetType (), "#A7"); 78 Win32Exception win32Error = (Win32Exception) ex.InnerException; 79 //Assert.AreEqual (-2147467259, win32Error.ErrorCode, "#A8"); 79 //Assert.AreEqual (-2147467259, win32Error.ErrorCode, "#A8"); 80 Assert.IsNotNull (win32Error.Message, "#A9"); 81 Assert.AreEqual (123, win32Error.NativeErrorCode, "#A10"); 81 Assert.AreEqual (123, win32Error.NativeErrorCode, "#A10"); 82 Assert.IsNull (win32Error.InnerException, "#A11"); 83 } 110 Assert.AreEqual (typeof (Win32Exception), ex.InnerException.GetType (), "#B7"); 111 Win32Exception win32Error = (Win32Exception) ex.InnerException; 112 //Assert.AreEqual (-2147467259, win32Error.ErrorCode, "#B8"); 112 //Assert.AreEqual (-2147467259, win32Error.ErrorCode, "#B8"); 113 Assert.IsNotNull (win32Error.Message, "#B9"); 114 Assert.AreEqual (123, win32Error.NativeErrorCode, "#B10");Win32EventLog.cs https://github.com/iainlane/mono.git | C# | 907 lines
65 if (ret != 1) 66 throw new Win32Exception (Marshal.GetLastWin32Error ()); 67 } 244 if (retVal != 1) 245 throw new Win32Exception (Marshal.GetLastWin32Error ()); 246 return entryCount; 388 if (ret != 1) { 389 throw new Win32Exception (Marshal.GetLastWin32Error ()); 390 } 452 if (ret != 1) { 453 int error = Marshal.GetLastWin32Error (); 454 if (i < (max_retries - 1)) {install.py https://bitbucket.org/beqa/nvdadependencyvirtualenvironment.git | Python | 730 lines
124# Convert an ADSI COM exception to the Win32 error code embedded in it. 125def _GetWin32ErrorCode(com_exc): 126 hr = com_exc.hresult 391 except pythoncom.com_error, details: 392 rc = _GetWin32ErrorCode(details) 393 if rc != winerror.ERROR_PATH_NOT_FOUND:Port.cs https://bitbucket.org/x893/sirflive.git | C# | 813 lines
379 { 380 int num = Marshal.GetLastWin32Error(); 381 throw new CommPortException(string.Format("Error open port: {0}", (APIErrors) num));Mkvcbuild.pm https://gitlab.com/kush/jarulraj-postgresql-cpp | Perl | 927 lines
91 sprompt.c tar.c thread.c getopt.c getopt_long.c dirent.c 92 win32env.c win32error.c win32setlocale.c); 93mdionet.c https://bitbucket.org/yingted/openturing.git | C | 988 lines
121static char *MyGetCookies (const char *pmURL); 122static void MyProcessWin32Error (int pmWin32Error); 123static void MyProcessWSAError (int *pmStatus);ErrorCodes.cs https://github.com/josephcooney/ILSpy.git | C# | 508 lines
30 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] 31 public static readonly Win32Error ERROR_INVALID_FUNCTION = new Win32Error(1); 32 /// <summary>The system cannot find the file specified.</summary> 33 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] 34 public static readonly Win32Error ERROR_FILE_NOT_FOUND = new Win32Error(2); 35 /// <summary>The system cannot find the path specified.</summary> 36 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] 37 public static readonly Win32Error ERROR_PATH_NOT_FOUND = new Win32Error(3); 38 /// <summary>The system cannot open the file.</summary> 57 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] 58 public static readonly Win32Error ERROR_INVALID_PARAMETER = new Win32Error(87); 59 /// <summary>The data area passed to a system call is too small.</summary> 72 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] 73 public static readonly Win32Error ERROR_NO_MATCH = new Win32Error(1169); 74 /// <summary>An invalid device was specified.</summary>tkWinSend.c https://bitbucket.org/vrrm/brl-cad-copy-for-fast-history-browsing-in-git.git | C | 1038 lines
77 Tcl_Obj *const objv[]); 78static Tcl_Obj * Win32ErrorObj(HRESULT hrError); 79static void SendTrace(const char *format, ...); 282 } 283 Tcl_SetObjResult(interp, Win32ErrorObj(hr)); 284 result = TCL_ERROR; 449 if (FAILED(hr) && result == TCL_OK) { 450 Tcl_SetObjResult(interp, Win32ErrorObj(hr)); 451 result = TCL_ERROR;tkWinSend.c https://bitbucket.org/vrrm/brl-cad-copy-for-fast-history-browsing-in-git.git | C | 1035 lines
76 Tcl_Obj *CONST objv[]); 77static Tcl_Obj * Win32ErrorObj(HRESULT hrError); 78static void SendTrace(const char *format, ...); 279 } 280 Tcl_SetObjResult(interp, Win32ErrorObj(hr)); 281 result = TCL_ERROR; 446 if (FAILED(hr) && result == TCL_OK) { 447 Tcl_SetObjResult(interp, Win32ErrorObj(hr)); 448 result = TCL_ERROR;Debugger.cs https://bitbucket.org/mvptracker/cosmos.git | C# | 1132 lines
52 if (ph.IsInvalid) 53 throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); 54 int neededSize;MemScan.cs https://gitlab.com/wh1t3rabbit/NovoAnimus | C# | 491 lines
293 { 294 int err = Marshal.GetLastWin32Error(); 295 if (err == 0) 383 { 384 int err = Marshal.GetLastWin32Error(); 385 System.Windows.Forms.MessageBox.Show("GetLastError was non-zero after VirtualQueryEx, error was " + err);Console.c https://gitlab.com/orvi2014/rcs-db-ext | C | 1216 lines
33VALUE 34rb_getWin32Error() 35{ 83 if (AllocConsole()) return INT2FIX(1); 84 return rb_getWin32Error(); 85} 90 if (FreeConsole()) return INT2FIX(1); 91 return rb_getWin32Error(); 92} 101 return INT2FIX(1); 102 return rb_getWin32Error(); 103} 110 return UINT2NUM(mode); 111 return rb_getWin32Error(); 112}Exceptions.cs https://gitlab.com/unofficial-mirrors/PowerShell | C# | 688 lines
179 : this(errorCode, 180 StringUtil.Format(Strings.UnspecifiedErrorWin32Error, errorCode), 181 target,NativeWrapper.cs https://gitlab.com/unofficial-mirrors/PowerShell | C# | 1045 lines
77 bool status = UnsafeNativeMethods.EvtSeek(resultSet, position, bookmark, timeout, flags); 78 int win32Error = Marshal.GetLastWin32Error(); 79 if (!status) 92 bool status = UnsafeNativeMethods.EvtNext(queryHandle, eventSize, events, timeout, flags, ref returned); 93 int win32Error = Marshal.GetLastWin32Error(); 94 if (!status && win32Error != UnsafeNativeMethods.ERROR_NO_MORE_ITEMS) 201 EventLogHandle handle = UnsafeNativeMethods.EvtOpenChannelConfig(session, channelPath, flags); 202 int win32Error = Marshal.GetLastWin32Error(); 203 if (handle.IsInvalid) 324 EventLogHandle handle = UnsafeNativeMethods.EvtCreateBookmark(bookmarkXml); 325 int win32Error = Marshal.GetLastWin32Error(); 326 if (handle.IsInvalid) 334 bool status = UnsafeNativeMethods.EvtUpdateBookmark(bookmark, eventHandle); 335 int win32Error = Marshal.GetLastWin32Error(); 336 if (!status)ServiceControlHelper.cs https://github.com/akilhoffer/Reactor.git | C# | 441 lines
175 { 176 throw new Win32Exception(Marshal.GetLastWin32Error(), "Unable to change the Service configuration."); 177 } 232 { 233 throw new Win32Exception(Marshal.GetLastWin32Error(), "Unable to query the Service configuration."); 234 }packet-ams.c https://gitlab.com/jvelando/wireshark | C | 1129 lines
144 { ERR_UNKNOWNAMSCMD, "UNKNOWN AMSCMD"}, 145 { ERR_WIN32ERROR, "WIN32 ERROR"}, 146 { ERR_PORTNOTCONNECTED, "PORT NOT CONNECTED"},setupapi.h https://github.com/aragaer/wine.git | C Header | 1292 lines
134 PCSTR FileName; 135 DWORD Win32Error; 136 DWORD FailureCode; 142 PCWSTR FileName; 143 DWORD Win32Error; 144 DWORD FailureCode;queue.c https://github.com/aragaer/wine.git | C | 1457 lines
163 concat_W( target, NULL, op->dst_path, op->dst_file ); 164 paths->Win32Error = 0; 165 paths->Flags = 0; 202 pathsA.Target = strdupWtoA( pathsW->Target ); 203 pathsA.Win32Error = pathsW->Win32Error; 204 pathsA.Flags = pathsW->Flags; 221 statusA.FileName = strdupWtoA( statusW->FileName ); 222 statusA.Win32Error = statusW->Win32Error; 223 statusA.FailureCode = statusW->FailureCode;error.c https://github.com/aragaer/wine.git | C | 754 lines
116/********************************************************************** 117 * RtlGetLastWin32Error (NTDLL.@) 118 * 124 * RETURNS 125 * The current error value for the thread, as set by SetLastWin32Error() or SetLastError(). 126 */ 126 */ 127DWORD WINAPI RtlGetLastWin32Error(void) 128{ 143/*********************************************************************** 144 * RtlSetLastWin32Error (NTDLL.@) 145 * RtlRestoreLastWin32Error (NTDLL.@) 154 */ 155void WINAPI RtlSetLastWin32Error( DWORD err ) 156{PrinterUtil.vb https://gitlab.com/edgardo001/csharp-demos | Visual Basic | 435 lines
167 If rtn = 0 Then 168 iError = Marshal.GetLastWin32Error() 169 Select Case iErrorWindows32USBController.cs https://github.com/thenathanjones/nusb.git | C# | 476 lines
170 { 171 var lastWin32Error = Marshal.GetLastWin32Error(); 172 173 // if the error is something other than pending IO (i.e. because we're using overlapped) 174 if (!ignoreOverlapped || lastWin32Error != (int)InteropCommon.Win32Errors.ERROR_IO_PENDING) 175 { 175 { 176 throw new Exception("Unknown Win32 Error occurred: " + lastWin32Error); 177 }packet-ams.h https://gitlab.com/crondaemon/wireshark-legacy | C Header | 1153 lines
170#define ERR_UNKNOWNAMSCMD 11 171#define ERR_WIN32ERROR 12 172#define ERR_PORTNOTCONNECTED 13File.cpp https://github.com/jiawen/temporal-lightfield-reconstruction.git | C++ | 593 lines
103 if (!m_overlapped.hEvent) 104 failWin32Error("CreateEvent"); 105} 198 if (!GetDiskFreeSpace(NULL, NULL, &bytesPerSector, NULL, NULL)) 199 failWin32Error("GetDiskFreeSpace"); 200 m_align = bytesPerSector;WinInet.cs https://github.com/easySaCoder/dingwalotsammino.git | C# | 472 lines
120 bool returnValue = InternetGetCookieEx(url, cookieName, buffer, ref bufferLength, 0, IntPtr.Zero); 121 int err = Marshal.GetLastWin32Error(); 122 128 if (err != 0 && err != ERROR_INSUFFICIENT_BUFFER) 129 ThrowExceptionForLastWin32Error(); 130 146 if (cookieState == InternetCookieState.COOKIE_STATE_UNKNOWN) 147 ThrowExceptionForLastWin32Error(); 148 166 { 167 int err = Marshal.GetLastWin32Error(); 168 if (err != ERROR_FILE_NOT_FOUND) 168 if (err != ERROR_FILE_NOT_FOUND) 169 ThrowExceptionForLastWin32Error(); 170 }ShellImageList.cs https://github.com/DavidMoore/Foundation.git | C# | 478 lines
80 var result = NativeMethods.ImageList_GetIconSize(hIml,ref cx,ref cy); 81 if( result != 0) throw new ShellImageListException("Couldn't get icon size. Result={0}, Last Win32 Error={1}", result, Marshal.GetLastWin32Error()); 82 } 245 246 if( ret != 0 ) throw new ShellImageListException("Error drawing image. Return code: {0}, Last Win32 Error: {1}", ret, Marshal.GetLastWin32Error()); 247 } 299 int ret = NativeMethods.ImageList_DrawIndirect(ref pimldp); 300 if (ret != 0) throw new ShellImageListException("Error drawing image. Return code: {0}, Last Win32 Error: {1}", ret, Marshal.GetLastWin32Error()); 301 }FileSystemEnumerator.cs https://github.com/DavidMoore/Foundation.git | C# | 497 lines
172 int hr = Marshal.GetLastWin32Error(); 173 if( hr != Win32Error.ERROR_FILE_NOT_FOUND && hr != Win32Error.ERROR_NO_MORE_FILES ) 174 { 278 int hr = Marshal.GetLastWin32Error(); 279 if( hr == Win32Error.ERROR_ACCESS_DENIED || hr == Win32Error.ERROR_FILE_NOT_FOUND || hr == Win32Error.ERROR_NO_MORE_FILES || hr == Win32Error.ERROR_PATH_NOT_FOUND ) 280 continue; 324 // Make sure we quit with a sensible error. 325 int hr = Marshal.GetLastWin32Error(); 326 332 // we will get here with this errorcode from the searchStack walk 333 if( (hr != 0) && (hr != Win32Error.ERROR_NO_MORE_FILES) 334 && (hr != Win32Error.ERROR_FILE_NOT_FOUND) )Win32Api.cs https://github.com/DavidMoore/Foundation.git | C# | 293 lines
34 /// <p>If the function succeeds, the return value is nonzero.</p> 35 /// <p>If the function fails, the return value is zero. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.</p> 36 /// </returns> 114 /// <p>If the function succeeds, the return value is nonzero.</p> 115 /// <p>If the function fails, the return value is zero (0). To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.</p> 116 /// </returns> 235 236 if (handle == null) throw new LoadLibraryException(file, Marshal.GetLastWin32Error()); 237WindowsFoundationDiagnostics.h https://gitlab.com/goolic/WinObjC | C Header | 537 lines
106 WFDLoggingFieldFormatJson = 12, 107 WFDLoggingFieldFormatWin32Error = 13, 108 WFDLoggingFieldFormatNTStatus = 14,timer.cs https://github.com/pruiz/mono.git | C# | 967 lines
91 if (!result) 92 throw Marshal.GetExceptionForHR(Marshal.GetLastWin32Error()); 93win32.cs https://github.com/pruiz/mono.git | C# | 457 lines
150 { 151 int win32ErrorCode = Win32Native.LsaNtStatusToWinError(unchecked((int) ReturnCode)); 152 152 153 throw new SystemException(Win32Native.GetMessage(win32ErrorCode)); 154 } 217 { 218 ErrorCode = Marshal.GetLastWin32Error(); 219 goto Error; 279 280 return Marshal.GetLastWin32Error(); 281 } 396 397 return Marshal.GetLastWin32Error(); 398 }privilege.cs https://github.com/pruiz/mono.git | C# | 734 lines
120 { 121 int error = Marshal.GetLastWin32Error(); 122 209 { 210 cachingError = Marshal.GetLastWin32Error(); 211 success = false; 262 { 263 error = Marshal.GetLastWin32Error(); 264 success = false;longpath.cs https://github.com/pruiz/mono.git | C# | 987 lines
218 // Save Win32 error because subsequent checks will overwrite this HRESULT. 219 int errorCode = Marshal.GetLastWin32Error(); 220 String fileName = destFileName; 265 if (!r) { 266 int hr = Marshal.GetLastWin32Error(); 267 if (hr==Win32Native.ERROR_FILE_NOT_FOUND)file.cs https://github.com/pruiz/mono.git | C# | 1152 lines
170 // Save Win32 error because subsequent checks will overwrite this HRESULT. 171 int errorCode = Marshal.GetLastWin32Error(); 172 String fileName = destFileName; 304 if (!r) { 305 int hr = Marshal.GetLastWin32Error(); 306 if (hr==Win32Native.ERROR_FILE_NOT_FOUND) 331 if (!r) { 332 int errorCode = Marshal.GetLastWin32Error(); 333 if (errorCode == Win32Native.ERROR_ACCESS_DENIED) {HttpException.cs https://github.com/pruiz/mono.git | C# | 700 lines
62 public static HttpException CreateFromLastError(String message) { 63 return new HttpException(message, HResultFromLastError(Marshal.GetLastWin32Error())); 64 }FileChangesMonitor.cs https://github.com/pruiz/mono.git | C# | 1138 lines
151 [SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", 152 Justification="Microsoft: Call to GetLastWin32Error() does follow P/Invoke call that is outside the if/else block.")] 153 static internal byte[] GetDacl(string filename) { 176 else { 177 int hr = HttpException.HResultFromLastError(Marshal.GetLastWin32Error()); 178 189#if DBG 190 hr = HttpException.HResultFromLastError(Marshal.GetLastWin32Error()); 191 Debug.Trace("GetDacl", "Error in second to GetFileSecurity: 0x" + hr.ToString("x", NumberFormatInfo.InvariantInfo));IssuedSecurityTokenProvider.cs https://github.com/pruiz/mono.git | C# | 1127 lines
28 using SafeNativeMethods = System.ServiceModel.ComIntegration.SafeNativeMethods; 29 using Win32Error = System.ServiceModel.ComIntegration.Win32Error; 30 using WSTrustFeb2005Constants = System.IdentityModel.Protocols.WSTrust.WSTrustFeb2005Constants;SecurityImpersonationBehavior.cs https://github.com/pruiz/mono.git | C# | 557 lines
31 using SafeNativeMethods = System.ServiceModel.ComIntegration.SafeNativeMethods; 32 using Win32Error = System.ServiceModel.ComIntegration.Win32Error; 33SafeNativeMethods.cs https://github.com/pruiz/mono.git | C# | 888 lines
92 93 enum Win32Error 94 {ComPlusAuthorization.cs https://github.com/pruiz/mono.git | C# | 618 lines
34 { 35 int error = Marshal.GetLastWin32Error(); 36 if (error != (int)Win32Error.ERROR_INSUFFICIENT_BUFFER) 45 { 46 int error = Marshal.GetLastWin32Error(); 47 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error, SR.GetString(SR.GetTokenInfoFailed, error))); 106 { 107 int error = Marshal.GetLastWin32Error(); 108 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error, SR.GetString(SR.ImpersonateAnonymousTokenFailed, error))); 114 { 115 int error = Marshal.GetLastWin32Error(); 116 119 { 120 error = Marshal.GetLastWin32Error(); 121PipeConnection.cs https://github.com/pruiz/mono.git | C# | 1350 lines
280 { 281 int error = Marshal.GetLastWin32Error(); 282 if (error != UnsafeNativeMethods.ERROR_IO_PENDING && error != UnsafeNativeMethods.ERROR_MORE_DATA) 374 { 375 int error = Marshal.GetLastWin32Error(); 376 if (error != UnsafeNativeMethods.ERROR_IO_PENDING)Utility.cs https://github.com/pruiz/mono.git | C# | 444 lines
35 int processId = Process.GetCurrentProcess().Id; 36#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() 37 SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION | ListenerUnsafeNativeMethods.WRITE_DAC | ListenerUnsafeNativeMethods.READ_CONTROL, false, processId); 48 { 49#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() 50 SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION, false, pid); 63 bool success = ListenerUnsafeNativeMethods.OpenProcessToken(process, requiredAccess, out processToken); 64 int error = Marshal.GetLastWin32Error(); 65 if (!success) 79 { 80 int error = Marshal.GetLastWin32Error(); 81 if (error != ListenerUnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) 94 { 95 int error = Marshal.GetLastWin32Error(); 96 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error));CollaborationHelperFunctions.cs https://github.com/pruiz/mono.git | C# | 601 lines
119 // <SatisfiesLinkDemand Name="SafeHandle.get_IsInvalid():System.Boolean" /> 120 // <SatisfiesLinkDemand Name="Marshal.GetLastWin32Error():System.Int32" /> 121 // <SatisfiesLinkDemand Name="SafeHandle.DangerousGetHandle():System.IntPtr" /> 156 if (certHandle == null || certHandle.IsInvalid){ 157 int win32ErrorCode = Marshal.GetLastWin32Error(); 158 throw PeerToPeerException.CreateFromHr(SR.GetString(SR.Collab_CredentialsError), win32ErrorCode); 173 // <SatisfiesLinkDemand Name="SafeHandle.get_IsInvalid():System.Boolean" /> 174 // <SatisfiesLinkDemand Name="Marshal.GetLastWin32Error():System.Int32" /> 175 // <SatisfiesLinkDemand Name="SafeHandle.DangerousGetHandle():System.IntPtr" /> 205 if (certHandle == null || certHandle.IsInvalid){ 206 int win32ErrorCode = Marshal.GetLastWin32Error(); 207 throw PeerToPeerException.CreateFromHr(SR.GetString(SR.Collab_CredentialsError), win32ErrorCode);InfocardTrace.cs https://github.com/pruiz/mono.git | C# | 886 lines
130 { 131 int error = Marshal.GetLastWin32Error(); 132 TraceDebug("failed to registereventsource with error {0}", error);X509CertificateStore.cs https://github.com/pruiz/mono.git | C# | 381 lines
96 { 97 int error = Marshal.GetLastWin32Error(); 98 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(error));X509CertificateChain.cs https://github.com/pruiz/mono.git | C# | 381 lines
124 { 125 int error = Marshal.GetLastWin32Error(); 126 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(error)); 194 { 195 int error = Marshal.GetLastWin32Error(); 196 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(error)); 232 { 233 int error = Marshal.GetLastWin32Error(); 234 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(error)); 251 { 252 int error = Marshal.GetLastWin32Error(); 253 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(error));LocalDBAPI.cs https://github.com/pruiz/mono.git | C# | 359 lines
122 { 123 int hResult=Marshal.GetLastWin32Error(); 124 Bid.Trace("<sc.LocalDBAPI.LocalDBCreateInstance> GetProcAddress for LocalDBCreateInstance error 0x{%X}",hResult); 164 // SNI checks for LocalDBFormatMessage during DLL loading, so it is practically impossibe to get this error. 165 int hResult=Marshal.GetLastWin32Error(); 166 Bid.Trace("<sc.LocalDBAPI.LocalDBFormatMessage> GetProcAddress for LocalDBFormatMessage error 0x{%X}", hResult);X509Native.cs https://github.com/pruiz/mono.git | C# | 395 lines
37 return gotProperty || 38 (ErrorCode)Marshal.GetLastWin32Error() == ErrorCode.MoreData; 39 } 98 ref bufferSize)) { 99 ErrorCode errorCode = (ErrorCode)Marshal.GetLastWin32Error(); 100 if (errorCode != ErrorCode.MoreData) { 109 ref bufferSize)) { 110 throw new CryptographicException(Marshal.GetLastWin32Error()); 111 }Pipe.cs https://github.com/pruiz/mono.git | C# | 1013 lines
211 if (!bSuccess) { 212 __Error.WinIOError(Marshal.GetLastWin32Error(), String.Empty); 213 } 222 if (!bSuccess) { 223 __Error.WinIOError(Marshal.GetLastWin32Error(), String.Empty); 224 }NativeWrapper.cs https://github.com/pruiz/mono.git | C# | 997 lines
70 EventLogHandle handle = UnsafeNativeMethods.EvtQuery(session, path, query, flags); 71 int win32Error = Marshal.GetLastWin32Error(); 72 if (handle.IsInvalid) 85 bool status = UnsafeNativeMethods.EvtSeek(resultSet, position, bookmark, timeout, flags); 86 int win32Error = Marshal.GetLastWin32Error(); 87 if (!status) 113 114 int win32Error = Marshal.GetLastWin32Error(); 115 if (handle.IsInvalid) 339 EventLogHandle renderContextHandleValues = UnsafeNativeMethods.EvtCreateRenderContext(valuePathsCount, valuePaths, flags); 340 int win32Error = Marshal.GetLastWin32Error(); 341 if (renderContextHandleValues.IsInvalid) 357 bool status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Capacity, buffer, out buffUsed, out propCount); 358 int win32Error = Marshal.GetLastWin32Error(); 359CapiSafeHandles.cs https://github.com/pruiz/mono.git | C# | 426 lines
125 else { 126 error = Marshal.GetLastWin32Error(); 127 } 299 if (!CapiNative.UnsafeNativeMethods.CryptDuplicateKey(this, IntPtr.Zero, 0, out duplicate)) { 300 throw new CryptographicException(Marshal.GetLastWin32Error()); 301 } 392 if (!CryptContextAddRef(this, IntPtr.Zero, 0)) { 393 error = Marshal.GetLastWin32Error(); 394 }semaphore.cs https://github.com/pruiz/mono.git | C# | 410 lines
83#if !MONO 84 int errorCode = Marshal.GetLastWin32Error(); 85#endif 161 162 int errorCode = Marshal.GetLastWin32Error(); 163#endif 314#if !MONO 315 int errorCode = Marshal.GetLastWin32Error(); 316#endifProcessManager.cs https://github.com/pruiz/mono.git | C# | 1007 lines
235 SafeProcessHandle processHandle = NativeMethods.OpenProcess(access, false, processId); 236 int result = Marshal.GetLastWin32Error(); 237 if (!processHandle.IsInvalid) { 261 SafeThreadHandle threadHandle = NativeMethods.OpenThread(access, false, threadId); 262 int result = Marshal.GetLastWin32Error(); 263 if (threadHandle.IsInvalid) {x509extension.cs https://github.com/pruiz/mono.git | C# | 738 lines
132 if (result == false) 133 throw new CryptographicException(Marshal.GetLastWin32Error()); 134 157 if (!CAPI.EncodeObject(CAPI.szOID_KEY_USAGE, new IntPtr(&blob), out encodedKeyUsages)) 158 throw new CryptographicException(Marshal.GetLastWin32Error()); 159 221 if (result == false) 222 throw new CryptographicException(Marshal.GetLastWin32Error()); 223 239 if (result == false) 240 throw new CryptographicException(Marshal.GetLastWin32Error()); 241 268 if (!CAPI.EncodeObject(CAPI.szOID_BASIC_CONSTRAINTS2, new IntPtr(&pBasicConstraints2), out encodedBasicConstraints)) 269 throw new CryptographicException(Marshal.GetLastWin32Error()); 270x509chain.cs https://github.com/pruiz/mono.git | C# | 450 lines
234 // The API failed. 235 throw new CryptographicException(Marshal.GetLastWin32Error()); 236 311 312 chainStatus[index].StatusInformation = X509Utils.GetSystemErrorString(mapping.Win32ErrorCode); 313 chainStatus[index].Status = mapping.ChainStatusFlag;x509certificate2collection.cs https://github.com/pruiz/mono.git | C# | 1070 lines
321 new IntPtr(&cbEncoded))) 322 throw new CryptographicException(Marshal.GetLastWin32Error()); 323 pbEncoded = CAPI.LocalAlloc(CAPI.LMEM_FIXED, new IntPtr(cbEncoded)); 327 new IntPtr(&cbEncoded))) 328 throw new CryptographicException(Marshal.GetLastWin32Error()); 329 339 CAPI.EXPORT_PRIVATE_KEYS | CAPI.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY)) 340 throw new CryptographicException(Marshal.GetLastWin32Error()); 341 347 CAPI.EXPORT_PRIVATE_KEYS | CAPI.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY)) 348 throw new CryptographicException(Marshal.GetLastWin32Error()); 349 366 0)) 367 throw new CryptographicException(Marshal.GetLastWin32Error()); 368x509certificate2.cs https://github.com/pruiz/mono.git | C# | 1183 lines
168 if (!result) 169 throw new CryptographicException(Marshal.GetLastWin32Error()); 170 182 if (!result) 183 throw new CryptographicException(Marshal.GetLastWin32Error()); 184WinHttpWebProxyFinder.cs https://github.com/pruiz/mono.git | C# | 345 lines
27 { 28 int errorCode = GetLastWin32Error(); 29 if (Logging.On) Logging.PrintError(Logging.Web, SR.GetString(SR.net_log_proxy_winhttp_cant_open_session, errorCode)); 42 // We weren't able to set the timeouts. Just log and continue. 43 int errorCode = GetLastWin32Error(); 44 if (Logging.On) Logging.PrintError(Logging.Web, SR.GetString(SR.net_log_proxy_winhttp_timeout_error, errorCode)); 182 { 183 errorCode = GetLastWin32Error(); 184 198 { 199 errorCode = GetLastWin32Error(); 200 } 241 242 private static int GetLastWin32Error() 243 {Mkvcbuild.pm https://github.com/gurjeet/postgres.git | Perl | 643 lines
53 sprompt.c thread.c getopt.c getopt_long.c dirent.c rint.c win32env.c 54 win32error.c); 55gdiplustypes.h https://gitlab.com/ubuntu-xenial/mingw-w64 | C Header | 460 lines
43 NotImplemented = 6, 44 Win32Error = 7, 45 WrongState = 8,WinGraphicsMode.cs https://gitlab.com/gonzague.defraiteur/GoliatEditor | C# | 429 lines
208 { 209 Debug.Print("[WGL] ChoosePixelFormatARB failed with {0}", Marshal.GetLastWin32Error()); 210 retry = Utilities.RelaxGraphicsMode(ref mode);WinGLContext.cs https://gitlab.com/gonzague.defraiteur/GoliatEditor | C# | 509 lines
76 { 77 Debug.Print("wglMakeCurrent failed with error: {0}. Retrying", Marshal.GetLastWin32Error()); 78 System.Threading.Thread.Sleep(10); 83 { 84 Debug.Print("[WGL] CreateContext failed with error: {0}", Marshal.GetLastWin32Error()); 85 } 171 if (Handle == ContextHandle.Zero) 172 Debug.Print("failed. (Error: {0})", Marshal.GetLastWin32Error()); 173 } 186 String.Format("Context creation failed. Wgl.CreateContext() error: {0}.", 187 Marshal.GetLastWin32Error())); 188 } 219 { 220 Marshal.GetLastWin32Error(); 221 Debug.Write(String.Format("Sharing state with context {0}: ", sharedContext));Favorites.cpp https://github.com/pcmac77/truecrypt-android.git | C++ | 859 lines
40 { 41 handleWin32Error (hwndDlg); 42 return FALSE;InPlace.c https://github.com/pcmac77/truecrypt-android.git | C | 1692 lines
66 if (!silent) 67 handleWin32Error (MainDlg); 68 165 { 166 handleWin32Error (MainDlg); 167 Error ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL"); 397 { 398 handleWin32Error (MainDlg); 399 ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE); 435 { 436 handleWin32Error (MainDlg); 437 ShowInPlaceEncErrMsgWAltSteps ("CANNOT_RESIZE_FILESYS", TRUE); 462 463 handleWin32Error (MainDlg); 464 }Random.c https://github.com/pcmac77/truecrypt-android.git | C | 772 lines
91 hKeyboard = SetWindowsHookEx (WH_KEYBOARD, (HOOKPROC)&KeyboardProc, NULL, GetCurrentThreadId ()); 92 if (hKeyboard == 0) handleWin32Error (0); 93 96 { 97 handleWin32Error (0); 98 goto error;Keyfiles.c https://github.com/pcmac77/truecrypt-android.git | C | 670 lines
245 SetLastError (ERROR_HANDLE_EOF); 246 handleWin32Error (MainDlg); 247 Error ("ERR_PROCESS_KEYFILE"); 284 { 285 handleWin32Error (MainDlg); 286 Error ("ERR_PROCESS_KEYFILE"); 298 { 299 handleWin32Error (MainDlg); 300 Error ("ERR_PROCESS_KEYFILE_PATH"); 314 { 315 handleWin32Error (MainDlg); 316 Error ("ERR_PROCESS_KEYFILE"); 330 { 331 handleWin32Error (MainDlg); 332 Error ("ERR_PROCESS_KEYFILE");FileTransaction.cs https://github.com/gusgorman/Castle.Services.Transaction.git | C# | 1093 lines
126 { 127 return Marshal.GetExceptionForHR(Marshal.GetLastWin32Error()); 128 } 139 throw new TransactionException("Rollback failed.", 140 Marshal.GetExceptionForHR(Marshal.GetLastWin32Error())); 141 } 185 { 186 var win32Exception = new Win32Exception(Marshal.GetLastWin32Error()); 187 throw new TransactionException(string.Format("Failed to create directory \"{1}\" at path \"{0}\". " 206 { 207 var win32Exception = new Win32Exception(Marshal.GetLastWin32Error()); 208 throw new TransactionException("Unable to perform transacted file delete.", win32Exception); 222 throw new TransactionException("Unable to delete folder. See inner exception for details.", 223 new Win32Exception(Marshal.GetLastWin32Error())); 224 }_subprocess.cs https://github.com/thomo13/ironruby.git | C# | 489 lines
132 if (!result) { 133 int error = Marshal.GetLastWin32Error(); 134 throw PythonExceptions.CreateThrowable(PythonExceptions.WindowsError, error, CTypes.FormatError(error));RegistryKey.cs https://github.com/directhex/mono-1.git | C# | 487 lines
140 // Throw the error 141 Win32Error(result, null); 142 break; 200 // Throw the error 201 Win32Error(result, null); 202 break;MainWindow.xaml.cs https://gitlab.com/Der_Informatiker/InternetChecker | C# | 483 lines
78 Int32 tempResult = IntSetWindowLong(hWnd, nIndex, IntPtrToInt32(dwNewLong)); 79 error = Marshal.GetLastWin32Error(); 80 result = new IntPtr(tempResult); 85 result = IntSetWindowLongPtr(hWnd, nIndex, dwNewLong); 86 error = Marshal.GetLastWin32Error(); 87 }ResourceTests.vb https://gitlab.com/sharadag/TestProject2 | Visual Basic | 814 lines
49 If [lib] = IntPtr.Zero Then 50 Throw New Win32Exception(Marshal.GetLastWin32Error()) 51 End If 136 If [lib] = IntPtr.Zero Then 137 Throw New Win32Exception(Marshal.GetLastWin32Error()) 138 End IfResourceTests.cs https://gitlab.com/sharadag/TestProject2 | C# | 882 lines
54 if (lib == IntPtr.Zero) 55 throw new Win32Exception(Marshal.GetLastWin32Error()); 56 144 if (lib == IntPtr.Zero) 145 throw new Win32Exception(Marshal.GetLastWin32Error()); 146ResourceTests.vb https://gitlab.com/sharadag/Roslyn | Visual Basic | 814 lines
49 If [lib] = IntPtr.Zero Then 50 Throw New Win32Exception(Marshal.GetLastWin32Error()) 51 End If 136 If [lib] = IntPtr.Zero Then 137 Throw New Win32Exception(Marshal.GetLastWin32Error()) 138 End If 334 [lib] = LoadLibraryEx(exeFile.Path, IntPtr.Zero, &H2) 335 Assert.True([lib] <> IntPtr.Zero, String.Format("LoadLibrary failed with HResult: {0:X}", Marshal.GetLastWin32Error())) 336queue.c https://github.com/mirrors/wine.git | C | 1473 lines
181 concat_W( target, NULL, op->dst_path, op->dst_file ); 182 paths->Win32Error = 0; 183 paths->Flags = 0; 221 pathsA.Target = strdupWtoA( pathsW->Target ); 222 pathsA.Win32Error = pathsW->Win32Error; 223 pathsA.Flags = pathsW->Flags; 240 statusA.FileName = strdupWtoA( statusW->FileName ); 241 statusA.Win32Error = statusW->Win32Error; 242 statusA.FailureCode = statusW->FailureCode; 387 const FILEPATHS_W *paths = (const FILEPATHS_W *)param1; 388 return paths->Win32Error; 389 }Mkvcbuild.pm https://bitbucket.org/robins/postgresql.git | Perl | 794 lines
74 sprompt.c tar.c thread.c wait_error.c getopt.c getopt_long.c dirent.c rint.c win32env.c 75 win32error.c win32setlocale.c); 76install.py https://github.com/beiske/play.git | Python | 585 lines
107# Convert an ADSI COM exception to the Win32 error code embedded in it. 108def _GetWin32ErrorCode(com_exc): 109 hr, msg, exc, narg = com_exc 298 except pythoncom.com_error, details: 299 rc = _GetWin32ErrorCode(details) 300 if rc != winerror.ERROR_PATH_NOT_FOUND:mscorlib.compat.sc https://github.com/andreiagaita/moon.git | Scala | 215 lines
37!SC-M: System.Int32 System.Runtime.InteropServices.Marshal::GetHRForException(System.Exception) 38!SC-M: System.Int32 System.Runtime.InteropServices.Marshal::GetLastWin32Error() 39!SC-M: System.Int32 System.Runtime.InteropServices.Marshal::ReadInt32(System.IntPtr)Misc.cs https://github.com/tforsberg/z.git | C# | 1298 lines
179 bool result = UnsafeNativeMethods.EnumChildWindows(hwnd, lpEnumFunc, lParam); 180 int lastWin32Error = Marshal.GetLastWin32Error(); 181 192 IntPtr result = NativeMethodsSetLastError.FindWindowEx(hwndParent, hwndChildAfter, className, wndName); 193 int lastWin32Error = Marshal.GetLastWin32Error(); 194 271 bool result = UnsafeNativeMethods.GetClientRect(hwnd, ref rc); 272 int lastWin32Error = Marshal.GetLastWin32Error(); 273 303 : UnsafeNativeMethods.GetCursorPos(ref pt); 304 int lastWin32Error = Marshal.GetLastWin32Error(); 305 317 IntPtr hdc = UnsafeNativeMethods.GetDC(hwnd); 318 int lastWin32Error = Marshal.GetLastWin32Error(); 319X509Utils.cs https://github.com/tforsberg/z.git | C# | 396 lines
149 ref cbData)) { 150 int dwErrorCode = Marshal.GetLastWin32Error(); 151 if (dwErrorCode == CAPI.CRYPT_E_NOT_FOUND) 153 else 154 throw new CryptographicException(Marshal.GetLastWin32Error()); 155 } 161 ref cbData)) { 162 int dwErrorCode = Marshal.GetLastWin32Error(); 163 if (dwErrorCode == CAPI.CRYPT_E_NOT_FOUND) 165 else 166 throw new CryptographicException(Marshal.GetLastWin32Error()); 167 } 202 if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) 203 throw new CryptographicException(Marshal.GetLastWin32Error()); 204Utility.cs https://github.com/tforsberg/z.git | C# | 444 lines
35 int processId = Process.GetCurrentProcess().Id; 36#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() 37 SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION | ListenerUnsafeNativeMethods.WRITE_DAC | ListenerUnsafeNativeMethods.READ_CONTROL, false, processId); 48 { 49#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() 50 SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION, false, pid); 63 bool success = ListenerUnsafeNativeMethods.OpenProcessToken(process, requiredAccess, out processToken); 64 int error = Marshal.GetLastWin32Error(); 65 if (!success) 79 { 80 int error = Marshal.GetLastWin32Error(); 81 if (error != ListenerUnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) 94 { 95 int error = Marshal.GetLastWin32Error(); 96 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error));WindowsIdentity.cs https://github.com/madewokherd/mono.git | C# | 1161 lines
80 if (!Interop.Advapi32.AllocateLocallyUniqueId(out sourceContext.SourceIdentifier)) 81 throw new SecurityException(string.Format(CultureInfo.InvariantCulture, "AllocateLocallyUniqueId returned error {0}", Marshal.GetLastWin32Error())); 82 sourceContext.SourceName = new byte[TOKEN_SOURCE.TOKEN_SOURCE_LENGTH]; 257 out dwLength) && 258 Marshal.GetLastWin32Error() == Interop.Errors.ERROR_INVALID_HANDLE) 259 { 273 { 274 throw new SecurityException(string.Format(CultureInfo.InvariantCulture, "DuplicateHandle returned error {0}", Marshal.GetLastWin32Error())); 275 }JclWin32.pas https://github.com/padcom/delcos.git | Pascal | 1185 lines
97 98// EJclWin32Error 99type 99type 100 EJclWin32Error = class(EJclError) 101 privateerror.c https://gitlab.com/dj-tech/reactos | C | 798 lines
119/********************************************************************** 120 * RtlGetLastWin32Error (NTDLL.@) 121 * 127 * RETURNS 128 * The current error value for the thread, as set by SetLastWin32Error() or SetLastError(). 129 */ 131NTAPI 132RtlGetLastWin32Error(VOID) 133{ 137/*********************************************************************** 138 * RtlSetLastWin32Error (NTDLL.@) 139 * RtlRestoreLastWin32Error (NTDLL.@) 150NTAPI 151RtlSetLastWin32Error(IN ULONG LastError) 152{virtmem.c https://gitlab.com/dj-tech/reactos | C | 735 lines
60 if (!bRet) 61 ShowLastWin32Error(pVirtMem->hSelf); 62 251 if (bErr) 252 ShowLastWin32Error(pVirtMem->hSelf); 253general.c https://gitlab.com/dj-tech/reactos | C | 583 lines
31 32VOID ShowLastWin32Error(HWND hWndOwner) 33{format.c https://gitlab.com/dj-tech/reactos | C | 672 lines
144// 145// PrintWin32Error 146// 149//---------------------------------------------------------------------- 150static VOID PrintWin32Error(LPWSTR Message, DWORD ErrorCode) 151{ 461 LoadStringW(GetModuleHandle(NULL), STRING_ERROR_DRIVE_TYPE, szMsg, ARRAYSIZE(szMsg)); 462 PrintWin32Error(szMsg, GetLastError()); 463 return -1; 471 LoadStringW(GetModuleHandle(NULL), STRING_NO_VOLUME, szMsg, ARRAYSIZE(szMsg)); 472 PrintWin32Error(szMsg, GetLastError()); 473 return -1; 511 LoadStringW(GetModuleHandle(NULL), STRING_NO_VOLUME, szMsg, ARRAYSIZE(szMsg)); 512 PrintWin32Error(szMsg, GetLastError()); 513 return -1;main.c https://gitlab.com/dj-tech/reactos | C | 1205 lines
145VOID 146PrintWin32Error(IN LPWSTR Message, IN DWORD ErrorCode) 147{ 157 158int ShowLastWin32Error(VOID) 159{welcome.c https://gitlab.com/dj-tech/reactos | C | 924 lines
110static VOID 111ShowLastWin32Error(HWND hWnd) 112{ 337 { 338 ShowLastWin32Error(hWndMain); 339 return TRUE;mplay32.c https://gitlab.com/dj-tech/reactos | C | 1540 lines
206static VOID 207ShowLastWin32Error(HWND hwnd) 208{ 231 { 232 ShowLastWin32Error(hwnd); 233 return; 310 { 311 ShowLastWin32Error(hwnd); 312 return; 330 { 331 ShowLastWin32Error(hwnd); 332 return; 348 { 349 ShowLastWin32Error(hwnd); 350 return;fileutils.c https://gitlab.com/dj-tech/reactos | C | 592 lines
302 { 303 ShowLastWin32Error(Globals.hMainWnd); 304 goto done; 309 { 310 ShowLastWin32Error(Globals.hMainWnd); 311 goto done; 341 { 342 ShowLastWin32Error(Globals.hMainWnd); 343 goto done; 365 { 366 ShowLastWin32Error(Globals.hMainWnd); 367 goto done; 371 { 372 ShowLastWin32Error(Globals.hMainWnd); 373 goto done;clipbrd.c https://gitlab.com/dj-tech/reactos | C | 597 lines
56 { 57 ShowLastWin32Error(Globals.hMainWnd); 58 return; 76 { 77 ShowLastWin32Error(Globals.hMainWnd); 78 return; 543 { 544 ShowLastWin32Error(NULL); 545 return 0; 562 { 563 ShowLastWin32Error(NULL); 564 return 0; 572 { 573 ShowLastWin32Error(Globals.hMainWnd); 574 }kernel32.py https://bitbucket.org/deeso/vivisect_stuff.git | Python | 1760 lines
45class EnterCriticalSection(ntdll.RtlEnterCriticalSection): pass 46class GetLastError(ntdll.RtlGetLastWin32Error): pass 47class HeapAlloc(ntdll.RtlAllocateHeap): pass 57class RemoveVectoredExceptionHandler(ntdll.RtlRemoveVectoredExceptionHandler): pass 58class RestoreLastError(ntdll.RtlRestoreLastWin32Error): pass 59class RtlCaptureContext(ntdll.RtlCaptureContext): pass 65class SetCriticalSectionSpinCount(ntdll.RtlSetCriticalSectionSpinCount): pass 66class SetLastError(ntdll.RtlSetLastWin32Error): pass 67class TryEnterCriticalSection(ntdll.RtlTryEnterCriticalSection): passServiceController.cs https://gitlab.com/0072016/0072016-corefx- | C# | 856 lines
158 159 int lastError = Marshal.GetLastWin32Error(); 160 if (lastError != Interop.mincore.Errors.ERROR_MORE_DATA) 236 237 int lastError = Marshal.GetLastWin32Error(); 238 if (lastError != Interop.mincore.Errors.ERROR_INSUFFICIENT_BUFFER) 246 if (!success) 247 throw new Win32Exception(Marshal.GetLastWin32Error()); 248 325 326 int lastError = Marshal.GetLastWin32Error(); 327 if (lastError != Interop.mincore.Errors.ERROR_INSUFFICIENT_BUFFER) 336 if (!success) 337 throw new Win32Exception(Marshal.GetLastWin32Error()); 338Interop.crypt32.cs https://gitlab.com/0072016/0072016-corefx- | C# | 298 lines
190 if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, null, ref cb)) 191 throw Marshal.GetLastWin32Error().ToCryptographicException(); 192 194 if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, encoded, ref cb)) 195 throw Marshal.GetLastWin32Error().ToCryptographicException(); 196 203 if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, null, ref cb)) 204 throw Marshal.GetLastWin32Error().ToCryptographicException(); 205 207 if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, encoded, ref cb)) 208 throw Marshal.GetLastWin32Error().ToCryptographicException(); 209CertificatePal.cs https://gitlab.com/0072016/0072016-corefx- | C# | 544 lines
67 if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_SHA1_HASH_PROP_ID, null, ref cbData)) 68 throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 69 71 if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_SHA1_HASH_PROP_ID, thumbprint, ref cbData)) 72 throw Marshal.GetHRForLastWin32Error().ToCryptographicException();; 73 return thumbprint; 146 if (!Interop.crypt32.CertGetCertificateChain(ChainEngine.HCCE_CURRENT_USER, _certContext, (FILETIME*)null, SafeCertStoreHandle.InvalidHandle, ref chainPara, CertChainFlags.None, IntPtr.Zero, out certChainContext)) 147 throw Marshal.GetHRForLastWin32Error().ToCryptographicException();; 148 if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, null, ref cbData)) 148 if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, null, ref cbData)) 149 throw Marshal.GetHRForLastWin32Error().ToCryptographicException();; 150 } 153 if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, keyAlgorithmParameters, ref cbData)) 154 throw Marshal.GetHRForLastWin32Error().ToCryptographicException();; 155PathHelper.Windows.cs https://gitlab.com/0072016/0072016-corefx- | C# | 390 lines
52 /// <exception cref="PathTooLongException">Thrown if the path or a path segment exceeds the filesystem limits.</exception> 53 /// <exception cref="FileNotFoundException">Thrown if Windows returns ERROR_FILE_NOT_FOUND. (See Win32Marshal.GetExceptionForWin32Error)</exception> 54 /// <exception cref="DirectoryNotFoundException">Thrown if Windows returns ERROR_PATH_NOT_FOUND. (See Win32Marshal.GetExceptionForWin32Error)</exception> 54 /// <exception cref="DirectoryNotFoundException">Thrown if Windows returns ERROR_PATH_NOT_FOUND. (See Win32Marshal.GetExceptionForWin32Error)</exception> 55 /// <exception cref="UnauthorizedAccessException">Thrown if Windows returns ERROR_ACCESS_DENIED. (See Win32Marshal.GetExceptionForWin32Error)</exception> 56 /// <exception cref="IOException">Thrown if Windows returns an error that doesn't map to the above. (See Win32Marshal.GetExceptionForWin32Error)</exception> 226 // Failure, get the error and throw 227 int errorCode = Marshal.GetLastWin32Error(); 228 if (errorCode == 0) 229 errorCode = Interop.mincore.Errors.ERROR_BAD_PATHNAME; 230 throw Win32Marshal.GetExceptionForWin32Error(errorCode, path); 231 }SocketPal.Windows.cs https://gitlab.com/0072016/0072016-corefx- | C# | 936 lines
35 { 36 return (SocketError)Marshal.GetLastWin32Error(); 37 } 56 { 57 errorCode = (SocketError)Marshal.GetLastWin32Error(); 58 } 147 { 148 errorCode = (SocketError)Marshal.GetLastWin32Error(); 149 } 263 { 264 errorCode = (SocketError)Marshal.GetLastWin32Error(); 265 } 326 { 327 errorCode = (SocketError)Marshal.GetLastWin32Error(); 328 }FakeInterop.cs https://gitlab.com/0072016/0072016-corefx- | C# | 622 lines
63 { 64 TestControl.LastWin32Error = (int)Interop.WinHttp.ERROR_INVALID_HANDLE; 65 return new FakeSafeWinHttpHandle(false); 70 { 71 TestControl.LastWin32Error = (int)Interop.WinHttp.ERROR_INVALID_PARAMETER; 72 return new FakeSafeWinHttpHandle(false); 269 { 270 TestControl.LastWin32Error = (int)Interop.WinHttp.ERROR_WINHTTP_HEADER_NOT_FOUND; 271 return false; 292 { 293 TestControl.LastWin32Error = (int)Interop.WinHttp.ERROR_WINHTTP_HEADER_NOT_FOUND; 294 return false; 315 bufferLength = bufferLengthNeeded; 316 TestControl.LastWin32Error = (int)Interop.WinHttp.ERROR_INSUFFICIENT_BUFFER; 317 return false;PipeStream.Windows.cs https://gitlab.com/0072016/0072016-corefx- | C# | 498 lines
72 { 73 throw Win32Marshal.GetExceptionForWin32Error(errorCode, String.Empty); 74 } 129 default: 130 throw Win32Marshal.GetExceptionForWin32Error(errorCode); 131 } 196 { 197 throw WinIOError(Marshal.GetLastWin32Error()); 198 } 216 { 217 throw WinIOError(Marshal.GetLastWin32Error()); 218 } 251 { 252 throw WinIOError(Marshal.GetLastWin32Error()); 253 }WinRTFileSystem.cs https://gitlab.com/0072016/0072016-corefx- | C# | 678 lines
131 // we reached the root and it did not exist. we can't create roots. 132 throw Win32Marshal.GetExceptionForWin32Error(Interop.mincore.Errors.ERROR_PATH_NOT_FOUND, workingPath); 133 } 142 if (failIfExists && (stackDir.Count == 0)) 143 throw Win32Marshal.GetExceptionForWin32Error(Interop.mincore.Errors.ERROR_ALREADY_EXISTS, fullPath); 144Win32FileSystemEnumerable.cs https://gitlab.com/0072016/0072016-corefx- | C# | 668 lines
173 { 174 int errorCode = Marshal.GetLastWin32Error(); 175 if (errorCode != Interop.mincore.Errors.ERROR_FILE_NOT_FOUND && errorCode != Interop.mincore.Errors.ERROR_NO_MORE_FILES) 312 { 313 int errorCode = Marshal.GetLastWin32Error(); 314 if (errorCode == Interop.mincore.Errors.ERROR_FILE_NOT_FOUND || errorCode == Interop.mincore.Errors.ERROR_NO_MORE_FILES || errorCode == Interop.mincore.Errors.ERROR_PATH_NOT_FOUND)Win32FileSystem.cs https://gitlab.com/0072016/0072016-corefx- | C# | 733 lines
43 44 throw Win32Marshal.GetExceptionForWin32Error(errorCode, fileName); 45 } 116 { 117 int currentError = Marshal.GetLastWin32Error(); 118 // While we tried to avoid creating directories that don't 145 if (!DirectoryExists(root)) 146 throw Win32Marshal.GetExceptionForWin32Error(Interop.mincore.Errors.ERROR_PATH_NOT_FOUND, root); 147 return; 152 if (!r && (firstError != 0)) 153 throw Win32Marshal.GetExceptionForWin32Error(firstError, errorString); 154 } 160 { 161 int errorCode = Marshal.GetLastWin32Error(); 162 if (errorCode == Interop.mincore.Errors.ERROR_FILE_NOT_FOUND)Win32FileStream.cs https://gitlab.com/0072016/0072016-corefx- | C# | 1125 lines
116 // probably be consistent w/ every other directory. 117 int errorCode = Marshal.GetLastWin32Error(); 118 121 122 throw Win32Marshal.GetExceptionForWin32Error(errorCode, _fileName); 123 }ProcessManager.Windows.cs https://gitlab.com/0072016/0072016-corefx- | C# | 1135 lines
174 SafeProcessHandle processHandle = Interop.mincore.OpenProcess(access, false, processId); 175 int result = Marshal.GetLastWin32Error(); 176 if (!processHandle.IsInvalid) 203 SafeThreadHandle threadHandle = Interop.mincore.OpenThread(access, false, threadId); 204 int result = Marshal.GetLastWin32Error(); 205 if (threadHandle.IsInvalid)ConsolePal.Windows.cs https://gitlab.com/0072016/0072016-corefx- | C# | 1124 lines
99 if (!Interop.mincore.SetConsoleCP(enc.CodePage)) 100 Win32Marshal.GetExceptionForWin32Error(Marshal.GetLastWin32Error()); 101 } 113 if (!Interop.mincore.SetConsoleOutputCP(enc.CodePage)) 114 Win32Marshal.GetExceptionForWin32Error(Marshal.GetLastWin32Error()); 115 } 294 { 295 int errorCode = Marshal.GetLastWin32Error(); 296 if (errorCode == Interop.mincore.Errors.ERROR_INVALID_HANDLE) 297 throw new InvalidOperationException(SR.InvalidOperation_ConsoleKeyAvailableOnFile); 298 throw Win32Marshal.GetExceptionForWin32Error(errorCode, "stdin"); 299 } 309 if (!r) 310 throw Win32Marshal.GetExceptionForWin32Error(Marshal.GetLastWin32Error()); 311 }