From e1570c84e9d4cdcc403aa5230e0d67acc93ed984 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Tue, 2 Nov 2021 20:03:28 +0200 Subject: [PATCH] Fixed #256 --- ExplorerPatcher/ExplorerPatcher.rc | 8 ++++---- ExplorerPatcher/dllmain.c | 33 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ExplorerPatcher/ExplorerPatcher.rc b/ExplorerPatcher/ExplorerPatcher.rc index c67b195..eb6a34b 100644 --- a/ExplorerPatcher/ExplorerPatcher.rc +++ b/ExplorerPatcher/ExplorerPatcher.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 22000,282,32,3 - PRODUCTVERSION 22000,282,32,3 + FILEVERSION 22000,282,32,4 + PRODUCTVERSION 22000,282,32,4 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "VALINET Solutions SRL" VALUE "FileDescription", "ExplorerPatcher" - VALUE "FileVersion", "22000.282.32.3" + VALUE "FileVersion", "22000.282.32.4" VALUE "InternalName", "ExplorerPatcher.dll" VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved." VALUE "OriginalFilename", "ExplorerPatcher.dll" VALUE "ProductName", "ExplorerPatcher" - VALUE "ProductVersion", "22000.282.32.3" + VALUE "ProductVersion", "22000.282.32.4" END END BLOCK "VarFileInfo" diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 0f29dfc..e2f4866 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -25,7 +25,9 @@ #ifdef _WIN64 #include #endif +#if defined(DEBUG) | defined(_DEBUG) #define _LIBVALINET_DEBUG_HOOKING_IATPATCH +#endif #include #define EP_CLSID "{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}" @@ -2790,20 +2792,23 @@ void WINAPI LoadSettings(BOOL bIsExplorer) &bSkinMenus, &dwSize ); - if (bAllocConsole) + if (bIsExplorerProcess) { - FILE* conout; - AllocConsole(); - freopen_s( - &conout, - "CONOUT$", - "w", - stdout - ); - } - else - { - FreeConsole(); + if (bAllocConsole) + { + FILE* conout; + AllocConsole(); + freopen_s( + &conout, + "CONOUT$", + "w", + stdout + ); + } + else + { + FreeConsole(); + } } if (!bIsExplorer) { @@ -3950,7 +3955,7 @@ __declspec(dllexport) DWORD WINAPI main( _In_ LPVOID bIsExplorer ) { -#ifdef DEBUG +#if defined(DEBUG) | defined(_DEBUG) FILE* conout; AllocConsole(); freopen_s(