disable veh and symbolhandler for linux

This commit is contained in:
pohky 2021-11-01 20:19:35 +01:00
parent 32896611d5
commit bddc1e1365
2 changed files with 26 additions and 5 deletions

View file

@ -9,6 +9,18 @@
HMODULE g_hModule;
bool is_running_on_linux()
{
HMODULE hntdll = GetModuleHandleW(L"ntdll.dll");
if (!hntdll) // not running on NT
return true;
FARPROC pwine_get_version = GetProcAddress(hntdll, "wine_get_version");
FARPROC pwine_get_host_version = GetProcAddress(hntdll, "wine_get_host_version");
return pwine_get_version != nullptr || pwine_get_host_version != nullptr;
}
DllExport DWORD WINAPI Initialize(LPVOID lpParam)
{
#ifndef NDEBUG
@ -48,9 +60,16 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam)
// ============================== VEH ======================================== //
printf("Initializing VEH... ");
if (veh::add_handler())
printf("Done!\n");
else printf("Failed!\n");
if(is_running_on_linux())
{
printf("Failed! [Disabled for Wine]\n");
}
else
{
if (veh::add_handler())
printf("Done!\n");
else printf("Failed!\n");
}
// =========================================================================== //

View file

@ -12,6 +12,7 @@ using Dalamud.Configuration.Internal;
using Dalamud.Game;
using Dalamud.Logging.Internal;
using Dalamud.Support;
using Dalamud.Utility;
using Newtonsoft.Json;
using PInvoke;
using Serilog;
@ -76,7 +77,8 @@ namespace Dalamud
// This is due to GitHub not supporting TLS 1.0, so we enable all TLS versions globally
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls;
InitSymbolHandler(info);
if (!Util.IsLinux())
InitSymbolHandler(info);
var dalamud = new Dalamud(info, levelSwitch, finishSignal, configuration);
Log.Information("Starting a session..");