[runtime] Clean up configure.ac a bit.
[mono.git] / mono / metadata / process.c
index 6831fbfc579db4ecff0937289156cef35037dd31..02b36b631c612ab69e00fc7ab69a382fe6d5d468 100644 (file)
@@ -20,6 +20,7 @@
 #include <mono/metadata/image.h>
 #include <mono/metadata/cil-coff.h>
 #include <mono/metadata/exception.h>
+#include <mono/metadata/threadpool-ms-io.h>
 #include <mono/utils/strenc.h>
 #include <mono/utils/mono-proclib.h>
 #include <mono/io-layer/io-layer.h>
@@ -53,11 +54,11 @@ ves_icall_System_Diagnostics_Process_GetPid_internal (void)
        return mono_process_current_pid ();
 }
 
-void ves_icall_System_Diagnostics_Process_Process_free_internal (MonoObject *this,
+void ves_icall_System_Diagnostics_Process_Process_free_internal (MonoObject *this_obj,
                                                                 HANDLE process)
 {
 #ifdef THREAD_DEBUG
-       g_message ("%s: Closing process %p, handle %p", __func__, this, process);
+       g_message ("%s: Closing process %p, handle %p", __func__, this_obj, process);
 #endif
 
 #if defined(TARGET_WIN32) || defined(HOST_WIN32)
@@ -67,9 +68,9 @@ void ves_icall_System_Diagnostics_Process_Process_free_internal (MonoObject *thi
 #endif
 }
 
-#define STASH_SYS_ASS(this) \
+#define STASH_SYS_ASS(this_obj) \
        if(system_assembly == NULL) { \
-               system_assembly=this->vtable->klass->image; \
+               system_assembly=this_obj->vtable->klass->image; \
        }
 
 static MonoImage *system_assembly=NULL;
@@ -377,7 +378,7 @@ static MonoObject* get_process_module (MonoAssembly *assembly, MonoClass *proc_c
        MonoObject *item, *filever;
        MonoDomain *domain = mono_domain_get ();
        char filename [80] = "[In Memory] ";
-       char *modulename = assembly->aname.name;
+       const char *modulename = assembly->aname.name;
 
        strncat (filename, modulename, 80);
 
@@ -469,7 +470,7 @@ static GPtrArray* get_domain_assemblies (MonoDomain *domain)
 }
 
 /* Returns an array of System.Diagnostics.ProcessModule */
-MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this, HANDLE process)
+MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, HANDLE process)
 {
        MonoArray *temp_arr = NULL;
        MonoArray *arr;
@@ -488,7 +489,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
                current_process = ves_icall_System_Diagnostics_Process_GetProcess_internal (pid);
        }
 
-       STASH_SYS_ASS (this);
+       STASH_SYS_ASS (this_obj);
 
        if (process == current_process) {
                assemblies = get_domain_assemblies (mono_domain_get ());
@@ -546,12 +547,12 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        return arr;
 }
 
-void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this, MonoString *filename)
+void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this_obj, MonoString *filename)
 {
-       STASH_SYS_ASS (this);
+       STASH_SYS_ASS (this_obj);
        
-       process_get_fileversion (this, mono_string_chars (filename));
-       process_set_field_string (this, "filename",
+       process_get_fileversion (this_obj, mono_string_chars (filename));
+       process_set_field_string (this_obj, "filename",
                                  mono_string_chars (filename),
                                  mono_string_length (filename));
 }
@@ -662,10 +663,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr
        } else {
                process_info->process_handle = shellex.hProcess;
                process_info->thread_handle = NULL;
-               /* It appears that there's no way to get the pid from a
-                * process handle before windows xp.  Really.
-                */
-#if defined(HAVE_GETPROCESSID) && !defined(MONO_CROSS_COMPILE)
+#if !defined(MONO_CROSS_COMPILE)
                process_info->pid = GetProcessId (shellex.hProcess);
 #else
                process_info->pid = 0;
@@ -802,7 +800,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoPro
        return(ret);
 }
 
-MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObject *this, HANDLE process, gint32 ms)
+MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObject *this_obj, HANDLE process, gint32 ms)
 {
        guint32 ret;
        
@@ -822,7 +820,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObjec
        }
 }
 
-MonoBoolean ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal (MonoObject *this, HANDLE process, gint32 ms)
+MonoBoolean ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal (MonoObject *this_obj, HANDLE process, gint32 ms)
 {
        guint32 ret;
        
@@ -1076,3 +1074,9 @@ ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type,
        return res;
 }
 
+void
+ves_icall_System_Diagnostics_Process_ProcessAsyncReader_RemoveFromIOThreadPool (HANDLE handle)
+{
+       mono_threadpool_ms_io_remove_socket (GPOINTER_TO_INT (handle));
+}
+