mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Support hardcoded environment variables
This commit is contained in:
@@ -122,6 +122,13 @@ public:
|
||||
return emulator_object<T>(*this->emu_, potential_start);
|
||||
}
|
||||
|
||||
wchar_t* copy_string(const std::wstring_view str)
|
||||
{
|
||||
UNICODE_STRING uc_str{};
|
||||
this->make_unicode_string(uc_str, str);
|
||||
return uc_str.Buffer;
|
||||
}
|
||||
|
||||
void make_unicode_string(UNICODE_STRING& result, const std::wstring_view str)
|
||||
{
|
||||
constexpr auto element_size = sizeof(str[0]);
|
||||
|
||||
@@ -226,6 +226,10 @@ namespace
|
||||
proc_params.StandardInput = STDIN_HANDLE.h;
|
||||
proc_params.StandardError = proc_params.StandardOutput;
|
||||
|
||||
proc_params.Environment = allocator.copy_string(L"=::=::\\");
|
||||
allocator.copy_string(L"EMULATOR=1");
|
||||
allocator.copy_string(L"COMPUTERNAME=momo");
|
||||
allocator.copy_string(L"");
|
||||
|
||||
std::wstring command_line = L"\"" + file.wstring() + L"\"";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user