nacl_main_platform_delegate_win.cc 790 B

1234567891011121314151617181920212223
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/nacl/loader/nacl_main_platform_delegate.h"
  5. #include "base/check.h"
  6. #include "content/public/common/main_function_params.h"
  7. #include "sandbox/win/src/sandbox.h"
  8. void NaClMainPlatformDelegate::EnableSandbox(
  9. const content::MainFunctionParams& parameters) {
  10. sandbox::TargetServices* target_services =
  11. parameters.sandbox_info->target_services;
  12. CHECK(target_services) << "NaCl-Win EnableSandbox: No Target Services!";
  13. // Cause advapi32 to load before the sandbox is turned on.
  14. unsigned int dummy_rand;
  15. rand_s(&dummy_rand);
  16. // Turn the sandbox on.
  17. target_services->LowerToken();
  18. }