1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-28 01:10:55 +01:00

Small fixes in Start menu injection

This commit is contained in:
Valentin Radu 2021-11-10 21:22:19 +02:00
parent 791541a3fb
commit 77bc654d9b

View File

@ -253,6 +253,7 @@ DWORD WINAPI HookStartMenu(HookStartMenuParams* params)
if (!hProcess)
{
printf("Unable to open handle to StartMenuExperienceHost.exe.\n");
CloseHandle(hSnapshot);
Sleep(params->dwTimeout);
continue;
}
@ -276,7 +277,10 @@ DWORD WINAPI HookStartMenu(HookStartMenuParams* params)
}
} while (Process32Next(hSnapshot, &pe32) == TRUE);
}
CloseHandle(hSnapshot);
if (hSnapshot)
{
CloseHandle(hSnapshot);
}
if (hProcess)
{
break;
@ -293,7 +297,7 @@ DWORD WINAPI HookStartMenu(HookStartMenuParams* params)
hProcess,
NULL,
MAX_PATH,
MEM_COMMIT,
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE
);
if (!lpRemotePath)