From e59c34c06e044df3f3ba445318a5a772c8f02e59 Mon Sep 17 00:00:00 2001 From: Amrsatrio Date: Thu, 25 Apr 2024 20:48:30 +0700 Subject: [PATCH] Start10: Revert 45bd735 to pin down antivirus detections --- ExplorerPatcher/StartMenuSettings.cpp | 8 ++++---- ExplorerPatcher/dllmain.c | 13 +++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ExplorerPatcher/StartMenuSettings.cpp b/ExplorerPatcher/StartMenuSettings.cpp index 5686762..ceaee8e 100644 --- a/ExplorerPatcher/StartMenuSettings.cpp +++ b/ExplorerPatcher/StartMenuSettings.cpp @@ -1207,11 +1207,11 @@ extern "C" { void PatchStartTileDataFurther(HMODULE hModule, BOOL bSMEH) { - ComPtr pPinnableSurfaceFactory; - PatchStartPinnableSurface(hModule, &pPinnableSurfaceFactory); + // ComPtr pPinnableSurfaceFactory; + PatchStartPinnableSurface(hModule, nullptr /*&pPinnableSurfaceFactory*/); // We might not need to patch this but just in case - if (bSMEH) - pPinnableSurfaceFactory->AddRef(); // Pin in memory so that StartTileData.dll doesn't get unloaded + // if (bSMEH) + // pPinnableSurfaceFactory->AddRef(); // Pin in memory so that StartTileData.dll doesn't get unloaded PatchUnifiedTilePinUnpinProvider(hModule); } diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 7269768..8c11eb8 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -51,8 +51,13 @@ RTL_OSVERSIONINFOW global_rovi; DWORD32 global_ubr; #endif #include +#ifndef WITH_SMA_PATCH_REPORT +#define WITH_SMA_PATCH_REPORT 0 +#endif +#if WITH_SMA_PATCH_REPORT #include #pragma comment(lib, "Userenv.lib") +#endif #define WINX_ADJUST_X 5 #define WINX_ADJUST_Y 5 @@ -12612,7 +12617,9 @@ DWORD Inject(BOOL bIsExplorer) GetCrashCounterSettings(&cfg); if (!cfg.bDisabled) { - if (FixStartMenuAnimation(&miTwinuiPcshell)) { + if (FixStartMenuAnimation(&miTwinuiPcshell)) + { +#if WITH_SMA_PATCH_REPORT PSID pMainSid = NULL; GetLogonSid(&pMainSid); PSID pSecondaySid = NULL; @@ -12633,6 +12640,7 @@ DWORD Inject(BOOL bIsExplorer) } if (pMainSid) free(pMainSid); if (pSecondaySid) FreeSid(pSecondaySid); +#endif } } } @@ -13554,19 +13562,20 @@ int Start_SetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw) HRESULT hr = IsThreadCoreWindowVisible(&bIsWindowVisible); if (SUCCEEDED(hr)) { +#if WITH_SMA_PATCH_REPORT if (dwStartShowClassicMode && IsWindows11()) { HANDLE hAnimationsPatched = OpenMutexW(SYNCHRONIZE, FALSE, _T(EPStart10_AnimationsPatched)); if (hAnimationsPatched) { CloseHandle(hAnimationsPatched); - if (!IsWindowVisible(hWnd)) ShowWindow(hWnd, SW_SHOW); } else { ShowWindow(hWnd, bIsWindowVisible ? SW_SHOW : SW_HIDE); } } +#endif DWORD TaskbarAl = InterlockedAdd(&dwTaskbarAl, 0); if (bIsWindowVisible && (!TaskbarAl ? (dwStartShowClassicMode ? StartUI_EnableRoundedCornersApply : StartDocked_DisableRecommendedSectionApply) : 1)) {