#include <glib.h>
#include <string.h>
-#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
#include <mono/metadata/process.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/appdomain.h>
g_message ("%s: Closing process %p, handle %p", __func__, this, process);
#endif
+#if TARGET_WIN32
CloseHandle (process);
+#else
+ CloseProcess (process);
+#endif
}
#define STASH_SYS_ASS(this) \
quote_path (const gchar *path)
{
gchar *res = g_shell_quote (path);
-#ifdef PLATFORM_WIN32
+#ifdef TARGET_WIN32
{
gchar *q = res;
while (*q) {
gchar *found;
utf8appmemory = utf8app = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL);
-#ifdef PLATFORM_WIN32 // Should this happen on all platforms?
+#ifdef TARGET_WIN32 // Should this happen on all platforms?
{
// remove the quotes around utf8app.
size_t len;
return TRUE;
}
+#if defined (MINGW_CROSS_COMPILE) && defined (HAVE_GETPROCESSID)
+#undef HAVE_GETPROCESSID
+#endif
+
#ifndef HAVE_GETPROCESSID
/* Run-time GetProcessId detection for Windows */
-#ifdef PLATFORM_WIN32
+#ifdef TARGET_WIN32
#define HAVE_GETPROCESSID
typedef DWORD (WINAPI *GETPROCESSID_PROC) (HANDLE);
GetProcessId = &GetProcessId_stub;
return GetProcessId (process);
}
-#endif /* PLATFORM_WIN32 */
+#endif /* HOST_WIN32 */
#endif /* !HAVE_GETPROCESSID */
MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoProcessStartInfo *proc_start_info, MonoProcInfo *process_info)
/* It appears that there's no way to get the pid from a
* process handle before windows xp. Really.
*/
-#ifdef HAVE_GETPROCESSID
+#if defined(HAVE_GETPROCESSID) && !defined(MONO_CROSS_COMPILE)
process_info->pid = GetProcessId (shellex.hProcess);
#else
process_info->pid = 0;
process_info->pid = -ERROR_FILE_NOT_FOUND;
return FALSE;
}
-#ifdef PLATFORM_WIN32
+#ifdef TARGET_WIN32
/* Seems like our CreateProcess does not work as the windows one.
* This hack is needed to deal with paths containing spaces */
shell_path = NULL;