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,6 +10161,7 @@ DWORD Inject(BOOL bIsExplorer)
} }
RtlQueryFeatureConfigurationFunc = GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlQueryFeatureConfiguration"); RtlQueryFeatureConfigurationFunc = GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlQueryFeatureConfiguration");
if (RtlQueryFeatureConfigurationFunc) {
rv = funchook_prepare( rv = funchook_prepare(
funchook, funchook,
(void**)&RtlQueryFeatureConfigurationFunc, (void**)&RtlQueryFeatureConfigurationFunc,
@ -10171,6 +10172,7 @@ DWORD Inject(BOOL bIsExplorer)
FreeLibraryAndExitThread(hModule, rv); FreeLibraryAndExitThread(hModule, rv);
return FALSE; return FALSE;
} }
}
printf("Setup ntdll functions done\n"); printf("Setup ntdll functions done\n");