Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: sandbox/win/src/window.cc

Issue 2193603004: Ignore desktop creation errors in the sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/window.cc
diff --git a/sandbox/win/src/window.cc b/sandbox/win/src/window.cc
index af834ca590463ad6ba6a35e32c234b1249683943..9bdf50f1adc3c6d7ae1b30d59d9e345d4eb38f8f 100644
--- a/sandbox/win/src/window.cc
+++ b/sandbox/win/src/window.cc
@@ -46,10 +46,14 @@ ResultCode CreateAltWindowStation(HWINSTA* winsta) {
if (!GetSecurityAttributes(current_winsta, &attributes))
return SBOX_ERROR_CANNOT_QUERY_WINSTATION_SECURITY;
- // Create the window station using NULL for the name to ask the os to
+ // Create the window station using nullptr for the name to ask the os to
// generate it.
*winsta = ::CreateWindowStationW(
- NULL, 0, GENERIC_READ | WINSTA_CREATEDESKTOP, &attributes);
+ nullptr, 0, GENERIC_READ | WINSTA_CREATEDESKTOP, &attributes);
+ if (*winsta == nullptr && ::GetLastError() == ERROR_ACCESS_DENIED) {
+ *winsta = ::CreateWindowStationW(
+ nullptr, 0, WINSTA_READATTRIBUTES | WINSTA_CREATEDESKTOP, &attributes);
+ }
LocalFree(attributes.lpSecurityDescriptor);
if (*winsta)
« no previous file with comments | « content/common/sandbox_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698