Esempio n. 1
0
 private static extern IntPtr GetStdHandle(StdHandle std);
Esempio n. 2
0
 private static extern IntPtr GetStdHandle(StdHandle index);
Esempio n. 3
0
 public static extern IntPtr GetStdHandle(StdHandle nStdHandle);
Esempio n. 4
0
 public static extern IntPtr GetStdHandle(StdHandle nStdHandle);
 public static extern bool SetStdHandle(StdHandle std, IntPtr handle);
Esempio n. 6
0
 internal static extern IntPtr GetStdHandle(
     StdHandle std
     );
Esempio n. 7
0
 private static extern IntPtr GetStdHandle( StdHandle index );
Esempio n. 8
0
 private static extern System.IntPtr GetStdHandle(StdHandle nStdHandle);
Esempio n. 9
0
 public static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
Esempio n. 10
0
 public static extern bool SetStdHandle(StdHandle nStdHandle, IntPtr hHandle);
Esempio n. 11
0
 public static extern IntPtr GetStdHandle(StdHandle handleId);
Esempio n. 12
0
 public static extern IntPtr GetStdHandle(StdHandle index);
Esempio n. 13
0
 internal static extern IntPtr GetStdHandle(StdHandle index);
Esempio n. 14
0
 internal static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
Esempio 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);
Esempio 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);
     }
   }
 }
Esempio n. 19
0
 private static extern System.IntPtr GetStdHandle(StdHandle nStdHandle);
Esempio n. 20
0
 private static extern bool SetStdHandle(StdHandle nStdHandle, IntPtr hHandle);
 public static extern bool SetStdHandle(StdHandle nStdHandle, IntPtr hHandle);
Esempio n. 22
0
 public static extern SafeFileHandle GetStdHandle(StdHandle nStdHandle);
 private static extern IntPtr GetStdHandle(StdHandle std);
 public static extern IntPtr GetStdHandle(StdHandle std);