100+ results for 'win32error'

Not the results you expected?

Exceptions.cs (https://gitlab.com/unofficial-mirrors/PowerShell) C# · 688 lines

178 ErrorCategory errorCategory = ErrorCategory.NotSpecified)

179 : this(errorCode,

180 StringUtil.Format(Strings.UnspecifiedErrorWin32Error, errorCode),

181 target,

182 errorCategory)

WinUsb.Helpers.cs (https://github.com/AArnott/pinvoke.git) C# · 127 lines

51 else

52 {

53 var error = (Win32ErrorCode)Marshal.GetLastWin32Error();

54

55 if (error == Win32ErrorCode.ERROR_IO_PENDING)

106 else

107 {

108 var error = (Win32ErrorCode)Marshal.GetLastWin32Error();

109

110 if (error == Win32ErrorCode.ERROR_IO_PENDING)

GdiPlusTypes2.h (https://github.com/snowie2000/mactype.git) C Header · 770 lines

100 InsufficientBuffer = 5,

101 NotImplemented = 6,

102 Win32Error = 7,

103 WrongState = 8,

104 Aborted = 9,

Utility.cs (https://github.com/Microsoft/service-fabric.git) C# · 953 lines

38 if (isSet == false)

39 {

40 int status = Marshal.GetLastWin32Error();

41 Assert(false, "SetFileInformationByHandle failed: ErrorCode: {0}", status);

42 }

StatusConverter.Test.cpp (https://github.com/Microsoft/service-fabric.git) C++ · 416 lines

367 }

368

369 BOOST_AUTO_TEST_CASE(TryConvert_Win32Error_WellKnown_TRUE)

370 {

371 bool isConverted = true;

401 }

402

403 BOOST_AUTO_TEST_CASE(TryConvert_Win32Error_UnKnown_TRUE)

404 {

405 bool isConverted = true;

I2C.cs (https://GumstixIII.svn.codeplex.com/svn) C# · 463 lines

128 {

129 case -7:

130 throw new Exception("No Acknowledge Issued:" + Marshal.GetLastWin32Error());

131 case -8:

132 throw new Exception("NULL Buffer:" + Marshal.GetLastWin32Error());

133 case -9:

134 throw new Exception("Invalid Buffer Size:" + Marshal.GetLastWin32Error());

135 case -10:

136 throw new Exception("NULL lpiResult field:" + Marshal.GetLastWin32Error());

137 case -11:

138 throw new Exception("CRM Operation Failure:" + Marshal.GetLastWin32Error());

139 case -12:

140 throw new Exception("I2C transmit timeout error:" + Marshal.GetLastWin32Error());

PrintSystemException.cs (https://github.com/dotnet/wpf.git) C# · 1294 lines

266 )

267 {

268 StringBuilder win32ErrorMessage = new StringBuilder(defaultWin32ErrorMessageLength);

269

270 int charCount = NativeMethodsForPrintExceptions.InvokeFormatMessage(FormatMessageFromSystem,

271 IntPtr.Zero,

272 win32Error,

273 0,

274 win32ErrorMessage,

278 if(charCount < 0)

279 {

280 win32ErrorMessage.Length = 0;

281 }

282 else

kernel32.cs (https://blend.svn.codeplex.com/svn) C# · 4524 lines

225 public static int GetLastError()

226 {

227 return Marshal.GetLastWin32Error();

228 }

229

SafeCryptHandles.cs (https://github.com/pruiz/mono.git) C# · 122 lines

32 protected override bool ReleaseHandle()

33 {

34 // PreSharp Bug: Call 'Marshal.GetLastWin32Error' or 'Marshal.GetHRForLastWin32Error' before any other interop call.

35 #pragma warning suppress 56523 // We are not interested in throwing an exception here if CloseHandle fails.

36 return NativeMethods.CryptReleaseContext(handle, 0);

59 protected override bool ReleaseHandle()

60 {

61 // PreSharp Bug: Call 'Marshal.GetLastWin32Error' or 'Marshal.GetHRForLastWin32Error' before any other interop call.

62 #pragma warning suppress 56523 // We are not interested in throwing an exception here if CloseHandle fails.

63 bool ret = NativeMethods.CryptDestroyKey(handle);

100 if (!b)

101 {

102 err = Marshal.GetLastWin32Error();

103 provHandle.DangerousRelease();

104 }

regclient.c (https://github.com/BeyondTrust/pbis-open.git) C · 868 lines

56 )

57 {

58 return RegNtStatusToWin32Error(

59 NtRegEnumRootKeysA(hRegConnection,

60 pppszRootKeyNames,

71 )

72 {

73 return RegNtStatusToWin32Error(

74 NtRegEnumRootKeysW(hRegConnection,

75 pppwszRootKeyNames,

93 )

94 {

95 return RegNtStatusToWin32Error(

96 NtRegCreateKeyExA(

97 hRegConnection,

samdbsecurity.c (https://github.com/BeyondTrust/pbis-open.git) C · 1448 lines

211 ntStatus != STATUS_SUCCESS)

212 {

213 dwError = LwNtStatusToWin32Error(ntStatus);

214 }

215

323 ntStatus != STATUS_SUCCESS)

324 {

325 dwError = LwNtStatusToWin32Error(ntStatus);

326 }

327

433 ntStatus != STATUS_SUCCESS)

434 {

435 dwError = LwNtStatusToWin32Error(ntStatus);

436 }

437

color.cxx (https://github.com/pustladi/Windows-2000.git) C++ · 910 lines

345 }

346 else

347 return GetLastWin32Error();

348 #else

349 // Win16 only

351 // BUGBUG This will leak hdc

352 if (g_hpalHalftone == NULL)

353 return GetLastWin32Error();

354 CopyColorsFromPaletteEntries(g_rgbHalftone, g_lpHalftone.ape, g_lpHalftone.wCnt);

355 #endif

AdvancedProviderEvents.cs (https://github.com/pauldotknopf/WindowsSDK7-Samples.git) C# · 1511 lines

71 private EventDescriptor SampleEvt_ValueMap_UInt8;

72 private EventDescriptor SampleEvt_BitMap_UInt8;

73 private EventDescriptor SampleEvt_UInt32_Win32Error;

74 private EventDescriptor SampleEvt_UInt32_NTSTATUS;

75 private EventDescriptor SampleEvt_Int32_HResult;

570 // Event method for SampleEvt_UInt32_Win32Error

571 //

572 public bool EventWriteSampleEvt_UInt32_Win32Error(uint Prop_UInt32_Win32Error)

573 {

574

578 }

579

580 return m_provider.TemplateT_UInt32_Win32Error(ref SampleEvt_UInt32_Win32Error, Prop_UInt32_Win32Error);

581 }

582

error.h (https://github.com/stephenegriffin/mfcmapi.git) C Header · 436 lines

19 // WC_W32 - does the same as WC_H, wrapping the result of the function call in HRESULT_FROM_WIN32

20

21 // EC_B - Similar to EC_H, but for Boolean functions, using CheckWin32Error to set failure in hRes

22 // WC_B - Similar to WC_H, but for Boolean functions, using CheckWin32Error to set failure in hRes

58

59 _Check_return_ HRESULT

60 CheckWin32Error(bool bDisplayDialog, _In_z_ LPCSTR szFile, int iLine, _In_z_ LPCSTR szFunction);

61

62 // Flag parsing array - used by ErrorNameFromErrorCode

216 }()

217

218 // Execute a bool/BOOL function, log error, and return CheckWin32Error(HRESULT)

219 // Will display dialog on error

220 #define EC_B(fnx) \

221 error::CheckMe( \

222 [&]() -> HRESULT { return !(fnx) ? error::CheckWin32Error(true, __FILE__, __LINE__, #fnx) : S_OK; }())

223

224 // Execute a bool/BOOL function, log error, and swallow error

DrsReplicaSyncFailures.cs (https://github.com/microsoft/WindowsProtocolTestSuites.git) C# · 570 lines

269 msgIn);

270 BaseTestSite.Assert.AreEqual<uint>(

271 (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,

272 ret,

273 "DrsReplicaSync: return code mismatch."

331 msgIn);

332 BaseTestSite.Assert.AreEqual<uint>(

333 (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,

334 ret,

335 "DrsReplicaSync: return code mismatch."

387 msgIn);

388 BaseTestSite.Assert.AreEqual<uint>(

389 (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,

390 ret,

391 "DrsReplicaSync: return code mismatch."

StreamInfo.cs (https://github.com/RoDaniel/featurehouse.git) C# · 282 lines

80 return false;

81 default:

82 throw Win32ErrorCode.GetExceptionForWin32Error(errorCode);

83 }

84 }

210 else

211 if (!NativeMethods.DeleteFile(FullName))

212 throw Win32ErrorCode.GetExceptionForWin32Error(Marshal.GetLastWin32Error());

213 }

214 public FileStream Open(FileMode mode)

258 int errorCode = Marshal.GetLastWin32Error();

259 result.Close();

260 throw Win32ErrorCode.GetExceptionForWin32Error(errorCode);

261 }

262 if (share == FileShare.None)

Windows.Foundation.Diagnostics.0.h (https://github.com/WhitewaterFoundry/WSLFedoraRemix.git) C Header · 971 lines

71 Xml = 11,

72 Json = 12,

73 Win32Error = 13,

74 NTStatus = 14,

75 HResult = 15,

gdiplustypes.h (https://github.com/aragaer/wine.git) C Header · 276 lines

30 InsufficientBuffer = 5,

31 NotImplemented = 6,

32 Win32Error = 7,

33 WrongState = 8,

34 Aborted = 9,

SelfSignedCertificate.cs (https://github.com/pruiz/mono.git) C# · 236 lines

116 out addedCert))

117 {

118 int error = Marshal.GetLastWin32Error();

119 Utility.CloseInvalidOutSafeHandle(addedCert);

120 PeerExceptionHelper.ThrowInvalidOperation_PeerCertGenFailure(new Win32Exception(error));

180 ContextFlags.NewKeySet | ContextFlags.Silent))

181 {

182 int error = Marshal.GetLastWin32Error();

183 Utility.CloseInvalidOutSafeHandle(keyContainer);

184 keyContainer = null;

192 out key))

193 {

194 int error = Marshal.GetLastWin32Error();

195 Utility.CloseInvalidOutSafeHandle(key);

196 key = null;

SystemColorsEx.cs (https://github.com/ctacke/sdf.git) C# · 676 lines

73 Int32[] rgbs = GetArrayOfRGBs(aSchemeName);

74 if (SetSysColors(29, el, rgbs) == false) {

75 throw new ApplicationException(Marshal.GetLastWin32Error().ToString());

76 }

77

208 set {

209 if (SetSysColors(1, new Int32[]{COLOR_GRADIENTACTIVECAPTION}, new Int32[]{ColorTranslator.ToWin32(value)}) == false) {

210 throw new ApplicationException(Marshal.GetLastWin32Error().ToString());

211 }

212 }

223 set {

224 if (SetSysColors(1, new Int32[]{COLOR_GRADIENTINACTIVECAPTION}, new Int32[]{ColorTranslator.ToWin32(value)}) == false) {

225 throw new ApplicationException(Marshal.GetLastWin32Error().ToString());

226 }

227 }

LongPathDirectory.cs (https://hg.codeplex.com/longpaths) C# · 927 lines

65

66 // To mimic Directory.CreateDirectory, we don't throw if the directory (not a file) already exists

67 int errorCode = Marshal.GetLastWin32Error();

68 if (errorCode != NativeMethods.ERROR_ALREADY_EXISTS || !LongPathDirectory.Exists(path)) {

69 throw LongPathCommon.GetExceptionFromWin32Error(errorCode);

127

128 if (!NativeMethods.RemoveDirectory(normalizedPath)) {

129 throw LongPathCommon.GetExceptionFromLastWin32Error();

130 }

131 }

804 int errorCode = LongPathCommon.TryGetDirectoryAttributes(normalizedPath, out attributes);

805 if (errorCode != 0) {

806 throw LongPathCommon.GetExceptionFromWin32Error(errorCode);

807 }

808

FtpConnection.cs (https://ftplib.svn.codeplex.com/svn) C# · 528 lines

198 if (hFindFile == IntPtr.Zero)

199 {

200 if (Marshal.GetLastWin32Error() == WINAPI.ERROR_NO_MORE_FILES)

201 {

202 return files;

232 }

233

234 if (Marshal.GetLastWin32Error() != WINAPI.ERROR_NO_MORE_FILES)

235 Error();

236

263 if (hFindFile == IntPtr.Zero)

264 {

265 if (Marshal.GetLastWin32Error() == WINAPI.ERROR_NO_MORE_FILES)

266 {

267 return files.ToArray();

Win32ExceptionTest.cs (https://github.com/QuickJack/mono.git) C# · 182 lines

41 public void Constructor0 ()

42 {

43 int native_error = Marshal.GetLastWin32Error ();

44

45 Win32Exception ex = new Win32Exception ();

83 Win32Exception ex;

84 string msg = "ERROR";

85 int native_error = Marshal.GetLastWin32Error ();

86

87 ex = new Win32Exception (msg);

150 Win32Exception ex;

151 string msg = "ERROR";

152 int native_error = Marshal.GetLastWin32Error ();

153 Exception inner = new Exception ();

154

FileAsyncOperation.cpp (https://github.com/Microsoft/service-fabric.git) C++ · 355 lines

347 bool FileAsyncOperation::IsSharingViolationError(Common::ErrorCode const& error)

348 {

349 if (error.IsWin32Error(ERROR_SHARING_VIOLATION) || error.IsError(ErrorCodeValue::SharingAccessLockViolation))

350 {

351 return true;

to32.c (https://github.com/Paolo-Maffei/OpenNT.git) C · 1268 lines

113 //

114 vLastCall = LAST_CALL_IS_WIN32 ;

115 err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,

116 (DWORD)aligned_p2,

117 (DWORD)aligned_p3,

171 //

172 vLastCall = LAST_CALL_IS_WIN32 ;

173 err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,

174 (DWORD)p2,

175 (DWORD)lpfnWNetCancelConnection,

233 //

234 vLastCall = LAST_CALL_IS_WIN32 ;

235 err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,

236 (DWORD)aligned_p2,

237 (DWORD)aligned_p3,

Win32Exception.cs (https://github.com/letssellsomebananas/mono.git) C# · 115 lines

48 #endif

49 public Win32Exception ()

50 : base (W32ErrorMessage (Marshal.GetLastWin32Error ()))

51 {

52 native_error_code = Marshal.GetLastWin32Error ();

74 : base (message)

75 {

76 native_error_code = Marshal.GetLastWin32Error ();

77 }

78

84 : base (message, innerException)

85 {

86 native_error_code = Marshal.GetLastWin32Error ();

87 }

88 #endif

HookKeyboard.cs (https://github.com/Wiladams/NewTOAPIA.git) C# · 235 lines

91 if (IntPtr.Zero == hKeyboardHook)

92 {

93 //Common.Log("Error installing keyboard hook: " + Marshal.GetLastWin32Error().ToString());

94 Stop();

95 }

105 if (retKeyboard == false)

106 {

107 int errorCode = Marshal.GetLastWin32Error();

108 //throw new Win32Exception(errorCode);

109 //Common.Log("Exception uninstalling keyboard hook, error code: " + errorCode.ToString());

E3ErrorManager.c (git://pkgs.fedoraproject.org/quesa) C · 550 lines

181

182 #elif QUESA_OS_WIN32

183 kQ3ErrorWin32Error,

184

185 #elif QUESA_OS_UNIX

UacProperties.cs (https://gitlab.com/doubledown/CitiBike) C# · 130 lines

61 if (!NativeMethods.OpenProcessToken(Process.GetCurrentProcess().Handle, 0x00020000 | 0x0008, out tokenHandle))

62 {

63 throw new ApplicationException("Could not get process token. Win32 Error Code: " + Marshal.GetLastWin32Error());

64 }

65 try

UnsafeNativeMethods.cs (https://github.com/dotnet/winforms.git) C# · 59 lines

35 // Performance should not be an issue for current MAX_PATH length due to this change.

36 while (((length = GetModuleFileName(hModule, buffer, buffer.Capacity)) == buffer.Capacity)

37 && Marshal.GetLastWin32Error() == ERROR.INSUFFICIENT_BUFFER

38 && buffer.Capacity < Kernel32.MAX_UNICODESTRING_LEN)

39 {

NamedPipeClient.cs (https://github.com/QuickJack/mono.git) C# · 113 lines

94 if (hPipe.ToInt32() == NamedPipeHelper.INVALID_HANDLE_VALUE)

95 {

96 int lastError = Marshal.GetLastWin32Error();

97 if (lastError != NamedPipeHelper.ERROR_PIPE_BUSY)

98 throw new NamedPipeException(lastError);

InternalResources.cs (https://github.com/kumpera/mono.git) C# · 148 lines

85 internal static void WinIOError()

86 {

87 int errorCode = Marshal.GetLastWin32Error();

88 WinIOError(errorCode, String.Empty);

89 }

94 internal static void WinIOError(string str)

95 {

96 int errorCode = Marshal.GetLastWin32Error();

97 WinIOError(errorCode, str);

98 }

99 #endif

100

101 // After calling GetLastWin32Error(), it clears the last error field,

102 // so you must save the HResult and pass it to this method. This method

103 // will determine the appropriate exception to throw dependent on your

ExceptionUtilities.cs (https://github.com/terrafx/terrafx.git) C# · 949 lines

147 /// <summary>Throws an <see cref="ExternalException" /> using the last available error code.</summary>

148 /// <param name="methodName">The name of the method that caused the exception.</param>

149 /// <exception cref="ExternalException"><paramref name="methodName" /> failed with an exit code of <see cref="Marshal.GetLastWin32Error()" />.</exception>

150 [DoesNotReturn]

151 public static void ThrowForLastError(string methodName)

ErrorHelper.cs (https://github.com/DavidMoore/Foundation.git) C# · 125 lines

83 internal static void WinIoError(int errorCode, String errorPath)

84 {

85 var isInvalidPath = errorCode == Win32Error.ERROR_INVALID_NAME || errorCode == Win32Error.ERROR_BAD_PATHNAME;

86 var path = GetDisplayablePath(errorPath, isInvalidPath);

87

100 throw new IOException("Path already exists: " + path, Win32Error.MakeHRFromErrorCode(errorCode));

101

102 case Win32Error.ERROR_FILENAME_EXCED_RANGE:

103 throw new PathTooLongException("Path too long: " + path);

104

108 case Win32Error.ERROR_INVALID_PARAMETER:

109 throw new IOException(Win32Error.GetMessage(errorCode), Win32Error.MakeHRFromErrorCode(errorCode));

110

111 case Win32Error.ERROR_SHARING_VIOLATION:

119

120 default:

121 throw new IOException(Win32Error.GetMessage(errorCode), Win32Error.MakeHRFromErrorCode(errorCode));

122 }

123 }

Timer.cpp (https://github.com/jiawen/temporal-lightfield-reconstruction.git) C++ · 88 lines

55 LARGE_INTEGER ticks;

56 if (!QueryPerformanceCounter(&ticks))

57 failWin32Error("QueryPerformanceCounter");

58

59 s_prevTicks = max(s_prevTicks, ticks.QuadPart);

69 LARGE_INTEGER freq;

70 if (!QueryPerformanceFrequency(&freq))

71 failWin32Error("QueryPerformanceFrequency");

72 s_ticksToSecsCoef = max(1.0 / (F64)freq.QuadPart, 0.0);

73 }

tif_xfile.cpp (https://github.com/tokyovigilante/xbmc-sources-fork.git) C++ · 225 lines

196

197 static void

198 Win32ErrorHandler(const char* module, const char* fmt, va_list ap)

199 {

200 #ifdef _DEBUG

222 #endif

223 }

224 TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;

225

226

CommonUtils.cpp (https://github.com/aybe/Windows-API-Code-Pack-1.1.git) C++ · 104 lines

76 if (softwareModule == NULL)

77 {

78 throw gcnew System::ComponentModel::Win32Exception(Marshal::GetLastWin32Error());

79 }

80

ServiceSecurity.cs (https://bitbucket.org/splatteredbits/carbon) C# · 103 lines

36 new Dictionary<int, string>

37 {

38 { Win32ErrorCodes.AccessDenied, "Access denied. The specified handle was not opened with READ_CONTROL access, or the calling process is not the owner of the object." },

39 { Win32ErrorCodes.InvalidHandle, "Invalid handle. The specified handle is not valid."},

40 { Win32ErrorCodes.InvalidParameter, "Invalid Parameter. The specified security information is not valid." },

41 { Win32ErrorCodes.InvalidFlags, "Invalid flags." }

54 if (!ok)

55 {

56 var errorCode = Marshal.GetLastWin32Error();

57 if (errorCode == Win32ErrorCodes.InsufficientBuffer)

74 private static readonly Dictionary<int,string> SetServiceObjectSecurityReturnCodes = new Dictionary<int, string>

75 {

76 { Win32ErrorCodes.AccessDenied, "Access denied. The specified handle was not opened with the required access, or the calling process is not the owner of the object." },

77 { Win32ErrorCodes.InvalidHandle, "Invalid handle. The specified handle is not valid." },

Drive.cs (https://github.com/camerb/IronAHK.git) C# · 74 lines

35 }

36 } catch {

37 throw new Exception(Marshal.GetLastWin32Error().ToString());

38 } finally {

39 // Close Drive Handle

NativeMethods.cs (https://github.com/ProgressiveDeveloper/cairoshell.git) C# · 140 lines

78 if (!tokenOpenResult)

79 {

80 throw new ApplicationException("Error attempting to open process token to raise level for shutdown.\nWin32 Error Code: " + Marshal.GetLastWin32Error());

81 }

82

85 if (!privLookupResult)

86 {

87 throw new ApplicationException("Error attempting to lookup value for shutdown privilege.\n Win32 Error Code: " + Marshal.GetLastWin32Error());

88 }

89

96 if (!tokenPrivResult)

97 {

98 throw new ApplicationException("Error attempting to adjust the token privileges to allow shutdown.\n Win32 Error Code: " + Marshal.GetLastWin32Error());

99 }

100 }

ServiceStatusInfo.java (https://github.com/alfresco-mirror/alfresco-mirror.git) Java · 264 lines

143 * @return int

144 */

145 public final int getWin32ErrorCode() {

146 return m_win32ExitCode;

147 }

kernel.c (https://gitlab.com/dj-tech/reactos) C · 132 lines

45 {

46 SND_ERR(L"CreateFile filed - winerror %d\n", GetLastError());

47 return Win32ErrorToMmResult(GetLastError());

48 }

49

90

91 if ( ! Overlapped.hEvent )

92 return Win32ErrorToMmResult(GetLastError());

93

94 /* Talk to the device */

108 {

109 CloseHandle(Overlapped.hEvent);

110 return Win32ErrorToMmResult(GetLastError());

111 }

112 }

UnitTest1.cs (https://github.com/DavidMoore/Foundation.git) C# · 186 lines

89 }

90

91 errorCode.IsHR = Win32Error.IsHR(errorCode.Value);

92 errorCode.ErrorMessage = Win32Error.GetMessage(errorCode.Value);

93 errorCode.HR = Win32Error.MakeHRFromErrorCode(errorCode.Value);

94 errorCode.Exception = Marshal.GetExceptionForHR(errorCode.HR);

95

136 Value = intValue;

137

138 IsHR = Win32Error.IsHR(Value);

139 }

140

WhoIsLocking.cs (https://github.com/fitzchak/ravendb.git) C# · 170 lines

47 }

48 if (rv != 0)

49 throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to RmStartSession");

50 try

51 {

56 0, null, 0, null);

57 if (rv != 0)

58 throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to RmRegisterResources (sessionHandle=" + sessionHandle + ")");

59

60 // Ask the restart manager what other applications

91 }

92 else

93 throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to RmGetList (sessionHandle=" + sessionHandle + ")");

94 }

95 else if (rv != 0)

WbfsDriveInfo.cs (https://wbfssync.svn.codeplex.com/svn) C# · 466 lines

290 else

291 {

292 return Marshal.GetLastWin32Error();

293 }

294

308 out volFree, out volTotal, out volDummy))

309 {

310 return Marshal.GetLastWin32Error();

311 }

312

351 if (!WbfsNative.SetVolumeLabel(this.name, value))

352 {

353 int error = Marshal.GetLastWin32Error();

354 switch (error)

355 {

NamedPipeListener.cs (https://github.com/iainlane/mono.git) C# · 113 lines

93

94 bool canConnect = NamedPipeHelper.ConnectNamedPipe(hPipe, IntPtr.Zero);

95 int lastError = Marshal.GetLastWin32Error();

96 if (!canConnect && lastError == NamedPipeHelper.ERROR_PIPE_CONNECTED)

97 canConnect = true;

WinRTFileStream.cs (https://gitlab.com/0072016/0072016-corefx-) C# · 234 lines

185 {

186 if (origin == SeekOrigin.Begin && offset < 0)

187 throw Win32Marshal.GetExceptionForWin32Error(Interop.mincore.Errors.ERROR_NEGATIVE_SEEK);

188

189 return _innerStream.Seek(offset, origin);

JvGnugettextD5.pas (http://my-chuanqi.googlecode.com/svn/trunk/) Pascal · 282 lines

72 procedure RaiseLastOSError;

73 begin

74 RaiseLastWin32Error;

75 end;

76

Extensions.cs (https://github.com/Wiladams/NewTOAPIA.git) C# · 101 lines

64 // if (!Native.ReadFile(device.DangerousGetHandle(), buffer, (uint)buffer.Length, out bytesRead, hOverlapped))

65 // {

66 // var error = Marshal.GetLastWin32Error();

67 // if (error == Native.ERROR_IO_PENDING)

68 // {

rpc.c (https://github.com/vmware/lightwave.git) C · 463 lines

63 NULL);

64 #ifndef _WIN32

65 dwError = LwErrnoToWin32Error(status);

66 #else

67 dwError = status;

Directory.cpp (https://gitlab.com/lxderunner-work/il2cpp-ubuntu) C++ · 245 lines

17 #endif

18

19 static inline int DirectoryWin32ErrorToErrorCode(DWORD win32ErrorCode)

20 {

21 return win32ErrorCode;

58 else

59 {

60 *error = DirectoryWin32ErrorToErrorCode(::GetLastError());

61 }

62

72 return true;

73

74 *error = DirectoryWin32ErrorToErrorCode(::GetLastError());

75 return false;

76 }

msrdc.h (https://github.com/tpn/winsdk-10.git) C Header · 2695 lines

406 RDC_ApplicationError = ( RDC_FileChecksumMismatch + 1 ) ,

407 RDC_Aborted = ( RDC_ApplicationError + 1 ) ,

408 RDC_Win32Error = ( RDC_Aborted + 1 )

409 } RDC_ErrorCode;

410

WaitHandle.cpp (https://github.com/Microsoft/service-fabric.git) C++ · 253 lines

171 eventName.empty() ? nullptr : eventName.c_str());

172

173 ASSERT_IFNOT(handle_, "CreateEvent failed: {0}", ErrorCode::FromWin32Error());

174 }

175

225 if(!::SetEvent(handle_))

226 {

227 err = ErrorCode::FromWin32Error();

228 TRACE_ERROR_AND_ASSERT(TraceType, "SetEvent failed: {0}", err);

229 }

238 if (!::ResetEvent(handle_))

239 {

240 err = ErrorCode::FromWin32Error();

241 TRACE_ERROR_AND_ASSERT(TraceType, "ResetEvent failed: {0}", err);

242 }

JnaException.java (https://github.com/bwalding/jenkins-1.git) Java · 44 lines

35

36 public JnaException(int errorCode) {

37 super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));

38 this.errorCode = errorCode;

39 }

http_log.h (https://bitbucket.org/steve_delbar/iepsm-projet-de-d-veloppement-internet-2013.git) C Header · 120 lines

54 /* Set to indicate that error msg should come from Win32's GetLastError(),

55 * not errno. */

56 #define APLOG_WIN32ERROR ((APLOG_LEVELMASK+1) * 2)

57 #endif

58

Window.cs (https://github.com/Roemer/FlaUI.git) C# · 167 lines

144 if (User32.SetWindowLong(Properties.NativeWindowHandle, WindowLongParam.GWL_EXSTYLE, WindowStyles.WS_EX_LAYERED) == 0)

145 {

146 throw new Win32Exception(Marshal.GetLastWin32Error());

147 }

148 if (!User32.SetLayeredWindowAttributes(Properties.NativeWindowHandle, 0, alpha, LayeredWindowAttributes.LWA_ALPHA))

149 {

150 throw new Win32Exception(Marshal.GetLastWin32Error());

151 }

152 }

SidHelper.cs (https://github.com/disaster123/MediaPortal-1.git) C# · 205 lines

83 LookupAccountName(null, name, _sid, ref _sidLength, _domain,

84 ref _domainLength, out _use);

85 int _error = Marshal.GetLastWin32Error();

86

87 //error 122 (The data area passed to a system call is too small)

100 if (_rc == false)

101 {

102 Marshal.GetLastWin32Error();

103 Marshal.FreeHGlobal(_sid);

104 return IntPtr.Zero;

126 LookupAccountName(null, name, _sid, ref _sidLength, _domain,

127 ref _domainLength, out _use);

128 int _error = Marshal.GetLastWin32Error();

129

130 //error 122 (The data area passed to a system call is too small)

TimerQueueTimer_.cs (https://gitlab.com/matt81093/space-station-14) C# · 144 lines

93 IntPtr.Zero // CompletionEvent - A handle to an optional event to be signaled when the function is successful and all callback functions have completed. Can be NULL.

94 );

95 int error = Marshal.GetLastWin32Error();

96 //CloseHandle(phNewTimer);

97 }

105 period

106 );

107 int error = Marshal.GetLastWin32Error();

108 }

109

RSACertificateExtensions.cs (https://github.com/kumpera/mono.git) C# · 112 lines

38 if (!result)

39 {

40 throw new CryptographicException(Marshal.GetLastWin32Error());

41 }

42

samr_binding.c (https://github.com/BeyondTrust/pbis-open.git) C · 396 lines

97 dwError != ERROR_SUCCESS)

98 {

99 ntStatus = LwWin32ErrorToNtStatus(dwError);

100 }

101

219 dwError != ERROR_SUCCESS)

220 {

221 ntStatus = LwWin32ErrorToNtStatus(dwError);

222 }

223

tif_xfile.cpp (https://github.com/energy6/xbmc.git) C++ · 224 lines

193

194 static void

195 Win32ErrorHandler(const char* module, const char* fmt, va_list ap)

196 {

197 #ifdef _DEBUG

219 #endif

220 }

221 TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;

222

223 #endif

ipendpoint_properties.cpp (https://github.com/dotnet/docs.git) C++ · 123 lines

118 {

119 Console::WriteLine( "Exception : {0}", e->Message );

120 Console::WriteLine( "WinSock Error : {0}", Convert::ToString( Marshal::GetLastWin32Error() ) );

121 return nullptr;

122 }

Volume.VolumeLabel.cs (https://github.com/alphaleonis/AlphaFS.git) C# · 114 lines

74 var success = NativeMethods.SetVolumeLabel(null, volumeName);

75

76 var lastError = Marshal.GetLastWin32Error();

77 if (!success)

78 NativeError.ThrowException(lastError, volumeName);

106 var success = NativeMethods.SetVolumeLabel(volumePath, volumeName);

107

108 var lastError = Marshal.GetLastWin32Error();

109 if (!success)

110 NativeError.ThrowException(lastError, volumePath, volumeName);

SemaphoreAcl.cs (https://github.com/dotnet/runtime.git) C# · 92 lines

75 private static void ValidateHandle(SafeWaitHandle handle, string? name, out bool createdNew)

76 {

77 int errorCode = Marshal.GetLastWin32Error();

78

79 if (handle.IsInvalid)

84 }

85

86 throw Win32Marshal.GetExceptionForLastWin32Error();

87 }

88

Impersonation.cs (https://github.com/bertvan/CruiseControl.NET.git) C# · 121 lines

62 {

63 // Something went wrong.

64 int ret = Marshal.GetLastWin32Error();

65 throw new System.ComponentModel.Win32Exception(ret);

66 }

RawPrinterHelper.cs (https://github.com/emreeren/SambaPOS-3.git) C# · 125 lines

77 if (bSuccess == false)

78 {

79 dwError = Marshal.GetLastWin32Error();

80 }

81 return bSuccess;

FtpConnection.cs (https://github.com/clawsoftware/clawPDF.git) C# · 428 lines

170 if (intPtr == IntPtr.Zero)

171 {

172 if (Marshal.GetLastWin32Error() == 18) return list;

173 Error();

174 return list;

211 }

212

213 if (Marshal.GetLastWin32Error() != 18) Error();

214 return list;

215 }

234 if (intPtr == IntPtr.Zero)

235 {

236 if (Marshal.GetLastWin32Error() == 18) return list.ToArray();

237 Error();

238 return list.ToArray();

FileSystemInfo.Windows.cs (https://gitlab.com/0072016/0072016-corefx-) C# · 132 lines

120

121 if (_dataInitialized != 0) // Refresh was unable to initialize the data

122 throw Win32Marshal.GetExceptionForWin32Error(_dataInitialized, FullPath);

123 }

124

WindowsPrincipal.cs (https://github.com/madewokherd/mono.git) C# · 193 lines

168 (uint)TokenType.TokenImpersonation,

169 ref token))

170 throw new SecurityException(string.Format(CultureInfo.InvariantCulture, "DuplicateTokenEx returned error {0}", Marshal.GetLastWin32Error()));

171 }

172

184 sid.BinaryForm,

185 ref isMember))

186 throw new SecurityException(string.Format(CultureInfo.InvariantCulture, "CheckTokenMembership returned error {0}", Marshal.GetLastWin32Error()));

187 #endif

188

messages.h (https://github.com/lithnet/ad-password-protection.git) C Header · 229 lines

91

92 //

93 // MessageId: MSG_WIN32ERROR

94 //

95 // MessageText:

99 // Message: %2

100 //

101 #define MSG_WIN32ERROR ((DWORD)0xC0020008L)

102

103 //

LongPathFile.cs (https://bcl.svn.codeplex.com/svn) C# · 499 lines

95 string normalizedPath = LongPathCommon.NormalizeLongPath(path);

96 if (!NativeMethods.DeleteFile(normalizedPath)) {

97 throw LongPathCommon.GetExceptionFromLastWin32Error();

98 }

99 }

161

162 if (!NativeMethods.MoveFile(normalizedSourcePath, normalizedDestinationPath))

163 throw LongPathCommon.GetExceptionFromLastWin32Error();

164 }

165

241

242 if (!NativeMethods.CopyFile(normalizedSourcePath, normalizedDestinationPath, !overwrite))

243 throw LongPathCommon.GetExceptionFromLastWin32Error();

244 }

245

TimerQueueTimer.cs (https://gitlab.com/matt81093/space-station-14) C# · 213 lines

65 if (Handle == IntPtr.Zero)

66 {

67 throw new Win32Exception(Marshal.GetLastWin32Error(), "Error creating timer queue.");

68 }

69 }

125 if (!rslt)

126 {

127 int err = Marshal.GetLastWin32Error();

128 throw new Win32Exception(err, "Error disposing timer queue");

129 }

166 if (!rslt)

167 {

168 throw new Win32Exception(Marshal.GetLastWin32Error(), "Error creating timer.");

169 }

170 }

COMError.cpp (https://github.com/Templier/desktopx.git) C++ · 138 lines

37 // Throws an exception corresponding to the given Win32 Error code.

38 // GUID is the CLSID of the component throwing error.

39 HRESULT CCOMError::DispatchWin32Error(DWORD error, REFCLSID clsid, LPCTSTR source,

40 DWORD helpContext, LPCTSTR helpFileName)

41 {

DIBSection.cs (https://gitlab.com/gpo04174/HSAudio) C# · 197 lines

113 if (Win32.SetPixelFormat(hDC, iPixelformat, pixelFormat) == 0)

114 {

115 int lastError = Marshal.GetLastWin32Error();

116 return false;

117 }

Cmdline.c (https://github.com/pcmac77/truecrypt-android.git) C · 244 lines

78 if (!arguments)

79 {

80 handleWin32Error (NULL);

81 return 0;

82 }

106 if (len == 0)

107 {

108 handleWin32Error (NULL);

109 AbortProcessSilent();

110 }

subprocess.h (https://github.com/chromium/chromium.git) C Header · 113 lines

81 // Given an error code, returns a human-readable error message. This is

82 // defined here so that CommandLineInterface can share it.

83 static std::string Win32ErrorMessage(DWORD error_code);

84 #endif

85

PosixElectricFencedMemory.cs (https://github.com/fitzchak/ravendb.git) C# · 122 lines

24 if (virtualAlloc == (byte*)-1)

25 {

26 var err = Marshal.GetLastWin32Error();

27 throw new InvalidOperationException("Failed to mmap with size " + allocatedSize + " . Err=" + err);

28 }

31 if (msync != 0)

32 {

33 throw new InvalidOperationException("Failed to free call msync " + (IntPtr)virtualAlloc + ". Err=" + Marshal.GetLastWin32Error());

34 }

35

40 if (virtualAlloc == (byte*)-1)

41 {

42 var err = Marshal.GetLastWin32Error();

43 throw new InvalidOperationException("Failed to re-mmap with size " + allocatedSize + " . Err=" + err);

44 }

ProcessExtensions.cs (https://bitbucket.org/Reivalyn/make-window-fullscreen.git) C# · 84 lines

29 if (hprocess == IntPtr.Zero)

30 {

31 var errorCode = Marshal.GetLastWin32Error();

32

33 const int AccessDeniedErrorCode = 0x5;

46 if (!SafeNativeMethods.QueryFullProcessImageName(hprocess, 0, buffer, ref size))

47 {

48 throw new Win32Exception(Marshal.GetLastWin32Error(), string.Format("Failed to query the image name for process {0}: \"{1}\"", process.Id, process.ProcessName));

49 }

50

FileEnumerator.vb (https://cfx.svn.codeplex.com/svn) Visual Basic · 230 lines ✨ Summary

This Visual Basic code implements an IEnumerable(Of String) that uses Win32 File Management functions to enumerate files and subdirectories in a specified directory one item at a time, based on a given search pattern and mode (directory or file). It provides methods for finding the next match, resetting the enumerator, and disposing of resources.

111 If Me.hFindFile.IsInvalid Then

112 ' Got an invalid find handle, get the error code

113 Dim code As Integer = Marshal.GetLastWin32Error()

114

115 If code = NativeMethods.ERROR_FILE_NOT_FOUND Then

147 End While

148

149 Dim code As Integer = Marshal.GetLastWin32Error()

150

151 If code = NativeMethods.ERROR_NO_MORE_FILES Then

processwaithandle.cs (https://github.com/pruiz/mono.git) C# · 38 lines

24 if (!succeeded) {

25 #if MONO

26 // In Mono, Marshal.GetHRForLastWin32Error is not implemented;

27 // and also DuplicateHandle throws its own exception rather

28 // than returning false on error, so this code is unreachable.

29 throw new SystemException("Unknown error in DuplicateHandle");

30 #else

31 Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());

32 #endif

33 }

PosixHelper.cs (https://github.com/fitzchak/ravendb.git) C# · 189 lines

52 if (fd == -1)

53 {

54 var err = Marshal.GetLastWin32Error();

55 Syscall.ThrowLastError(err, "when opening " + path);

56 }

68 if (written == -1)

69 {

70 var err = Marshal.GetLastWin32Error();

71 Syscall.ThrowLastError(err, "writing to " + path);

72 }

77 if (Syscall.FSync(fd) == -1)

78 {

79 var err = Marshal.GetLastWin32Error();

80 Syscall.ThrowLastError(err, "FSync " + path);

81 }

CnGlobalKeyHook.pas (http://cnpack.googlecode.com/svn/trunk/) Pascal · 365 lines

266 begin

267 SetLength(FIDs, Length(FIDs)-1);

268 RaiseLastWin32Error;

269 end;

270 end;

Native.SetupApiAdapter.fs (https://github.com/jwelch222/HidLibrary.git) F# · 128 lines

19 let success = SetupApi.SetupDiEnumDeviceInterfaces(handle, &info, &classFilter, index, &deviceInterface)

20 if not success then

21 let error = Marshal.GetLastWin32Error()

22 match error with

23 | SetupApi.ERROR_NO_MORE_ITEMS -> (deviceInterface,false)

24 | SetupApi.SUCCESS -> (deviceInterface,false)

25 | _ -> raise (Win32Exception(Marshal.GetLastWin32Error()))

26 else (deviceInterface,true)

27

46 | false -> DeviceInterfaceGetClassFlags.DEVICEINTERFACE

47 let handle = SetupApi.SetupDiGetClassDevs(&classFilter, null, IntPtr.Zero, flags)

48 let error = Marshal.GetLastWin32Error()

49 match error with

50 | 0 -> handle

Win32Security.cs (https://github.com/RoDaniel/featurehouse.git) C# · 137 lines

30 if (!GetFileSecurity(path, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, fileSD, 0, out sdLength))

31 {

32 lastError = Marshal.GetLastWin32Error();

33 if (lastError != ERROR_INSUFFICIENT_BUFFER)

34 {

38 if (!GetFileSecurity(path, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, fileSD, sdLength, out sdLength))

39 {

40 lastError = Marshal.GetLastWin32Error();

41 return accessAllowed;

42 }

54 if (!ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation))

55 {

56 lastError = Marshal.GetLastWin32Error();

57 return accessAllowed;

58 }

WinWindowInfo.cs (https://github.com/virtualglobebook/OpenGlobe.git) C# · 173 lines

146 if (this.dc != IntPtr.Zero)

147 if (!Functions.ReleaseDC(this.handle, this.dc))

148 Debug.Print("[Warning] Failed to release device context {0}. Windows error: {1}.", this.dc, Marshal.GetLastWin32Error());

149

150 if (manual)

IniFileManager.cs (https://bitbucket.org/xact/cs.ff.xact.lib.git) C# · 244 lines

17 /// <para>

18 /// I've built this class too many times in too many languages...this time, the code was found for free at: http://archive.devx.com/dotnet/discussions/040902/cominterop.asp, thank you!...Although he does end with:

19 /// this code is meant for example use only. You should add error-trapping and checking (see the DllImportAttribute.SetLastError field in the documentation, and the Marshal.GetLastWin32Error method in the documentation for more information.)

20 /// </para>

21 /// <para>

memory.c (https://github.com/BeyondTrust/pbis-open.git) C · 216 lines

168 )

169 {

170 return LwNtStatusToWin32Error(

171 LwRtlWC16StringAllocateFromCString(

172 ppszNewString,

208 )

209 {

210 return LwNtStatusToWin32Error(

211 RtlAllocateSidFromCString(

212 Sid,

netr_serverauthenticate3.c (https://github.com/BeyondTrust/pbis-open.git) C · 144 lines

120 dwError != ERROR_SUCCESS)

121 {

122 ntStatus = LwWin32ErrorToNtStatus(dwError);

123 }

124

EmbeddedDLLLoader.cs (git://github.com/kevingadd/Fracture.git) C# · 121 lines

99 var hLibrary = LoadLibrary(path);

100 if (hLibrary == null)

101 throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), "Failed to load " + name);

102 LoadedHandles.Add(hLibrary);

103 }

File64.cpp (https://github.com/jeeb/avisynth.git) C++ · 166 lines

55

56 if (lActual < 0)

57 throw MyWin32Error("Failure reading file: %%s.",GetLastError());

58

59 if (lActual != len)

82 if (0xFFFFFFFF == SetFilePointer(hFile, (LONG)i64NewPos, &lHi, FILE_BEGIN))

83 if ((dwError = GetLastError()) != NO_ERROR)

84 throw MyWin32Error("File64: %%s", dwError);

85

86 i64FilePosition = i64NewPos;

109 if (0xFFFFFFFF == (lNewLow = SetFilePointer(hFile, (LONG)bytes, &lHi, FILE_CURRENT)))

110 if ((dwError = GetLastError()) != NO_ERROR)

111 throw MyWin32Error("File64: %%s", dwError);

112

113 i64FilePosition = (unsigned long)lNewLow | (((__int64)(unsigned long)lHi)<<32);

Microsoft_Windows_WebAuthN.py (https://github.com/airbus-cert/etl-parser.git) Python · 888 lines

319 "TransactionId" / Guid,

320 "Error" / Int32ul,

321 "Win32Error" / Int32ul

322 )

323

342 "Location" / CString,

343 "Error" / Int32ul,

344 "Win32Error" / Int32ul

345 )

346

360 "WnfState" / Int32ul,

361 "Error" / Int32ul,

362 "Win32Error" / Int32ul

363 )

364

CollationKeyFilter.cs (https://github.com/fitzchak/ravendb.git) C# · 139 lines

60 var length = PosixNativeMethods.GetSortKey(sortHandle, text, text.Length, null, 0, CompareOptions.None);

61 if (length == 0)

62 throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to GetSortKey for text=" + text);

63

64 var sortKey = new byte[length];

68 length = PosixNativeMethods.GetSortKey(sortHandle, text, text.Length, pSortKey, sortKey.Length, CompareOptions.None);

69 if (length == 0)

70 throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to GetSortKey for text=" + text);

71 return sortKey;

72 }

77 var length = Win32NativeMethods.LCMapStringEx(_cultureInfo.CompareInfo.Name, Win32NativeMethods.LCMAP_SORTKEY, text, text.Length, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

78 if (length == 0)

79 throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to GetSortKey for text=" + text);

80

81 var sortKey = new byte[length];

Window1.xaml.cs (https://github.com/urasandesu/NTroll.git) C# · 145 lines

91 //else

92 //{

93 // Console.WriteLine("Expected error at GetWindow. {0}", new Win32Exception(Marshal.GetLastWin32Error()).Message);

94 //}

95

132 else

133 {

134 //Console.WriteLine("Expected error at GetWindowText. {0}", new Win32Exception(Marshal.GetLastWin32Error()).Message);

135 return null;

136 }

138 else

139 {

140 //Console.WriteLine("Expected error at GetWindowTextLength. {0}", new Win32Exception(Marshal.GetLastWin32Error()).Message);

141 return null;

142 }

memory.c (https://github.com/vmware/lightwave.git) C · 636 lines

263

264

265 ulError = LwNtStatusToWin32Error(

266 LwRtlCStringAllocatePrintfV(

267 ppszString,

296 else

297 {

298 dwError = LwNtStatusToWin32Error(

299 LwRtlWC16StringDuplicate(ppwszDst, pwszSrc));

300 BAIL_ON_LWCA_ERROR(dwError);

327 else

328 {

329 dwError = LwNtStatusToWin32Error(

330 LwRtlWC16StringAllocateFromCString(ppwszDst, pszSrc));

331 }

Memory.cs (https://github.com/warbler/SharpMonoInjector.git) C# · 104 lines

59

60 if (!Native.ReadProcessMemory(_handle, address, bytes, size))

61 throw new InjectorException("Failed to read process memory", new Win32Exception(Marshal.GetLastWin32Error()));

62

63 return bytes;

84

85 if (addr == IntPtr.Zero)

86 throw new InjectorException("Failed to allocate process memory", new Win32Exception(Marshal.GetLastWin32Error()));

87

88 _allocations.Add(addr, size);

93 {

94 if (!Native.WriteProcessMemory(_handle, addr, data, data.Length))

95 throw new InjectorException("Failed to write process memory", new Win32Exception(Marshal.GetLastWin32Error()));

96 }

97

PipeCompletionSource.cs (https://gitlab.com/0072016/0072016-corefx-) C# · 185 lines

146 // it will be easier to debug if there exists any special case

147 // we are not aware of.

148 int errorCode = Marshal.GetLastWin32Error();

149 Debug.WriteLine("CancelIoEx finished with error code {0}.", errorCode);

150 }

TempFile.cs (https://github.com/DavidMoore/Foundation.git) C# · 125 lines

96

97 throw new FoundationException("Couldn't schedule delete of locked file '{0}' at reboot.",

98 Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error()));

99 }

100 catch (Exception)

_AcceptOverlappedAsyncResult.cs (https://github.com/pruiz/mono.git) C# · 171 lines

87 Marshal.SizeOf(handle));

88

89 if (errorCode == SocketError.SocketError) errorCode = (SocketError) Marshal.GetLastWin32Error();

90 GlobalLog.Print("AcceptOverlappedAsyncResult#" + ValidationHelper.HashString(this) + "::PostCallback() setsockopt handle:" + handle.ToString() + " AcceptSocket:" + ValidationHelper.HashString(m_AcceptSocket) + " itsHandle:" + m_AcceptSocket.SafeHandle.DangerousGetHandle().ToString() + " returns:" + errorCode.ToString());

91 }

OgreErrorDialogImp.h (https://bitbucket.org/barakianc/nvidia-physx-and-apex-in-gge.git) C Header · 77 lines

26 -----------------------------------------------------------------------------

27 */

28 #ifndef __WIN32ERRORDIALOG_H__

29 #define __WIN32ERRORDIALOG_H__

Marshal.h (https://github.com/nevermoe/unity_metadata_loader.git) C Header · 95 lines

28 {

29 public:

30 static int32_t GetLastWin32Error();

31 static int32_t AddRefInternal(Il2CppIntPtr pUnk);

32 static Il2CppIntPtr AllocCoTaskMem(int32_t size);

Startup.cs (https://nougakudo.svn.codeplex.com/svn) C# · 149 lines

127 Console.WriteLine("GenerateConsoleCtrlEvent true");

128 else

129 Console.WriteLine(Marshal.GetLastWin32Error().ToString());

130

131 }