Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Client/loader/MainFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <iterator>
#include <optional>
#include <locale.h>
#include <windows.h>
#include <stdio.h>

// Function must be at the start to fix odd compile error (Didn't happen locally but does in build server)
namespace
Expand Down Expand Up @@ -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
Expand All @@ -947,6 +972,12 @@ void ValidateGTAPath()
//////////////////////////////////////////////////////////
void CheckAntiVirusStatus()
{
if (isUsingWine())
{
WriteDebugEvent("Skipping AV check under Wine");
return;
}

std::vector<SString> enabledList, disabledList;
GetWMIAntiVirusStatus(enabledList, disabledList);

Expand Down