Added null checks before hooking

This commit is contained in:
cdozdil
2026-07-31 08:40:16 +03:00
parent 0c4884a824
commit 1ee520e6fa
+5 -2
View File
@@ -60,8 +60,11 @@ static void HookDevice(VkDevice InDevice)
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&) o_QueuePresentKHR, hkvkQueuePresentKHR);
DetourAttach(&(PVOID&) o_CreateSwapchainKHR, hkvkCreateSwapchainKHR);
if (o_QueuePresentKHR != nullptr)
DetourAttach(&(PVOID&) o_QueuePresentKHR, hkvkQueuePresentKHR);
if (o_CreateSwapchainKHR != nullptr)
DetourAttach(&(PVOID&) o_CreateSwapchainKHR, hkvkCreateSwapchainKHR);
auto detourResult = DetourTransactionCommit();
if (detourResult != NO_ERROR)