diff --git a/Client/loader/MainFunctions.cpp b/Client/loader/MainFunctions.cpp index abd523dfc6..be6b4a0361 100644 --- a/Client/loader/MainFunctions.cpp +++ b/Client/loader/MainFunctions.cpp @@ -21,6 +21,7 @@ #include #include #include +#include // Function must be at the start to fix odd compile error (Didn't happen locally but does in build server) namespace @@ -938,6 +939,23 @@ void ValidateGTAPath() } } +////////////////////////////////////////////////////////// +// +// isUsingWine +// +// Detect if we are running under Wine +// +////////////////////////////////////////////////////////// +bool isUsingWine() +{ + HMODULE ntdll = GetModuleHandleA("ntdll.dll"); + if (!ntdll) + return false; + + FARPROC wineVersion = GetProcAddress(ntdll, "wine_get_version"); + return wineVersion != nullptr; +} + ////////////////////////////////////////////////////////// // // CheckAntiVirusStatus @@ -947,6 +965,12 @@ void ValidateGTAPath() ////////////////////////////////////////////////////////// void CheckAntiVirusStatus() { + if (isUsingWine()) + { + WriteDebugEvent("Skipping AV check under Wine"); + return; + } + std::vector enabledList, disabledList; GetWMIAntiVirusStatus(enabledList, disabledList);