Skip to content

Commit 115b462

Browse files
committed
ep_dwm: Renamed ep_dwm.exe to ep_dwm_svc.exe
1 parent 0e55f30 commit 115b462

6 files changed

Lines changed: 19 additions & 54 deletions

File tree

ExplorerPatcher/updates.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@ BOOL IsUpdateAvailableHelper(
752752
}
753753
}
754754

755-
SHELLEXECUTEINFO ShExecInfo = { 0 };
756-
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
755+
SHELLEXECUTEINFOW ShExecInfo = { 0 };
756+
ShExecInfo.cbSize = sizeof(ShExecInfo);
757757
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
758758
ShExecInfo.hwnd = nullptr;
759759
ShExecInfo.lpVerb = bIsUsingEpMake ? L"open" : L"runas";

ExplorerPatcher/utility.c

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -626,15 +626,7 @@ LSTATUS RegisterDWMService(DWORD dwDesiredState, DWORD dwOverride)
626626
WCHAR wszRundll32[MAX_PATH];
627627
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszRundll32);
628628
wcscat_s(wszRundll32, MAX_PATH, _T(APP_RELATIVE_PATH));
629-
wcscat_s(wszRundll32, MAX_PATH, L"\\ep_dwm.exe");
630-
631-
WCHAR wszEP[MAX_PATH];
632-
GetWindowsDirectoryW(wszEP, MAX_PATH);
633-
wcscat_s(wszEP, MAX_PATH, L"\\dxgi.dll");
634-
635-
WCHAR wszTaskkill[MAX_PATH];
636-
GetSystemDirectoryW(wszTaskkill, MAX_PATH);
637-
wcscat_s(wszTaskkill, MAX_PATH, L"\\taskkill.exe");
629+
wcscat_s(wszRundll32, MAX_PATH, L"\\ep_dwm_svc.exe");
638630

639631
WCHAR wszArgumentsRegister[MAX_PATH * 10];
640632
swprintf_s(
@@ -675,34 +667,20 @@ LSTATUS RegisterDWMService(DWORD dwDesiredState, DWORD dwOverride)
675667
HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, _T(EP_DWM_EVENTNAME));
676668
if (h_exists)
677669
{
678-
if (GetLastError() == ERROR_ALREADY_EXISTS)
679-
{
680-
bAreRoundedCornersDisabled = TRUE;
681-
}
682-
else
683-
{
684-
bAreRoundedCornersDisabled = FALSE;
685-
}
670+
bAreRoundedCornersDisabled = GetLastError() == ERROR_ALREADY_EXISTS;
686671
CloseHandle(h_exists);
687672
}
688673
else
689674
{
690-
if (GetLastError() == ERROR_ACCESS_DENIED)
691-
{
692-
bAreRoundedCornersDisabled = TRUE;
693-
}
694-
else
695-
{
696-
bAreRoundedCornersDisabled = FALSE;
697-
}
675+
bAreRoundedCornersDisabled = GetLastError() == ERROR_ACCESS_DENIED;
698676
}
699677
if ((bAreRoundedCornersDisabled && dwDesiredState) || (!bAreRoundedCornersDisabled && !dwDesiredState))
700678
{
701679
return FALSE;
702680
}
703681
}
704-
SHELLEXECUTEINFO ShExecInfo = { 0 };
705-
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
682+
SHELLEXECUTEINFOW ShExecInfo = { 0 };
683+
ShExecInfo.cbSize = sizeof(ShExecInfo);
706684
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
707685
ShExecInfo.hwnd = NULL;
708686
ShExecInfo.lpVerb = L"runas";

ep_dwm

