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

Side by Side Diff: sandbox/win/src/process_mitigations_win32k_dispatcher.cc

Issue 1460903002: Unify PolicyBase into TargetPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy_dispatcher
Patch Set: Rebase. Created 5 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sandbox/win/src/process_mitigations_win32k_dispatcher.h" 5 #include "sandbox/win/src/process_mitigations_win32k_dispatcher.h"
6 #include "sandbox/win/src/interception.h" 6 #include "sandbox/win/src/interception.h"
7 #include "sandbox/win/src/interceptors.h" 7 #include "sandbox/win/src/interceptors.h"
8 #include "sandbox/win/src/ipc_tags.h" 8 #include "sandbox/win/src/ipc_tags.h"
9 #include "sandbox/win/src/process_mitigations_win32k_interception.h" 9 #include "sandbox/win/src/process_mitigations_win32k_interception.h"
10 10
11 namespace sandbox { 11 namespace sandbox {
12 12
13 ProcessMitigationsWin32KDispatcher::ProcessMitigationsWin32KDispatcher( 13 ProcessMitigationsWin32KDispatcher::ProcessMitigationsWin32KDispatcher(
14 PolicyBase* policy_base) 14 TargetPolicy* policy)
15 : policy_base_(policy_base) { 15 : policy_(policy) {}
16 }
17 16
18 bool ProcessMitigationsWin32KDispatcher::SetupService( 17 bool ProcessMitigationsWin32KDispatcher::SetupService(
19 InterceptionManager* manager, int service) { 18 InterceptionManager* manager, int service) {
20 if (!(policy_base_->GetProcessMitigations() & 19 if (!(policy_->GetProcessMitigations() &
21 sandbox::MITIGATION_WIN32K_DISABLE)) { 20 sandbox::MITIGATION_WIN32K_DISABLE)) {
22 return false; 21 return false;
23 } 22 }
24 23
25 switch (service) { 24 switch (service) {
26 case IPC_GDI_GDIDLLINITIALIZE_TAG: { 25 case IPC_GDI_GDIDLLINITIALIZE_TAG: {
27 if (!INTERCEPT_EAT(manager, L"gdi32.dll", GdiDllInitialize, 26 if (!INTERCEPT_EAT(manager, L"gdi32.dll", GdiDllInitialize,
28 GDIINITIALIZE_ID, 12)) { 27 GDIINITIALIZE_ID, 12)) {
29 return false; 28 return false;
30 } 29 }
(...skipping 17 matching lines...) Expand all
48 } 47 }
49 48
50 default: 49 default:
51 break; 50 break;
52 } 51 }
53 return false; 52 return false;
54 } 53 }
55 54
56 } // namespace sandbox 55 } // namespace sandbox
57 56
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698