mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
Use LoadLibrary instead of LoadModule
LoadLibrary increase the reference count to the library. So we make sure this library is still loaded when we shut down the hook.
This commit is contained in:
parent
fdeb5912d3
commit
f096a2d8a2
7 changed files with 27 additions and 24 deletions
|
|
@ -184,7 +184,7 @@ DX11_Hook::DX11_Hook():
|
|||
pContext(nullptr),
|
||||
mainRenderTargetView(nullptr)
|
||||
{
|
||||
_dll = GetModuleHandle(DLL_NAME);
|
||||
_library = LoadLibrary(DLL_NAME);
|
||||
|
||||
// Hook to D3D11CreateDevice and D3D11CreateDeviceAndSwapChain so we know when it gets called.
|
||||
// If its called, then DX11 will be used to render the overlay.
|
||||
|
|
@ -203,8 +203,9 @@ DX11_Hook::~DX11_Hook()
|
|||
{
|
||||
PRINT_DEBUG("DX11 Hook removed\n");
|
||||
|
||||
if (_hooked)
|
||||
resetRenderState();
|
||||
resetRenderState();
|
||||
|
||||
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
||||
|
||||
_inst = nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue