Skip to content

CreateProcess needs CREATE_UNICODE_ENVIRONMENT - #903

Merged
smorimoto merged 1 commit into
ocsigen:masterfrom
MisterDA:windows-create-process-unicode-env
Nov 23, 2021
Merged

smorimoto merged 1 commit into
ocsigen:masterfrom
MisterDA:windows-create-process-unicode-env

Conversation

@MisterDA

Copy link
Copy Markdown
Contributor

If the environment block pointed to by lpEnvironment contains
Unicode characters, be sure that dwCreationFlags includes
CREATE_UNICODE_ENVIRONMENT. If this parameter is NULL and the
environment block of the parent process contains Unicode characters,
you must also ensure that dwCreationFlags includes
CREATE_UNICODE_ENVIRONMENT.

From doc1.

If this flag is set, the environment block pointed to by
lpEnvironment uses Unicode characters. Otherwise, the environment
block uses ANSI characters.

From doc2.

This was forgotten from PR #843 that switched to Unicode strings on
Windows (including the environment). I noticed it when reading code
from win32unix.

> If the environment block pointed to by lpEnvironment contains
> Unicode characters, be sure that dwCreationFlags includes
> CREATE_UNICODE_ENVIRONMENT. If this parameter is NULL and the
> environment block of the parent process contains Unicode characters,
> you must also ensure that dwCreationFlags includes
> CREATE_UNICODE_ENVIRONMENT.

From [doc1][].

> If this flag is set, the environment block pointed to by
> lpEnvironment uses Unicode characters. Otherwise, the environment
> block uses ANSI characters.

From [doc2][].

This was forgotten from PR ocsigen#843 that switched to Unicode strings on
Windows (including the environment).

[doc1]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
[doc2]: https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags#CREATE_UNICODE_ENVIRONMENT
@smorimoto
smorimoto merged commit d5f8452 into ocsigen:master Nov 23, 2021
@smorimoto

Copy link
Copy Markdown
Member

Thanks @MisterDA!

@MisterDA
MisterDA deleted the windows-create-process-unicode-env branch November 23, 2021 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants