Browse Source

Fix unicode conversion issue when getting the path of the proxy binary

pull/72/head
Anairkoen Schno 3 years ago
parent
commit
29a2c7661a
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      Doorstop/Proxy/main.c

+ 3
- 2
Doorstop/Proxy/main.c View File

@ -194,8 +194,9 @@ void *ownMonoJitInitVersion(const char *root_domain_name, const char *runtime_ve
wchar_t* dll_path_w; // self path wchar_t* dll_path_w; // self path
size_t dll_path_len = get_module_path((HINSTANCE)&__ImageBase, &dll_path_w, NULL, 0); size_t dll_path_len = get_module_path((HINSTANCE)&__ImageBase, &dll_path_w, NULL, 0);
char* self_dll_path = memalloc(dll_path_len + 1);
WideCharToMultiByte(CP_UTF8, 0, dll_path_w, -1, self_dll_path, dll_path_len + 1, NULL, NULL);
size_t multibyte_path_len = WideCharToMultiByte(CP_UTF8, 0, dll_path_w, dll_path_len, NULL, 0, NULL, NULL);
char* self_dll_path = memalloc(multibyte_path_len);
WideCharToMultiByte(CP_UTF8, 0, dll_path_w, dll_path_len, self_dll_path, multibyte_path_len, NULL, NULL);
mono_dllmap_insert(NULL, "i:bsipa-doorstop", NULL, self_dll_path, NULL); // remap `bsipa-doorstop` to this assembly mono_dllmap_insert(NULL, "i:bsipa-doorstop", NULL, self_dll_path, NULL); // remap `bsipa-doorstop` to this assembly


Loading…
Cancel
Save