#include "mini-runtime.h"
#include <mono/metadata/assembly.h>
#include <mono/metadata/assembly-internals.h>
+#include <mono/metadata/environment.h>
#include <mono/metadata/loader-internals.h>
#include <mono/utils/mono-logger-internals.h>
*ptr = NULL;
mono_parse_env_options (&mono_argc, &mono_argv);
+
+ // TODO: Should be return code of Main only (mono_jit_exec result)
*exitCode = mono_main (mono_argc, mono_argv);
return 0;
// Parameters:
// hostHandle - Handle of the host
// domainId - Id of the domain
+// latchedExitCode - Latched exit code after domain unloaded
//
// Returns:
// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
trusted_platform_assemblies = NULL;
mono_core_trusted_platform_assemblies_free (a);
+ *latchedExitCode = mono_environment_exitcode_get ();
+
return 0;
}