Browse Source

Application starts with limited functionality on builds lacking hardcoded symbol information

pull/492/head 22000.318.38.7_6b5a265
Valentin Radu 4 years ago
parent
commit
6b5a265a04
  1. 3
      CHANGELOG.md
  2. 166
      ExplorerPatcher/dllmain.c
  3. 2
      ExplorerPatcher/settings.reg
  4. 6
      version.h

3
CHANGELOG.md

@ -4,7 +4,7 @@ This document includes the same release notes as in the [Releases](https://githu
## 22000.318.38 ## 22000.318.38
Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and release preview channels). Tested on build 22000.318.
#### New features #### New features
@ -20,6 +20,7 @@ Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and r
* Running `ep-setup.exe` again while EP is already installed will now update the program to the latest version. To uninstall, as the previous behavior did, run `ep_setup.exe /uninstall` (.4) * Running `ep-setup.exe` again while EP is already installed will now update the program to the latest version. To uninstall, as the previous behavior did, run `ep_setup.exe /uninstall` (.4)
* Implemented absolute height and width parameters for the Windows 10 switcher. These are especially useful for ultra wide monitors, in a scenario similar to the one described in [this post](https://github.com/valinet/ExplorerPatcher/discussions/110#discussioncomment-1673007) - to configure, set `MaxWidthAbs` and/or `MaxHeightAbs` DWORD values in `HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher\sws` (#110) (.5) * Implemented absolute height and width parameters for the Windows 10 switcher. These are especially useful for ultra wide monitors, in a scenario similar to the one described in [this post](https://github.com/valinet/ExplorerPatcher/discussions/110#discussioncomment-1673007) - to configure, set `MaxWidthAbs` and/or `MaxHeightAbs` DWORD values in `HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher\sws` (#110) (.5)
* Provides a simple mechanism for chainloading a custom library when the shell interface is created, from which you can execute your custom code (subject to change, see [this](https://github.com/valinet/ExplorerPatcher/discussions/408#discussioncomment-1674348) for more details) (#408) (.6) * Provides a simple mechanism for chainloading a custom library when the shell interface is created, from which you can execute your custom code (subject to change, see [this](https://github.com/valinet/ExplorerPatcher/discussions/408#discussioncomment-1674348) for more details) (#408) (.6)
* Application starts with limited functionality on builds lacking hardcoded symbol information; symbol downloading is disabled for now, by default, but can be enabled in the "Advanced" settings section of "Properties" (.7)
#### Feature enhancements #### Feature enhancements

166
ExplorerPatcher/dllmain.c

@ -72,6 +72,7 @@ DWORD bShowUpdateToast = FALSE;
DWORD bToolbarSeparators = FALSE; DWORD bToolbarSeparators = FALSE;
DWORD bTaskbarAutohideOnDoubleClick = FALSE; DWORD bTaskbarAutohideOnDoubleClick = FALSE;
DWORD dwOrbStyle = 0; DWORD dwOrbStyle = 0;
DWORD bEnableSymbolDownload = FALSE;
HMODULE hModule = NULL; HMODULE hModule = NULL;
HANDLE hDelayedInjectionThread = NULL; HANDLE hDelayedInjectionThread = NULL;
HANDLE hIsWinXShown = NULL; HANDLE hIsWinXShown = NULL;
@ -726,43 +727,43 @@ static INT64(*winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnM
void* _this, void* _this,
INT64 a2, INT64 a2,
INT a3 INT a3
); ) = NULL;
static INT64(*CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc)( static INT64(*CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc)(
void* _this, void* _this,
POINT* pt POINT* pt
); ) = NULL;
static void(*CLauncherTipContextMenu_ExecuteCommandFunc)( static void(*CLauncherTipContextMenu_ExecuteCommandFunc)(
void* _this, void* _this,
int a2 int a2
); ) = NULL;
static void(*CLauncherTipContextMenu_ExecuteShutdownCommandFunc)( static void(*CLauncherTipContextMenu_ExecuteShutdownCommandFunc)(
void* _this, void* _this,
void* a2 void* a2
); ) = NULL;
static INT64(*ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)( static INT64(*ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)(
HMENU h1, HMENU h1,
HMENU h2, HMENU h2,
HWND a3, HWND a3,
unsigned int a4, unsigned int a4,
void* data void* data
); ) = NULL;
static void(*ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)( static void(*ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)(
HMENU _this, HMENU _this,
HMENU hWnd, HMENU hWnd,
HWND a3 HWND a3
); ) = NULL;
static INT64(*CLauncherTipContextMenu_GetMenuItemsAsyncFunc)( static INT64(*CLauncherTipContextMenu_GetMenuItemsAsyncFunc)(
void* _this, void* _this,
void* rect, void* rect,
void** iunk void** iunk
); ) = NULL;
static INT64(*CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc)( static INT64(*CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc)(
HWND hWnd, HWND hWnd,
int a2, int a2,
HWND a3, HWND a3,
int a4, int a4,
BOOL* a5 BOOL* a5
); ) = NULL;
LRESULT CALLBACK CLauncherTipContextMenu_WndProc( LRESULT CALLBACK CLauncherTipContextMenu_WndProc(
_In_ HWND hWnd, _In_ HWND hWnd,
@ -819,6 +820,7 @@ LRESULT CALLBACK CLauncherTipContextMenu_WndProc(
void* _this = GetWindowLongPtr(hWnd, GWLP_USERDATA); void* _this = GetWindowLongPtr(hWnd, GWLP_USERDATA);
BOOL v12 = FALSE; BOOL v12 = FALSE;
if ((uMsg == WM_DRAWITEM || uMsg == WM_MEASUREITEM) && if ((uMsg == WM_DRAWITEM || uMsg == WM_MEASUREITEM) &&
CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc &&
CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc( CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc(
hWnd, hWnd,
uMsg, uMsg,
@ -953,6 +955,8 @@ DWORD ShowLauncherTipContextMenu(
if (bSkinMenus) if (bSkinMenus)
{ {
unknown_array = calloc(4, sizeof(INT64)); unknown_array = calloc(4, sizeof(INT64));
if (ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)
{
ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc( ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc(
*((HMENU*)((char*)params->_this + 0xe8)), *((HMENU*)((char*)params->_this + 0xe8)),
hWinXWnd, hWinXWnd,
@ -961,6 +965,7 @@ DWORD ShowLauncherTipContextMenu(
unknown_array unknown_array
); );
} }
}
BOOL res = TrackPopupMenu( BOOL res = TrackPopupMenu(
*((HMENU*)((char*)params->_this + 0xe8)), *((HMENU*)((char*)params->_this + 0xe8)),
@ -973,12 +978,15 @@ DWORD ShowLauncherTipContextMenu(
); );
if (bSkinMenus) if (bSkinMenus)
{
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{ {
ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc( ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc(
*((HMENU*)((char*)params->_this + 0xe8)), *((HMENU*)((char*)params->_this + 0xe8)),
hWinXWnd, hWinXWnd,
&(params->point) &(params->point)
); );
}
free(unknown_array); free(unknown_array);
} }
@ -1000,20 +1008,26 @@ DWORD ShowLauncherTipContextMenu(
else if (res < 4000) else if (res < 4000)
{ {
INT64 info = *(INT64*)((char*)(*(INT64*)((char*)params->_this + 0xa8 - 0x58)) + (INT64)res * 8 - 8); INT64 info = *(INT64*)((char*)(*(INT64*)((char*)params->_this + 0xa8 - 0x58)) + (INT64)res * 8 - 8);
if (CLauncherTipContextMenu_ExecuteCommandFunc)
{
CLauncherTipContextMenu_ExecuteCommandFunc( CLauncherTipContextMenu_ExecuteCommandFunc(
(char*)params->_this - 0x58, (char*)params->_this - 0x58,
&info &info
); );
} }
}
else else
{ {
INT64 info = *(INT64*)((char*)(*(INT64*)((char*)params->_this + 0xc8 - 0x58)) + ((INT64)res - 4000) * 8); INT64 info = *(INT64*)((char*)(*(INT64*)((char*)params->_this + 0xc8 - 0x58)) + ((INT64)res - 4000) * 8);
if (CLauncherTipContextMenu_ExecuteShutdownCommandFunc)
{
CLauncherTipContextMenu_ExecuteShutdownCommandFunc( CLauncherTipContextMenu_ExecuteShutdownCommandFunc(
(char*)params->_this - 0x58, (char*)params->_this - 0x58,
&info &info
); );
} }
} }
}
finalize: finalize:
params->iunk->lpVtbl->Release(params->iunk); params->iunk->lpVtbl->Release(params->iunk);
@ -1132,12 +1146,17 @@ INT64 CLauncherTipContextMenu_ShowLauncherTipContextMenuHook(
point = GetDefaultWinXPosition(FALSE, NULL, NULL, TRUE); point = GetDefaultWinXPosition(FALSE, NULL, NULL, TRUE);
} }
IUnknown* iunk; IUnknown* iunk = NULL;
INT64 r = CLauncherTipContextMenu_GetMenuItemsAsyncFunc( if (CLauncherTipContextMenu_GetMenuItemsAsyncFunc)
{
CLauncherTipContextMenu_GetMenuItemsAsyncFunc(
_this, _this,
&point, &point,
&iunk &iunk
); );
}
if (iunk)
{
iunk->lpVtbl->AddRef(iunk); iunk->lpVtbl->AddRef(iunk);
ShowLauncherTipContextMenuParameters* params = malloc( ShowLauncherTipContextMenuParameters* params = malloc(
@ -1156,10 +1175,14 @@ INT64 CLauncherTipContextMenu_ShowLauncherTipContextMenuHook(
0 0
); );
hWinXThread = hIsWinXShown; hWinXThread = hIsWinXShown;
}
finalize: finalize:
if (CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc)
{
return CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc(_this, pt); return CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc(_this, pt);
} }
return 0;
}
#endif #endif
#pragma endregion #pragma endregion
@ -1466,6 +1489,8 @@ INT64 Shell_TrayWndSubclassProc(
if (bSkinMenus) if (bSkinMenus)
{ {
unknown_array = calloc(4, sizeof(INT64)); unknown_array = calloc(4, sizeof(INT64));
if (ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)
{
ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc( ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc(
hSubMenu, hSubMenu,
hWnd, hWnd,
@ -1474,6 +1499,7 @@ INT64 Shell_TrayWndSubclassProc(
unknown_array unknown_array
); );
} }
}
BOOL res = TrackPopupMenu( BOOL res = TrackPopupMenu(
hSubMenu, hSubMenu,
@ -1506,12 +1532,15 @@ INT64 Shell_TrayWndSubclassProc(
} }
if (bSkinMenus) if (bSkinMenus)
{
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{ {
ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc( ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc(
hSubMenu, hSubMenu,
hWnd, hWnd,
&pt &pt
); );
}
free(unknown_array); free(unknown_array);
} }
@ -1769,10 +1798,12 @@ BOOL TrackPopupMenuHookEx(
if (IsImmersiveMenu) if (IsImmersiveMenu)
{ {
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
#ifndef _WIN64
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
#ifdef _WIN64 #else
if (bIsExplorerProcess && ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{
POINT pt; POINT pt;
pt.x = x; pt.x = x;
pt.y = y; pt.y = y;
@ -1855,9 +1886,12 @@ BOOL TrackPopupMenuHook(
{ {
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
#ifndef _WIN64
if (bIsExplorerProcess) if (bIsExplorerProcess)
{ {
#ifdef _WIN64 #else
if (bIsExplorerProcess && ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{
POINT pt; POINT pt;
pt.x = x; pt.x = x;
pt.y = y; pt.y = y;
@ -1991,6 +2025,7 @@ INT64 OwnerDrawSubclassProc(
{ {
BOOL v12 = FALSE; BOOL v12 = FALSE;
if ((uMsg == WM_DRAWITEM || uMsg == WM_MEASUREITEM) && if ((uMsg == WM_DRAWITEM || uMsg == WM_MEASUREITEM) &&
CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc &&
CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc( CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc(
hWnd, hWnd,
uMsg, uMsg,
@ -2040,6 +2075,8 @@ BOOL explorer_TrackPopupMenuExHook(
{ {
EnumPropsA(hWnd, CheckIfImmersiveContextMenu); EnumPropsA(hWnd, CheckIfImmersiveContextMenu);
if (IsImmersiveMenu) if (IsImmersiveMenu)
{
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{ {
POINT pt; POINT pt;
pt.x = x; pt.x = x;
@ -2050,6 +2087,11 @@ BOOL explorer_TrackPopupMenuExHook(
&(pt) &(pt)
); );
} }
else
{
RemoveOwnerDrawFromMenu(0, hMenu);
}
}
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
} }
b = TrackPopupMenuEx( b = TrackPopupMenuEx(
@ -2093,6 +2135,8 @@ BOOL pnidui_TrackPopupMenuHook(
{ {
EnumPropsA(hWnd, CheckIfImmersiveContextMenu); EnumPropsA(hWnd, CheckIfImmersiveContextMenu);
if (IsImmersiveMenu) if (IsImmersiveMenu)
{
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{ {
POINT pt; POINT pt;
pt.x = x; pt.x = x;
@ -2103,6 +2147,11 @@ BOOL pnidui_TrackPopupMenuHook(
&(pt) &(pt)
); );
} }
else
{
RemoveOwnerDrawFromMenu(0, hMenu);
}
}
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
} }
b = TrackPopupMenu( b = TrackPopupMenu(
@ -2146,6 +2195,8 @@ BOOL sndvolsso_TrackPopupMenuExHook(
{ {
EnumPropsA(hWnd, CheckIfImmersiveContextMenu); EnumPropsA(hWnd, CheckIfImmersiveContextMenu);
if (IsImmersiveMenu) if (IsImmersiveMenu)
{
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{ {
POINT pt; POINT pt;
pt.x = x; pt.x = x;
@ -2156,6 +2207,11 @@ BOOL sndvolsso_TrackPopupMenuExHook(
&(pt) &(pt)
); );
} }
else
{
RemoveOwnerDrawFromMenu(0, hMenu);
}
}
IsImmersiveMenu = FALSE; IsImmersiveMenu = FALSE;
} }
@ -2232,6 +2288,8 @@ BOOL stobject_TrackPopupMenuExHook(
unknown_array = calloc(4, sizeof(INT64)); unknown_array = calloc(4, sizeof(INT64));
pt.x = x; pt.x = x;
pt.y = y; pt.y = y;
if (ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)
{
ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc( ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc(
hMenu, hMenu,
hWnd, hWnd,
@ -2239,6 +2297,7 @@ BOOL stobject_TrackPopupMenuExHook(
0xc, 0xc,
unknown_array unknown_array
); );
}
SetWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc, 0); SetWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc, 0);
} }
b = TrackPopupMenuEx( b = TrackPopupMenuEx(
@ -2253,11 +2312,14 @@ BOOL stobject_TrackPopupMenuExHook(
if (bSkinMenus) if (bSkinMenus)
{ {
RemoveWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc); RemoveWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc);
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{
ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc( ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc(
hMenu, hMenu,
hWnd, hWnd,
&(pt) &(pt)
); );
}
free(unknown_array); free(unknown_array);
} }
} }
@ -2289,6 +2351,8 @@ BOOL stobject_TrackPopupMenuHook(
unknown_array = calloc(4, sizeof(INT64)); unknown_array = calloc(4, sizeof(INT64));
pt.x = x; pt.x = x;
pt.y = y; pt.y = y;
if (ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)
{
ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc( ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc(
hMenu, hMenu,
hWnd, hWnd,
@ -2296,6 +2360,7 @@ BOOL stobject_TrackPopupMenuHook(
0xc, 0xc,
unknown_array unknown_array
); );
}
SetWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc, 0); SetWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc, 0);
} }
b = TrackPopupMenu( b = TrackPopupMenu(
@ -2311,11 +2376,14 @@ BOOL stobject_TrackPopupMenuHook(
if (bSkinMenus) if (bSkinMenus)
{ {
RemoveWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc); RemoveWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc);
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{
ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc( ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc(
hMenu, hMenu,
hWnd, hWnd,
&(pt) &(pt)
); );
}
free(unknown_array); free(unknown_array);
} }
} }
@ -2346,6 +2414,8 @@ BOOL bthprops_TrackPopupMenuExHook(
unknown_array = calloc(4, sizeof(INT64)); unknown_array = calloc(4, sizeof(INT64));
pt.x = x; pt.x = x;
pt.y = y; pt.y = y;
if (ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)
{
ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc( ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc(
hMenu, hMenu,
hWnd, hWnd,
@ -2353,6 +2423,7 @@ BOOL bthprops_TrackPopupMenuExHook(
0xc, 0xc,
unknown_array unknown_array
); );
}
SetWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc, 0); SetWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc, 0);
} }
b = TrackPopupMenuEx( b = TrackPopupMenuEx(
@ -2367,11 +2438,14 @@ BOOL bthprops_TrackPopupMenuExHook(
if (bSkinMenus) if (bSkinMenus)
{ {
RemoveWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc); RemoveWindowSubclass(hWnd, OwnerDrawSubclassProc, OwnerDrawSubclassProc);
if (ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)
{
ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc( ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc(
hMenu, hMenu,
hWnd, hWnd,
&(pt) &(pt)
); );
}
free(unknown_array); free(unknown_array);
} }
} }
@ -2698,9 +2772,13 @@ INT64 winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageHo
) )
{ {
if (!bClockFlyoutOnWinC) if (!bClockFlyoutOnWinC)
{
if (winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc)
{ {
return winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc(_this, a2, a3); return winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc(_this, a2, a3);
} }
return 0;
}
if (a2 == 786 && a3 == 107) if (a2 == 786 && a3 == 107)
{ {
POINT ptCursor; POINT ptCursor;
@ -3738,6 +3816,15 @@ void WINAPI LoadSettings(BOOL bIsExplorer)
&dwSize &dwSize
); );
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("EnableSymbolDownload"),
0,
NULL,
&bEnableSymbolDownload,
&dwSize
);
dwSize = sizeof(DWORD);
dwTemp = 0; dwTemp = 0;
RegQueryValueExW( RegQueryValueExW(
hKey, hKey,
@ -5329,6 +5416,12 @@ DWORD Inject(BOOL bIsExplorer)
sizeof(symbols_addr) sizeof(symbols_addr)
); );
if (LoadSymbols(&symbols_PTRS, hModule)) if (LoadSymbols(&symbols_PTRS, hModule))
{
if (!bEnableSymbolDownload)
{
printf("Unable to load symbols; the program may have limited functionality.\n");
}
else
{ {
printf("Symbols have to be (re)downloaded...\n"); printf("Symbols have to be (re)downloaded...\n");
DownloadSymbolsParams* params = malloc(sizeof(DownloadSymbolsParams)); DownloadSymbolsParams* params = malloc(sizeof(DownloadSymbolsParams));
@ -5336,6 +5429,7 @@ DWORD Inject(BOOL bIsExplorer)
CreateThread(0, 0, DownloadSymbols, params, 0, 0); CreateThread(0, 0, DownloadSymbols, params, 0, 0);
return 0; return 0;
} }
}
else else
{ {
printf("Loaded symbols\n"); printf("Loaded symbols\n");
@ -5444,43 +5538,43 @@ DWORD Inject(BOOL bIsExplorer)
HANDLE hTwinuiPcshell = LoadLibraryW(L"twinui.pcshell.dll"); HANDLE hTwinuiPcshell = LoadLibraryW(L"twinui.pcshell.dll");
if (symbols_PTRS.twinui_pcshell_PTRS[0] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[0] && symbols_PTRS.twinui_pcshell_PTRS[0] != 0xFFFFFFFF)
{ {
CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc = (INT64(*)(HWND, int, HWND, int, BOOL*)) CImmersiveContextMenuOwnerDrawHelper_s_ContextMenuWndProcFunc = (INT64(*)(HWND, int, HWND, int, BOOL*))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[0]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[0]);
} }
if (symbols_PTRS.twinui_pcshell_PTRS[1] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[1] && symbols_PTRS.twinui_pcshell_PTRS[1] != 0xFFFFFFFF)
{ {
CLauncherTipContextMenu_GetMenuItemsAsyncFunc = (INT64(*)(void*, void*, void**)) CLauncherTipContextMenu_GetMenuItemsAsyncFunc = (INT64(*)(void*, void*, void**))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[1]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[1]);
} }
if (symbols_PTRS.twinui_pcshell_PTRS[2] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[2] && symbols_PTRS.twinui_pcshell_PTRS[2] != 0xFFFFFFFF)
{ {
ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc = (INT64(*)(HMENU, HMENU, HWND, unsigned int, void*)) ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc = (INT64(*)(HMENU, HMENU, HWND, unsigned int, void*))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[2]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[2]);
} }
if (symbols_PTRS.twinui_pcshell_PTRS[3] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[3] && symbols_PTRS.twinui_pcshell_PTRS[3] != 0xFFFFFFFF)
{ {
ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc = (void(*)(HMENU, HMENU, HWND)) ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc = (void(*)(HMENU, HMENU, HWND))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[3]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[3]);
} }
if (symbols_PTRS.twinui_pcshell_PTRS[4] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[4] && symbols_PTRS.twinui_pcshell_PTRS[4] != 0xFFFFFFFF)
{ {
CLauncherTipContextMenu_ExecuteShutdownCommandFunc = (void(*)(void*, void*)) CLauncherTipContextMenu_ExecuteShutdownCommandFunc = (void(*)(void*, void*))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[4]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[4]);
} }
if (symbols_PTRS.twinui_pcshell_PTRS[5] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[5] && symbols_PTRS.twinui_pcshell_PTRS[5] != 0xFFFFFFFF)
{ {
CLauncherTipContextMenu_ExecuteCommandFunc = (void(*)(void*, int)) CLauncherTipContextMenu_ExecuteCommandFunc = (void(*)(void*, int))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[5]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[5]);
} }
if (symbols_PTRS.twinui_pcshell_PTRS[6] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[6] && symbols_PTRS.twinui_pcshell_PTRS[6] != 0xFFFFFFFF)
{ {
CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc = (INT64(*)(void*, POINT*)) CLauncherTipContextMenu_ShowLauncherTipContextMenuFunc = (INT64(*)(void*, POINT*))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[6]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[6]);
@ -5496,9 +5590,7 @@ DWORD Inject(BOOL bIsExplorer)
} }
} }
if (symbols_PTRS.twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT - 1] != 0xFFFFFFFF) if (symbols_PTRS.twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT - 1] && symbols_PTRS.twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT - 1] != 0xFFFFFFFF)
{
if (symbols_PTRS.twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT - 1])
{ {
winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc = (INT64(*)(void*, POINT*)) winrt_Windows_Internal_Shell_implementation_MeetAndChatManager_OnMessageFunc = (INT64(*)(void*, POINT*))
((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT - 1]); ((uintptr_t)hTwinuiPcshell + symbols_PTRS.twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT - 1]);
@ -5513,7 +5605,6 @@ DWORD Inject(BOOL bIsExplorer)
return rv; return rv;
} }
} }
}
VnPatchIAT(hTwinuiPcshell, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegGetValueW", twinuipcshell_RegGetValueW); VnPatchIAT(hTwinuiPcshell, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegGetValueW", twinuipcshell_RegGetValueW);
printf("Setup twinui.pcshell functions done\n"); printf("Setup twinui.pcshell functions done\n");
@ -5830,31 +5921,38 @@ void StartMenu_LoadSettings(BOOL bRestartIfChanged)
} }
} }
static INT64(*StartDocked_LauncherFrame_OnVisibilityChangedFunc)(void*, INT64, void*); static INT64(*StartDocked_LauncherFrame_OnVisibilityChangedFunc)(void*, INT64, void*) = NULL;
static INT64(*StartDocked_LauncherFrame_ShowAllAppsFunc)(void* _this); static INT64(*StartDocked_LauncherFrame_ShowAllAppsFunc)(void* _this) = NULL;
INT64 StartDocked_LauncherFrame_OnVisibilityChangedHook(void* _this, INT64 a2, void* VisibilityChangedEventArguments) INT64 StartDocked_LauncherFrame_OnVisibilityChangedHook(void* _this, INT64 a2, void* VisibilityChangedEventArguments)
{ {
INT64 r = StartDocked_LauncherFrame_OnVisibilityChangedFunc(_this, a2, VisibilityChangedEventArguments); INT64 r = 0;
if (StartDocked_LauncherFrame_OnVisibilityChangedFunc)
{
r = StartDocked_LauncherFrame_OnVisibilityChangedFunc(_this, a2, VisibilityChangedEventArguments);
}
if (StartMenu_ShowAllApps) if (StartMenu_ShowAllApps)
{ {
//if (VisibilityChangedEventArguments_GetVisible(VisibilityChangedEventArguments)) //if (VisibilityChangedEventArguments_GetVisible(VisibilityChangedEventArguments))
{
if (StartDocked_LauncherFrame_ShowAllAppsFunc)
{ {
StartDocked_LauncherFrame_ShowAllAppsFunc(_this); StartDocked_LauncherFrame_ShowAllAppsFunc(_this);
} }
} }
}
return r; return r;
} }
INT64(*StartDocked_SystemListPolicyProvider_GetMaximumFrequentAppsFunc)(void*); INT64(*StartDocked_SystemListPolicyProvider_GetMaximumFrequentAppsFunc)(void*) = NULL;
INT64 StartDocked_SystemListPolicyProvider_GetMaximumFrequentAppsHook(void* _this) INT64 StartDocked_SystemListPolicyProvider_GetMaximumFrequentAppsHook(void* _this)
{ {
return StartMenu_maximumFreqApps; return StartMenu_maximumFreqApps;
} }
INT64(*StartDocked_StartSizingFrame_StartSizingFrameFunc)(void* _this); INT64(*StartDocked_StartSizingFrame_StartSizingFrameFunc)(void* _this) = NULL;
INT64 StartDocked_StartSizingFrame_StartSizingFrameHook(void* _this) INT64 StartDocked_StartSizingFrame_StartSizingFrameHook(void* _this)
{ {
@ -6390,12 +6488,12 @@ void InjectStartMenu()
LoadLibraryW(L"StartDocked.dll"); LoadLibraryW(L"StartDocked.dll");
HANDLE hStartDocked = GetModuleHandle(L"StartDocked.dll"); HANDLE hStartDocked = GetModuleHandle(L"StartDocked.dll");
if (dwVal1 != 0xFFFFFFFF) if (dwVal1 && dwVal1 != 0xFFFFFFFF)
{ {
StartDocked_LauncherFrame_ShowAllAppsFunc = (INT64(*)(void*)) StartDocked_LauncherFrame_ShowAllAppsFunc = (INT64(*)(void*))
((uintptr_t)hStartDocked + dwVal1); ((uintptr_t)hStartDocked + dwVal1);
} }
if (dwVal2 != 0xFFFFFFFF) if (dwVal2 && dwVal2 != 0xFFFFFFFF)
{ {
StartDocked_LauncherFrame_OnVisibilityChangedFunc = (INT64(*)(void*, INT64, void*)) StartDocked_LauncherFrame_OnVisibilityChangedFunc = (INT64(*)(void*, INT64, void*))
((uintptr_t)hStartDocked + dwVal2); ((uintptr_t)hStartDocked + dwVal2);
@ -6410,7 +6508,7 @@ void InjectStartMenu()
return rv; return rv;
} }
} }
if (dwVal3 != 0xFFFFFFFF) if (dwVal3 && dwVal3 != 0xFFFFFFFF)
{ {
StartDocked_SystemListPolicyProvider_GetMaximumFrequentAppsFunc = (INT64(*)(void*, INT64, void*)) StartDocked_SystemListPolicyProvider_GetMaximumFrequentAppsFunc = (INT64(*)(void*, INT64, void*))
((uintptr_t)hStartDocked + dwVal3); ((uintptr_t)hStartDocked + dwVal3);
@ -6425,7 +6523,7 @@ void InjectStartMenu()
return rv; return rv;
} }
} }
if (dwVal4 != 0xFFFFFFFF) if (dwVal4 && dwVal4 != 0xFFFFFFFF)
{ {
/*StartDocked_StartSizingFrame_StartSizingFrameFunc = (INT64(*)(void*, INT64, void*)) /*StartDocked_StartSizingFrame_StartSizingFrameFunc = (INT64(*)(void*, INT64, void*))
((uintptr_t)hStartDocked + dwVal4); ((uintptr_t)hStartDocked + dwVal4);

2
ExplorerPatcher/settings.reg

@ -364,6 +364,8 @@
;d Enable SysListView32 for Explorer views * ;d Enable SysListView32 for Explorer views *
@="" @=""
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher]
;b Enable symbols download *
"EnableSymbolDownload"=dword:00000000
;i Do not hook Start menu from main Explorer process (permanently disabled) * ;i Do not hook Start menu from main Explorer process (permanently disabled) *
"HookStartMenu"=dword:00000001 "HookStartMenu"=dword:00000001
;c 12 Supplementary delay at logon * ;c 12 Supplementary delay at logon *

6
version.h

@ -1,7 +1,7 @@
#define VER_MAJOR 22000 #define VER_MAJOR 22000
#define VER_MINOR 318 #define VER_MINOR 318
#define VER_BUILD_HI 38 #define VER_BUILD_HI 38
#define VER_BUILD_LO 6 #define VER_BUILD_LO 7
#define VER_FLAGS VS_FF_PRERELEASE #define VER_FLAGS VS_FF_PRERELEASE
@ -12,5 +12,5 @@
#define VER_STR(arg) #arg #define VER_STR(arg) #arg
// The String form of the version numbers // The String form of the version numbers
#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.6" #define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.7"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.6" #define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.7"

Loading…
Cancel
Save