Skip to content

Commit

Permalink
[ZoomIt]React to gpo setting when run as standalone (microsoft#36975)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo authored and daverayment committed Jan 26, 2025
1 parent e3e32fa commit 7b477d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/modules/ZoomIt/ZoomIt/Zoomit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7416,19 +7416,19 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
if( !ShowEula( APPNAME, NULL, NULL )) return 1;

#ifdef __ZOOMIT_POWERTOYS__
if (powertoys_gpo::getConfiguredZoomItEnabledValue() == powertoys_gpo::gpo_rule_configured_disabled)
{
Logger::warn(L"Tried to start with a GPO policy setting the utility to always be disabled. Please contact your systems administrator.");
return 1;
}

Shared::Trace::ETWTrace* trace = nullptr;
std::wstring pid = std::wstring(lpCmdLine); // The PowerToys pid is the argument to the process.
auto mainThreadId = GetCurrentThreadId();
if (!pid.empty())
{
g_StartedByPowerToys = TRUE;

if (powertoys_gpo::getConfiguredZoomItEnabledValue() == powertoys_gpo::gpo_rule_configured_disabled)
{
Logger::warn(L"Tried to start with a GPO policy setting the utility to always be disabled. Please contact your systems administrator.");
return 1;
}

trace = new Shared::Trace::ETWTrace();
Trace::RegisterProvider();
trace->UpdateState(true);
Expand Down

0 comments on commit 7b477d1

Please sign in to comment.