ChildAccountService: get service flags from AccountTrackerService instead of fetching...
[chromium-blink-merge.git] / sandbox / win / sandbox_win.gypi
blobe085cfb5efe2231a3e94d2526aec959cea777399
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
3 # found in the LICENSE file.
6   'target_defaults': {
7     'variables': {
8       'sandbox_windows_target': 0,
9       'target_arch%': 'ia32',
10     },
11     'target_conditions': [
12       ['sandbox_windows_target==1', {
13         # Files that are shared between the 32-bit and the 64-bit versions
14         # of the Windows sandbox library.
15         'sources': [
16             'src/acl.cc',
17             'src/acl.h',
18             'src/app_container.cc',
19             'src/app_container.h',
20             'src/broker_services.cc',
21             'src/broker_services.h',
22             'src/crosscall_client.h',
23             'src/crosscall_params.h',
24             'src/crosscall_server.cc',
25             'src/crosscall_server.h',
26             'src/eat_resolver.cc',
27             'src/eat_resolver.h',
28             'src/filesystem_dispatcher.cc',
29             'src/filesystem_dispatcher.h',
30             'src/filesystem_interception.cc',
31             'src/filesystem_interception.h',
32             'src/filesystem_policy.cc',
33             'src/filesystem_policy.h',
34             'src/handle_closer.cc',
35             'src/handle_closer.h',
36             'src/handle_closer_agent.cc',
37             'src/handle_closer_agent.h',
38             'src/handle_dispatcher.cc',
39             'src/handle_dispatcher.h',
40             'src/handle_interception.cc',
41             'src/handle_interception.h',
42             'src/handle_policy.cc',
43             'src/handle_policy.h',
44             'src/handle_table.cc',
45             'src/handle_table.h',
46             'src/interception.cc',
47             'src/interception.h',
48             'src/interception_agent.cc',
49             'src/interception_agent.h',
50             'src/interception_internal.h',
51             'src/interceptors.h',
52             'src/internal_types.h',
53             'src/ipc_tags.h',
54             'src/job.cc',
55             'src/job.h',
56             'src/named_pipe_dispatcher.cc',
57             'src/named_pipe_dispatcher.h',
58             'src/named_pipe_interception.cc',
59             'src/named_pipe_interception.h',
60             'src/named_pipe_policy.cc',
61             'src/named_pipe_policy.h',
62             'src/nt_internals.h',
63             'src/policy_broker.cc',
64             'src/policy_broker.h',
65             'src/policy_engine_opcodes.cc',
66             'src/policy_engine_opcodes.h',
67             'src/policy_engine_params.h',
68             'src/policy_engine_processor.cc',
69             'src/policy_engine_processor.h',
70             'src/policy_low_level.cc',
71             'src/policy_low_level.h',
72             'src/policy_params.h',
73             'src/policy_target.cc',
74             'src/policy_target.h',
75             'src/process_mitigations.cc',
76             'src/process_mitigations.h',
77             'src/process_mitigations_win32k_dispatcher.cc',
78             'src/process_mitigations_win32k_dispatcher.h',
79             'src/process_mitigations_win32k_interception.cc',
80             'src/process_mitigations_win32k_interception.h',
81             'src/process_mitigations_win32k_policy.cc',
82             'src/process_mitigations_win32k_policy.h',
83             'src/process_thread_dispatcher.cc',
84             'src/process_thread_dispatcher.h',
85             'src/process_thread_interception.cc',
86             'src/process_thread_interception.h',
87             'src/process_thread_policy.cc',
88             'src/process_thread_policy.h',
89             'src/registry_dispatcher.cc',
90             'src/registry_dispatcher.h',
91             'src/registry_interception.cc',
92             'src/registry_interception.h',
93             'src/registry_policy.cc',
94             'src/registry_policy.h',
95             'src/resolver.cc',
96             'src/resolver.h',
97             'src/restricted_token_utils.cc',
98             'src/restricted_token_utils.h',
99             'src/restricted_token.cc',
100             'src/restricted_token.h',
101             'src/sandbox_factory.h',
102             'src/sandbox_globals.cc',
103             'src/sandbox_nt_types.h',
104             'src/sandbox_nt_util.cc',
105             'src/sandbox_nt_util.h',
106             'src/sandbox_policy_base.cc',
107             'src/sandbox_policy_base.h',
108             'src/sandbox_policy.h',
109             'src/sandbox_types.h',
110             'src/sandbox_utils.cc',
111             'src/sandbox_utils.h',
112             'src/sandbox.cc',
113             'src/sandbox.h',
114             'src/security_level.h',
115             'src/service_resolver.cc',
116             'src/service_resolver.h',
117             'src/shared_handles.cc',
118             'src/shared_handles.h',
119             'src/sharedmem_ipc_client.cc',
120             'src/sharedmem_ipc_client.h',
121             'src/sharedmem_ipc_server.cc',
122             'src/sharedmem_ipc_server.h',
123             'src/sid.cc',
124             'src/sid.h',
125             'src/sync_dispatcher.cc',
126             'src/sync_dispatcher.h',
127             'src/sync_interception.cc',
128             'src/sync_interception.h',
129             'src/sync_policy.cc',
130             'src/sync_policy.h',
131             'src/target_interceptions.cc',
132             'src/target_interceptions.h',
133             'src/target_process.cc',
134             'src/target_process.h',
135             'src/target_services.cc',
136             'src/target_services.h',
137             'src/win_utils.cc',
138             'src/win_utils.h',
139             'src/win2k_threadpool.cc',
140             'src/win2k_threadpool.h',
141             'src/window.cc',
142             'src/window.h',
143         ],
144         'target_conditions': [
145           ['target_arch=="x64"', {
146             'sources': [
147               'src/interceptors_64.cc',
148               'src/interceptors_64.h',
149               'src/resolver_64.cc',
150               'src/service_resolver_64.cc',
151               'src/Wow64_64.cc',
152             ],
153           }],
154           ['target_arch=="ia32"', {
155             'sources': [
156               'src/resolver_32.cc',
157               'src/service_resolver_32.cc',
158               'src/sidestep_resolver.cc',
159               'src/sidestep_resolver.h',
160               'src/sidestep\ia32_modrm_map.cpp',
161               'src/sidestep\ia32_opcode_map.cpp',
162               'src/sidestep\mini_disassembler_types.h',
163               'src/sidestep\mini_disassembler.cpp',
164               'src/sidestep\mini_disassembler.h',
165               'src/sidestep\preamble_patcher_with_stub.cpp',
166               'src/sidestep\preamble_patcher.h',
167               'src/Wow64.cc',
168               'src/Wow64.h',
169             ],
170           }],
171         ],
172       }],
173     ],
174   },
175   'targets': [
176     {
177       'target_name': 'sandbox',
178       'type': 'static_library',
179       'variables': {
180         'sandbox_windows_target': 1,
181       },
182       'dependencies': [
183         '../base/base.gyp:base',
184         '../base/base.gyp:base_static',
185       ],
186       'export_dependent_settings': [
187         '../base/base.gyp:base',
188       ],
189       'include_dirs': [
190         '../..',
191       ],
192       'direct_dependent_settings': {
193         'include_dirs': [
194           'src',
195           '../..',
196         ],
197       },
198       'target_conditions': [
199         ['target_arch=="ia32"', {
200           'copies': [
201             {
202               'destination': '<(PRODUCT_DIR)',
203               'files': [
204                 'wow_helper/wow_helper.exe',
205                 'wow_helper/wow_helper.pdb',
206               ],
207             },
208           ],
209         }],
210       ],
211     },
212     {
213       'target_name': 'sbox_integration_tests',
214       'type': 'executable',
215       'dependencies': [
216         'sandbox',
217         '../base/base.gyp:test_support_base',
218         '../testing/gtest.gyp:gtest',
219       ],
220       'sources': [
221         'src/address_sanitizer_test.cc',
222         'src/app_container_test.cc',
223         'src/file_policy_test.cc',
224         'src/handle_inheritance_test.cc',
225         'src/handle_policy_test.cc',
226         'tests/integration_tests/integration_tests_test.cc',
227         'src/handle_closer_test.cc',
228         'src/integrity_level_test.cc',
229         'src/ipc_ping_test.cc',
230         'src/named_pipe_policy_test.cc',
231         'src/policy_target_test.cc',
232         'src/process_mitigations_test.cc',
233         'src/process_policy_test.cc',
234         'src/registry_policy_test.cc',
235         'src/sync_policy_test.cc',
236         'src/sync_policy_test.h',
237         'src/unload_dll_test.cc',
238         'tests/common/controller.cc',
239         'tests/common/controller.h',
240         'tests/common/test_utils.cc',
241         'tests/common/test_utils.h',
242         'tests/integration_tests/integration_tests.cc',
243       ],
244     },
245     {
246       'target_name': 'sbox_validation_tests',
247       'type': 'executable',
248       'dependencies': [
249         'sandbox',
250         '../base/base.gyp:test_support_base',
251         '../testing/gtest.gyp:gtest',
252       ],
253       'sources': [
254         'tests/common/controller.cc',
255         'tests/common/controller.h',
256         'tests/validation_tests/unit_tests.cc',
257         'tests/validation_tests/commands.cc',
258         'tests/validation_tests/commands.h',
259         'tests/validation_tests/suite.cc',
260       ],
261     },
262     {
263       'target_name': 'sbox_unittests',
264       'type': 'executable',
265       'dependencies': [
266         'sandbox',
267         '../base/base.gyp:test_support_base',
268         '../testing/gtest.gyp:gtest',
269       ],
270       'sources': [
271         'src/app_container_unittest.cc',
272         'src/interception_unittest.cc',
273         'src/service_resolver_unittest.cc',
274         'src/restricted_token_unittest.cc',
275         'src/job_unittest.cc',
276         'src/sid_unittest.cc',
277         'src/policy_engine_unittest.cc',
278         'src/policy_low_level_unittest.cc',
279         'src/policy_opcodes_unittest.cc',
280         'src/ipc_unittest.cc',
281         'src/threadpool_unittest.cc',
282         'src/win_utils_unittest.cc',
283         'tests/common/test_utils.cc',
284         'tests/common/test_utils.h',
285         'tests/unit_tests/unit_tests.cc',
286       ],
287     },
288     {
289       'target_name': 'sandbox_poc',
290       'type': 'executable',
291       'dependencies': [
292         'sandbox',
293         'pocdll',
294       ],
295       'sources': [
296         'sandbox_poc/main_ui_window.cc',
297         'sandbox_poc/main_ui_window.h',
298         'sandbox_poc/resource.h',
299         'sandbox_poc/sandbox.cc',
300         'sandbox_poc/sandbox.h',
301         'sandbox_poc/sandbox.ico',
302         'sandbox_poc/sandbox.rc',
303       ],
304       'link_settings': {
305         'libraries': [
306           '-lcomctl32.lib',
307         ],
308       },
309       'msvs_settings': {
310         'VCLinkerTool': {
311           'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
312         },
313       },
314     },
315     {
316       'target_name': 'pocdll',
317       'type': 'shared_library',
318       'sources': [
319         'sandbox_poc/pocdll/exports.h',
320         'sandbox_poc/pocdll/fs.cc',
321         'sandbox_poc/pocdll/handles.cc',
322         'sandbox_poc/pocdll/invasive.cc',
323         'sandbox_poc/pocdll/network.cc',
324         'sandbox_poc/pocdll/pocdll.cc',
325         'sandbox_poc/pocdll/processes_and_threads.cc',
326         'sandbox_poc/pocdll/registry.cc',
327         'sandbox_poc/pocdll/spyware.cc',
328         'sandbox_poc/pocdll/utils.h',
329       ],
330       'defines': [
331         'POCDLL_EXPORTS',
332       ],
333       'include_dirs': [
334         '../..',
335       ],
336     },
337   ],
338   'conditions': [
339     ['OS=="win" and target_arch=="ia32"', {
340       'targets': [
341         {
342           'target_name': 'sandbox_win64',
343           'type': 'static_library',
344           'variables': {
345             'sandbox_windows_target': 1,
346             'target_arch': 'x64',
347           },
348           'dependencies': [
349             '../base/base.gyp:base_win64',
350             '../base/base.gyp:base_static_win64',
351           ],
352           'configurations': {
353             'Common_Base': {
354               'msvs_target_platform': 'x64',
355             },
356           },
357           'include_dirs': [
358             '../..',
359           ],
360           'direct_dependent_settings': {
361             'include_dirs': [
362               'src',
363               '../..',
364             ],
365           },
366           'defines': [
367             '<@(nacl_win64_defines)',
368           ]
369         },
370       ],
371     }],
372   ],