replaced with thread

This commit is contained in:
2026-07-08 19:07:31 +03:00
parent d67d956aca
commit d2ef40e0bd
+5 -5
View File
@@ -5,6 +5,7 @@
#include <imgui.h> #include <imgui.h>
#include <imgui_impl_dx11.h> #include <imgui_impl_dx11.h>
#include <imgui_impl_win32.h> #include <imgui_impl_win32.h>
#include <thread>
#include <tuple> #include <tuple>
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND, UINT, WPARAM, LPARAM); extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND, UINT, WPARAM, LPARAM);
@@ -135,9 +136,8 @@ BOOL WINAPI DllMain(const HINSTANCE h_instance, const DWORD reason, LPVOID)
if (reason == DLL_PROCESS_ATTACH) if (reason == DLL_PROCESS_ATTACH)
{ {
DisableThreadLibraryCalls(h_instance); DisableThreadLibraryCalls(h_instance);
CreateThread( std::thread(
nullptr, 0, []()
[](LPVOID) -> DWORD
{ {
while (!GetModuleHandle("d3d11.dll")) while (!GetModuleHandle("d3d11.dll"))
Sleep(100); Sleep(100);
@@ -147,8 +147,8 @@ BOOL WINAPI DllMain(const HINSTANCE h_instance, const DWORD reason, LPVOID)
mgr.set_on_resize_buffers(on_resize_buffers); mgr.set_on_resize_buffers(on_resize_buffers);
std::ignore = mgr.hook_dx11(); std::ignore = mgr.hook_dx11();
return 0; return 0;
}, })
nullptr, 0, nullptr); .detach();
} }
else if (reason == DLL_PROCESS_DETACH) else if (reason == DLL_PROCESS_DETACH)
{ {