The "rfb_win32" library merged with VNC 4.1.1 code.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/merge-with-vnc-4.1.1@523 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfb_win32/LaunchProcess.h b/rfb_win32/LaunchProcess.h
index 6fd34e9..38521dc 100644
--- a/rfb_win32/LaunchProcess.h
+++ b/rfb_win32/LaunchProcess.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -24,9 +24,7 @@
 #ifndef __RFB_WIN32_LAUNCHPROCESS_H__
 #define __RFB_WIN32_LAUNCHPROCESS_H__
 
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
-
 #include <rfb_win32/TCharArray.h>
 
 namespace rfb {
@@ -38,14 +36,28 @@
       LaunchProcess(const TCHAR* exeName_, const TCHAR* params);
       ~LaunchProcess();
 
-      // If userToken is 0 then starts as current user, otherwise
-      // starts as the specified user.  userToken must be a primary token.
-      void start(HANDLE userToken);
+      // start() starts the specified process with the supplied
+      //   command-line.
+      //   If userToken is INVALID_HANDLE_VALUE then starts the process
+      //   as the current user, otherwise as the specified user.
+      //   If createConsole is true then CREATE_CONSOLE_WINDOW is passed
+      //   as an extra flag to the process creation call.
+      void start(HANDLE userToken, bool createConsole=false);
 
-      // Wait for the process to quit, and close the handles to it.
-      void await();
+      // Detatch from the child process. After detatching from a child
+      //   process, no other methods should be called on the object
+      //   that started it
+      void detach();
+
+      // Wait for the process to quit, up to the specified timeout, and
+      //   close the handles to it once it has quit.
+      //   If the process quits within the timeout then true is returned
+      //   and returnCode is set. If it has not quit then false is returned.
+      //   If an error occurs then an exception will be thrown.
+      bool await(DWORD timeoutMs=INFINITE);
 
       PROCESS_INFORMATION procInfo;
+      DWORD returnCode;
     protected:
       TCharArray exeName;
       TCharArray params;