2008-11-13 Bill Holmes <billholmes54@gmail.com>
authorBill Holmes <holmes@mono-cvs.ximian.com>
Thu, 13 Nov 2008 16:03:48 +0000 (16:03 -0000)
committerBill Holmes <holmes@mono-cvs.ximian.com>
Thu, 13 Nov 2008 16:03:48 +0000 (16:03 -0000)
* process.h : Adding method declaration for
  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

* process.c : Adding implementation for
  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

* icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
  to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

* wait.h : Adding method declaration for WaitForInputIdle.

* wait.c : Adding implementation for WaitForInputIdle.

* Process.cs : Adding an implementation for WaitForInputIdle
  to call the an internal call.  The internal call is only
  implemented properly on Windows.

Code is contributed under MIT/X11 license.

svn path=/trunk/mono/; revision=118724

mono/io-layer/ChangeLog
mono/io-layer/wait.c
mono/io-layer/wait.h
mono/metadata/ChangeLog
mono/metadata/icall-def.h
mono/metadata/process.c
mono/metadata/process.h

index f0611e5d9db869172f2614d1de398c481df9c004..2f2388b27819a5e73860d267cbda6c4d926c8f70 100644 (file)
@@ -1,3 +1,10 @@
+2008-11-13  Bill Holmes  <billholmes54@gmail.com>
+
+       * wait.h : Adding method declaration for WaitForInputIdle.
+         
+       * wait.c : Adding implementation for WaitForInputIdle.
+         
+       Code is contributed under MIT/X11 license.
 
 Fri Oct 17 15:23:00 CEST 2008 Paolo Molaro <lupus@ximian.com>
 
index 6a24d83b5184ee62a74043fcb19e2ea715e9de7c..50a8b5038f8eded92d34499e60fadc8d3ecd1388 100644 (file)
@@ -766,3 +766,25 @@ guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
 {
        return WaitForMultipleObjectsEx(numobjects, handles, waitall, timeout, FALSE);
 }
+
+/**
+ * WaitForInputIdle:
+ * @handle: a handle to the process to wait for
+ * @timeout: the maximum time in milliseconds to wait for
+ *
+ * This function returns when either @handle process is waiting
+ * for input, or @timeout ms elapses.  If @timeout is zero, the
+ * process state is tested and the function returns immediately.
+ * If @timeout is %INFINITE, the function waits forever.
+ *
+ * Return value: 0 - @handle process is waiting for input.
+ * %WAIT_TIMEOUT - The @timeout interval elapsed and
+ * @handle process is not waiting for input.  %WAIT_FAILED - an error
+ * occurred. 
+ */
+guint32 WaitForInputIdle(gpointer handle, guint32 timeout)
+{
+       /*TODO: Not implemented*/
+       return WAIT_TIMEOUT;
+}
+
index 629fe5b3a578c2060d68eced974b7c4abae4edd7..a4ff149147efe3ee4cd17e8f01125002ad10083b 100644 (file)
@@ -36,6 +36,7 @@ extern guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
                                      gboolean waitall, guint32 timeout);
 extern guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
                                      gboolean waitall, guint32 timeout, gboolean alertable);
+extern guint32 WaitForInputIdle(gpointer handle, guint32 timeout);
 
 G_END_DECLS
 #endif /* _WAPI_WAIT_H_ */
index 59078aa358dae364f4628491a6302587f2e22216..2a326aec5af4be2213b08e1743d3973f119b3d42 100644 (file)
@@ -1,3 +1,16 @@
+2008-11-13  Bill Holmes  <billholmes54@gmail.com>
+
+       * process.h : Adding method declaration for
+         ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
+         
+       * process.c : Adding implementation for
+         ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
+         
+       * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
+         to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
+
+       Code is contributed under MIT/X11 license.
+
 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
 
        * appdomain.c (unload_thread_main): Clean up threadpool by
index 794dd2082ded8d0d985fc11015487c5e56cfc8e2..b3fc8a4ce9f60a352e5c9f8e06ee7bb9c63bb5d6 100644 (file)
@@ -208,6 +208,7 @@ ICALL(PROCESS_13, "ShellExecuteEx_internal(System.Diagnostics.ProcessStartInfo,S
 ICALL(PROCESS_14, "StartTime_internal(intptr)", ves_icall_System_Diagnostics_Process_StartTime_internal)
 ICALL(PROCESS_14M, "Times", ves_icall_System_Diagnostics_Process_Times)
 ICALL(PROCESS_15, "WaitForExit_internal(intptr,int)", ves_icall_System_Diagnostics_Process_WaitForExit_internal)
+ICALL(PROCESS_16, "WaitForInputIdle_internal(intptr,int)", ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal)
 
 ICALL_TYPE (PROCESSHANDLE, "System.Diagnostics.Process/ProcessWaitHandle", PROCESSHANDLE_1)
 ICALL (PROCESSHANDLE_1, "ProcessHandle_close(intptr)", ves_icall_System_Diagnostics_Process_ProcessHandle_close)
index a7b36e4ff4fa8e8ee2c872eb58ee3429296410bf..bbf964d9f87409735b144a66b7396049cf051ea7 100644 (file)
@@ -808,6 +808,22 @@ MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObjec
        }
 }
 
+MonoBoolean ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal (MonoObject *this, HANDLE process, gint32 ms)
+{
+       guint32 ret;
+       
+       MONO_ARCH_SAVE_REGS;
+
+       if(ms<0) {
+               /* Wait forever */
+               ret=WaitForInputIdle (process, INFINITE);
+       } else {
+               ret=WaitForInputIdle (process, ms);
+       }
+
+       return (ret) ? FALSE : TRUE;
+}
+
 gint64 ves_icall_System_Diagnostics_Process_ExitTime_internal (HANDLE process)
 {
        gboolean ret;
index 0e7980b3cfb6b2ff43805e1103205fe16f2738b5..fb184a774b67020636ca112a3f1f1b63854913ad 100644 (file)
@@ -66,6 +66,7 @@ void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoO
 MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoProcessStartInfo *proc_start_info, MonoProcInfo *process_handle) MONO_INTERNAL;
 MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoProcessStartInfo *proc_start_info, HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, MonoProcInfo *process_handle) MONO_INTERNAL;
 MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObject *this, HANDLE process, gint32 ms) MONO_INTERNAL;
+MonoBoolean ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal (MonoObject *this, HANDLE process, gint32 ms) MONO_INTERNAL;
 gint64 ves_icall_System_Diagnostics_Process_ExitTime_internal (HANDLE process) MONO_INTERNAL;
 gint64 ves_icall_System_Diagnostics_Process_StartTime_internal (HANDLE process) MONO_INTERNAL;
 gint32 ves_icall_System_Diagnostics_Process_ExitCode_internal (HANDLE process) MONO_INTERNAL;