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