Skip to content

Commit

Permalink
chore(UE4SS): remove windows.h leaking
Browse files Browse the repository at this point in the history
  • Loading branch information
localcc authored and Buckminsterfullerene02 committed Aug 6, 2024
1 parent b23cd21 commit 9fd6e3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 3 additions & 4 deletions UE4SS/include/Mod/CppMod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#include <vector>

#define NOMINMAX
#include <Windows.h>
#include <Unreal/Core/Windows/MinimalWindowsApi.hpp>

#include <Mod/CppUserModBase.hpp>
#include <Mod/Mod.hpp>
Expand All @@ -24,8 +23,8 @@ namespace RC
private:
std::wstring m_dlls_path;

HMODULE m_main_dll_module = NULL;
DLL_DIRECTORY_COOKIE m_dlls_path_cookie = NULL;
Unreal::Windows::HMODULE m_main_dll_module = NULL;
void* m_dlls_path_cookie = NULL;
start_type m_start_mod_func = nullptr;
uninstall_type m_uninstall_mod_func = nullptr;

Expand Down
2 changes: 2 additions & 0 deletions UE4SS/src/LuaLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <Unreal/FOutputDevice.hpp>
#include <Unreal/UnrealInitializer.hpp>

#include <Windows.h>

namespace RC::LuaLibrary
{
auto get_outputdevice_ref(const LuaMadeSimple::Lua& lua) -> const Unreal::FOutputDevice*
Expand Down
4 changes: 3 additions & 1 deletion UE4SS/src/Mod/CppMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <Helpers/String.hpp>
#include <Mod/CppMod.hpp>

#include <Windows.h>

namespace RC
{
CppMod::CppMod(UE4SSProgram& program, std::wstring&& mod_name, std::wstring&& mod_path) : Mod(program, std::move(mod_name), std::move(mod_path))
Expand Down Expand Up @@ -168,4 +170,4 @@ namespace RC
RemoveDllDirectory(m_dlls_path_cookie);
}
}
} // namespace RC
} // namespace RC

0 comments on commit 9fd6e3e

Please sign in to comment.