ep_gui/GUI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ LSTATUS SetPolicy(HKEY hKey, LPCWSTR wszPolicyPath, LPCWSTR wszPolicyName, DWORD
2727
{
2828
swprintf_s(wszArguments, MAX_PATH, L"DELETE \"%s\\%s\" /V %s /F", (hKey == HKEY_LOCAL_MACHINE ? L"HKLM" : L"HKCU"), wszPolicyPath, wszPolicyName);
2929
}
30-
SHELLEXECUTEINFO ShExecInfo = { 0 };
31-
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
30+
SHELLEXECUTEINFOW ShExecInfo = { 0 };
31+
ShExecInfo.cbSize = sizeof(ShExecInfo);
3232
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
3333
ShExecInfo.hwnd = NULL;
3434
ShExecInfo.lpVerb = L"runas";

ep_setup/ep_setup.c

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,29 +1152,15 @@ int WINAPI wWinMain(
11521152
Sleep(500);
11531153

11541154
BOOL bAreRoundedCornersDisabled = FALSE;
1155-
HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, L"Global\\ep_dwm_" _T(EP_CLSID));
1155+
HANDLE h_exists = CreateEventW(NULL, FALSE, FALSE, _T(EP_DWM_EVENTNAME));
11561156
if (h_exists)
11571157
{
1158-
if (GetLastError() == ERROR_ALREADY_EXISTS)
1159-
{
1160-
bAreRoundedCornersDisabled = TRUE;
1161-
}
1162-
else
1163-
{
1164-
bAreRoundedCornersDisabled = FALSE;
1165-
}
1158+
bAreRoundedCornersDisabled = GetLastError() == ERROR_ALREADY_EXISTS;
11661159
CloseHandle(h_exists);
11671160
}
11681161
else
11691162
{
1170-
if (GetLastError() == ERROR_ACCESS_DENIED)
1171-
{
1172-
bAreRoundedCornersDisabled = TRUE;
1173-
}
1174-
else
1175-
{
1176-
bAreRoundedCornersDisabled = FALSE;
1177-
}
1163+
bAreRoundedCornersDisabled = GetLastError() == ERROR_ACCESS_DENIED;
11781164
}
11791165
if (bAreRoundedCornersDisabled)
11801166
{
@@ -1185,8 +1171,8 @@ int WINAPI wWinMain(
11851171
WCHAR wszSCPath[MAX_PATH];
11861172
GetSystemDirectoryW(wszSCPath, MAX_PATH);
11871173
wcscat_s(wszSCPath, MAX_PATH, L"\\sc.exe");
1188-
SHELLEXECUTEINFO ShExecInfo = { 0 };
1189-
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
1174+
SHELLEXECUTEINFOW ShExecInfo = { 0 };
1175+
ShExecInfo.cbSize = sizeof(ShExecInfo);
11901176
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
11911177
ShExecInfo.hwnd = NULL;
11921178
ShExecInfo.lpVerb = L"runas";
@@ -1327,7 +1313,8 @@ int WINAPI wWinMain(
13271313
if (CHECK_OK(bOk)) bOk = InstallResource(bInstall, hInstance, zipFile, PRODUCT_NAME ".arm64.dll", wszPath, _T(PRODUCT_NAME) L".arm64.dll");
13281314
#endif
13291315
if (CHECK_OK(bOk)) bOk = InstallResource(bInstall, hInstance, zipFile, "ep_gui.dll", wszPath, L"ep_gui.dll");
1330-
if (CHECK_OK(bOk)) bOk = InstallResource(bInstall, hInstance, zipFile, "ep_dwm.exe", wszPath, L"ep_dwm.exe");
1316+
if (CHECK_OK(bOk)) bOk = DeleteResource(wszPath, L"ep_dwm.exe"); // We renamed it to ep_dwm_svc.exe due to Microsoft imposing 24H2 upgrade blocks
1317+
if (CHECK_OK(bOk)) bOk = InstallResource(bInstall, hInstance, zipFile, "ep_dwm_svc.exe", wszPath, L"ep_dwm_svc.exe");
13311318
if (bInstall)
13321319
{
13331320
if (CHECK_OK(bOk)) bOk = InstallResource(bInstall, hInstance, zipFile, "ep_weather_host.dll", wszPath, L"ep_weather_host.dll");

ep_setup/ep_setup.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
<PackFile Include="..\build\$(Configuration)\x64\ExplorerPatcher.amd64.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\x64\ExplorerPatcher.amd64.dll')" />
278278
<PackFile Include="..\build\$(Configuration)\ARM64\ExplorerPatcher.arm64.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\ARM64\ExplorerPatcher.arm64.dll')" />
279279
<PackFile Include="..\build\$(Configuration)\$(Platform)\WebView2Loader.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\WebView2Loader.dll')" />
280-
<PackFile Include="..\build\$(Configuration)\$(Platform)\ep_dwm.exe" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\ep_dwm.exe')" />
280+
<PackFile Include="..\build\$(Configuration)\$(Platform)\ep_dwm_svc.exe" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\ep_dwm_svc.exe')" />
281281
<PackFile Include="..\build\$(Configuration)\$(Platform)\ep_gui.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\ep_gui.dll')" />
282282
<PackFile Include="..\build\$(Configuration)\$(Platform)\ep_startmenu.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\ep_startmenu.dll')" />
283283
<PackFile Include="..\build\$(Configuration)\$(Platform)\ep_taskbar.0.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\ep_taskbar.0.dll')" />
@@ -290,7 +290,7 @@
290290
<PackFile Include="..\build\$(Configuration)\$(Platform)\ep_weather_host_stub.dll" Condition="Exists('$(SolutionDir)\build\$(Configuration)\$(Platform)\ep_weather_host_stub.dll')" />
291291
</ItemGroup>
292292
<Target Name="GetCommitHash" AfterTargets="PrepareForBuild">
293-
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" Condition="'$(GitCommitHashShort)' == '0000000'">
293+
<Exec Command="git rev-parse --short HEAD" Condition="'$(GitCommitHashShort)' == '0000000'">
294294
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHashShort" />
295295
</Exec>
296296
<Message Text="Git commit hash: $(GitCommitHashShort)" />

0 commit comments

Comments
 (0)