1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-27 17:00:59 +01:00

Work on ARM64 shell extension support

This commit is contained in:
Amrsatrio 2024-07-13 20:50:37 +07:00
parent c9884b2ba3
commit 57f63ad56f
17 changed files with 377 additions and 228 deletions

View File

@ -25,6 +25,14 @@
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>ARM64</Platform> <Platform>ARM64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
@ -32,41 +40,16 @@
<RootNamespace>CenterTitlebarTextLibrary</RootNamespace> <RootNamespace>CenterTitlebarTextLibrary</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>ExplorerPatcher</ProjectName> <ProjectName>ExplorerPatcher</ProjectName>
<WithArm64XBinaries>false</WithArm64XBinaries>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
@ -111,21 +94,37 @@
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<TargetName>ExplorerPatcher.amd64</TargetName> <TargetName>ExplorerPatcher.amd64</TargetName>
<WithMainPatcher>true</WithMainPatcher>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<TargetName>ExplorerPatcher.amd64</TargetName> <TargetName>ExplorerPatcher.amd64</TargetName>
<WithMainPatcher>true</WithMainPatcher>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<TargetName>ExplorerPatcher.arm64</TargetName> <TargetName>ExplorerPatcher.arm64</TargetName>
<WithMainPatcher>true</WithMainPatcher>
<BuildAsX>$(WithArm64XBinaries)</BuildAsX>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<TargetName>ExplorerPatcher.arm64</TargetName> <TargetName>ExplorerPatcher.arm64</TargetName>
<WithMainPatcher>true</WithMainPatcher>
<BuildAsX>$(WithArm64XBinaries)</BuildAsX>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<TargetName>ExplorerPatcher.arm64ec</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<TargetName>ExplorerPatcher.arm64ec</TargetName>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
@ -170,6 +169,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'"> <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WITH_MAIN_PATCHER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CallingConvention>Cdecl</CallingConvention> <CallingConvention>Cdecl</CallingConvention>
</ClCompile> </ClCompile>
<Link> <Link>
@ -178,106 +178,90 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM64'"> <ItemDefinitionGroup Condition="'$(Platform)'=='ARM64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WITH_MAIN_PATCHER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CallingConvention>Cdecl</CallingConvention> <CallingConvention>Cdecl</CallingConvention>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalLibraryDirectories>$(SolutionDir)libs\funchook\build-arm64\Release\;$(SolutionDir)libs\funchook\build-arm64\_deps\capstone-build\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(SolutionDir)libs\funchook\build-arm64\Release\;$(SolutionDir)libs\funchook\build-arm64\_deps\capstone-build\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM64EC'">
<ClCompile>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_error.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_error.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_IconPainter.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_IconPainter.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_RegistryMonitor.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_RegistryMonitor.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_tshwnd.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_tshwnd.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_vector.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_vector.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_window.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_window.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowHelpers.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowHelpers.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowSwitcher.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowSwitcher.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowSwitcherLayout.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowSwitcherLayout.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowSwitcherLayoutWindow.c"> <ClCompile Include="..\libs\sws\SimpleWindowSwitcher\sws_WindowSwitcherLayoutWindow.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="ArchiveMenu.c"> <ClCompile Include="ArchiveMenu.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="dllmain.c" /> <ClCompile Include="dllmain.c" />
<ClCompile Include="fmemopen.c" /> <ClCompile Include="fmemopen.c" />
<ClCompile Include="getline.c" /> <ClCompile Include="getline.c" />
<ClCompile Include="HideExplorerSearchBar.c" /> <ClCompile Include="HideExplorerSearchBar.c" />
<ClCompile Include="ImmersiveFlyouts.c"> <ClCompile Include="ImmersiveFlyouts.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="InputSwitch.cpp"> <ClCompile Include="InputSwitch.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="Localization.cpp" /> <ClCompile Include="Localization.cpp" />
<ClCompile Include="lvt.c"> <ClCompile Include="lvt.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="SettingsMonitor.c" /> <ClCompile Include="SettingsMonitor.c" />
<ClCompile Include="StartMenu.c"> <ClCompile Include="StartMenu.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="StartMenuSettings.cpp"> <ClCompile Include="StartMenuSettings.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="StartupSound.cpp"> <ClCompile Include="StartupSound.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="symbols.c"> <ClCompile Include="symbols.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="Taskbar10.cpp"> <ClCompile Include="Taskbar10.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="TaskbarCenter.c"> <ClCompile Include="TaskbarCenter.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="updates.c"> <ClCompile Include="updates.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="utility.c"> <ClCompile Include="utility.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(WithMainPatcher)'!='true'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,4 +1,4 @@
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#include "hooking.h" #include "hooking.h"
#endif #endif
#include <initguid.h> #include <initguid.h>
@ -27,7 +27,7 @@
#include <UIAutomationClient.h> #include <UIAutomationClient.h>
#include <math.h> #include <math.h>
#include "lvt.h" #include "lvt.h"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#include <valinet/pdb/pdb.h> #include <valinet/pdb/pdb.h>
#endif #endif
#if defined(DEBUG) | defined(_DEBUG) #if defined(DEBUG) | defined(_DEBUG)
@ -36,7 +36,7 @@
#include <valinet/hooking/iatpatch.h> #include <valinet/hooking/iatpatch.h>
#include <valinet/utility/memmem.h> #include <valinet/utility/memmem.h>
#include "../ep_weather_host/ep_weather.h" #include "../ep_weather_host/ep_weather.h"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#include "../ep_weather_host/ep_weather_host_h.h" #include "../ep_weather_host/ep_weather_host_h.h"
IEPWeather* epw = NULL; IEPWeather* epw = NULL;
CRITICAL_SECTION lock_epw; CRITICAL_SECTION lock_epw;
@ -46,7 +46,7 @@ HWND PeopleButton_LastHWND = NULL;
#include "osutility.h" #include "osutility.h"
HANDLE hServiceWindowThread = NULL; HANDLE hServiceWindowThread = NULL;
//#pragma comment(lib, "Winmm.lib") //#pragma comment(lib, "Winmm.lib")
#ifndef _WIN64 #if !WITH_MAIN_PATCHER
RTL_OSVERSIONINFOW global_rovi; RTL_OSVERSIONINFOW global_rovi;
DWORD32 global_ubr; DWORD32 global_ubr;
#endif #endif
@ -207,7 +207,7 @@ BOOL g_bIsDesktopRaised = FALSE;
#ifdef USE_PRIVATE_INTERFACES #ifdef USE_PRIVATE_INTERFACES
#include "ep_private.h" #include "ep_private.h"
#endif #endif
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#include "symbols.h" #include "symbols.h"
#include "dxgi_imp.h" #include "dxgi_imp.h"
#include "ArchiveMenu.h" #include "ArchiveMenu.h"
@ -225,7 +225,7 @@ DWORD dwUpdatePolicy = UPDATE_POLICY_DEFAULT;
wchar_t* EP_TASKBAR_LENGTH_PROP_NAME = L"EPTBLEN"; wchar_t* EP_TASKBAR_LENGTH_PROP_NAME = L"EPTBLEN";
HWND hWinXWnd; HWND hWinXWnd;
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#define MAX_NUM_MONITORS 30 #define MAX_NUM_MONITORS 30
MonitorListEntry hMonitorList[MAX_NUM_MONITORS]; MonitorListEntry hMonitorList[MAX_NUM_MONITORS];
DWORD dwMonitorCount = 0; DWORD dwMonitorCount = 0;
@ -247,7 +247,7 @@ DEFINE_GUID(CLSID_EPStart10,
0x9717d01, 0x5d10, 0x4fb5, 0xbd, 0x5, 0x46, 0x38, 0xb, 0x51, 0x65, 0xaa); 0x9717d01, 0x5d10, 0x4fb5, 0xbd, 0x5, 0x46, 0x38, 0xb, 0x51, 0x65, 0xaa);
#pragma region "Updates" #pragma region "Updates"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DWORD CheckForUpdatesThread(LPVOID timeout) DWORD CheckForUpdatesThread(LPVOID timeout)
{ {
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -438,7 +438,7 @@ DWORD CheckForUpdatesThread(LPVOID timeout)
#pragma region "Generics" #pragma region "Generics"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HWND GetMonitorInfoFromPointForTaskbarFlyoutActivation(POINT ptCursor, DWORD dwFlags, LPMONITORINFO lpMi) HWND GetMonitorInfoFromPointForTaskbarFlyoutActivation(POINT ptCursor, DWORD dwFlags, LPMONITORINFO lpMi)
{ {
HMONITOR hMonitor = MonitorFromPoint(ptCursor, dwFlags); HMONITOR hMonitor = MonitorFromPoint(ptCursor, dwFlags);
@ -788,7 +788,7 @@ void LaunchNetworkTargets(DWORD dwTarget)
#pragma region "Service Window" #pragma region "Service Window"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HWND hWndServiceWindow = NULL; HWND hWndServiceWindow = NULL;
void FixUpCenteredTaskbar() void FixUpCenteredTaskbar()
@ -1029,7 +1029,7 @@ BOOL ToggleActionCenter()
return PostMessageW(FindWindowExW(NULL, NULL, L"Shell_TrayWnd", NULL), WM_HOTKEY, 500, MAKELPARAM(MOD_WIN, 0x41)); return PostMessageW(FindWindowExW(NULL, NULL, L"Shell_TrayWnd", NULL), WM_HOTKEY, 500, MAKELPARAM(MOD_WIN, 0x41));
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
void ToggleLauncherTipContextMenu() void ToggleLauncherTipContextMenu()
{ {
if (hIsWinXShown) if (hIsWinXShown)
@ -1126,7 +1126,7 @@ HRESULT WINAPI windowsudkshellcommon_SLGetWindowsInformationDWORDHook(PCWSTR pws
#pragma region "twinui.pcshell.dll hooks" #pragma region "twinui.pcshell.dll hooks"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#define LAUNCHERTIP_CLASS_NAME L"LauncherTipWnd" #define LAUNCHERTIP_CLASS_NAME L"LauncherTipWnd"
static INT64(*winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc)( static INT64(*winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc)(
void* _this, void* _this,
@ -1602,7 +1602,7 @@ finalize:
#pragma region "Windows 10 Taskbar Hooks" #pragma region "Windows 10 Taskbar Hooks"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
// credits: https://github.com/m417z/7-Taskbar-Tweaker // credits: https://github.com/m417z/7-Taskbar-Tweaker
DEFINE_GUID(IID_ITaskGroup, DEFINE_GUID(IID_ITaskGroup,
@ -1806,7 +1806,7 @@ HRESULT explorer_QISearch(void* that, LPCQITAB pqit, REFIID riid, void** ppv)
#pragma region "Show Start in correct location according to TaskbarAl" #pragma region "Show Start in correct location according to TaskbarAl"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
void UpdateStartMenuPositioning(LPARAM loIsShouldInitializeArray_hiIsShouldRoInitialize) void UpdateStartMenuPositioning(LPARAM loIsShouldInitializeArray_hiIsShouldRoInitialize)
{ {
BOOL bShouldInitialize = LOWORD(loIsShouldInitializeArray_hiIsShouldRoInitialize); BOOL bShouldInitialize = LOWORD(loIsShouldInitializeArray_hiIsShouldRoInitialize);
@ -1877,7 +1877,7 @@ void UpdateStartMenuPositioning(LPARAM loIsShouldInitializeArray_hiIsShouldRoIni
#pragma region "Fix Windows 11 taskbar not showing tray when auto hide is on" #pragma region "Fix Windows 11 taskbar not showing tray when auto hide is on"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#define FIXTASKBARAUTOHIDE_CLASS_NAME L"FixTaskbarAutohide_" _T(EP_CLSID) #define FIXTASKBARAUTOHIDE_CLASS_NAME L"FixTaskbarAutohide_" _T(EP_CLSID)
LRESULT CALLBACK FixTaskbarAutohide_WndProc( LRESULT CALLBACK FixTaskbarAutohide_WndProc(
HWND hWnd, HWND hWnd,
@ -1964,7 +1964,7 @@ DWORD FixTaskbarAutohide(DWORD unused)
#pragma region "Allow enabling XAML sounds" #pragma region "Allow enabling XAML sounds"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
void ForceEnableXamlSounds(HMODULE hWindowsUIXaml) void ForceEnableXamlSounds(HMODULE hWindowsUIXaml)
{ {
MODULEINFO mi; MODULEINFO mi;
@ -2034,7 +2034,7 @@ BOOL IsXamlSoundsEnabled()
#pragma region "EnsureXAML on OS builds 22621+" #pragma region "EnsureXAML on OS builds 22621+"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DEFINE_GUID(uuidof_Windows_Internal_Shell_XamlExplorerHost_IXamlApplicationStatics, DEFINE_GUID(uuidof_Windows_Internal_Shell_XamlExplorerHost_IXamlApplicationStatics,
0xECC13292, 0xECC13292,
0x27EF, 0x547A, 0xAC, 0x8B, 0x27EF, 0x547A, 0xAC, 0x8B,
@ -2206,7 +2206,7 @@ HMODULE __fastcall combase_LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, D
#pragma region "Shell_TrayWnd subclass" #pragma region "Shell_TrayWnd subclass"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
int HandleTaskbarCornerInteraction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) int HandleTaskbarCornerInteraction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
POINT pt; pt.x = 0; pt.y = 0; POINT pt; pt.x = 0; pt.y = 0;
@ -2855,7 +2855,7 @@ INT64 Shell_TrayWndSubclassProc(
#pragma region "Allow legacy volume applet" #pragma region "Allow legacy volume applet"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
LSTATUS sndvolsso_RegGetValueW( LSTATUS sndvolsso_RegGetValueW(
HKEY hkey, HKEY hkey,
LPCWSTR lpSubKey, LPCWSTR lpSubKey,
@ -2887,7 +2887,7 @@ LSTATUS sndvolsso_RegGetValueW(
#pragma region "Allow legacy date and time" #pragma region "Allow legacy date and time"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DEFINE_GUID(GUID_Win32Clock, DEFINE_GUID(GUID_Win32Clock,
0x0A323554A, 0x0A323554A,
0x0FE1, 0x4E49, 0xae, 0xe1, 0x0FE1, 0x4E49, 0xae, 0xe1,
@ -3056,7 +3056,7 @@ void RemoveOwnerDrawFromMenu(int level, HMENU hMenu)
} }
BOOL CheckIfMenuContainsOwnPropertiesItem(HMENU hMenu) BOOL CheckIfMenuContainsOwnPropertiesItem(HMENU hMenu)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (hMenu) if (hMenu)
{ {
int k = GetMenuItemCount(hMenu); int k = GetMenuItemCount(hMenu);
@ -3076,7 +3076,7 @@ BOOL CheckIfMenuContainsOwnPropertiesItem(HMENU hMenu)
return FALSE; return FALSE;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#define DEFINE_IMMERSIVE_MENU_HOOK(name) \ #define DEFINE_IMMERSIVE_MENU_HOOK(name) \
static ImmersiveContextMenuHelper_ApplyOwnerDrawToMenu_t name##_ApplyOwnerDrawToMenuFunc = NULL; \ static ImmersiveContextMenuHelper_ApplyOwnerDrawToMenu_t name##_ApplyOwnerDrawToMenuFunc = NULL; \
static HRESULT name##_ApplyOwnerDrawToMenuHook(HMENU hMenu, HWND hWnd, POINT* pPt, unsigned int options, void* data) \ static HRESULT name##_ApplyOwnerDrawToMenuHook(HMENU hMenu, HWND hWnd, POINT* pPt, unsigned int options, void* data) \
@ -3179,7 +3179,7 @@ BOOL TrackPopupMenuHookEx(
if (IsImmersiveMenu) if (IsImmersiveMenu)
{ {
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
#ifndef _WIN64 #if !WITH_MAIN_PATCHER
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
#else #else
@ -3207,7 +3207,7 @@ BOOL TrackPopupMenuHookEx(
hWnd, hWnd,
lptpm lptpm
); );
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bContainsOwn && (bRet >= 12000 && bRet <= 12200)) if (bContainsOwn && (bRet >= 12000 && bRet <= 12200))
{ {
LaunchPropertiesGUI(hModule); LaunchPropertiesGUI(hModule);
@ -3226,7 +3226,7 @@ BOOL TrackPopupMenuHookEx(
hWnd, hWnd,
lptpm lptpm
); );
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bContainsOwn && (b >= 12000 && b <= 12200)) if (bContainsOwn && (b >= 12000 && b <= 12200))
{ {
LaunchPropertiesGUI(hModule); LaunchPropertiesGUI(hModule);
@ -3267,7 +3267,7 @@ BOOL TrackPopupMenuHook(
{ {
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
#ifndef _WIN64 #if !WITH_MAIN_PATCHER
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
#else #else
@ -3296,7 +3296,7 @@ BOOL TrackPopupMenuHook(
hWnd, hWnd,
prcRect prcRect
); );
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bContainsOwn && (bRet >= 12000 && bRet <= 12200)) if (bContainsOwn && (bRet >= 12000 && bRet <= 12200))
{ {
LaunchPropertiesGUI(hModule); LaunchPropertiesGUI(hModule);
@ -3316,7 +3316,7 @@ BOOL TrackPopupMenuHook(
hWnd, hWnd,
prcRect prcRect
); );
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bContainsOwn && (b >= 12000 && b <= 12200)) if (bContainsOwn && (b >= 12000 && b <= 12200))
{ {
LaunchPropertiesGUI(hModule); LaunchPropertiesGUI(hModule);
@ -3325,7 +3325,7 @@ BOOL TrackPopupMenuHook(
#endif #endif
return b; return b;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#define TB_POS_NOWHERE 0 #define TB_POS_NOWHERE 0
#define TB_POS_BOTTOM 1 #define TB_POS_BOTTOM 1
#define TB_POS_TOP 2 #define TB_POS_TOP 2
@ -4189,7 +4189,7 @@ HWND WINAPI explorerframe_SHCreateWorkerWindowHook(
#pragma region "Fix battery flyout" #pragma region "Fix battery flyout"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
LSTATUS stobject_RegGetValueW( LSTATUS stobject_RegGetValueW(
HKEY hkey, HKEY hkey,
LPCWSTR lpSubKey, LPCWSTR lpSubKey,
@ -4321,7 +4321,7 @@ HRESULT stobject_CoCreateInstanceHook(
#pragma region "Show WiFi networks on network icon click" #pragma region "Show WiFi networks on network icon click"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HRESULT pnidui_CoCreateInstanceHook( HRESULT pnidui_CoCreateInstanceHook(
REFCLSID rclsid, REFCLSID rclsid,
LPUNKNOWN pUnkOuter, LPUNKNOWN pUnkOuter,
@ -4425,7 +4425,7 @@ HRESULT pnidui_CoCreateInstanceHook(
#pragma region "Clock flyout helper" #pragma region "Clock flyout helper"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
typedef struct _ClockButton_ToggleFlyoutCallback_Params typedef struct _ClockButton_ToggleFlyoutCallback_Params
{ {
void* TrayUIInstance; void* TrayUIInstance;
@ -4604,7 +4604,7 @@ INT64 winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageHo
#pragma region "Open power user menu on Win+X" #pragma region "Open power user menu on Win+X"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
LRESULT explorer_SendMessageW(HWND hWndx, UINT uMsg, WPARAM wParam, LPARAM lParam) LRESULT explorer_SendMessageW(HWND hWndx, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
if (uMsg == TB_GETTEXTROWS) if (uMsg == TB_GETTEXTROWS)
@ -4646,7 +4646,7 @@ LRESULT explorer_SendMessageW(HWND hWndx, UINT uMsg, WPARAM wParam, LPARAM lPara
#pragma region "Set up taskbar button hooks, implement Weather widget" #pragma region "Set up taskbar button hooks, implement Weather widget"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DWORD ShouldShowWidgetsInsteadOfCortana() DWORD ShouldShowWidgetsInsteadOfCortana()
{ {
@ -5760,7 +5760,7 @@ BOOL explorer_SetChildWindowNoActivateHook(HWND hWnd)
#pragma region "Hide Show desktop button" #pragma region "Hide Show desktop button"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
INT64 ShowDesktopSubclassProc( INT64 ShowDesktopSubclassProc(
_In_ HWND hWnd, _In_ HWND hWnd,
_In_ UINT uMsg, _In_ UINT uMsg,
@ -5802,7 +5802,7 @@ INT64 ShowDesktopSubclassProc(
#pragma region "Notify shell ready" #pragma region "Notify shell ready"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DWORD SignalShellReady(DWORD wait) DWORD SignalShellReady(DWORD wait)
{ {
printf("Started \"Signal shell ready\" thread.\n"); printf("Started \"Signal shell ready\" thread.\n");
@ -5852,7 +5852,7 @@ DWORD SignalShellReady(DWORD wait)
#pragma region "Window Switcher" #pragma region "Window Switcher"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DWORD sws_IsEnabled = FALSE; DWORD sws_IsEnabled = FALSE;
void sws_ReadSettings(sws_WindowSwitcher* sws) void sws_ReadSettings(sws_WindowSwitcher* sws)
@ -6223,7 +6223,7 @@ void WINAPI LoadSettings(LPARAM lParam)
} }
if (hKey) if (hKey)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
dwTemp = 0; dwTemp = 0;
RegQueryValueExW( RegQueryValueExW(
@ -6795,7 +6795,7 @@ void WINAPI LoadSettings(LPARAM lParam)
); );
if (!IsAppRunningAsAdminMode() && dwTemp) if (!IsAppRunningAsAdminMode() && dwTemp)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
LaunchPropertiesGUI(hModule); LaunchPropertiesGUI(hModule);
#endif #endif
} }
@ -6867,7 +6867,7 @@ void WINAPI LoadSettings(LPARAM lParam)
if (dwTemp != bDisableSpotlightIcon) if (dwTemp != bDisableSpotlightIcon)
{ {
bDisableSpotlightIcon = dwTemp; bDisableSpotlightIcon = dwTemp;
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (IsSpotlightEnabled()) dwRefreshUIMask |= REFRESHUI_SPOTLIGHT; if (IsSpotlightEnabled()) dwRefreshUIMask |= REFRESHUI_SPOTLIGHT;
#endif #endif
} }
@ -6893,7 +6893,7 @@ void WINAPI LoadSettings(LPARAM lParam)
if (dwTemp != dwSpotlightUpdateSchedule) if (dwTemp != dwSpotlightUpdateSchedule)
{ {
dwSpotlightUpdateSchedule = dwTemp; dwSpotlightUpdateSchedule = dwTemp;
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (IsSpotlightEnabled() && hWndServiceWindow) if (IsSpotlightEnabled() && hWndServiceWindow)
{ {
if (dwSpotlightUpdateSchedule) if (dwSpotlightUpdateSchedule)
@ -6955,7 +6955,7 @@ void WINAPI LoadSettings(LPARAM lParam)
&dwSize &dwSize
); );
#ifdef _WIN64 #if WITH_MAIN_PATCHER
EnterCriticalSection(&lock_epw); EnterCriticalSection(&lock_epw);
DWORD dwOldWeatherTemperatureUnit = dwWeatherTemperatureUnit; DWORD dwOldWeatherTemperatureUnit = dwWeatherTemperatureUnit;
@ -7451,7 +7451,7 @@ void WINAPI LoadSettings(LPARAM lParam)
{ {
//if (epw_dummytext[0] == 0) epw_dummytext = L"\u2009"; //if (epw_dummytext[0] == 0) epw_dummytext = L"\u2009";
//else epw_dummytext = L""; //else epw_dummytext = L"";
#ifdef _WIN64 #if WITH_MAIN_PATCHER
InvalidateRect(PeopleButton_LastHWND, NULL, TRUE); InvalidateRect(PeopleButton_LastHWND, NULL, TRUE);
#endif #endif
} }
@ -7475,7 +7475,7 @@ void WINAPI LoadSettings(LPARAM lParam)
} }
if (dwRefreshUIMask & REFRESHUI_CENTER) if (dwRefreshUIMask & REFRESHUI_CENTER)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
//ToggleTaskbarAutohide(); //ToggleTaskbarAutohide();
//Sleep(1000); //Sleep(1000);
//ToggleTaskbarAutohide(); //ToggleTaskbarAutohide();
@ -7700,7 +7700,7 @@ void WINAPI Explorer_RefreshUI(int src)
Explorer_RefreshClock(0); Explorer_RefreshClock(0);
if (dwRefreshMask & REFRESHUI_CENTER) if (dwRefreshMask & REFRESHUI_CENTER)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
FixUpCenteredTaskbar(); FixUpCenteredTaskbar();
#endif #endif
} }
@ -7816,7 +7816,7 @@ HWND CreateWindowExWHook(
hInstance, hInstance,
lpParam lpParam
); );
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bIsExplorerProcess && (*((WORD*)&(lpClassName)+1)) && (!wcscmp(lpClassName, L"TrayClockWClass") || !wcscmp(lpClassName, L"ClockButton"))) if (bIsExplorerProcess && (*((WORD*)&(lpClassName)+1)) && (!wcscmp(lpClassName, L"TrayClockWClass") || !wcscmp(lpClassName, L"ClockButton")))
{ {
SetWindowSubclass(hWnd, ClockButtonSubclassProc, ClockButtonSubclassProc, 0); SetWindowSubclass(hWnd, ClockButtonSubclassProc, ClockButtonSubclassProc, 0);
@ -7913,7 +7913,7 @@ LONG_PTR SetWindowLongPtrWHook(
return SetWindowLongPtrWFunc(hWnd, nIndex, dwNewLong); return SetWindowLongPtrWFunc(hWnd, nIndex, dwNewLong);
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HRESULT (*explorer_SetWindowThemeFunc)( HRESULT (*explorer_SetWindowThemeFunc)(
HWND hwnd, HWND hwnd,
LPCWSTR pszSubAppName, LPCWSTR pszSubAppName,
@ -8391,7 +8391,7 @@ int ExplorerFrame_CompareStringOrdinal(const WCHAR* a1, int a2, const WCHAR* a3,
return CSTR_GREATER_THAN; return CSTR_GREATER_THAN;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DEFINE_GUID(IID_EnumExplorerCommand, DEFINE_GUID(IID_EnumExplorerCommand,
0xA88826F8, 0xA88826F8,
0x186F, 0x4987, 0xAA, 0xDE, 0x186F, 0x4987, 0xAA, 0xDE,
@ -8591,7 +8591,7 @@ HINSTANCE explorer_ShellExecuteW(
#pragma region "Classic Drive Grouping" #pragma region "Classic Drive Grouping"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
const struct { DWORD dwDescriptionId; UINT uResourceId; } driveCategoryMap[] = { const struct { DWORD dwDescriptionId; UINT uResourceId; } driveCategoryMap[] = {
{ SHDID_FS_DIRECTORY, 9338 }, //shell32 { SHDID_FS_DIRECTORY, 9338 }, //shell32
{ SHDID_COMPUTER_SHAREDDOCS, 9338 }, //shell32 { SHDID_COMPUTER_SHAREDDOCS, 9338 }, //shell32
@ -8873,7 +8873,7 @@ HRESULT ExplorerFrame_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
#pragma region "Change language UI style + Enable old taskbar" #pragma region "Change language UI style + Enable old taskbar"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
DEFINE_GUID(CLSID_TrayUIComponent, DEFINE_GUID(CLSID_TrayUIComponent,
0x88FC85D3, 0x88FC85D3,
0x7090, 0x4F53, 0x8F, 0x7A, 0x7090, 0x4F53, 0x8F, 0x7A,
@ -9412,7 +9412,7 @@ BOOL twinui_RegisterHotkeyHook(HWND hWnd, int id, UINT fsModifiers, UINT vk)
#pragma region "Fix taskbar thumbnails and acrylic in newer OS builds (22572+)" #pragma region "Fix taskbar thumbnails and acrylic in newer OS builds (22572+)"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HRESULT explorer_DwmUpdateThumbnailPropertiesHook(HTHUMBNAIL hThumbnailId, DWM_THUMBNAIL_PROPERTIES* ptnProperties) HRESULT explorer_DwmUpdateThumbnailPropertiesHook(HTHUMBNAIL hThumbnailId, DWM_THUMBNAIL_PROPERTIES* ptnProperties)
{ {
if (ptnProperties->dwFlags == 0 || ptnProperties->dwFlags == DWM_TNP_RECTSOURCE) if (ptnProperties->dwFlags == 0 || ptnProperties->dwFlags == DWM_TNP_RECTSOURCE)
@ -9455,7 +9455,7 @@ BOOL SHELL32_CanDisplayWin8CopyDialogHook()
#pragma region "Windows Spotlight customization" #pragma region "Windows Spotlight customization"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HKEY hKeySpotlight1 = NULL; HKEY hKeySpotlight1 = NULL;
HKEY hKeySpotlight2 = NULL; HKEY hKeySpotlight2 = NULL;
@ -9522,7 +9522,7 @@ BOOL shell32_TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, int nReserve
#pragma region "Fix Windows 10 taskbar high DPI button width bug" #pragma region "Fix Windows 10 taskbar high DPI button width bug"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
int patched_GetSystemMetrics(int nIndex) int patched_GetSystemMetrics(int nIndex)
{ {
if ((bOldTaskbar && nIndex == SM_CXMINIMIZED) || nIndex == SM_CXICONSPACING || nIndex == SM_CYICONSPACING) if ((bOldTaskbar && nIndex == SM_CXMINIMIZED) || nIndex == SM_CXICONSPACING || nIndex == SM_CYICONSPACING)
@ -9991,7 +9991,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{ {
if (bInstall) if (bInstall)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (DoesOSBuildSupportSpotlight()) if (DoesOSBuildSupportSpotlight())
{ {
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", shell32_TrackPopupMenu); VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", shell32_TrackPopupMenu);
@ -10000,7 +10000,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{ {
#endif #endif
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook); VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook);
#ifdef _WIN64 #if WITH_MAIN_PATCHER
} }
#endif #endif
if (bIsExplorerProcess) if (bIsExplorerProcess)
@ -10065,7 +10065,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
} }
VnPatchIAT(hExplorerFrame, "API-MS-WIN-CORE-STRING-L1-1-0.DLL", "CompareStringOrdinal", ExplorerFrame_CompareStringOrdinal); VnPatchIAT(hExplorerFrame, "API-MS-WIN-CORE-STRING-L1-1-0.DLL", "CompareStringOrdinal", ExplorerFrame_CompareStringOrdinal);
VnPatchIAT(hExplorerFrame, "user32.dll", "GetSystemMetricsForDpi", explorerframe_GetSystemMetricsForDpi); VnPatchIAT(hExplorerFrame, "user32.dll", "GetSystemMetricsForDpi", explorerframe_GetSystemMetricsForDpi);
#ifdef _WIN64 #if WITH_MAIN_PATCHER
MODULEINFO mi; MODULEINFO mi;
GetModuleInformation(GetCurrentProcess(), hExplorerFrame, &mi, sizeof(MODULEINFO)); GetModuleInformation(GetCurrentProcess(), hExplorerFrame, &mi, sizeof(MODULEINFO));
if (bShrinkExplorerAddressBar) if (bShrinkExplorerAddressBar)
@ -10135,7 +10135,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
} }
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
// As of writing, this function is never invoked with bInstall=TRUE, so we don't handle the case if it's false for now // As of writing, this function is never invoked with bInstall=TRUE, so we don't handle the case if it's false for now
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
@ -10201,7 +10201,7 @@ INT64 twinui_pcshell_CMultitaskingViewManager__CreateXamlMTVHostHook(INT64 _this
#pragma region "Fixes related to the removal of STTest feature flag (22621.2134+)" #pragma region "Fixes related to the removal of STTest feature flag (22621.2134+)"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HRESULT(*twinui_pcshell_PenMenuSystemTrayManager__GetDynamicSystemTrayHeightForMonitorFunc)(IInspectable* _this, HMONITOR hMonitor, float* outHeight); HRESULT(*twinui_pcshell_PenMenuSystemTrayManager__GetDynamicSystemTrayHeightForMonitorFunc)(IInspectable* _this, HMONITOR hMonitor, float* outHeight);
HRESULT twinui_pcshell_PenMenuSystemTrayManager__GetDynamicSystemTrayHeightForMonitorHook(IInspectable* _this, HMONITOR hMonitor, float* outHeight) HRESULT twinui_pcshell_PenMenuSystemTrayManager__GetDynamicSystemTrayHeightForMonitorHook(IInspectable* _this, HMONITOR hMonitor, float* outHeight)
{ {
@ -10733,7 +10733,7 @@ BOOL Moment2PatchHardwareConfirmator(LPMODULEINFO mi)
#pragma region "Enable EP weather on Windows Server SKUs" #pragma region "Enable EP weather on Windows Server SKUs"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
BOOL PeopleBand_IsOS(DWORD dwOS) BOOL PeopleBand_IsOS(DWORD dwOS)
{ {
if (dwOS == OS_ANYSERVER) return FALSE; if (dwOS == OS_ANYSERVER) return FALSE;
@ -10768,7 +10768,7 @@ BOOL explorer_IsOS(DWORD dwOS)
#pragma region "Find offsets of needed functions when symbols are not available" #pragma region "Find offsets of needed functions when symbols are not available"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
inline BOOL FollowJnz(PBYTE pJnz, PBYTE* pTarget, DWORD* pJnzSize) inline BOOL FollowJnz(PBYTE pJnz, PBYTE* pTarget, DWORD* pJnzSize)
{ {
// Check big jnz // Check big jnz
@ -11355,7 +11355,7 @@ cleanup:
#pragma region "Fix Pin to Start from Explorer not working when using Windows 10 start menu" #pragma region "Fix Pin to Start from Explorer not working when using Windows 10 start menu"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
extern HRESULT AppResolver_StartTileData_RoGetActivationFactory(HSTRING activatableClassId, REFIID iid, void** factory); extern HRESULT AppResolver_StartTileData_RoGetActivationFactory(HSTRING activatableClassId, REFIID iid, void** factory);
typedef struct CCacheShortcut CCacheShortcut; typedef struct CCacheShortcut CCacheShortcut;
@ -11452,7 +11452,7 @@ static void PatchStartTileData(BOOL bSMEH)
#pragma region "Fix Windows 10 start menu animation on 22000.65+" #pragma region "Fix Windows 10 start menu animation on 22000.65+"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
static struct static struct
{ {
int startExperienceManager_IStartExperienceManager; int startExperienceManager_IStartExperienceManager;
@ -12118,7 +12118,7 @@ BOOL FixStartMenuAnimation(LPMODULEINFO mi)
#pragma region "Crash counter system" #pragma region "Crash counter system"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
typedef struct CrashCounterSettings typedef struct CrashCounterSettings
{ {
BOOL bDisabled; BOOL bDisabled;
@ -12349,7 +12349,7 @@ BOOL CrashCounterHandleEntryPoint()
#pragma region "Loader for alternate taskbar implementation" #pragma region "Loader for alternate taskbar implementation"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
BOOL CheckExplorerSymbols(symbols_addr* symbols_PTRS) BOOL CheckExplorerSymbols(symbols_addr* symbols_PTRS)
{ {
BOOL bAllValid = TRUE; BOOL bAllValid = TRUE;
@ -12440,7 +12440,7 @@ HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const
#pragma region "Restore network icon on builds without pnidui.dll shipped" #pragma region "Restore network icon on builds without pnidui.dll shipped"
#ifdef _WIN64 #if WITH_MAIN_PATCHER
typedef struct SSOEntry typedef struct SSOEntry
{ {
GUID* pguid; GUID* pguid;
@ -12576,7 +12576,7 @@ DWORD Inject(BOOL bIsExplorer)
if (bIsExplorer) if (bIsExplorer)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
InitializeCriticalSection(&lock_epw); InitializeCriticalSection(&lock_epw);
#endif #endif
wszWeatherLanguage = malloc(sizeof(WCHAR) * MAX_PATH); wszWeatherLanguage = malloc(sizeof(WCHAR) * MAX_PATH);
@ -12586,7 +12586,7 @@ DWORD Inject(BOOL bIsExplorer)
LoadSettings(MAKELPARAM(bIsExplorer, FALSE)); LoadSettings(MAKELPARAM(bIsExplorer, FALSE));
Explorer_RefreshUI(99); Explorer_RefreshUI(99);
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
funchook = funchook_create(); funchook = funchook_create();
@ -12771,7 +12771,7 @@ DWORD Inject(BOOL bIsExplorer)
if (!bIsExplorer) if (!bIsExplorer)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
rv = funchook_install(funchook, 0); rv = funchook_install(funchook, 0);
@ -12786,7 +12786,7 @@ DWORD Inject(BOOL bIsExplorer)
return 0; return 0;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
extern void InitializeWilLogCallback(); extern void InitializeWilLogCallback();
InitializeWilLogCallback(); InitializeWilLogCallback();
wprintf(L"Running on Windows %d, OS Build %d.%d.%d.%d.\n", IsWindows11() ? 11 : 10, global_rovi.dwMajorVersion, global_rovi.dwMinorVersion, global_rovi.dwBuildNumber, global_ubr); wprintf(L"Running on Windows %d, OS Build %d.%d.%d.%d.\n", IsWindows11() ? 11 : 10, global_rovi.dwMajorVersion, global_rovi.dwMinorVersion, global_rovi.dwBuildNumber, global_ubr);
@ -12800,7 +12800,7 @@ DWORD Inject(BOOL bIsExplorer)
CreateDirectoryW(wszPath, NULL); CreateDirectoryW(wszPath, NULL);
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
wszEPWeatherKillswitch = calloc(sizeof(WCHAR), MAX_PATH); wszEPWeatherKillswitch = calloc(sizeof(WCHAR), MAX_PATH);
srand(time(NULL)); srand(time(NULL));
rand_string(wszEPWeatherKillswitch, MAX_PATH / 2 - 1); rand_string(wszEPWeatherKillswitch, MAX_PATH / 2 - 1);
@ -12824,7 +12824,7 @@ DWORD Inject(BOOL bIsExplorer)
#endif #endif
#ifdef _WIN64 #if WITH_MAIN_PATCHER
hCanStartSws = CreateEventW(NULL, FALSE, FALSE, NULL); hCanStartSws = CreateEventW(NULL, FALSE, FALSE, NULL);
hWin11AltTabInitialized = CreateEventW(NULL, FALSE, FALSE, NULL); hWin11AltTabInitialized = CreateEventW(NULL, FALSE, FALSE, NULL);
CreateThread( CreateThread(
@ -13210,7 +13210,7 @@ DWORD Inject(BOOL bIsExplorer)
printf("Failed to hook winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessage(). rv = %d\n", rv); printf("Failed to hook winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessage(). rv = %d\n", rv);
}*/ }*/
#ifdef _WIN64 #if WITH_MAIN_PATCHER
#if USE_MOMENT_3_FIXES_ON_MOMENT_2 #if USE_MOMENT_3_FIXES_ON_MOMENT_2
// Use this only for testing, since the RtlQueryFeatureConfiguration() hook is perfect. // Use this only for testing, since the RtlQueryFeatureConfiguration() hook is perfect.
// Only tested on 22621.1992. // Only tested on 22621.1992.
@ -13388,7 +13388,7 @@ DWORD Inject(BOOL bIsExplorer)
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (global_rovi.dwBuildNumber < 22567) if (global_rovi.dwBuildNumber < 22567)
{ {
PatchSndvolsso(); PatchSndvolsso();
@ -13736,7 +13736,7 @@ DWORD Inject(BOOL bIsExplorer)
return 0; return 0;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
char VisibilityChangedEventArguments_GetVisible(__int64 a1) char VisibilityChangedEventArguments_GetVisible(__int64 a1)
{ {
int v1; int v1;
@ -14517,7 +14517,13 @@ void Setup_Regsvr32(BOOL bInstall)
wszCurrentDirectory[2] = L' '; wszCurrentDirectory[2] = L' ';
wszCurrentDirectory[3] = L'"'; wszCurrentDirectory[3] = L'"';
} }
#if defined(_M_X64)
wcscat_s(wszCurrentDirectory, ARRAYSIZE(wszCurrentDirectory), L"\\ExplorerPatcher.amd64.dll\""); wcscat_s(wszCurrentDirectory, ARRAYSIZE(wszCurrentDirectory), L"\\ExplorerPatcher.amd64.dll\"");
#elif defined(_M_ARM64)
wcscat_s(wszCurrentDirectory, ARRAYSIZE(wszCurrentDirectory), L"\\ExplorerPatcher.arm64.dll\"");
#else
#error "Unsupported architecture"
#endif
SHELLEXECUTEINFOW sei; SHELLEXECUTEINFOW sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFOW)); ZeroMemory(&sei, sizeof(SHELLEXECUTEINFOW));
sei.cbSize = sizeof(sei); sei.cbSize = sizeof(sei);
@ -14873,7 +14879,7 @@ HRESULT WINAPI _DllCanUnloadNow()
DWORD InjectStartMenu() DWORD InjectStartMenu()
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
funchook = funchook_create(); funchook = funchook_create();
HANDLE hStartDocked = NULL; HANDLE hStartDocked = NULL;
@ -15093,7 +15099,7 @@ DWORD InjectStartMenu()
void InjectShellExperienceHost() void InjectShellExperienceHost()
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
HKEY hKey; HKEY hKey;
if (RegOpenKeyW(HKEY_CURRENT_USER, _T(SEH_REGPATH), &hKey) != ERROR_SUCCESS) if (RegOpenKeyW(HKEY_CURRENT_USER, _T(SEH_REGPATH), &hKey) != ERROR_SUCCESS)
{ {
@ -15220,7 +15226,7 @@ BOOL SEH_GetProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dw
} }
void InjectShellExperienceHostFor22H2OrHigher() { void InjectShellExperienceHostFor22H2OrHigher() {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (!IsWindows11Version22H2Build1413OrHigher()) if (!IsWindows11Version22H2Build1413OrHigher())
{ {
HKEY hKey; HKEY hKey;
@ -15236,7 +15242,7 @@ void InjectShellExperienceHostFor22H2OrHigher() {
#endif #endif
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
bool IsUserOOBE() bool IsUserOOBE()
{ {
BOOL b = FALSE; BOOL b = FALSE;
@ -15340,7 +15346,7 @@ HRESULT EntryPoint(DWORD dwMethod)
TCHAR wszRealDXGIPath[MAX_PATH]; TCHAR wszRealDXGIPath[MAX_PATH];
GetSystemDirectoryW(wszRealDXGIPath, MAX_PATH); GetSystemDirectoryW(wszRealDXGIPath, MAX_PATH);
wcscat_s(wszRealDXGIPath, MAX_PATH, L"\\dxgi.dll"); wcscat_s(wszRealDXGIPath, MAX_PATH, L"\\dxgi.dll");
#ifdef _WIN64 #if WITH_MAIN_PATCHER
SetupDXGIImportFunctions(LoadLibraryW(wszRealDXGIPath)); SetupDXGIImportFunctions(LoadLibraryW(wszRealDXGIPath));
#endif #endif
} }
@ -15356,7 +15362,7 @@ HRESULT EntryPoint(DWORD dwMethod)
bIsExplorerProcess = bIsThisExplorer; bIsExplorerProcess = bIsThisExplorer;
if (bIsThisExplorer) if (bIsThisExplorer)
{ {
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (GetSystemMetrics(SM_CLEANBOOT) != 0 || IsUserOOBEOrCredentialReset()) if (GetSystemMetrics(SM_CLEANBOOT) != 0 || IsUserOOBEOrCredentialReset())
{ {
IncrementDLLReferenceCount(hModule); IncrementDLLReferenceCount(hModule);
@ -15365,7 +15371,7 @@ HRESULT EntryPoint(DWORD dwMethod)
} }
#endif #endif
BOOL desktopExists = IsDesktopWindowAlreadyPresent(); BOOL desktopExists = IsDesktopWindowAlreadyPresent();
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (!desktopExists && CrashCounterHandleEntryPoint()) if (!desktopExists && CrashCounterHandleEntryPoint())
{ {
IncrementDLLReferenceCount(hModule); IncrementDLLReferenceCount(hModule);
@ -15380,7 +15386,7 @@ HRESULT EntryPoint(DWORD dwMethod)
else if (bIsThisStartMEH) else if (bIsThisStartMEH)
{ {
InjectStartMenu(); InjectStartMenu();
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (IsXamlSoundsEnabled()) if (IsXamlSoundsEnabled())
{ {
HMODULE hWindowsUIXaml = LoadLibraryW(L"Windows.UI.Xaml.dll"); HMODULE hWindowsUIXaml = LoadLibraryW(L"Windows.UI.Xaml.dll");
@ -15400,7 +15406,7 @@ HRESULT EntryPoint(DWORD dwMethod)
{ {
InjectShellExperienceHost(); InjectShellExperienceHost();
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
if (IsXamlSoundsEnabled()) if (IsXamlSoundsEnabled())
{ {
HMODULE hWindowsUIXaml = LoadLibraryW(L"Windows.UI.Xaml.dll"); HMODULE hWindowsUIXaml = LoadLibraryW(L"Windows.UI.Xaml.dll");
@ -15420,7 +15426,7 @@ HRESULT EntryPoint(DWORD dwMethod)
return E_NOINTERFACE; return E_NOINTERFACE;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
// for explorer.exe and ShellExperienceHost.exe // for explorer.exe and ShellExperienceHost.exe
__declspec(dllexport) HRESULT DXGIDeclareAdapterRemovalSupport() __declspec(dllexport) HRESULT DXGIDeclareAdapterRemovalSupport()
{ {
@ -15439,6 +15445,9 @@ HRESULT InjectStartFromExplorer()
EntryPoint(DLL_INJECTION_METHOD_START_INJECTION); EntryPoint(DLL_INJECTION_METHOD_START_INJECTION);
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
#endif
#ifdef _WIN64
#pragma comment(linker, "/export:DllGetClassObject=_DllGetClassObject") #pragma comment(linker, "/export:DllGetClassObject=_DllGetClassObject")
#else #else
#pragma comment(linker, "/export:DllGetClassObject=__DllGetClassObject@12") #pragma comment(linker, "/export:DllGetClassObject=__DllGetClassObject@12")
@ -15475,7 +15484,7 @@ BOOL WINAPI DllMain(
return TRUE; return TRUE;
} }
#ifdef _WIN64 #if WITH_MAIN_PATCHER
__declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow) __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
{ {
// Forward to ep_gui.dll // Forward to ep_gui.dll

View File

@ -1611,37 +1611,7 @@ HRESULT SHRegGetDWORD(HKEY hkey, const WCHAR* pwszSubKey, const WCHAR* pwszValue
return HRESULT_FROM_WIN32(lres); return HRESULT_FROM_WIN32(lres);
} }
#ifdef _WIN64 #ifdef WITH_MAIN_PATCHER
static BOOL MaskCompare(PVOID pBuffer, LPCSTR lpPattern, LPCSTR lpMask)
{
for (PBYTE value = (PBYTE)pBuffer; *lpMask; ++lpPattern, ++lpMask, ++value)
{
if (*lpMask == 'x' && *(LPCBYTE)lpPattern != *value)
return FALSE;
}
return TRUE;
}
static __declspec(noinline) PVOID FindPatternHelper(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask)
{
for (SIZE_T index = 0; index < dwSize; ++index)
{
PBYTE pAddress = (PBYTE)pBase + index;
if (MaskCompare(pAddress, lpPattern, lpMask))
return pAddress;
}
return NULL;
}
PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask)
{
dwSize -= strlen(lpMask);
return FindPatternHelper(pBase, dwSize, lpPattern, lpMask);
}
// https://learn.microsoft.com/en-us/windows/uwp/communication/sharing-named-objects // https://learn.microsoft.com/en-us/windows/uwp/communication/sharing-named-objects
// https://learn.microsoft.com/en-us/windows/win32/api/securityappcontainer/nf-securityappcontainer-getappcontainernamedobjectpath#examples // https://learn.microsoft.com/en-us/windows/win32/api/securityappcontainer/nf-securityappcontainer-getappcontainernamedobjectpath#examples
BOOL GetLogonSid(PSID* ppsid) BOOL GetLogonSid(PSID* ppsid)

View File

@ -576,7 +576,6 @@ inline BOOL IncrementDLLReferenceCount(HINSTANCE hinst)
return TRUE; return TRUE;
} }
#ifdef _WIN64
PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask); PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask);
#if _M_ARM64 #if _M_ARM64
@ -689,6 +688,7 @@ inline UINT_PTR ARM64_DecodeADRL(UINT_PTR offset, DWORD insnADRP, DWORD insnADD)
} }
#endif #endif
#if defined(WITH_MAIN_PATCHER) && WITH_MAIN_PATCHER
inline BOOL WINAPI PatchContextMenuOfNewMicrosoftIME(BOOL* bFound) inline BOOL WINAPI PatchContextMenuOfNewMicrosoftIME(BOOL* bFound)
{ {
// huge thanks to @Simplestas: https://github.com/valinet/ExplorerPatcher/issues/598 // huge thanks to @Simplestas: https://github.com/valinet/ExplorerPatcher/issues/598
@ -801,9 +801,35 @@ BOOL ExtractMonitorByIndex(HMONITOR hMonitor, HDC hDC, LPRECT lpRect, MonitorOve
HRESULT SHRegGetBOOLWithREGSAM(HKEY key, LPCWSTR subKey, LPCWSTR value, REGSAM regSam, BOOL* data); HRESULT SHRegGetBOOLWithREGSAM(HKEY key, LPCWSTR subKey, LPCWSTR value, REGSAM regSam, BOOL* data);
HRESULT SHRegGetDWORD(HKEY hkey, const WCHAR* pwszSubKey, const WCHAR* pwszValue, DWORD* pdwData); HRESULT SHRegGetDWORD(HKEY hkey, const WCHAR* pwszSubKey, const WCHAR* pwszValue, DWORD* pdwData);
#ifdef _WIN64 inline BOOL MaskCompare(PVOID pBuffer, LPCSTR lpPattern, LPCSTR lpMask)
PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask); {
#endif for (PBYTE value = (PBYTE)pBuffer; *lpMask; ++lpPattern, ++lpMask, ++value)
{
if (*lpMask == 'x' && *(LPCBYTE)lpPattern != *value)
return FALSE;
}
return TRUE;
}
inline __declspec(noinline) PVOID FindPatternHelper(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask)
{
for (SIZE_T index = 0; index < dwSize; ++index)
{
PBYTE pAddress = (PBYTE)pBase + index;
if (MaskCompare(pAddress, lpPattern, lpMask))
return pAddress;
}
return NULL;
}
inline PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask)
{
dwSize -= strlen(lpMask);
return FindPatternHelper(pBase, dwSize, lpPattern, lpMask);
}
inline HMODULE LoadGuiModule() inline HMODULE LoadGuiModule()
{ {

View File

@ -531,7 +531,6 @@ LSTATUS GUI_Internal_RegSetValueExW(
{ {
wszArgs[0] = L'\"'; wszArgs[0] = L'\"';
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 1); SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 1);
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".amd64.dll\"");
} }
else else
{ {
@ -540,8 +539,14 @@ LSTATUS GUI_Internal_RegSetValueExW(
wszArgs[2] = L' '; wszArgs[2] = L' ';
wszArgs[3] = L'"'; wszArgs[3] = L'"';
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 4); SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 4);
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".amd64.dll\"");
} }
#if defined(_M_X64)
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".amd64.dll\"");
#elif defined(_M_ARM64)
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".arm64.dll\"");
#else
#error "Unsupported architecture"
#endif
wprintf(L"%s\n", wszArgs); wprintf(L"%s\n", wszArgs);
WCHAR wszApp[MAX_PATH * 2]; WCHAR wszApp[MAX_PATH * 2];
GetSystemDirectoryW(wszApp, MAX_PATH * 2); GetSystemDirectoryW(wszApp, MAX_PATH * 2);
@ -2745,7 +2750,6 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
{ {
wszArgs[0] = L'\"'; wszArgs[0] = L'\"';
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 1); SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 1);
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".amd64.dll\"");
} }
else else
{ {
@ -2754,8 +2758,14 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
wszArgs[2] = L' '; wszArgs[2] = L' ';
wszArgs[3] = L'"'; wszArgs[3] = L'"';
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 4); SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszArgs + 4);
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".amd64.dll\"");
} }
#if defined(_M_X64)
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".amd64.dll\"");
#elif defined(_M_ARM64)
wcscat_s(wszArgs, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(PRODUCT_NAME) L".arm64.dll\"");
#else
#error "Unsupported architecture"
#endif
wprintf(L"%s\n", wszArgs); wprintf(L"%s\n", wszArgs);
WCHAR wszApp[MAX_PATH * 2]; WCHAR wszApp[MAX_PATH * 2];
GetSystemDirectoryW(wszApp, MAX_PATH * 2); GetSystemDirectoryW(wszApp, MAX_PATH * 2);

View File

@ -25,8 +25,8 @@ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include "../ExplorerPatcher/fmemopen.h" #include "../ExplorerPatcher/fmemopen.h"
#include "../ExplorerPatcher/Localization.h" #include "../ExplorerPatcher/Localization.h"
#include "../ExplorerPatcher/utility.h" #include "../ExplorerPatcher/utility.h"
#include "../ep_weather_host/ep_weather.h" #include "ep_weather.h"
#include "../ep_weather_host/ep_weather_host_h.h" #include "ep_weather_host_h.h"
#define MAX_LINE_LENGTH 2000 #define MAX_LINE_LENGTH 2000
extern HMODULE hModule; extern HMODULE hModule;

View File

@ -92,7 +92,7 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard> <LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>$(SolutionDir)libs\libvalinet;$(SolutionDir)libs\funchook\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(SolutionDir)libs\libvalinet;$(SolutionDir)libs\funchook\include;$(SolutionDir)\ep_weather_host;$(SolutionDir)\ep_weather_host\$(Platform)\$(Configuration);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile> </ClCompile>
<Link> <Link>
@ -133,7 +133,7 @@
<ClCompile Include="..\ExplorerPatcher\getline.c" /> <ClCompile Include="..\ExplorerPatcher\getline.c" />
<ClCompile Include="..\ExplorerPatcher\Localization.cpp" /> <ClCompile Include="..\ExplorerPatcher\Localization.cpp" />
<ClCompile Include="..\ExplorerPatcher\utility.c" /> <ClCompile Include="..\ExplorerPatcher\utility.c" />
<ClCompile Include="..\ep_weather_host_stub\ep_weather_host_i.c" /> <ClCompile Include="..\ep_weather_host_stub\$(Platform)\$(Configuration)\ep_weather_host_i.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="GUI.h" /> <ClInclude Include="GUI.h" />

View File

@ -502,8 +502,11 @@ int WINAPI wWinMain(
GetCurrentDirectoryW(MAX_PATH, wszPath); GetCurrentDirectoryW(MAX_PATH, wszPath);
} }
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_IA32, wszPath, _T(PRODUCT_NAME) L".IA-32.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_IA32, wszPath, _T(PRODUCT_NAME) L".IA-32.dll");
#if defined(_M_X64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, _T(PRODUCT_NAME) L".amd64.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, _T(PRODUCT_NAME) L".amd64.dll");
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_ARM64, wszPath, _T(PRODUCT_NAME) L".arm64.dll"); #elif defined(_M_ARM64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, _T(PRODUCT_NAME) L".arm64.dll");
#endif
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_DWM, wszPath, L"ep_dwm.exe"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_DWM, wszPath, L"ep_dwm.exe");
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_WEATHER, wszPath, L"ep_weather_host.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_WEATHER, wszPath, L"ep_weather_host.dll");
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_WEATHER_STUB, wszPath, L"ep_weather_host_stub.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_WEATHER_STUB, wszPath, L"ep_weather_host_stub.dll");
@ -853,9 +856,10 @@ int WINAPI wWinMain(
} }
} }
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_IA32, wszPath, _T(PRODUCT_NAME) L".IA-32.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_IA32, wszPath, _T(PRODUCT_NAME) L".IA-32.dll");
#if defined(_M_X64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, _T(PRODUCT_NAME) L".amd64.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, _T(PRODUCT_NAME) L".amd64.dll");
#ifdef _M_ARM64 #elif defined(_M_ARM64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_ARM64, wszPath, _T(PRODUCT_NAME) L".arm64.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, _T(PRODUCT_NAME) L".arm64.dll");
#endif #endif
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_GUI, wszPath, L"ep_gui.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_GUI, wszPath, L"ep_gui.dll");
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_DWM, wszPath, L"ep_dwm.exe"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_DWM, wszPath, L"ep_dwm.exe");
@ -872,10 +876,10 @@ int WINAPI wWinMain(
// C:\Windows // C:\Windows
// + dxgi.dll // + dxgi.dll
if (bOk) GetWindowsDirectoryW(wszPath, MAX_PATH); if (bOk) GetWindowsDirectoryW(wszPath, MAX_PATH);
#ifdef _M_X64 #if defined(_M_X64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll");
#elif defined(_M_ARM64) #elif defined(_M_ARM64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_ARM64, wszPath, L"dxgi.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll");
#endif #endif
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
@ -891,10 +895,10 @@ int WINAPI wWinMain(
// - pris2\Windows.UI.ShellCommon.en-US.pri // - pris2\Windows.UI.ShellCommon.en-US.pri
if (bOk) GetWindowsDirectoryW(wszPath, MAX_PATH); if (bOk) GetWindowsDirectoryW(wszPath, MAX_PATH);
if (bOk) wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy"); if (bOk) wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy");
#ifdef _M_X64 #if defined(_M_X64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll");
#elif defined(_M_ARM64) #elif defined(_M_ARM64)
if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_ARM64, wszPath, L"dxgi.dll"); if (bOk) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll");
#endif #endif
if (bOk) bOk = InstallResource(bInstall && IsWindows11(), hInstance, IDR_EP_STARTMENU, wszPath, L"wincorlib.dll"); if (bOk) bOk = InstallResource(bInstall && IsWindows11(), hInstance, IDR_EP_STARTMENU, wszPath, L"wincorlib.dll");
if (bOk) bOk = DeleteResource(wszPath, L"wincorlib_orig.dll"); if (bOk) bOk = DeleteResource(wszPath, L"wincorlib_orig.dll");
@ -950,10 +954,10 @@ int WINAPI wWinMain(
// + dxgi.dll // + dxgi.dll
if (bOk) GetWindowsDirectoryW(wszPath, MAX_PATH); if (bOk) GetWindowsDirectoryW(wszPath, MAX_PATH);
if (bOk) wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\ShellExperienceHost_cw5n1h2txyewy"); if (bOk) wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\ShellExperienceHost_cw5n1h2txyewy");
#ifdef _M_X64 #if defined(_M_X64)
if (bOk && IsWindows11()) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll"); if (bOk && IsWindows11()) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll");
#elif defined(_M_ARM64) #elif defined(_M_ARM64)
if (bOk && IsWindows11()) bOk = InstallResource(bInstall, hInstance, IDR_EP_ARM64, wszPath, L"dxgi.dll"); if (bOk && IsWindows11()) bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath, L"dxgi.dll");
#endif #endif
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------

View File

@ -90,16 +90,12 @@ END
// RCDATA // RCDATA
// //
IDR_EP_AMD64 RCDATA "..\\build\\Release\\x64\\ExplorerPatcher.amd64.dll"
IDR_EP_IA32 RCDATA "..\\build\\Release\\Win32\\ExplorerPatcher.IA-32.dll" IDR_EP_IA32 RCDATA "..\\build\\Release\\Win32\\ExplorerPatcher.IA-32.dll"
#ifdef PLATFORM_ARM64
IDR_EP_ARM64 RCDATA "..\\build\\Release\\ARM64\\ExplorerPatcher.arm64.dll"
#endif
#if defined(PLATFORM_AMD64) #if defined(PLATFORM_AMD64)
IDR_EP_AMD64 RCDATA "..\\build\\Release\\x64\\ExplorerPatcher.amd64.dll"
IDR_EP_DWM RCDATA "..\\build\\Release\\x64\\ep_dwm.exe" IDR_EP_DWM RCDATA "..\\build\\Release\\x64\\ep_dwm.exe"
IDR_EP_WEATHER RCDATA "..\\build\\Release\\x64\\ep_weather_host.dll" IDR_EP_WEATHER RCDATA "..\\build\\Release\\x64\\ep_weather_host.dll"
@ -130,6 +126,8 @@ IDR_EP_TASKBAR_5 RCDATA "..\\build\\Release\\x64\\ep_taskbar.
#elif defined(PLATFORM_ARM64) #elif defined(PLATFORM_ARM64)
IDR_EP_ARM64 RCDATA "..\\build\\Release\\ARM64\\ExplorerPatcher.arm64.dll"
IDR_EP_DWM RCDATA "..\\build\\Release\\ARM64\\ep_dwm.exe" IDR_EP_DWM RCDATA "..\\build\\Release\\ARM64\\ep_dwm.exe"
IDR_EP_WEATHER RCDATA "..\\build\\Release\\ARM64\\ep_weather_host.dll" IDR_EP_WEATHER RCDATA "..\\build\\Release\\ARM64\\ep_weather_host.dll"

View File

@ -4,7 +4,6 @@
// //
#define IDR_EP_AMD64 103 #define IDR_EP_AMD64 103
#define IDR_EP_IA32 104 #define IDR_EP_IA32 104
#define IDR_EP_ARM64 114
#define IDR_EP_DWM 105 #define IDR_EP_DWM 105
#define IDR_EP_WEATHER 106 #define IDR_EP_WEATHER 106
#define IDR_EP_WEATHER_STUB 107 #define IDR_EP_WEATHER_STUB 107

View File

@ -1453,7 +1453,11 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this)
GenericObjectWithThis* pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = GenericObjectWithThis* pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler =
GenericObjectWithThis_MakeAndInitialize(&EPWeather_ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerVtbl, _this, L"pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler"); GenericObjectWithThis_MakeAndInitialize(&EPWeather_ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerVtbl, _this, L"pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler");
if (!pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler) goto cleanup; if (!pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler) goto cleanup;
#if !defined(_M_ARM64EC)
_this->hrLastError = CreateCoreWebView2EnvironmentWithOptions(NULL, wszWorkFolder, &EPWeather_ICoreWebView2EnvironmentOptions, pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler); _this->hrLastError = CreateCoreWebView2EnvironmentWithOptions(NULL, wszWorkFolder, &EPWeather_ICoreWebView2EnvironmentOptions, pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler);
#else
_this->hrLastError = E_NOTIMPL;
#endif
pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler->lpVtbl->Release(pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler); pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler->lpVtbl->Release(pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler);
if (FAILED(_this->hrLastError)) goto cleanup; if (FAILED(_this->hrLastError)) goto cleanup;

View File

@ -2,7 +2,7 @@
#define _H_AS_SERVICE_P_H_ #define _H_AS_SERVICE_P_H_
#include "ep_weather.h" #include "ep_weather.h"
#include "ep_weather_utility.h" #include "ep_weather_utility.h"
#include "../ep_weather_host_stub/ep_weather_host_h.h" #include "ep_weather_host_h.h"
#include "../ExplorerPatcher/def.h" #include "../ExplorerPatcher/def.h"
#include <windowsx.h> #include <windowsx.h>
#include <ShlObj.h> #include <ShlObj.h>

View File

@ -25,6 +25,14 @@
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>ARM64</Platform> <Platform>ARM64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
@ -32,6 +40,7 @@
<ProjectGuid>{314a50c1-f0a0-4d0c-89e1-ad8f3951043e}</ProjectGuid> <ProjectGuid>{314a50c1-f0a0-4d0c-89e1-ad8f3951043e}</ProjectGuid>
<RootNamespace>epweatherhost</RootNamespace> <RootNamespace>epweatherhost</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WithArm64XBinaries>false</WithArm64XBinaries>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -73,6 +82,19 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
@ -96,6 +118,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
@ -116,10 +144,20 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<BuildAsX>$(WithArm64XBinaries)</BuildAsX>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<BuildAsX>$(WithArm64XBinaries)</BuildAsX>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
@ -220,13 +258,46 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ForcedIncludeFiles>$(SolutionDir)debug.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>$(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>$(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="ep_weather.c" /> <ClCompile Include="ep_weather.c" />
<ClCompile Include="ep_weather_factory.c" /> <ClCompile Include="ep_weather_factory.c" />
<ClCompile Include="ep_weather_host.c" /> <ClCompile Include="ep_weather_host.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\ep_weather_host_stub\ep_weather_host_h.h" /> <ClInclude Include="..\ep_weather_host_stub\$(Platform)\$(Configuration)\ep_weather_host_h.h" />
<ClInclude Include="..\ExplorerPatcher\def.h" /> <ClInclude Include="..\ExplorerPatcher\def.h" />
<ClInclude Include="ep_weather.h" /> <ClInclude Include="ep_weather.h" />
<ClInclude Include="ep_weather_error_html.h" /> <ClInclude Include="ep_weather_error_html.h" />
@ -248,12 +319,12 @@
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.1072.54\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.1072.54\build\native\Microsoft.Web.WebView2.targets')" /> <Import Project="..\packages\Microsoft.Web.WebView2.1.0.2592.51\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2592.51\build\native\Microsoft.Web.WebView2.targets')" />
</ImportGroup> </ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.1072.54\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.1072.54\build\native\Microsoft.Web.WebView2.targets'))" /> <Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2592.51\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2592.51\build\native\Microsoft.Web.WebView2.targets'))" />
</Target> </Target>
</Project> </Project>

View File

@ -38,9 +38,6 @@
<ClInclude Include="ep_weather_host.h"> <ClInclude Include="ep_weather_host.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\ep_weather_host_stub\ep_weather_host_h.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ep_weather_utility.h"> <ClInclude Include="ep_weather_utility.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@ -56,6 +53,9 @@
<ClInclude Include="..\ExplorerPatcher\def.h"> <ClInclude Include="..\ExplorerPatcher\def.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\ep_weather_host_stub\$(Platform)\$(Configuration)\ep_weather_host_h.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="ep_weather_host.rc"> <ResourceCompile Include="ep_weather_host.rc">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Microsoft.Web.WebView2" version="1.0.1072.54" targetFramework="native" /> <package id="Microsoft.Web.WebView2" version="1.0.2592.51" targetFramework="native" />
</packages> </packages>

View File

@ -25,6 +25,14 @@
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>ARM64</Platform> <Platform>ARM64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
@ -32,6 +40,7 @@
<ProjectGuid>{af02abac-eaeb-471c-9957-73d430b8b4de}</ProjectGuid> <ProjectGuid>{af02abac-eaeb-471c-9957-73d430b8b4de}</ProjectGuid>
<RootNamespace>epweatherhoststub</RootNamespace> <RootNamespace>epweatherhoststub</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WithArm64XBinaries>false</WithArm64XBinaries>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -73,6 +82,19 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
@ -96,6 +118,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
@ -116,10 +144,20 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<BuildAsX>$(WithArm64XBinaries)</BuildAsX>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
<BuildAsX>$(WithArm64XBinaries)</BuildAsX>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(Configuration)\$(Platform)\</OutDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
@ -223,15 +261,51 @@
<ModuleDefinitionFile>ep_weather_host_stub.def</ModuleDefinitionFile> <ModuleDefinitionFile>ep_weather_host_stub.def</ModuleDefinitionFile>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>RpcRT4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>ep_weather_host_stub.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>RpcRT4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>ep_weather_host_stub.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<Midl Include="ep_weather_host.idl" /> <Midl Include="ep_weather_host.idl">
<OutputDirectory>$(IntDir)</OutputDirectory>
</Midl>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="dlldata.c"> <ClCompile Include="$(IntDir)\dlldata.c">
<PreprocessorDefinitions>REGISTER_PROXY_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>REGISTER_PROXY_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ClCompile Include="ep_weather_host_i.c" /> <ClCompile Include="$(IntDir)\ep_weather_host_i.c" />
<ClCompile Include="ep_weather_host_p.c"> <ClCompile Include="$(IntDir)\ep_weather_host_p.c">
<PreprocessorDefinitions>REGISTER_PROXY_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>REGISTER_PROXY_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>

@ -1 +1 @@
Subproject commit 586fe7d6bdbab4eec0c4b0999efe7c8602636a0b Subproject commit 971a3f20262c065c3b001c1781b6d75f9083680e