diff --git a/Client/loader/MainFunctions.cpp b/Client/loader/MainFunctions.cpp index abd523dfc6..1262e2ba5b 100644 --- a/Client/loader/MainFunctions.cpp +++ b/Client/loader/MainFunctions.cpp @@ -21,6 +21,8 @@ #include #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 +940,29 @@ void ValidateGTAPath() } } +////////////////////////////////////////////////////////// +// +// isUsingWine +// +// Detect if we are running under Wine +// +////////////////////////////////////////////////////////// +int isUsingWine() +{ + HMODULE ntdll = GetModuleHandleA("ntdll.dll"); + if (!ntdll) + return 0; // Not ntdll? Not Wine. + + // Check for Wine-specific function + FARPROC wineVersion = GetProcAddress(ntdll, "wine_get_version"); + if (wineVersion) + { + return 1; // Is Wine. + } + + return 0; // Not Wine. +} + ////////////////////////////////////////////////////////// // // CheckAntiVirusStatus @@ -947,6 +972,12 @@ void ValidateGTAPath() ////////////////////////////////////////////////////////// void CheckAntiVirusStatus() { + if (isUsingWine()) + { + WriteDebugEvent("Skipping AV check under Wine"); + return; + } + std::vector enabledList, disabledList; GetWMIAntiVirusStatus(enabledList, disabledList);