Skip to content

Commit 30da6d3

Browse files
committed
v1.6.1 exclude installer process
1 parent b471f03 commit 30da6d3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Source/nsProcess.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ int FIND_PROC_BY_NAME(TCHAR *szProcessName, BOOL bTerminate, BOOL bClose)
252252
BOOL bFound=FALSE;
253253
BOOL bSuccess=FALSE;
254254
BOOL bFailed=FALSE;
255+
DWORD dwCurrentProcessID = 0;
256+
257+
// Gets Current Process ID
258+
dwCurrentProcessID = GetCurrentProcessId();
255259

256260
// First check what version of Windows we're in
257261
osvi.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
@@ -321,8 +325,7 @@ int FIND_PROC_BY_NAME(TCHAR *szProcessName, BOOL bTerminate, BOOL bClose)
321325
#else
322326
WideCharToMultiByte(CP_ACP, 0, spiCount->pszProcessName, -1, szName, MAX_PATH, NULL, NULL);
323327
#endif
324-
325-
if (!lstrcmpi(szName, szProcessName))
328+
if (spiCount->dwProcessID != dwCurrentProcessID && !lstrcmpi(szName, szProcessName))
326329
{
327330
// Process found
328331
bFound=TRUE;
@@ -380,7 +383,7 @@ int FIND_PROC_BY_NAME(TCHAR *szProcessName, BOOL bTerminate, BOOL bClose)
380383
lstrcpyn(szName, pName, MAX_PATH);
381384
#endif
382385

383-
if (!lstrcmpi(szName, szProcessName))
386+
if (pe.th32ProcessID != dwCurrentProcessID && !lstrcmpi(szName, szProcessName))
384387
{
385388
// Process found
386389
bFound=TRUE;

0 commit comments

Comments
 (0)