Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateProcess needs CREATE_UNICODE_ENVIRONMENT #903

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

* Code quality improvement: remove an uneeded Obj.magic (#844, Benoit Montagu).

* On Windows, use the Unicode API in C stubs and functions introduced in OCaml 4.06 to handle Unicode strings. Raise the minimum requirement to OCaml 4.06 (on Windows only). (#843, Antonin Décimo)
* On Windows, use the Unicode API in C stubs and functions introduced in OCaml 4.06 to handle Unicode strings. Raise the minimum requirement to OCaml 4.06 (on Windows only). (#843, #903, Antonin Décimo)

===== 5.4.2 =====

Expand Down
3 changes: 2 additions & 1 deletion src/unix/lwt_process_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CAMLprim value lwt_process_create_process(value prog, value cmdline, value env,

STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD flags = CREATE_UNICODE_ENVIRONMENT;
BOOL ret;

#define string_option(opt) \
Expand All @@ -62,7 +63,7 @@ CAMLprim value lwt_process_create_process(value prog, value cmdline, value env,
si.hStdOutput = get_handle(Field(fds, 1));
si.hStdError = get_handle(Field(fds, 2));

ret = CreateProcess(progs, cmdlines, NULL, NULL, TRUE, 0,
ret = CreateProcess(progs, cmdlines, NULL, NULL, TRUE, flags,
envs, cwds, &si, &pi);
caml_stat_free(progs);
caml_stat_free(cmdlines);
Expand Down
3 changes: 2 additions & 1 deletion src/unix/windows_c/windows_system_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ CAMLprim value lwt_unix_system_job(value cmdline)
CAMLparam1(cmdline);
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD flags = CREATE_UNICODE_ENVIRONMENT;
BOOL ret;

char_os *cmdlines = caml_stat_strdup_to_os(String_val(cmdline));
Expand All @@ -59,7 +60,7 @@ CAMLprim value lwt_unix_system_job(value cmdline)
ZeroMemory(&pi, sizeof(pi));
si.cb = sizeof(si);

ret = CreateProcess(NULL, cmdlines, NULL, NULL, TRUE, 0,
ret = CreateProcess(NULL, cmdlines, NULL, NULL, TRUE, flags,
NULL, NULL, &si, &pi);
caml_stat_free(cmdlines);
if (!ret) {
Expand Down