[Installer]Upgrade to Windows App SDK 1.1.0 (#18603)

* Move to WinAppSDK-1.1.0

* expect.txt

* Revert "[Settings]Don't launch if explorer is running elevated"

This reverts commit c485da2816.

* Make copyright header analyze suppression module scope
This commit is contained in:
Stefan Markovic
2022-06-05 00:30:34 +02:00
committed by GitHub
parent 29f0ae0395
commit 7a7d025956
13 changed files with 118 additions and 83 deletions

View File

@@ -83,7 +83,7 @@ namespace
inline bool GetDesktopAutomationObject(REFIID riid, void** ppv)
{
CComPtr<IShellView> spsv;
// Desktop may not be available on startup
auto attempts = 5;
for (auto i = 1; i <= attempts; i++)
@@ -492,31 +492,4 @@ inline bool check_user_is_admin()
freeMemory(pSID, pGroupInfo);
return false;
}
inline bool is_process_of_window_elevated(HWND window)
{
DWORD pid = 0;
GetWindowThreadProcessId(window, &pid);
if (!pid)
{
return false;
}
wil::unique_handle hProcess{ OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION,
FALSE,
pid) };
wil::unique_handle token;
if (OpenProcessToken(hProcess.get(), TOKEN_QUERY, &token))
{
TOKEN_ELEVATION elevation;
DWORD size;
if (GetTokenInformation(token.get(), TokenElevation, &elevation, sizeof(elevation), &size))
{
return elevation.TokenIsElevated != 0;
}
}
return false;
}
}