Browse Source

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
pull/1648/head
Valentin Radu 3 years ago
parent
commit
6bc2ea5d2b
  1. 2
      ExplorerPatcher/dllmain.c

2
ExplorerPatcher/dllmain.c

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

Loading…
Cancel
Save