Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improving the grammar of this code comment.
  • Loading branch information
Nonary authored and ReenigneArcher committed Mar 27, 2023
commit 45983bb0559b34531a9bac3907c6189e4d7022e9
9 changes: 4 additions & 5 deletions src/platform/windows/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,10 @@ bp::child run_unprivileged(const std::string &cmd, boost::filesystem::path &work
std::wstring elevated_command = L"tools\\elevator.exe ";
elevated_command += wcmd;

// For security reasons, Windows enforces that an application can only have one "interactive thread," responsible for processing input from the user and managing the user interface (UI).
// Since UAC prompts are interactive, we can't have a UAC prompt while Sunshine is already running because it would block the thread.
// To workaround this issue, we will launch a separate process that will elevate the command which will prompt for user to confirm the elevation.
// This is our intended behavior, to require interaction before elevating the command.

// For security reasons, Windows enforces that an application can have only one "interactive thread" responsible for processing user input and managing the user interface (UI).
// Since UAC prompts are interactive, we cannot have a UAC prompt while Sunshine is already running because it would block the thread.
// To work around this issue, we will launch a separate process that will elevate the command, which will prompt the user to confirm the elevation.
// This is our intended behavior: to require interaction before elevating the command.
ret = CreateProcessAsUserW(shell_token,
NULL,
(LPWSTR)elevated_command.c_str(),
Expand Down