mirror of https://github.com/winsw/winsw
parent
0c8a5e6ee0
commit
ab51b50d85
|
@ -555,7 +555,7 @@ namespace winsw
|
|||
Console.SetOut(w);
|
||||
Console.SetError(w);
|
||||
|
||||
var handle = f.Handle;
|
||||
var handle = f.SafeFileHandle;
|
||||
Kernel32.SetStdHandle(-11, handle); // set stdout
|
||||
Kernel32.SetStdHandle(-12, handle); // set stder
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace winsw.Native
|
||||
|
@ -7,9 +8,9 @@ namespace winsw.Native
|
|||
/// kernel32.dll P/Invoke wrappers
|
||||
/// </summary>
|
||||
public class Kernel32
|
||||
{
|
||||
[DllImport("Kernel32.dll", SetLastError = true)]
|
||||
public static extern int SetStdHandle(int device, IntPtr handle);
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern bool SetStdHandle(int nStdHandle, SafeFileHandle handle);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern bool CreateProcess(string lpApplicationName,
|
||||
|
|
Loading…
Reference in New Issue