From ea6ebaafeb9d8cfe0daf0db48aa8c979e3e26543 Mon Sep 17 00:00:00 2001 From: Maplespe <43676879+Maplespe@users.noreply.github.com> Date: Tue, 11 Jan 2022 03:24:12 +0800 Subject: [PATCH] Update dllmain.cpp --- ExplorerBgTool/dllmain.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ExplorerBgTool/dllmain.cpp b/ExplorerBgTool/dllmain.cpp index de6fb76..34fe3ab 100644 --- a/ExplorerBgTool/dllmain.cpp +++ b/ExplorerBgTool/dllmain.cpp @@ -1,4 +1,4 @@ -/* +/* * 文件资源管理器背景工具扩展 * * Author: Maple @@ -66,18 +66,22 @@ bool Random = true;//随机显示图片 Random pictures #pragma endregion +extern bool InjectionEntryPoint(); + BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { - g_hModule = hModule; - DisableThreadLibraryCalls(hModule); + if (!g_hModule) { + g_hModule = hModule; + DisableThreadLibraryCalls(hModule); + InjectionEntryPoint(); + } return TRUE; } -//Hook入口点 EasyHook EntryPoint -extern "C" __declspec(dllexport) bool __stdcall InjectionEntryPoint() +bool InjectionEntryPoint() { //初始化 Gdiplus Init GdiPlus GdiplusStartupInput StartupInput; @@ -307,4 +311,4 @@ HDC MyCreateCompatibleDC(HDC hDC) } } return retDC; -} \ No newline at end of file +}