Skip to content

Commit

Permalink
Added compatibility message for GAS Tecnologia G-Buster Browser Defense
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Aug 21, 2017
1 parent 4159728 commit a7880e9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
28 changes: 20 additions & 8 deletions Client/loader/MainFunctions.cpp
Expand Up @@ -388,16 +388,28 @@ void HandleNotUsedMainMenu ( void )
}
}

// Check if Evolve is active
for ( auto processId : MyEnumProcesses( true ) )
// Check if problem processes are active
struct
{
SString strFilename = ExtractFilename( GetProcessPathFilename( processId ) );
if ( strFilename.BeginsWithI( "Evolve" ) )
const char* szFilename;
const char* szProductName;
const char* szTrouble;
} procItems[] = {
{"Evolve", "Evolve", "not-used-menu-evolve"},
{"GbpSv.exe", "GAS Tecnologia - G-Buster Browser Defense", "not-used-menu-gbpsv"}};
for (uint i = 0; i < NUMELMS(procItems); i++ )
{
for ( auto processId : MyEnumProcesses( true ) )
{
SString strMessage = _("Are you having problems running MTA:SA?.\n\nTry disabling the following products for GTA and MTA:");
strMessage += "\n\nEvolve";
DisplayErrorMessageBox ( strMessage, _E("CL43"), "not-used-menu-evolve" );
break;
SString strFilename = GetProcessFilename( processId );
if ( strFilename.BeginsWithI( procItems[i].szFilename ) )
{
SString strMessage = _("Are you having problems running MTA:SA?.\n\nTry disabling the following products for GTA and MTA:");
strMessage += "\n\n";
strMessage += procItems[i].szProductName;
DisplayErrorMessageBox ( strMessage, _E("CL43"), procItems[i].szTrouble );
break;
}
}
}
}
Expand Down
30 changes: 30 additions & 0 deletions Client/loader/Utils.cpp
Expand Up @@ -351,6 +351,7 @@ WString devicePathToWin32Path ( const WString& strDevicePath )

typedef WINBASEAPI BOOL (WINAPI *LPFN_QueryFullProcessImageNameW)(__in HANDLE hProcess, __in DWORD dwFlags, __out_ecount_part(*lpdwSize, *lpdwSize) LPWSTR lpExeName, __inout PDWORD lpdwSize);


///////////////////////////////////////////////////////////////////////////
//
// GetProcessPathFilename
Expand Down Expand Up @@ -436,6 +437,35 @@ SString GetProcessPathFilename ( DWORD processID )
}


///////////////////////////////////////////////////////////////////////////
//
// GetProcessFilename
//
// More reliable than GetProcessPathFilename, but no path
//
///////////////////////////////////////////////////////////////////////////
SString GetProcessFilename(DWORD processID)
{
SString strFilename;
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32W pe = {sizeof(PROCESSENTRY32W)};
if( Process32FirstW(hSnapshot, &pe))
{
do
{
if (pe.th32ProcessID == processID)
{
strFilename = ToUTF8(pe.szExeFile);
break;
}
}
while( Process32NextW(hSnapshot, &pe));
}
CloseHandle(hSnapshot);
return strFilename;
}


///////////////////////////////////////////////////////////////////////////
//
// MyEnumProcesses
Expand Down
1 change: 1 addition & 0 deletions Client/loader/Utils.h
Expand Up @@ -130,6 +130,7 @@ SString PadLeft ( const SString& strText, ui
bool IsDeviceSelectionDialogOpen ( DWORD dwThreadId );
std::vector < DWORD > MyEnumProcesses ( bool bInclude64bit = false, bool bIncludeCurrent = false );
SString GetProcessPathFilename ( DWORD processID );
SString GetProcessFilename ( DWORD processID );
void WriteDebugEventAndReport ( uint uiId, const SString& strText );
WString ReadCompatibilityEntries ( const WString& strProgName, const WString& strSubKey, HKEY hKeyRoot, uint uiFlags );
bool WriteCompatibilityEntries ( const WString& strProgName, const WString& strSubKey, HKEY hKeyRoot, uint uiFlags, const WString& strNewData );
Expand Down

0 comments on commit a7880e9

Please sign in to comment.