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 "chrome_frame/test/chrome_frame_test_utils.h" | 5 #include "chrome_frame/test/chrome_frame_test_utils.h" |
6 | 6 |
7 #include <atlapp.h> | 7 #include <atlapp.h> |
8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
10 #include <sddl.h> | 10 #include <sddl.h> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // Create impersonation low integrity token. | 311 // Create impersonation low integrity token. |
312 HANDLE impersonation_token_handle = NULL; | 312 HANDLE impersonation_token_handle = NULL; |
313 ok = ::DuplicateTokenEx(process_token, | 313 ok = ::DuplicateTokenEx(process_token, |
314 TOKEN_QUERY | TOKEN_IMPERSONATE | TOKEN_ADJUST_DEFAULT, NULL, | 314 TOKEN_QUERY | TOKEN_IMPERSONATE | TOKEN_ADJUST_DEFAULT, NULL, |
315 SecurityImpersonation, TokenImpersonation, &impersonation_token_handle); | 315 SecurityImpersonation, TokenImpersonation, &impersonation_token_handle); |
316 if (!ok) { | 316 if (!ok) { |
317 LOG(ERROR) << "::DuplicateTokenEx failed: " << GetLastError(); | 317 LOG(ERROR) << "::DuplicateTokenEx failed: " << GetLastError(); |
318 return ok; | 318 return ok; |
319 } | 319 } |
320 | 320 |
321 // TODO(stoyan): sandbox/src/restricted_token_utils.cc has | 321 // TODO(stoyan): sandbox/win/src/restricted_token_utils.cc has |
322 // SetTokenIntegrityLevel function already. | 322 // SetTokenIntegrityLevel function already. |
323 base::win::ScopedHandle impersonation_token(impersonation_token_handle); | 323 base::win::ScopedHandle impersonation_token(impersonation_token_handle); |
324 PSID integrity_sid = NULL; | 324 PSID integrity_sid = NULL; |
325 TOKEN_MANDATORY_LABEL tml = {0}; | 325 TOKEN_MANDATORY_LABEL tml = {0}; |
326 ok = ::ConvertStringSidToSid(SDDL_ML_LOW, &integrity_sid); | 326 ok = ::ConvertStringSidToSid(SDDL_ML_LOW, &integrity_sid); |
327 if (!ok) { | 327 if (!ok) { |
328 LOG(ERROR) << "::ConvertStringSidToSid failed: " << GetLastError(); | 328 LOG(ERROR) << "::ConvertStringSidToSid failed: " << GetLastError(); |
329 return ok; | 329 return ok; |
330 } | 330 } |
331 | 331 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 if (address.empty()) { | 700 if (address.empty()) { |
701 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " | 701 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " |
702 << "run over the loopback adapter, which may result in hangs."; | 702 << "run over the loopback adapter, which may result in hangs."; |
703 address.assign("127.0.0.1"); | 703 address.assign("127.0.0.1"); |
704 } | 704 } |
705 | 705 |
706 return address; | 706 return address; |
707 } | 707 } |
708 | 708 |
709 } // namespace chrome_frame_test | 709 } // namespace chrome_frame_test |
OLD | NEW |