Update Dalamud.Boot to use extra import checks

- Ports extra import checks to Dalamud Boot
- Renames is_running_on_linux to is_running_on_wine
- Update relevant logging string for VEH
This commit is contained in:
Kaz Wolfe 2023-09-12 17:06:22 -07:00
parent fd518f8e3f
commit 2acba2b81f
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
3 changed files with 8 additions and 4 deletions

View file

@ -133,8 +133,8 @@ DWORD WINAPI InitializeImpl(LPVOID lpParam, HANDLE hMainThreadContinue) {
// ============================== VEH ======================================== // // ============================== VEH ======================================== //
logging::I("Initializing VEH..."); logging::I("Initializing VEH...");
if (utils::is_running_on_linux()) { if (utils::is_running_on_wine()) {
logging::I("=> VEH was disabled, running on linux"); logging::I("=> VEH was disabled, running on wine");
} else if (g_startInfo.BootVehEnabled) { } else if (g_startInfo.BootVehEnabled) {
if (veh::add_handler(g_startInfo.BootVehFull, g_startInfo.WorkingDirectory)) if (veh::add_handler(g_startInfo.BootVehFull, g_startInfo.WorkingDirectory))
logging::I("=> Done!"); logging::I("=> Done!");

View file

@ -578,7 +578,7 @@ std::vector<std::string> utils::get_env_list(const wchar_t* pcszName) {
return res; return res;
} }
bool utils::is_running_on_linux() { bool utils::is_running_on_wine() {
if (get_env<bool>(L"XL_WINEONLINUX")) if (get_env<bool>(L"XL_WINEONLINUX"))
return true; return true;
HMODULE hntdll = GetModuleHandleW(L"ntdll.dll"); HMODULE hntdll = GetModuleHandleW(L"ntdll.dll");
@ -588,6 +588,10 @@ bool utils::is_running_on_linux() {
return true; return true;
if (GetProcAddress(hntdll, "wine_get_host_version")) if (GetProcAddress(hntdll, "wine_get_host_version"))
return true; return true;
if (GetProcAddress(hntdll, "wine_server_call"))
return true;
if (GetProcAddress(hntdll, "wine_unix_to_nt_file_name"))
return true;
return false; return false;
} }

View file

@ -264,7 +264,7 @@ namespace utils {
return get_env_list<T>(unicode::convert<std::wstring>(pcszName).c_str()); return get_env_list<T>(unicode::convert<std::wstring>(pcszName).c_str());
} }
bool is_running_on_linux(); bool is_running_on_wine();
std::filesystem::path get_module_path(HMODULE hModule); std::filesystem::path get_module_path(HMODULE hModule);