Skip to content

Commit

Permalink
22000.318.38.1: Fixed valinet#410
Browse files Browse the repository at this point in the history
  • Loading branch information
valinet committed Nov 18, 2021
1 parent aff330c commit 033ad03
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and r
* Functional Windows 10 network flyout
* Functional Windows 10 battery flyout
* Implemented support for Windows 7 battery flyout (#274)
* Implemented `/extract` switch which unpacks the files from `ep_setup.exe` to disk (#396):
* Implemented `/extract` switch which unpacks the files from `ep_setup.exe` to disk (#396) (.1):
* `ep_setup /extract` - extracts `ExplorerPatcher.IA-32.dll` and `ExplorerPatcher.amd64.dll` to current directory
* `ep-setup /extract test` - extracts to `test` folder in current directory
* `ep-setup /extract "C:\test with space"` - extracts to `C:\test with space` directory
Expand All @@ -22,6 +22,10 @@ Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and r
* Improved reliability when invoking Control Center (`Win`+`A`) when the taskbar icon is disabled (the icon should now not reappear anymore sometimes) (#242)
* Small reorganization of some options in "Properties"

#### Fixes

* Windows 10 network and battery flyout should now always launch when the tray icon is clicked (#410) (.1)

## 22000.318.37

Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and release preview channels).
Expand Down
21 changes: 19 additions & 2 deletions ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@ POINT GetDefaultWinXPosition(BOOL bUseRcWork, BOOL* lpBottom, BOOL* lpRight, BOO
return point;
}

void TerminateShellExperienceHost()
BOOL TerminateShellExperienceHost()
{
BOOL bRet = FALSE;
WCHAR wszKnownPath[MAX_PATH];
GetWindowsDirectoryW(wszKnownPath, MAX_PATH);
wcscat_s(wszKnownPath, MAX_PATH, L"\\SystemApps\\ShellExperienceHost_cw5n1h2txyewy\\ShellExperienceHost.exe");
Expand Down Expand Up @@ -500,6 +501,7 @@ void TerminateShellExperienceHost()
if (!_wcsicmp(wszProcessPath, wszKnownPath))
{
TerminateProcess(hProcess, 0);
bRet = TRUE;
}
CloseHandle(hProcess);
hProcess = NULL;
Expand All @@ -511,6 +513,7 @@ void TerminateShellExperienceHost()
CloseHandle(hSnapshot);
}
}
return bRet;
}

long long elapsedCheckForeground = 0;
Expand Down Expand Up @@ -546,6 +549,7 @@ DWORD CheckForegroundThread(DWORD dwMode)
{
RegDeleteKeyW(HKEY_CURRENT_USER, _T(SEH_REGPATH));
TerminateShellExperienceHost();
Sleep(100);
}
printf("Ended \"Check foreground window\" thread.\n");
return 0;
Expand Down Expand Up @@ -2498,6 +2502,10 @@ HRESULT stobject_CoCreateInstanceHook(
{
if (hCheckForegroundThread)
{
if (WaitForSingleObject(hCheckForegroundThread, 0) == WAIT_TIMEOUT)
{
return E_NOINTERFACE;
}
WaitForSingleObject(hCheckForegroundThread, INFINITE);
CloseHandle(hCheckForegroundThread);
hCheckForegroundThread = NULL;
Expand All @@ -2518,6 +2526,8 @@ HRESULT stobject_CoCreateInstanceHook(
RegCloseKey(hKey);
}
TerminateShellExperienceHost();
InvokeFlyout(0, INVOKE_FLYOUT_BATTERY);
Sleep(100);
hCheckForegroundThread = CreateThread(
0,
0,
Expand Down Expand Up @@ -2596,6 +2606,10 @@ HRESULT pnidui_CoCreateInstanceHook(
{
if (hCheckForegroundThread)
{
if (WaitForSingleObject(hCheckForegroundThread, 0) == WAIT_TIMEOUT)
{
return E_NOINTERFACE;
}
WaitForSingleObject(hCheckForegroundThread, INFINITE);
CloseHandle(hCheckForegroundThread);
hCheckForegroundThread = NULL;
Expand All @@ -2616,6 +2630,8 @@ HRESULT pnidui_CoCreateInstanceHook(
RegCloseKey(hKey);
}
TerminateShellExperienceHost();
InvokeFlyout(0, INVOKE_FLYOUT_NETWORK);
Sleep(100);
hCheckForegroundThread = CreateThread(
0,
0,
Expand Down Expand Up @@ -6290,10 +6306,11 @@ void InjectShellExperienceHost()
{
#ifdef _WIN64
HKEY hKey;
if (RegOpenKeyW(HKEY_CURRENT_USER, _T(SEH_REGPATH), &hKey))
if (RegOpenKeyW(HKEY_CURRENT_USER, _T(SEH_REGPATH), &hKey) != ERROR_SUCCESS)
{
return;
}
RegCloseKey(hKey);
HMODULE hQA = LoadLibraryW(L"Windows.UI.QuickActions.dll");
if (hQA)
{
Expand Down
6 changes: 3 additions & 3 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define VER_MAJOR 22000
#define VER_MINOR 318
#define VER_BUILD_HI 38
#define VER_BUILD_LO 0
#define VER_BUILD_LO 1
#define VER_FLAGS VS_FF_PRERELEASE


Expand All @@ -12,5 +12,5 @@
#define VER_STR(arg) #arg

// The String form of the version numbers
#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.0"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.0"
#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.1"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.1"

0 comments on commit 033ad03

Please sign in to comment.