Exemplo n.º 1
0
 private static extern IntPtr GetStdHandle(StdHandle std);
Exemplo n.º 2
0
 private static extern IntPtr GetStdHandle(StdHandle index);
Exemplo n.º 3
0
 public static extern IntPtr GetStdHandle(StdHandle nStdHandle);
Exemplo n.º 4
0
 public static extern IntPtr GetStdHandle(StdHandle nStdHandle);
 public static extern bool SetStdHandle(StdHandle std, IntPtr handle);
Exemplo n.º 6
0
 internal static extern IntPtr GetStdHandle(
     StdHandle std
     );
Exemplo n.º 7
0
 private static extern IntPtr GetStdHandle( StdHandle index );
Exemplo n.º 8
0
 private static extern System.IntPtr GetStdHandle(StdHandle nStdHandle);
Exemplo n.º 9
0
 public static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
Exemplo n.º 10
0
 public static extern bool SetStdHandle(StdHandle nStdHandle, IntPtr hHandle);
Exemplo n.º 11
0
 public static extern IntPtr GetStdHandle(StdHandle handleId);
Exemplo n.º 12
0
 public static extern IntPtr GetStdHandle(StdHandle index);
Exemplo n.º 13
0
 internal static extern IntPtr GetStdHandle(StdHandle index);
Exemplo n.º 14
0
 internal static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
Exemplo n.º 15
0
 public StdHandle sceKernelStdoutReopen(string File, HleIoFlags Flags, Vfs.SceMode Mode)
 {
     StdOut = (StdHandle)IoFileMgrForUser.sceIoOpen(File, Flags, Mode);
     //Console.WriteLine("StdOut: {0}", StdOut);
     return StdOut;
 }
 private static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
Exemplo n.º 17
0
 public StdHandle sceKernelStderrReopen(string File, HleIoFlags Flags, Vfs.SceMode Mode)
 {
     StdError = (StdHandle)IoFileMgrForUser.sceIoOpen(File, Flags, Mode);
     return StdError;
 }
 private void CreateStandardPipe(out SafeFileHandle readHandle, out SafeFileHandle writeHandle, StdHandle standardHandle, bool isInput, bool redirect)
 {
   if (redirect)
   {
     var security = new SecurityAttributes { bInheritHandle = true };
     if (!CreatePipe(out readHandle, out writeHandle, security, DEFAULT_PIPE_BUFFER_SIZE))
     {
       var error = Marshal.GetLastWin32Error();
       _debugLogger.Error("AsyncImpersonationProcess ({0}): CreatePipe failed. ErrorCode: {1} ({2})", StartInfo.FileName, error, new Win32Exception(error).Message);
       return;
     }
     if (!SetHandleInformation(isInput ? writeHandle : readHandle, HandleFlags.Inherit, HandleFlags.None))
     {
       var error = Marshal.GetLastWin32Error();
       _debugLogger.Error("AsyncImpersonationProcess ({0}): SetHandleInformation failed. ErrorCode: {1} ({2})", StartInfo.FileName, error, new Win32Exception(error).Message);
     }
   }
   else
   {
     if (isInput)
     {
       writeHandle = new SafeFileHandle(IntPtr.Zero, false);
       readHandle = GetStdHandle(standardHandle);
       var error = Marshal.GetLastWin32Error();
       // Error code 1008 means "An attempt was made to reference a token that does not exist". This is the case
       // in particular in the server process because a Windows service does not have a standard output or standard error stream.
       // This is expected behaviour - not an error.
       if (error != 0 && error != 1008)
         _debugLogger.Error("AsyncImpersonationProcess ({0}): GetStdHandle failed. ErrorCode: {1} ({2})", StartInfo.FileName, error, new Win32Exception(error).Message);
     }
     else
     {
       readHandle = new SafeFileHandle(IntPtr.Zero, false);
       writeHandle = GetStdHandle(standardHandle);
       var error = Marshal.GetLastWin32Error();
       // Error code 1008 means "An attempt was made to reference a token that does not exist". This is the case
       // in particular in the server process because a Windows service does not have a standard output or standard error stream.
       // This is expected behaviour - not an error.
       if (error != 0 && error != 1008)
         _debugLogger.Error("AsyncImpersonationProcess ({0}): GetStdHandle failed. ErrorCode: {1} ({2})", StartInfo.FileName, error, new Win32Exception(error).Message);
     }
   }
 }
Exemplo n.º 19
0
 private static extern System.IntPtr GetStdHandle(StdHandle nStdHandle);
Exemplo n.º 20
0
 private static extern bool SetStdHandle(StdHandle nStdHandle, IntPtr hHandle);
Exemplo n.º 21
0
 public static extern bool SetStdHandle(StdHandle nStdHandle, IntPtr hHandle);
Exemplo n.º 22
0
 public static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
 private static extern IntPtr GetStdHandle(StdHandle std);
 public static extern IntPtr GetStdHandle(StdHandle std);