Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / w32process.h
1 /**
2  * \file
3  * System.Diagnostics.Process support
4  *
5  * Author:
6  *      Dick Porter (dick@ximian.com)
7  *
8  * (C) 2002 Ximian, Inc.
9  */
10
11 #ifndef _MONO_METADATA_W32PROCESS_H_
12 #define _MONO_METADATA_W32PROCESS_H_
13
14 #include <config.h>
15 #include <glib.h>
16
17 #if HAVE_SYS_TYPES_H
18 #include <sys/types.h>
19 #endif
20
21 #include <mono/metadata/object.h>
22
23 G_BEGIN_DECLS
24
25 typedef enum {
26         MONO_W32PROCESS_PRIORITY_CLASS_NORMAL       = 0x0020,
27         MONO_W32PROCESS_PRIORITY_CLASS_IDLE         = 0x0040,
28         MONO_W32PROCESS_PRIORITY_CLASS_HIGH         = 0x0080,
29         MONO_W32PROCESS_PRIORITY_CLASS_REALTIME     = 0x0100,
30         MONO_W32PROCESS_PRIORITY_CLASS_BELOW_NORMAL = 0x4000,
31         MONO_W32PROCESS_PRIORITY_CLASS_ABOVE_NORMAL = 0x8000,
32 } MonoW32ProcessPriorityClass;
33
34 typedef struct 
35 {
36         gpointer process_handle;
37         gpointer thread_handle;
38         guint32 pid; /* Contains mono_w32error_get_last () on failure */
39         guint32 tid;
40         MonoArray *env_variables;
41         MonoString *username;
42         MonoString *domain;
43         gpointer password; /* BSTR from SecureString in 2.0 profile */
44         MonoBoolean load_user_profile;
45 } MonoW32ProcessInfo;
46
47 typedef struct
48 {
49         MonoObject object;
50         MonoString *filename;
51         MonoString *arguments;
52         MonoString *working_directory;
53         MonoString *verb;
54         guint32 window_style;
55         MonoBoolean error_dialog;
56         gpointer error_dialog_parent_handle;
57         MonoBoolean use_shell_execute;
58         MonoString *username;
59         MonoString *domain;
60         MonoObject *password; /* SecureString in 2.0 profile, dummy in 1.x */
61         MonoString *password_in_clear_text;
62         MonoBoolean load_user_profile;
63         MonoBoolean redirect_standard_input;
64         MonoBoolean redirect_standard_output;
65         MonoBoolean redirect_standard_error;
66         MonoObject *encoding_stdout;
67         MonoObject *encoding_stderr;
68         MonoBoolean create_no_window;
69         MonoObject *weak_parent_process;
70         MonoObject *envVars;
71 } MonoW32ProcessStartInfo;
72
73 void
74 mono_w32process_init (void);
75
76 void
77 mono_w32process_cleanup (void);
78
79 void
80 mono_w32process_signal_finished (void);
81
82 #ifndef HOST_WIN32
83
84 void
85 mono_w32process_set_cli_launcher (gchar *path);
86
87 gchar*
88 mono_w32process_get_path (pid_t pid);
89
90 #endif
91
92 gpointer
93 ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid);
94
95 MonoArray*
96 ves_icall_System_Diagnostics_Process_GetProcesses_internal (void);
97
98 MonoArray*
99 ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, gpointer process);
100
101 void
102 ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this_obj, MonoString *filename);
103
104 MonoBoolean
105 ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStartInfo *proc_start_info, MonoW32ProcessInfo *process_handle);
106
107 MonoBoolean
108 ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoW32ProcessStartInfo *proc_start_info, gpointer stdin_handle,
109         gpointer stdout_handle, gpointer stderr_handle, MonoW32ProcessInfo *process_handle);
110
111 MonoString*
112 ves_icall_System_Diagnostics_Process_ProcessName_internal (gpointer process);
113
114 gint64
115 ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, gint32 *error);
116
117 gpointer
118 ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void);
119
120 MonoBoolean
121 ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode);
122
123 MonoBoolean
124 ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle);
125
126 MonoBoolean
127 ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode);
128
129 MonoBoolean
130 ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max);
131 MonoBoolean
132 ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max);
133
134 gint32
135 ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle);
136 MonoBoolean
137 ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass);
138
139 MonoBoolean
140 ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creationtime, gint64 *exittime, gint64 *kerneltime, gint64 *usertime);
141
142 G_END_DECLS
143
144 #endif /* _MONO_METADATA_W32PROCESS_H_ */
145