| OLD | NEW |
| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 ::CloseHandle(test_handle); | 269 ::CloseHandle(test_handle); |
| 270 if (result != ERROR_ACCESS_DENIED) { | 270 if (result != ERROR_ACCESS_DENIED) { |
| 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 if ((desktop = ::OpenDesktop(desktop_name, 0, FALSE, WRITE_DAC)) || | 279 desktop = ::OpenDesktop(desktop_name, 0, FALSE, WRITE_DAC); |
| 280 ::GetLastError() != ERROR_ACCESS_DENIED) { | 280 if (desktop || ::GetLastError() != ERROR_ACCESS_DENIED) { |
| 281 ::CloseDesktop(desktop); | 281 ::CloseDesktop(desktop); |
| 282 return SBOX_TEST_SUCCEEDED; | 282 return SBOX_TEST_SUCCEEDED; |
| 283 } | 283 } |
| 284 | 284 |
| 285 return SBOX_TEST_DENIED; | 285 return SBOX_TEST_DENIED; |
| 286 } | 286 } |
| 287 | 287 |
| 288 BOOL CALLBACK DesktopTestEnumProc(LPTSTR desktop_name, LPARAM result) { | 288 BOOL CALLBACK DesktopTestEnumProc(LPTSTR desktop_name, LPARAM result) { |
| 289 return TRUE; | 289 return TRUE; |
| 290 } | 290 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |