mirror of https://github.com/winsw/winsw
Replace GetLastError
parent
3bb10ab60d
commit
f1036e613b
|
@ -195,7 +195,7 @@ namespace winsw.Native
|
|||
|
||||
if (!result)
|
||||
{
|
||||
winErrorCode = Kernel32.GetLastError();
|
||||
winErrorCode = Marshal.GetLastWin32Error();
|
||||
Console.WriteLine("LookupAccountName failed: " + winErrorCode);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -24,9 +24,6 @@ namespace winsw.Native
|
|||
string? lpCurrentDirectory,
|
||||
[In] ref STARTUPINFO lpStartupInfo,
|
||||
out PROCESS_INFORMATION lpProcessInformation);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern int GetLastError();
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using log4net;
|
||||
using winsw.Native;
|
||||
|
||||
namespace winsw.Util
|
||||
{
|
||||
|
@ -57,7 +56,7 @@ namespace winsw.Util
|
|||
bool success = FreeConsole();
|
||||
if (!success)
|
||||
{
|
||||
long errorCode = Kernel32.GetLastError();
|
||||
long errorCode = Marshal.GetLastWin32Error();
|
||||
Logger.Warn("Failed to detach from console. Error code: " + errorCode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue