After running the lld unit tests on Windows, it was discovered that various llvm tools on Windows are not handling unicode command lines. An example of a test that does not work on Windows because of this issue is lld/test/ELF/format-binary-non-ascii.s.
This problem was originally fixed in r329468 by modifying Windows/Path.inc to try and use the current codepage. Eli Friedman recommended instead modifying the llvm tools to properly handle unicode command lines by calling sys::Process::GetArgumentVector.
With this change and the change in D45551, lld/test/ELF/format-binary-non-ascii.s passes.
Why is this function's signature so complex? How can it fail?