Commit Graph

15 Commits

Author SHA1 Message Date
Ryan Prichard
44554d5e9d Add an MIT copyright notice to all the source files. 2012-03-23 03:11:34 -07:00
Ryan Prichard
d3667e38a8 Review the named pipe setup code.
The goal is to setup pipes between the libpconsole process and the new
agent process in a way that's secure and doesn't create an unnecessary
burden on the library's user.  This is apparently hard.

I think this code is good enough.
2012-03-23 02:19:09 -07:00
Ryan Prichard
d418679741 Include stdint.h to provide int32_t.
* This fixed a libpconsole build error that happened with mingw-w64.
2012-03-21 03:30:18 -07:00
Ryan Prichard
f66e877cba Improve error handling in libpconsole.
If we couldn't create the new pipes, then perhaps some other process has
already created them.  I think it's a security hole to start the agent if
the pipe creation failed.
2012-03-21 03:28:31 -07:00
Ryan Prichard
7e6f8195ba Turn on -Wall and fix build warnings. No bug fixes. 2012-03-21 00:14:04 -07:00
Ryan Prichard
0afc69c733 Move the three output binaries into a build directory. 2012-03-21 00:13:46 -07:00
Ryan Prichard
1901ed62d6 Add some TODO comments. 2012-02-20 04:54:18 -08:00
Ryan Prichard
00a6c3b90e Shut down the unix-adapter when the child process exits.
- In the agent, poll for the process exit at the same time we pull for
   output.  Once the child exits, record the exit code and close the data
   pipe.

 - In the unix-adapter, shut the program down once the input or output
   handlers abort.  Before exiting, query the agent for the exit code.

 - Also: in the unix-adapter, apparently receiving the SIGWINCH signal can
   interrupt both select and the InputHandler's read system call.  I hope
   it doesn't affect the blocking Win32 APIs, but I'm not really sure.
2012-02-20 03:30:43 -08:00
Ryan Prichard
90164c34a9 Get the agent + libpconsole + unix-adapter trio working.
- Update the Agent to use separate control and data pipes and to receive
   arbitrary-sized packets.  Handle child process creation in the agent.

 - Fix bugs in libpconsole:
    - Insert a space between the pipe names on the agent command line.
    - Don't close the desktop and window station until after connecting
      to the agent's pipes.

 - Change the format of the pconsole_start_process env parameter from an
   array of wide-character-string pointers to a single contiguous block of
   memory, like that accepted by CreateProcess.
2012-02-20 01:23:46 -08:00
Ryan Prichard
27f0c4d156 Get pconsole.exe and pconsole.dll building simultaneously.
* Remove obsolete comments and APIs.

 * In pconsole.exe, use two threads to handle pconsole<->pty communication.
   I use blocking I/O for the pty.  For the Win32 pipe to the pconsole
   agent, I use overlapped I/O and emulate blocking I/O.

   I'm not sure I *have* to open the pipe in overlapped mode.  When I last
   tried using non-overlapped I/O, I had a problem where a pending read
   would block writes (or vice versa).  Maybe setting the overlapped
   parameter to {Read,Write}File would be sufficient.
2012-02-16 03:49:17 -08:00
Ryan Prichard
40c7e87528 Checkpoint work on libpconsole. 2012-02-10 02:09:38 -08:00
Ryan Prichard
a53fcbbea6 Checkpoint work on libpconsole. 2012-01-31 00:45:04 -08:00
Ryan Prichard
1aaf102905 Get libpconsole.dll building again with stubbed out functions. 2012-01-27 10:08:21 -08:00
Ryan Prichard
b0555bbbcf Update the libpconsole's agent-finding code.
Look for the new pconsole-agent.exe program, and look for it in its new
location.
2012-01-23 22:05:37 -08:00
Ryan Prichard
a4df196ed4 Work on switching from qmake to makefiles and reorganize code a little.
My plan now is to integrate the PseudoConsole with Cygwin and MSYS ptys,
with initial focus on Cygwin.  I think I'll keep the separate Agent and DLL
binaries, and they'll continue to be native Win32 binaries.  I don't want
to have two build systems (qmake vs whatever MSYS/Cygwin uses), and since
I'd like to remove the Qt dependency anyway, I'm trying to switch to
makefiles.
2012-01-21 17:30:41 -08:00