Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dynamic Link Library (DLL) entrypoint without Windows bloat
#include <cstdint>
constexpr auto REASON_PROCESS_ATTACH = 1;
constexpr auto REASON_PROCESS_DETACH = 0;
std::uint32_t __stdcall DllMain(const void* mod_instance, const std::uint32_t call_reason, const void* reserved)
{
switch (call_reason)
{
case REASON_PROCESS_ATTACH:
break;
case REASON_PROCESS_DETACH:
break;
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment