1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-04 13:25:36 +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"); RtlQueryFeatureConfigurationFunc = GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlQueryFeatureConfiguration");
rv = funchook_prepare( if (RtlQueryFeatureConfigurationFunc) {
funchook, rv = funchook_prepare(
(void**)&RtlQueryFeatureConfigurationFunc, funchook,
RtlQueryFeatureConfigurationHook (void**)&RtlQueryFeatureConfigurationFunc,
); RtlQueryFeatureConfigurationHook
if (rv != 0) );
{ if (rv != 0)
FreeLibraryAndExitThread(hModule, rv); {
return FALSE; FreeLibraryAndExitThread(hModule, rv);
return FALSE;
}
} }
printf("Setup ntdll functions done\n"); printf("Setup ntdll functions done\n");