Skip to content

Commit 2968207

Browse files
committed
Update to feature parity with Doorstop 3.0
1 parent 2a1e87d commit 2968207

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

doorstop.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ void *jit_init_hook(const char *root_domain_name, const char *runtime_version)
159159
setenv("DOORSTOP_MANAGED_FOLDER_DIR", assembly_dir, TRUE);
160160
free(assembly_dir);
161161

162+
char app_path[PATH_MAX] = "\0";
163+
program_path(app_path);
164+
setenv("DOORSTOP_PROCESS_PATH", app_path, TRUE);
165+
162166
// Load our custom assembly into the domain
163167
void *assembly = r_mono_domain_assembly_open(domain, dll_path);
164168

@@ -199,24 +203,11 @@ void *jit_init_hook(const char *root_domain_name, const char *runtime_version)
199203
uint32_t params = r_mono_signature_get_param_count(signature);
200204

201205
void **args = NULL;
202-
char app_path[PATH_MAX] = "\0";
203206
if (params == 1)
204207
{
205208
// If there is a parameter, it's most likely a string[].
206-
// Populate it as follows
207-
// 0 => path to the game's executable
208-
// 1 => --doorstop-invoke
209-
210-
program_path(app_path);
211-
212-
void *exe_path = r_mono_string_new(domain, app_path);
213-
void *doorstop_handle = r_mono_string_new(domain, "--doorstop-invoke");
214-
215209
void *args_array = r_mono_array_new(domain, r_mono_get_string_class(), 2);
216210

217-
SET_ARRAY_REF(args_array, 0, exe_path);
218-
SET_ARRAY_REF(args_array, 1, doorstop_handle);
219-
220211
args = malloc(sizeof(void *) * 1);
221212
args[0] = args_array;
222213
}

0 commit comments

Comments
 (0)