mirror of
https://github.com/valinet/ExplorerPatcher.git
synced 2024-11-23 23:21:08 +01:00
Added guard to stop trying to hook Start menu after some time if not found
This commit is contained in:
parent
04b204f2b6
commit
4cf492c8d3
@ -201,6 +201,7 @@ DWORD WINAPI HookStartMenu(HookStartMenuParams* params)
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
unsigned int retry = 0;
|
||||
HANDLE hProcess, hSnapshot;
|
||||
PROCESSENTRY32 pe32;
|
||||
while (TRUE)
|
||||
@ -233,6 +234,7 @@ DWORD WINAPI HookStartMenu(HookStartMenuParams* params)
|
||||
{
|
||||
printf("Unable to open handle to StartMenuExperienceHost.exe.\n");
|
||||
Sleep(params->dwTimeout);
|
||||
continue;
|
||||
}
|
||||
TCHAR wszProcessPath[MAX_PATH];
|
||||
DWORD dwLength = MAX_PATH;
|
||||
@ -261,6 +263,8 @@ DWORD WINAPI HookStartMenu(HookStartMenuParams* params)
|
||||
}
|
||||
else
|
||||
{
|
||||
retry++;
|
||||
if (retry > 5) return 0;
|
||||
Sleep(params->dwTimeout);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user