22#define SHIM_NS ForceDXSetupSuccess
23#include <setup_shim.inl>
26#define DSETUPERR_SUCCESS 0
30 SHIM_MSG(
"Returning DSETUPERR_SUCCESS\n");
36 SHIM_MSG(
"Returning DSETUPERR_SUCCESS\n");
42 SHIM_MSG(
"Returning DSETUPERR_SUCCESS\n");
73 PathDivider +=
sizeof(
WCHAR);
150 static const STRING DxSetupFunctions[] = {
156 static const FARPROC DxSetupRedirections[] = {
172 SHIM_MSG(
"Intercepted %Z\n", DxSetupFunctions +
n);
173 return DxSetupRedirections[
n];
192#define SHIM_NUM_HOOKS 6
193#define SHIM_SETUP_HOOKS \
194 SHIM_HOOK(0, "KERNEL32.DLL", "LoadLibraryA", SHIM_OBJ_NAME(APIHook_LoadLibraryA)) \
195 SHIM_HOOK(1, "KERNEL32.DLL", "LoadLibraryW", SHIM_OBJ_NAME(APIHook_LoadLibraryW)) \
196 SHIM_HOOK(2, "KERNEL32.DLL", "LoadLibraryExA", SHIM_OBJ_NAME(APIHook_LoadLibraryExA)) \
197 SHIM_HOOK(3, "KERNEL32.DLL", "LoadLibraryExW", SHIM_OBJ_NAME(APIHook_LoadLibraryExW)) \
198 SHIM_HOOK(4, "KERNEL32.DLL", "GetProcAddress", SHIM_OBJ_NAME(APIHook_GetProcAddress)) \
199 SHIM_HOOK(5, "KERNEL32.DLL", "FreeLibrary", SHIM_OBJ_NAME(APIHook_FreeLibrary))
201#include <implement_shim.inl>
#define NT_SUCCESS(StatCode)
static DWORD * lpdwMinorVersion
INT_PTR WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion)
INT_PTR WINAPI DirectXSetupA(HWND hWnd, LPSTR lpszRootPath, DWORD dwFlags)
HMODULE(WINAPI * LOADLIBRARYEXAPROC)(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
HMODULE WINAPI SHIM_OBJ_NAME() APIHook_LoadLibraryW(LPCWSTR lpLibFileName)
HMODULE WINAPI SHIM_OBJ_NAME() APIHook_LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
static BOOL IsDxSetupA(PCANSI_STRING LibraryPath)
HMODULE(WINAPI * LOADLIBRARYWPROC)(LPCWSTR lpLibFileName)
HMODULE WINAPI SHIM_OBJ_NAME() APIHook_LoadLibraryA(LPCSTR lpLibFileName)
#define DSETUPERR_SUCCESS
BOOL(WINAPI * FREELIBRARYPROC)(HINSTANCE hLibModule)
BOOL WINAPI SHIM_OBJ_NAME() APIHook_FreeLibrary(HINSTANCE hLibModule)
HMODULE(WINAPI * LOADLIBRARYAPROC)(LPCSTR lpLibFileName)
INT_PTR WINAPI DirectXSetupW(HWND hWnd, LPWSTR lpszRootPath, DWORD dwFlags)
FARPROC(WINAPI * GETPROCADDRESSPROC)(HMODULE hModule, LPCSTR lpProcName)
HMODULE(WINAPI * LOADLIBRARYEXWPROC)(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
static BOOL IsDxSetupW(PCUNICODE_STRING LibraryPath)
FARPROC WINAPI SHIM_OBJ_NAME() APIHook_GetProcAddress(HMODULE hModule, LPCSTR lpProcName)
HMODULE WINAPI SHIM_OBJ_NAME() APIHook_LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
INT_PTR WINAPI DirectXSetup(HWND hWnd, LPSTR lpszRootPath, DWORD dwFlags)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END
NTSTATUS NTAPI RtlFindCharInUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING SearchString, _In_ PCUNICODE_STRING MatchString, _Out_ PUSHORT Position)
HINSTANCE ShimLib_Instance(VOID)
#define SHIM_MSG(fmt,...)
#define RTL_CONSTANT_STRING(s)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags