Skip to content

Commit a7880e9

Browse files
committed
Added compatibility message for GAS Tecnologia G-Buster Browser Defense
1 parent 4159728 commit a7880e9

File tree

3 files changed

+51
-8
lines changed

3 files changed

+51
-8
lines changed

Client/loader/MainFunctions.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,28 @@ void HandleNotUsedMainMenu ( void )
388388
}
389389
}
390390

391-
// Check if Evolve is active
392-
for ( auto processId : MyEnumProcesses( true ) )
391+
// Check if problem processes are active
392+
struct
393393
{
394-
SString strFilename = ExtractFilename( GetProcessPathFilename( processId ) );
395-
if ( strFilename.BeginsWithI( "Evolve" ) )
394+
const char* szFilename;
395+
const char* szProductName;
396+
const char* szTrouble;
397+
} procItems[] = {
398+
{"Evolve", "Evolve", "not-used-menu-evolve"},
399+
{"GbpSv.exe", "GAS Tecnologia - G-Buster Browser Defense", "not-used-menu-gbpsv"}};
400+
for (uint i = 0; i < NUMELMS(procItems); i++ )
401+
{
402+
for ( auto processId : MyEnumProcesses( true ) )
396403
{
397-
SString strMessage = _("Are you having problems running MTA:SA?.\n\nTry disabling the following products for GTA and MTA:");
398-
strMessage += "\n\nEvolve";
399-
DisplayErrorMessageBox ( strMessage, _E("CL43"), "not-used-menu-evolve" );
400-
break;
404+
SString strFilename = GetProcessFilename( processId );
405+
if ( strFilename.BeginsWithI( procItems[i].szFilename ) )
406+
{
407+
SString strMessage = _("Are you having problems running MTA:SA?.\n\nTry disabling the following products for GTA and MTA:");
408+
strMessage += "\n\n";
409+
strMessage += procItems[i].szProductName;
410+
DisplayErrorMessageBox ( strMessage, _E("CL43"), procItems[i].szTrouble );
411+
break;
412+
}
401413
}
402414
}
403415
}

Client/loader/Utils.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ WString devicePathToWin32Path ( const WString& strDevicePath )
351351

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

354+
354355
///////////////////////////////////////////////////////////////////////////
355356
//
356357
// GetProcessPathFilename
@@ -436,6 +437,35 @@ SString GetProcessPathFilename ( DWORD processID )
436437
}
437438

438439

440+
///////////////////////////////////////////////////////////////////////////
441+
//
442+
// GetProcessFilename
443+
//
444+
// More reliable than GetProcessPathFilename, but no path
445+
//
446+
///////////////////////////////////////////////////////////////////////////
447+
SString GetProcessFilename(DWORD processID)
448+
{
449+
SString strFilename;
450+
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
451+
PROCESSENTRY32W pe = {sizeof(PROCESSENTRY32W)};
452+
if( Process32FirstW(hSnapshot, &pe))
453+
{
454+
do
455+
{
456+
if (pe.th32ProcessID == processID)
457+
{
458+
strFilename = ToUTF8(pe.szExeFile);
459+
break;
460+
}
461+
}
462+
while( Process32NextW(hSnapshot, &pe));
463+
}
464+
CloseHandle(hSnapshot);
465+
return strFilename;
466+
}
467+
468+
439469
///////////////////////////////////////////////////////////////////////////
440470
//
441471
// MyEnumProcesses

Client/loader/Utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ SString PadLeft ( const SString& strText, ui
130130
bool IsDeviceSelectionDialogOpen ( DWORD dwThreadId );
131131
std::vector < DWORD > MyEnumProcesses ( bool bInclude64bit = false, bool bIncludeCurrent = false );
132132
SString GetProcessPathFilename ( DWORD processID );
133+
SString GetProcessFilename ( DWORD processID );
133134
void WriteDebugEventAndReport ( uint uiId, const SString& strText );
134135
WString ReadCompatibilityEntries ( const WString& strProgName, const WString& strSubKey, HKEY hKeyRoot, uint uiFlags );
135136
bool WriteCompatibilityEntries ( const WString& strProgName, const WString& strSubKey, HKEY hKeyRoot, uint uiFlags, const WString& strNewData );

0 commit comments

Comments
 (0)