Skip to content

Commit

Permalink
The finishing touches to get sandbox working post-Vista
Browse files Browse the repository at this point in the history
  • Loading branch information
win32ss committed May 12, 2023
1 parent 28fbe78 commit f342b49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions base/win/win_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ void __cdecl ForceCrashOnSigAbort(int) {
*((volatile int*)nullptr) = 0x1337;
}

// Returns the current platform role. We use the PowerDeterminePlatformRoleEx
// Returns the current platform role. We use the PowerDeterminePlatformRole
// API for that.
POWER_PLATFORM_ROLE GetPlatformRole() {
return PowerDeterminePlatformRoleEx(POWER_PLATFORM_ROLE_V2);
return PowerDeterminePlatformRole();
}

// Because we used to support versions earlier than 8.1, we dynamically load
Expand Down
6 changes: 5 additions & 1 deletion sandbox/win/src/broker_services.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,11 @@ ResultCode BrokerServicesBase::SpawnTarget(const wchar_t* exe_path,
if (container)
startup_info->SetAppContainer(container);

startup_info->AddJobToAssociate(policy_base->GetJobHandle());
// On Win10, jobs are associated via startup_info.
if (base::win::GetVersion() >= base::win::Version::WIN10 &&
policy_base->HasJob()) {
startup_info->AddJobToAssociate(policy_base->GetJobHandle());
}

if (!startup_info->BuildStartupInformation())
return SBOX_ERROR_PROC_THREAD_ATTRIBUTES;
Expand Down

0 comments on commit f342b49

Please sign in to comment.