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

Side by Side Diff: sandbox/win/tests/validation_tests/commands.cc

Issue 543003002: Fix sbox_validation_tests for Server 2012R2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <Aclapi.h> 5 #include <Aclapi.h>
6 #include <windows.h> 6 #include <windows.h>
7 #include <string> 7 #include <string>
8 8
9 #include "sandbox/win/tests/validation_tests/commands.h" 9 #include "sandbox/win/tests/validation_tests/commands.h"
10 10
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 HDESK desktop = ::GetThreadDesktop(::GetCurrentThreadId()); 260 HDESK desktop = ::GetThreadDesktop(::GetCurrentThreadId());
261 if (desktop) { 261 if (desktop) {
262 HANDLE test_handle; 262 HANDLE test_handle;
263 if (::DuplicateHandle(::GetCurrentProcess(), desktop, 263 if (::DuplicateHandle(::GetCurrentProcess(), desktop,
264 ::GetCurrentProcess(), &test_handle, 264 ::GetCurrentProcess(), &test_handle,
265 WRITE_DAC, FALSE, 0)) { 265 WRITE_DAC, FALSE, 0)) {
266 DWORD result = ::SetSecurityInfo(test_handle, SE_WINDOW_OBJECT, 266 DWORD result = ::SetSecurityInfo(test_handle, SE_WINDOW_OBJECT,
267 DACL_SECURITY_INFORMATION, NULL, NULL, 267 DACL_SECURITY_INFORMATION, NULL, NULL,
268 NULL, NULL); 268 NULL, NULL);
269 ::CloseHandle(test_handle); 269 ::CloseHandle(test_handle);
270 if (result != ERROR_ACCESS_DENIED) { 270 if (result == ERROR_SUCCESS) {
271 return SBOX_TEST_SUCCEEDED; 271 return SBOX_TEST_SUCCEEDED;
272 } 272 }
273 } else if (::GetLastError() != ERROR_ACCESS_DENIED) { 273 } else if (::GetLastError() != ERROR_ACCESS_DENIED) {
274 return SBOX_TEST_FAILED; 274 return SBOX_TEST_FAILED;
275 } 275 }
276 } 276 }
277 277
278 // Open by name with WRITE_DAC. 278 // Open by name with WRITE_DAC.
279 desktop = ::OpenDesktop(desktop_name, 0, FALSE, WRITE_DAC); 279 desktop = ::OpenDesktop(desktop_name, 0, FALSE, WRITE_DAC);
280 if (desktop || ::GetLastError() != ERROR_ACCESS_DENIED) { 280 if (desktop || ::GetLastError() != ERROR_ACCESS_DENIED) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 if (!::VirtualFree(memory, 0, MEM_RELEASE)) 326 if (!::VirtualFree(memory, 0, MEM_RELEASE))
327 return SBOX_TEST_FAILED; 327 return SBOX_TEST_FAILED;
328 328
329 return SBOX_TEST_SUCCEEDED; 329 return SBOX_TEST_SUCCEEDED;
330 } 330 }
331 331
332 332
333 } // namespace sandbox 333 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698