[Lldb-commits] [lldb] [lldb][windows] refactor CreateProcessW setup (PR #168733)
Charles Zablit via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 27 03:54:46 PST 2025
================
@@ -23,7 +26,33 @@ class ProcessLauncherWindows : public ProcessLauncher {
protected:
HANDLE GetStdioHandle(const ProcessLaunchInfo &launch_info, int fd);
+
+ /// Create a UTF-16 environment block to use with CreateProcessW.
+ ///
+ /// The buffer is a sequence of null-terminated UTF-16 strings, followed by an
+ /// extra L'\0' (two bytes of 0). An empty environment must have one
+ /// empty string, followed by an extra L'\0'.
+ ///
+ /// The keys are sorted to comply with the CreateProcess' calling convention.
+ ///
+ /// Ensure that the resulting buffer is used in conjunction with
+ /// CreateProcessW and be sure that dwCreationFlags includes
+ /// CREATE_UNICODE_ENVIRONMENT.
+ ///
+ /// \param env The Environment object to convert.
+ /// \returns The sorted sequence of environment variables and their values,
+ /// separated by null terminators.
+ static std::vector<wchar_t> CreateEnvironmentBufferW(const Environment &env);
----------------
charles-zablit wrote:
Fixed in a3029fc8046b2af9ad65ec7052dcf7a8fdead9eb
https://github.com/llvm/llvm-project/pull/168733
More information about the lldb-commits
mailing list