1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-04 05:15:30 +01:00

All: Fix crash when attempting to hook function on older OS builds

`RtlQueryFeatureConfiguration` is not available on old Windows 10
builds, like 17763 (LTSC 2019).
Related issue: https://github.com/valinet/ExplorerPatcher/discussions/1142
This commit is contained in:
Valentin Radu 2023-03-20 23:58:32 +02:00
parent 8e9403cfb5
commit 6bc2ea5d2b

View File

@ -10161,15 +10161,17 @@ DWORD Inject(BOOL bIsExplorer)
}
RtlQueryFeatureConfigurationFunc = GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlQueryFeatureConfiguration");
rv = funchook_prepare(
funchook,
(void**)&RtlQueryFeatureConfigurationFunc,
RtlQueryFeatureConfigurationHook
);
if (rv != 0)
{
FreeLibraryAndExitThread(hModule, rv);
return FALSE;
if (RtlQueryFeatureConfigurationFunc) {
rv = funchook_prepare(
funchook,
(void**)&RtlQueryFeatureConfigurationFunc,
RtlQueryFeatureConfigurationHook
);
if (rv != 0)
{
FreeLibraryAndExitThread(hModule, rv);
return FALSE;
}
}
printf("Setup ntdll functions done\n");