Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / sandbox / win / BUILD.gn
blob3063f7f17d7027056fa5ac4b49415e0f5b7f922c
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
3 # found in the LICENSE file.
5 import("//testing/test.gni")
7 source_set("sandbox") {
8   sources = [
9     "src/acl.cc",
10     "src/acl.h",
11     "src/app_container.cc",
12     "src/app_container.h",
13     "src/broker_services.cc",
14     "src/broker_services.h",
15     "src/crosscall_client.h",
16     "src/crosscall_params.h",
17     "src/crosscall_server.cc",
18     "src/crosscall_server.h",
19     "src/eat_resolver.cc",
20     "src/eat_resolver.h",
21     "src/filesystem_dispatcher.cc",
22     "src/filesystem_dispatcher.h",
23     "src/filesystem_interception.cc",
24     "src/filesystem_interception.h",
25     "src/filesystem_policy.cc",
26     "src/filesystem_policy.h",
27     "src/handle_closer.cc",
28     "src/handle_closer.h",
29     "src/handle_closer_agent.cc",
30     "src/handle_closer_agent.h",
31     "src/handle_dispatcher.cc",
32     "src/handle_dispatcher.h",
33     "src/handle_interception.cc",
34     "src/handle_interception.h",
35     "src/handle_policy.cc",
36     "src/handle_policy.h",
37     "src/handle_table.cc",
38     "src/handle_table.h",
39     "src/interception.cc",
40     "src/interception.h",
41     "src/interception_agent.cc",
42     "src/interception_agent.h",
43     "src/interception_internal.h",
44     "src/interceptors.h",
45     "src/internal_types.h",
46     "src/ipc_tags.h",
47     "src/job.cc",
48     "src/job.h",
49     "src/named_pipe_dispatcher.cc",
50     "src/named_pipe_dispatcher.h",
51     "src/named_pipe_interception.cc",
52     "src/named_pipe_interception.h",
53     "src/named_pipe_policy.cc",
54     "src/named_pipe_policy.h",
55     "src/nt_internals.h",
56     "src/policy_broker.cc",
57     "src/policy_broker.h",
58     "src/policy_engine_opcodes.cc",
59     "src/policy_engine_opcodes.h",
60     "src/policy_engine_params.h",
61     "src/policy_engine_processor.cc",
62     "src/policy_engine_processor.h",
63     "src/policy_low_level.cc",
64     "src/policy_low_level.h",
65     "src/policy_params.h",
66     "src/policy_target.cc",
67     "src/policy_target.h",
68     "src/process_mitigations.cc",
69     "src/process_mitigations.h",
70     "src/process_mitigations_win32k_dispatcher.cc",
71     "src/process_mitigations_win32k_dispatcher.h",
72     "src/process_mitigations_win32k_interception.cc",
73     "src/process_mitigations_win32k_interception.h",
74     "src/process_mitigations_win32k_policy.cc",
75     "src/process_mitigations_win32k_policy.h",
76     "src/process_thread_dispatcher.cc",
77     "src/process_thread_dispatcher.h",
78     "src/process_thread_interception.cc",
79     "src/process_thread_interception.h",
80     "src/process_thread_policy.cc",
81     "src/process_thread_policy.h",
82     "src/registry_dispatcher.cc",
83     "src/registry_dispatcher.h",
84     "src/registry_interception.cc",
85     "src/registry_interception.h",
86     "src/registry_policy.cc",
87     "src/registry_policy.h",
88     "src/resolver.cc",
89     "src/resolver.h",
90     "src/restricted_token.cc",
91     "src/restricted_token.h",
92     "src/restricted_token_utils.cc",
93     "src/restricted_token_utils.h",
94     "src/sandbox.cc",
95     "src/sandbox.h",
96     "src/sandbox_factory.h",
97     "src/sandbox_globals.cc",
98     "src/sandbox_nt_types.h",
99     "src/sandbox_nt_util.cc",
100     "src/sandbox_nt_util.h",
101     "src/sandbox_policy.h",
102     "src/sandbox_policy_base.cc",
103     "src/sandbox_policy_base.h",
104     "src/sandbox_types.h",
105     "src/sandbox_utils.cc",
106     "src/sandbox_utils.h",
107     "src/security_level.h",
108     "src/service_resolver.cc",
109     "src/service_resolver.h",
110     "src/shared_handles.cc",
111     "src/shared_handles.h",
112     "src/sharedmem_ipc_client.cc",
113     "src/sharedmem_ipc_client.h",
114     "src/sharedmem_ipc_server.cc",
115     "src/sharedmem_ipc_server.h",
116     "src/sid.cc",
117     "src/sid.h",
118     "src/sync_dispatcher.cc",
119     "src/sync_dispatcher.h",
120     "src/sync_interception.cc",
121     "src/sync_interception.h",
122     "src/sync_policy.cc",
123     "src/sync_policy.h",
124     "src/target_interceptions.cc",
125     "src/target_interceptions.h",
126     "src/target_process.cc",
127     "src/target_process.h",
128     "src/target_services.cc",
129     "src/target_services.h",
130     "src/win2k_threadpool.cc",
131     "src/win2k_threadpool.h",
132     "src/win_utils.cc",
133     "src/win_utils.h",
134     "src/window.cc",
135     "src/window.h",
136   ]
138   if (current_cpu == "x64") {
139     sources += [
140       "src/Wow64_64.cc",
141       "src/interceptors_64.cc",
142       "src/interceptors_64.h",
143       "src/resolver_64.cc",
144       "src/service_resolver_64.cc",
145     ]
146   } else if (current_cpu == "x86") {
147     sources += [
148       "src/Wow64.cc",
149       "src/Wow64.h",
150       "src/resolver_32.cc",
151       "src/service_resolver_32.cc",
152       "src/sidestep/ia32_modrm_map.cpp",
153       "src/sidestep/ia32_opcode_map.cpp",
154       "src/sidestep/mini_disassembler.cpp",
155       "src/sidestep/mini_disassembler.h",
156       "src/sidestep/mini_disassembler_types.h",
157       "src/sidestep/preamble_patcher.h",
158       "src/sidestep/preamble_patcher_with_stub.cpp",
159       "src/sidestep_resolver.cc",
160       "src/sidestep_resolver.h",
161     ]
162   }
164   deps = [
165     "//base",
166     "//base:base_static",
167   ]
168   if (current_cpu == "x86") {
169     deps += [ ":copy_wow_helper" ]
170   }
173 if (current_cpu == "x86") {
174   # Make a target that copies the wow_helper files to the out dir.
175   #
176   # TODO(brettw) we can probably just build this now that we have proper
177   # toolchain support.
178   copy("copy_wow_helper") {
179     sources = [
180       "wow_helper/wow_helper.exe",
181       "wow_helper/wow_helper.pdb",
182     ]
183     outputs = [
184       "$root_out_dir/{{source_file_part}}",
185     ]
186   }
189 test("sbox_integration_tests") {
190   sources = [
191     "src/address_sanitizer_test.cc",
192     "src/app_container_test.cc",
193     "src/file_policy_test.cc",
194     "src/handle_closer_test.cc",
195     "src/handle_inheritance_test.cc",
196     "src/handle_policy_test.cc",
197     "src/integrity_level_test.cc",
198     "src/ipc_ping_test.cc",
199     "src/named_pipe_policy_test.cc",
200     "src/policy_target_test.cc",
201     "src/process_mitigations_test.cc",
202     "src/process_policy_test.cc",
203     "src/registry_policy_test.cc",
204     "src/sync_policy_test.cc",
205     "src/sync_policy_test.h",
206     "src/unload_dll_test.cc",
207     "tests/common/controller.cc",
208     "tests/common/controller.h",
209     "tests/common/test_utils.cc",
210     "tests/common/test_utils.h",
211     "tests/integration_tests/integration_tests.cc",
212     "tests/integration_tests/integration_tests_test.cc",
213   ]
215   deps = [
216     ":sandbox",
217     "//base/test:test_support",
218     "//testing/gtest",
219   ]
222 test("sbox_validation_tests") {
223   sources = [
224     "tests/common/controller.cc",
225     "tests/common/controller.h",
226     "tests/validation_tests/commands.cc",
227     "tests/validation_tests/commands.h",
228     "tests/validation_tests/suite.cc",
229     "tests/validation_tests/unit_tests.cc",
230   ]
232   deps = [
233     ":sandbox",
234     "//base/test:test_support",
235     "//testing/gtest",
236   ]
239 test("sbox_unittests") {
240   sources = [
241     "src/app_container_unittest.cc",
242     "src/interception_unittest.cc",
243     "src/ipc_unittest.cc",
244     "src/job_unittest.cc",
245     "src/policy_engine_unittest.cc",
246     "src/policy_low_level_unittest.cc",
247     "src/policy_opcodes_unittest.cc",
248     "src/restricted_token_unittest.cc",
249     "src/service_resolver_unittest.cc",
250     "src/sid_unittest.cc",
251     "src/threadpool_unittest.cc",
252     "src/win_utils_unittest.cc",
253     "tests/common/test_utils.cc",
254     "tests/common/test_utils.h",
255     "tests/unit_tests/unit_tests.cc",
256   ]
258   deps = [
259     ":sandbox",
260     "//base/test:test_support",
261     "//testing/gtest",
262   ]
265 test("sandbox_poc") {
266   sources = [
267     "sandbox_poc/main_ui_window.cc",
268     "sandbox_poc/main_ui_window.h",
269     "sandbox_poc/resource.h",
270     "sandbox_poc/sandbox.cc",
271     "sandbox_poc/sandbox.h",
272     "sandbox_poc/sandbox.ico",
273     "sandbox_poc/sandbox.rc",
274   ]
276   configs -= [ "//build/config/win:console" ]
277   configs += [ "//build/config/win:windowed" ]
279   libs = [ "comctl32.lib" ]
281   deps = [
282     ":sandbox",
283     ":pocdll",
284   ]
287 shared_library("pocdll") {
288   sources = [
289     "sandbox_poc/pocdll/exports.h",
290     "sandbox_poc/pocdll/fs.cc",
291     "sandbox_poc/pocdll/handles.cc",
292     "sandbox_poc/pocdll/invasive.cc",
293     "sandbox_poc/pocdll/network.cc",
294     "sandbox_poc/pocdll/pocdll.cc",
295     "sandbox_poc/pocdll/processes_and_threads.cc",
296     "sandbox_poc/pocdll/registry.cc",
297     "sandbox_poc/pocdll/spyware.cc",
298     "sandbox_poc/pocdll/utils.h",
299   ]
301   defines = [ "POCDLL_EXPORTS" ]