summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpetewil <petewil@chromium.org>2015-12-21 10:48:36 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-21 18:49:26 +0000
commit61731d3ff51877ddb5f67aa3b937d5011a348d17 (patch)
treec0f148f8f53480e367276c8d349969e12486e5f7
parent9575f9a4af9115c88bf8ba04e63a77e14e1d2750 (diff)
downloadchromium_src-61731d3ff51877ddb5f67aa3b937d5011a348d17.zip
chromium_src-61731d3ff51877ddb5f67aa3b937d5011a348d17.tar.gz
chromium_src-61731d3ff51877ddb5f67aa3b937d5011a348d17.tar.bz2
Revert of Switch to standard integer types in sandbox/. (patchset #3 id:40001 of https://codereview.chromium.org/1538283002/ )
Reason for revert: This appears to be causing a compile failure (macros.h omitted) Original issue's description: > Switch to standard integer types in sandbox/. > > BUG=138542 > TBR=cpu@chromium.org > > Committed: https://crrev.com/b5032dd2fd694a9bd7a9e96ad8fefcaf29c24c9e > Cr-Commit-Position: refs/heads/master@{#366413} TBR=cpu@chromium.org,avi@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=138542 Review URL: https://codereview.chromium.org/1539423002 Cr-Commit-Position: refs/heads/master@{#366428}
-rw-r--r--content/common/sandbox_win.cc2
-rw-r--r--content/common/sandbox_win.h2
-rw-r--r--sandbox/linux/bpf_dsl/bpf_dsl.cc4
-rw-r--r--sandbox/linux/bpf_dsl/bpf_dsl.h1
-rw-r--r--sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc1
-rw-r--r--sandbox/linux/bpf_dsl/codegen.cc3
-rw-r--r--sandbox/linux/bpf_dsl/codegen_unittest.cc3
-rw-r--r--sandbox/linux/bpf_dsl/cons.h1
-rw-r--r--sandbox/linux/bpf_dsl/dump_bpf.cc2
-rw-r--r--sandbox/linux/bpf_dsl/policy_compiler.cc2
-rw-r--r--sandbox/linux/bpf_dsl/policy_compiler.h1
-rw-r--r--sandbox/linux/bpf_dsl/syscall_set.cc2
-rw-r--r--sandbox/linux/bpf_dsl/syscall_set_unittest.cc1
-rw-r--r--sandbox/linux/bpf_dsl/test_trap_registry.cc2
-rw-r--r--sandbox/linux/bpf_dsl/test_trap_registry.h1
-rw-r--r--sandbox/linux/bpf_dsl/verifier.cc2
-rw-r--r--sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc4
-rw-r--r--sandbox/linux/integration_tests/namespace_unix_domain_socket_unittest.cc1
-rw-r--r--sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc3
-rw-r--r--sandbox/linux/seccomp-bpf-helpers/baseline_policy.h1
-rw-r--r--sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc1
-rw-r--r--sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc2
-rw-r--r--sandbox/linux/seccomp-bpf/bpf_tester_compatibility_delegate.h1
-rw-r--r--sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc1
-rw-r--r--sandbox/linux/seccomp-bpf/sandbox_bpf.cc1
-rw-r--r--sandbox/linux/seccomp-bpf/syscall_unittest.cc3
-rw-r--r--sandbox/linux/seccomp-bpf/trap.cc2
-rw-r--r--sandbox/linux/seccomp-bpf/trap.h1
-rw-r--r--sandbox/linux/services/credentials.cc1
-rw-r--r--sandbox/linux/services/namespace_sandbox.cc1
-rw-r--r--sandbox/linux/services/namespace_utils.cc3
-rw-r--r--sandbox/linux/services/syscall_wrappers_unittest.cc1
-rw-r--r--sandbox/linux/services/thread_helpers_unittests.cc1
-rw-r--r--sandbox/linux/services/yama.cc1
-rw-r--r--sandbox/linux/suid/client/setuid_sandbox_host.cc1
-rw-r--r--sandbox/linux/suid/common/suid_unsafe_environment_variables.h1
-rw-r--r--sandbox/linux/suid/process_util.h1
-rw-r--r--sandbox/linux/suid/process_util_linux.c1
-rw-r--r--sandbox/linux/suid/sandbox.c1
-rw-r--r--sandbox/linux/syscall_broker/broker_client.cc6
-rw-r--r--sandbox/linux/syscall_broker/broker_file_permission.cc1
-rw-r--r--sandbox/linux/syscall_broker/broker_host.cc1
-rw-r--r--sandbox/linux/syscall_broker/broker_policy.cc1
-rw-r--r--sandbox/linux/syscall_broker/broker_policy.h2
-rw-r--r--sandbox/linux/syscall_broker/broker_process_unittest.cc1
-rw-r--r--sandbox/linux/system_headers/arm64_linux_ucontext.h1
-rw-r--r--sandbox/linux/system_headers/arm_linux_ucontext.h2
-rw-r--r--sandbox/linux/system_headers/i386_linux_ucontext.h3
-rw-r--r--sandbox/linux/system_headers/linux_signal.h2
-rw-r--r--sandbox/linux/system_headers/mips_linux_ucontext.h2
-rw-r--r--sandbox/linux/system_headers/x86_64_linux_ucontext.h2
-rw-r--r--sandbox/linux/tests/scoped_temporary_file_unittest.cc1
-rw-r--r--sandbox/linux/tests/unit_tests.cc3
-rw-r--r--sandbox/mac/bootstrap_sandbox.cc2
-rw-r--r--sandbox/mac/bootstrap_sandbox.h1
-rw-r--r--sandbox/mac/launchd_interception_server.cc2
-rw-r--r--sandbox/mac/mach_message_server.cc1
-rw-r--r--sandbox/mac/mach_message_server.h1
-rw-r--r--sandbox/mac/os_compatibility.cc2
-rw-r--r--sandbox/mac/os_compatibility.h1
-rw-r--r--sandbox/mac/pre_exec_delegate.cc1
-rw-r--r--sandbox/mac/pre_exec_delegate.h3
-rw-r--r--sandbox/mac/xpc_message_server.h1
-rw-r--r--sandbox/mac/xpc_message_server_unittest.cc1
-rw-r--r--sandbox/mac/xpc_stubs_header.fragment2
-rw-r--r--sandbox/win/sandbox_poc/main_ui_window.cc4
-rw-r--r--sandbox/win/sandbox_poc/main_ui_window.h2
-rw-r--r--sandbox/win/sandbox_poc/pocdll/utils.h1
-rw-r--r--sandbox/win/src/Wow64.cc2
-rw-r--r--sandbox/win/src/Wow64.h2
-rw-r--r--sandbox/win/src/app_container.cc1
-rw-r--r--sandbox/win/src/app_container.h1
-rw-r--r--sandbox/win/src/broker_services.cc3
-rw-r--r--sandbox/win/src/broker_services.h2
-rw-r--r--sandbox/win/src/crosscall_client.h3
-rw-r--r--sandbox/win/src/crosscall_params.h3
-rw-r--r--sandbox/win/src/crosscall_server.cc7
-rw-r--r--sandbox/win/src/crosscall_server.h2
-rw-r--r--sandbox/win/src/eat_resolver.cc2
-rw-r--r--sandbox/win/src/eat_resolver.h4
-rw-r--r--sandbox/win/src/filesystem_dispatcher.cc42
-rw-r--r--sandbox/win/src/filesystem_dispatcher.h32
-rw-r--r--sandbox/win/src/filesystem_interception.cc32
-rw-r--r--sandbox/win/src/filesystem_policy.cc57
-rw-r--r--sandbox/win/src/filesystem_policy.h39
-rw-r--r--sandbox/win/src/handle_closer.cc2
-rw-r--r--sandbox/win/src/handle_closer.h4
-rw-r--r--sandbox/win/src/handle_closer_agent.cc2
-rw-r--r--sandbox/win/src/handle_closer_agent.h2
-rw-r--r--sandbox/win/src/handle_closer_test.cc2
-rw-r--r--sandbox/win/src/handle_dispatcher.cc8
-rw-r--r--sandbox/win/src/handle_dispatcher.h10
-rw-r--r--sandbox/win/src/handle_policy.h1
-rw-r--r--sandbox/win/src/interception.cc2
-rw-r--r--sandbox/win/src/interception.h4
-rw-r--r--sandbox/win/src/interception_agent.cc6
-rw-r--r--sandbox/win/src/interception_agent.h2
-rw-r--r--sandbox/win/src/interception_internal.h2
-rw-r--r--sandbox/win/src/interception_unittest.cc7
-rw-r--r--sandbox/win/src/internal_types.h10
-rw-r--r--sandbox/win/src/ipc_unittest.cc1
-rw-r--r--sandbox/win/src/job.cc2
-rw-r--r--sandbox/win/src/job.h4
-rw-r--r--sandbox/win/src/named_pipe_dispatcher.cc15
-rw-r--r--sandbox/win/src/named_pipe_dispatcher.h16
-rw-r--r--sandbox/win/src/named_pipe_policy.h1
-rw-r--r--sandbox/win/src/nt_internals.h1
-rw-r--r--sandbox/win/src/policy_broker.cc2
-rw-r--r--sandbox/win/src/policy_engine_opcodes.cc63
-rw-r--r--sandbox/win/src/policy_engine_opcodes.h76
-rw-r--r--sandbox/win/src/policy_engine_params.h12
-rw-r--r--sandbox/win/src/policy_engine_processor.cc7
-rw-r--r--sandbox/win/src/policy_engine_processor.h17
-rw-r--r--sandbox/win/src/policy_engine_unittest.cc7
-rw-r--r--sandbox/win/src/policy_low_level.cc42
-rw-r--r--sandbox/win/src/policy_low_level.h27
-rw-r--r--sandbox/win/src/policy_low_level_unittest.cc37
-rw-r--r--sandbox/win/src/policy_opcodes_unittest.cc21
-rw-r--r--sandbox/win/src/policy_target.cc2
-rw-r--r--sandbox/win/src/process_mitigations.cc2
-rw-r--r--sandbox/win/src/process_mitigations.h2
-rw-r--r--sandbox/win/src/process_mitigations_win32k_dispatcher.h2
-rw-r--r--sandbox/win/src/process_mitigations_win32k_interception.h1
-rw-r--r--sandbox/win/src/process_mitigations_win32k_policy.h1
-rw-r--r--sandbox/win/src/process_thread_dispatcher.cc18
-rw-r--r--sandbox/win/src/process_thread_dispatcher.h18
-rw-r--r--sandbox/win/src/process_thread_interception.cc14
-rw-r--r--sandbox/win/src/process_thread_policy.cc16
-rw-r--r--sandbox/win/src/process_thread_policy.h17
-rw-r--r--sandbox/win/src/registry_dispatcher.cc18
-rw-r--r--sandbox/win/src/registry_dispatcher.h16
-rw-r--r--sandbox/win/src/registry_interception.cc10
-rw-r--r--sandbox/win/src/registry_policy.cc24
-rw-r--r--sandbox/win/src/registry_policy.h27
-rw-r--r--sandbox/win/src/resolver.cc2
-rw-r--r--sandbox/win/src/resolver.h4
-rw-r--r--sandbox/win/src/resolver_32.cc2
-rw-r--r--sandbox/win/src/resolver_64.cc2
-rw-r--r--sandbox/win/src/restricted_token.cc2
-rw-r--r--sandbox/win/src/restricted_token.h2
-rw-r--r--sandbox/win/src/sandbox.h1
-rw-r--r--sandbox/win/src/sandbox_factory.h1
-rw-r--r--sandbox/win/src/sandbox_nt_util.cc3
-rw-r--r--sandbox/win/src/sandbox_nt_util.h1
-rw-r--r--sandbox/win/src/sandbox_policy.h7
-rw-r--r--sandbox/win/src/sandbox_policy_base.cc5
-rw-r--r--sandbox/win/src/sandbox_policy_base.h8
-rw-r--r--sandbox/win/src/sandbox_rand.h1
-rw-r--r--sandbox/win/src/sandbox_utils.h1
-rw-r--r--sandbox/win/src/security_level.h4
-rw-r--r--sandbox/win/src/service_resolver.h2
-rw-r--r--sandbox/win/src/service_resolver_32.cc2
-rw-r--r--sandbox/win/src/service_resolver_64.cc2
-rw-r--r--sandbox/win/src/service_resolver_unittest.cc4
-rw-r--r--sandbox/win/src/sharedmem_ipc_client.cc8
-rw-r--r--sandbox/win/src/sharedmem_ipc_client.h5
-rw-r--r--sandbox/win/src/sharedmem_ipc_server.cc26
-rw-r--r--sandbox/win/src/sharedmem_ipc_server.h8
-rw-r--r--sandbox/win/src/sidestep/preamble_patcher_with_stub.cpp2
-rw-r--r--sandbox/win/src/sidestep_resolver.cc2
-rw-r--r--sandbox/win/src/sidestep_resolver.h4
-rw-r--r--sandbox/win/src/sync_dispatcher.cc8
-rw-r--r--sandbox/win/src/sync_dispatcher.h14
-rw-r--r--sandbox/win/src/sync_interception.cc10
-rw-r--r--sandbox/win/src/sync_policy.cc20
-rw-r--r--sandbox/win/src/sync_policy.h17
-rw-r--r--sandbox/win/src/target_process.cc12
-rw-r--r--sandbox/win/src/target_process.h10
-rw-r--r--sandbox/win/src/target_services.cc12
-rw-r--r--sandbox/win/src/target_services.h2
-rw-r--r--sandbox/win/src/threadpool_unittest.cc10
-rw-r--r--sandbox/win/src/top_level_dispatcher.cc8
-rw-r--r--sandbox/win/src/win2k_threadpool.cc2
-rw-r--r--sandbox/win/src/win2k_threadpool.h5
-rw-r--r--sandbox/win/src/win_utils.cc2
-rw-r--r--sandbox/win/src/win_utils.h3
-rw-r--r--sandbox/win/tests/common/test_utils.cc1
-rw-r--r--sandbox/win/tests/integration_tests/integration_tests_test.cc6
-rw-r--r--sandbox/win/tests/validation_tests/commands.cc1
-rw-r--r--sandbox/win/tests/validation_tests/suite.cc3
-rw-r--r--sandbox/win/wow_helper/service64_resolver.cc2
-rw-r--r--sandbox/win/wow_helper/service64_resolver.h3
-rw-r--r--sandbox/win/wow_helper/wow_helper.cc1
183 files changed, 463 insertions, 754 deletions
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index 295473d..5f0c5b2 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -559,7 +559,7 @@ bool IsAppContainerEnabled() {
void SetJobLevel(const base::CommandLine& cmd_line,
sandbox::JobLevel job_level,
- uint32_t ui_exceptions,
+ uint32 ui_exceptions,
sandbox::TargetPolicy* policy) {
if (ShouldSetJobLevel(cmd_line)) {
#ifdef _WIN64
diff --git a/content/common/sandbox_win.h b/content/common/sandbox_win.h
index 70d2e4f..2547aed 100644
--- a/content/common/sandbox_win.h
+++ b/content/common/sandbox_win.h
@@ -24,7 +24,7 @@ namespace content {
// should be let to run without a job object assigned.
void SetJobLevel(const base::CommandLine& cmd_line,
sandbox::JobLevel job_level,
- uint32_t ui_exceptions,
+ uint32 ui_exceptions,
sandbox::TargetPolicy* policy);
// Closes handles that are opened at process creation and initialization.
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl.cc b/sandbox/linux/bpf_dsl/bpf_dsl.cc
index 3330c47..b57c713 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl.cc
+++ b/sandbox/linux/bpf_dsl/bpf_dsl.cc
@@ -4,13 +4,9 @@
#include "sandbox/linux/bpf_dsl/bpf_dsl.h"
-#include <stddef.h>
-#include <stdint.h>
-
#include <limits>
#include "base/logging.h"
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl_impl.h"
#include "sandbox/linux/bpf_dsl/errorcode.h"
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl.h b/sandbox/linux/bpf_dsl/bpf_dsl.h
index ffd20ff..2d3c9d4 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl.h
+++ b/sandbox/linux/bpf_dsl/bpf_dsl.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_
#define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_
-#include <stddef.h>
#include <stdint.h>
#include <utility>
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc b/sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc
index 801deee..6e0c29e 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc
+++ b/sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc
@@ -7,7 +7,6 @@
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
-#include <stdint.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/utsname.h>
diff --git a/sandbox/linux/bpf_dsl/codegen.cc b/sandbox/linux/bpf_dsl/codegen.cc
index 647f55a..d9eaf20 100644
--- a/sandbox/linux/bpf_dsl/codegen.cc
+++ b/sandbox/linux/bpf_dsl/codegen.cc
@@ -4,9 +4,6 @@
#include "sandbox/linux/bpf_dsl/codegen.h"
-#include <stddef.h>
-#include <stdint.h>
-
#include <limits>
#include <utility>
diff --git a/sandbox/linux/bpf_dsl/codegen_unittest.cc b/sandbox/linux/bpf_dsl/codegen_unittest.cc
index 56a0dd2..ec2abc7 100644
--- a/sandbox/linux/bpf_dsl/codegen_unittest.cc
+++ b/sandbox/linux/bpf_dsl/codegen_unittest.cc
@@ -4,9 +4,6 @@
#include "sandbox/linux/bpf_dsl/codegen.h"
-#include <stddef.h>
-#include <stdint.h>
-
#include <map>
#include <utility>
#include <vector>
diff --git a/sandbox/linux/bpf_dsl/cons.h b/sandbox/linux/bpf_dsl/cons.h
index be050f7..fa47c14 100644
--- a/sandbox/linux/bpf_dsl/cons.h
+++ b/sandbox/linux/bpf_dsl/cons.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_LINUX_BPF_DSL_CONS_H_
#define SANDBOX_LINUX_BPF_DSL_CONS_H_
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "sandbox/sandbox_export.h"
diff --git a/sandbox/linux/bpf_dsl/dump_bpf.cc b/sandbox/linux/bpf_dsl/dump_bpf.cc
index 2edf592..29d28a6 100644
--- a/sandbox/linux/bpf_dsl/dump_bpf.cc
+++ b/sandbox/linux/bpf_dsl/dump_bpf.cc
@@ -5,8 +5,6 @@
#include "sandbox/linux/bpf_dsl/dump_bpf.h"
#include <inttypes.h>
-#include <stddef.h>
-#include <stdint.h>
#include <stdio.h>
#include <string>
diff --git a/sandbox/linux/bpf_dsl/policy_compiler.cc b/sandbox/linux/bpf_dsl/policy_compiler.cc
index 7ce517a..a4a842b 100644
--- a/sandbox/linux/bpf_dsl/policy_compiler.cc
+++ b/sandbox/linux/bpf_dsl/policy_compiler.cc
@@ -5,8 +5,6 @@
#include "sandbox/linux/bpf_dsl/policy_compiler.h"
#include <errno.h>
-#include <stddef.h>
-#include <stdint.h>
#include <sys/syscall.h>
#include <limits>
diff --git a/sandbox/linux/bpf_dsl/policy_compiler.h b/sandbox/linux/bpf_dsl/policy_compiler.h
index 48b1d78..6398ef6 100644
--- a/sandbox/linux/bpf_dsl/policy_compiler.h
+++ b/sandbox/linux/bpf_dsl/policy_compiler.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_LINUX_BPF_DSL_POLICY_COMPILER_H_
#define SANDBOX_LINUX_BPF_DSL_POLICY_COMPILER_H_
-#include <stddef.h>
#include <stdint.h>
#include <vector>
diff --git a/sandbox/linux/bpf_dsl/syscall_set.cc b/sandbox/linux/bpf_dsl/syscall_set.cc
index 3d61fa3..47810e9 100644
--- a/sandbox/linux/bpf_dsl/syscall_set.cc
+++ b/sandbox/linux/bpf_dsl/syscall_set.cc
@@ -4,8 +4,6 @@
#include "sandbox/linux/bpf_dsl/syscall_set.h"
-#include <stdint.h>
-
#include "base/logging.h"
#include "base/macros.h"
#include "sandbox/linux/bpf_dsl/linux_syscall_ranges.h"
diff --git a/sandbox/linux/bpf_dsl/syscall_set_unittest.cc b/sandbox/linux/bpf_dsl/syscall_set_unittest.cc
index c03f3b4..fafb6f6 100644
--- a/sandbox/linux/bpf_dsl/syscall_set_unittest.cc
+++ b/sandbox/linux/bpf_dsl/syscall_set_unittest.cc
@@ -4,7 +4,6 @@
#include "sandbox/linux/bpf_dsl/syscall_set.h"
-#include <stddef.h>
#include <stdint.h>
#include "sandbox/linux/bpf_dsl/linux_syscall_ranges.h"
diff --git a/sandbox/linux/bpf_dsl/test_trap_registry.cc b/sandbox/linux/bpf_dsl/test_trap_registry.cc
index e29049a..eaf8e34 100644
--- a/sandbox/linux/bpf_dsl/test_trap_registry.cc
+++ b/sandbox/linux/bpf_dsl/test_trap_registry.cc
@@ -4,8 +4,6 @@
#include "sandbox/linux/bpf_dsl/test_trap_registry.h"
-#include <stdint.h>
-
#include "testing/gtest/include/gtest/gtest.h"
namespace sandbox {
diff --git a/sandbox/linux/bpf_dsl/test_trap_registry.h b/sandbox/linux/bpf_dsl/test_trap_registry.h
index 19e4e9c..161f28e 100644
--- a/sandbox/linux/bpf_dsl/test_trap_registry.h
+++ b/sandbox/linux/bpf_dsl/test_trap_registry.h
@@ -10,7 +10,6 @@
#include <map>
#include <utility>
-#include "base/macros.h"
#include "sandbox/linux/bpf_dsl/trap_registry.h"
namespace sandbox {
diff --git a/sandbox/linux/bpf_dsl/verifier.cc b/sandbox/linux/bpf_dsl/verifier.cc
index b5383e5..fbf07058 100644
--- a/sandbox/linux/bpf_dsl/verifier.cc
+++ b/sandbox/linux/bpf_dsl/verifier.cc
@@ -4,10 +4,8 @@
#include "sandbox/linux/bpf_dsl/verifier.h"
-#include <stdint.h>
#include <string.h>
-#include "base/macros.h"
#include "sandbox/linux/bpf_dsl/seccomp_macros.h"
#include "sandbox/linux/bpf_dsl/trap_registry.h"
#include "sandbox/linux/system_headers/linux_filter.h"
diff --git a/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc b/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
index 3b0d6ac..a053773 100644
--- a/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
+++ b/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
@@ -7,16 +7,14 @@
#include <pthread.h>
#include <sched.h>
#include <signal.h>
-#include <stddef.h>
-#include <stdint.h>
#include <sys/prctl.h>
#include <sys/ptrace.h>
-#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
+#include <sys/socket.h>
#if defined(ANDROID)
// Work-around for buggy headers in Android's NDK
diff --git a/sandbox/linux/integration_tests/namespace_unix_domain_socket_unittest.cc b/sandbox/linux/integration_tests/namespace_unix_domain_socket_unittest.cc
index aa993ce..5e8a239 100644
--- a/sandbox/linux/integration_tests/namespace_unix_domain_socket_unittest.cc
+++ b/sandbox/linux/integration_tests/namespace_unix_domain_socket_unittest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include <sched.h>
-#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
diff --git a/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc b/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc
index c46b808..09f2d58 100644
--- a/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc
+++ b/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc
@@ -4,14 +4,13 @@
#include <errno.h>
#include <fcntl.h>
-#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <vector>
#include "base/bind.h"
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.h b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.h
index dcf308c..4169d9c 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.h
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_LINUX_SECCOMP_BPF_HELPERS_BASELINE_POLICY_H_
#define SANDBOX_LINUX_SECCOMP_BPF_HELPERS_BASELINE_POLICY_H_
-#include "base/macros.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl_forward.h"
#include "sandbox/linux/bpf_dsl/policy.h"
#include "sandbox/sandbox_export.h"
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
index 09a6ac8..7ece8be 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
@@ -9,7 +9,6 @@
#include <netinet/in.h>
#include <sched.h>
#include <signal.h>
-#include <stddef.h>
#include <string.h>
#include <sys/prctl.h>
#include <sys/resource.h>
diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
index 077bc61..05250d1 100644
--- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
@@ -6,8 +6,6 @@
#include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
-#include <stddef.h>
-#include <stdint.h>
#include <sys/syscall.h>
#include <unistd.h>
diff --git a/sandbox/linux/seccomp-bpf/bpf_tester_compatibility_delegate.h b/sandbox/linux/seccomp-bpf/bpf_tester_compatibility_delegate.h
index 00d415c..7736c15 100644
--- a/sandbox/linux/seccomp-bpf/bpf_tester_compatibility_delegate.h
+++ b/sandbox/linux/seccomp-bpf/bpf_tester_compatibility_delegate.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_LINUX_SECCOMP_BPF_BPF_TESTER_COMPATIBILITY_DELEGATE_H_
#define SANDBOX_LINUX_SECCOMP_BPF_BPF_TESTER_COMPATIBILITY_DELEGATE_H_
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.h"
diff --git a/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc b/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
index e300baf..63e1814 100644
--- a/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
+++ b/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
@@ -11,7 +11,6 @@
#include <unistd.h>
#include "base/logging.h"
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl.h"
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
index b48682b..5fc0990 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
@@ -5,7 +5,6 @@
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
#include <errno.h>
-#include <stdint.h>
#include <sys/prctl.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/sandbox/linux/seccomp-bpf/syscall_unittest.cc b/sandbox/linux/seccomp-bpf/syscall_unittest.cc
index 01336f9..3fe404c 100644
--- a/sandbox/linux/seccomp-bpf/syscall_unittest.cc
+++ b/sandbox/linux/seccomp-bpf/syscall_unittest.cc
@@ -7,8 +7,6 @@
#include <asm/unistd.h>
#include <errno.h>
#include <fcntl.h>
-#include <stddef.h>
-#include <stdint.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/types.h>
@@ -16,7 +14,6 @@
#include <vector>
-#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl.h"
diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
index 003708d..01cbbac 100644
--- a/sandbox/linux/seccomp-bpf/trap.cc
+++ b/sandbox/linux/seccomp-bpf/trap.cc
@@ -6,8 +6,6 @@
#include <errno.h>
#include <signal.h>
-#include <stddef.h>
-#include <stdint.h>
#include <string.h>
#include <sys/syscall.h>
diff --git a/sandbox/linux/seccomp-bpf/trap.h b/sandbox/linux/seccomp-bpf/trap.h
index a73d206..50ac3fd 100644
--- a/sandbox/linux/seccomp-bpf/trap.h
+++ b/sandbox/linux/seccomp-bpf/trap.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__
#define SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__
-#include <stddef.h>
#include <stdint.h>
#include <map>
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
index 88c8b7b..dd26472 100644
--- a/sandbox/linux/services/credentials.cc
+++ b/sandbox/linux/services/credentials.cc
@@ -6,7 +6,6 @@
#include <errno.h>
#include <signal.h>
-#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/syscall.h>
diff --git a/sandbox/linux/services/namespace_sandbox.cc b/sandbox/linux/services/namespace_sandbox.cc
index 00e5947..a82caf4 100644
--- a/sandbox/linux/services/namespace_sandbox.cc
+++ b/sandbox/linux/services/namespace_sandbox.cc
@@ -6,7 +6,6 @@
#include <sched.h>
#include <signal.h>
-#include <stddef.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/sandbox/linux/services/namespace_utils.cc b/sandbox/linux/services/namespace_utils.cc
index 97add26..82a5444 100644
--- a/sandbox/linux/services/namespace_utils.cc
+++ b/sandbox/linux/services/namespace_utils.cc
@@ -6,9 +6,8 @@
#include <fcntl.h>
#include <sched.h>
-#include <stddef.h>
-#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <string>
diff --git a/sandbox/linux/services/syscall_wrappers_unittest.cc b/sandbox/linux/services/syscall_wrappers_unittest.cc
index 34ac740..1878ff3 100644
--- a/sandbox/linux/services/syscall_wrappers_unittest.cc
+++ b/sandbox/linux/services/syscall_wrappers_unittest.cc
@@ -4,7 +4,6 @@
#include "sandbox/linux/services/syscall_wrappers.h"
-#include <stdint.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/sandbox/linux/services/thread_helpers_unittests.cc b/sandbox/linux/services/thread_helpers_unittests.cc
index 6dcae0f..1461c35 100644
--- a/sandbox/linux/services/thread_helpers_unittests.cc
+++ b/sandbox/linux/services/thread_helpers_unittests.cc
@@ -11,7 +11,6 @@
#include <unistd.h>
#include "base/logging.h"
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process/process_metrics.h"
diff --git a/sandbox/linux/services/yama.cc b/sandbox/linux/services/yama.cc
index 6831cd9..274443c 100644
--- a/sandbox/linux/services/yama.cc
+++ b/sandbox/linux/services/yama.cc
@@ -6,7 +6,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stddef.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/sandbox/linux/suid/client/setuid_sandbox_host.cc b/sandbox/linux/suid/client/setuid_sandbox_host.cc
index caa1acf..71171eb 100644
--- a/sandbox/linux/suid/client/setuid_sandbox_host.cc
+++ b/sandbox/linux/suid/client/setuid_sandbox_host.cc
@@ -5,7 +5,6 @@
#include "sandbox/linux/suid/client/setuid_sandbox_host.h"
#include <fcntl.h>
-#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/sandbox/linux/suid/common/suid_unsafe_environment_variables.h b/sandbox/linux/suid/common/suid_unsafe_environment_variables.h
index e955e0c..048cc86 100644
--- a/sandbox/linux/suid/common/suid_unsafe_environment_variables.h
+++ b/sandbox/linux/suid/common/suid_unsafe_environment_variables.h
@@ -16,7 +16,6 @@
#ifndef SANDBOX_LINUX_SUID_COMMON_SUID_UNSAFE_ENVIRONMENT_VARIABLES_H_
#define SANDBOX_LINUX_SUID_COMMON_SUID_UNSAFE_ENVIRONMENT_VARIABLES_H_
-#include <stddef.h>
#include <stdint.h>
#include <stdlib.h> // malloc
#include <string.h> // memcpy
diff --git a/sandbox/linux/suid/process_util.h b/sandbox/linux/suid/process_util.h
index 10071d3..9fb9a87 100644
--- a/sandbox/linux/suid/process_util.h
+++ b/sandbox/linux/suid/process_util.h
@@ -9,7 +9,6 @@
#define SANDBOX_LINUX_SUID_PROCESS_UTIL_H_
#include <stdbool.h>
-#include <stdint.h>
#include <sys/types.h>
// This adjusts /proc/process/oom_score_adj so the Linux OOM killer
diff --git a/sandbox/linux/suid/process_util_linux.c b/sandbox/linux/suid/process_util_linux.c
index 40949bd..8d9a53c 100644
--- a/sandbox/linux/suid/process_util_linux.c
+++ b/sandbox/linux/suid/process_util_linux.c
@@ -15,7 +15,6 @@
#include <fcntl.h>
#include <inttypes.h>
#include <limits.h>
-#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c
index 3acb44c..187df94 100644
--- a/sandbox/linux/suid/sandbox.c
+++ b/sandbox/linux/suid/sandbox.c
@@ -15,7 +15,6 @@
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
-#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sandbox/linux/syscall_broker/broker_client.cc b/sandbox/linux/syscall_broker/broker_client.cc
index 36c92cd..db8201a 100644
--- a/sandbox/linux/syscall_broker/broker_client.cc
+++ b/sandbox/linux/syscall_broker/broker_client.cc
@@ -6,17 +6,15 @@
#include <errno.h>
#include <fcntl.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/socket.h>
#include <sys/types.h>
#include <utility>
+#include "build/build_config.h"
#include "base/logging.h"
#include "base/pickle.h"
#include "base/posix/unix_domain_socket_linux.h"
-#include "build/build_config.h"
#include "sandbox/linux/syscall_broker/broker_channel.h"
#include "sandbox/linux/syscall_broker/broker_common.h"
#include "sandbox/linux/syscall_broker/broker_policy.h"
diff --git a/sandbox/linux/syscall_broker/broker_file_permission.cc b/sandbox/linux/syscall_broker/broker_file_permission.cc
index 3907344..beceda9 100644
--- a/sandbox/linux/syscall_broker/broker_file_permission.cc
+++ b/sandbox/linux/syscall_broker/broker_file_permission.cc
@@ -5,7 +5,6 @@
#include "sandbox/linux/syscall_broker/broker_file_permission.h"
#include <fcntl.h>
-#include <stddef.h>
#include <string.h>
#include <string>
diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc
index dd61dac6..a81a30e 100644
--- a/sandbox/linux/syscall_broker/broker_host.cc
+++ b/sandbox/linux/syscall_broker/broker_host.cc
@@ -6,7 +6,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stddef.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
diff --git a/sandbox/linux/syscall_broker/broker_policy.cc b/sandbox/linux/syscall_broker/broker_policy.cc
index cd09245..d9f69e3 100644
--- a/sandbox/linux/syscall_broker/broker_policy.cc
+++ b/sandbox/linux/syscall_broker/broker_policy.cc
@@ -5,7 +5,6 @@
#include "sandbox/linux/syscall_broker/broker_policy.h"
#include <fcntl.h>
-#include <stddef.h>
#include <stdint.h>
#include <string.h>
diff --git a/sandbox/linux/syscall_broker/broker_policy.h b/sandbox/linux/syscall_broker/broker_policy.h
index 58bc29a..d5146ed 100644
--- a/sandbox/linux/syscall_broker/broker_policy.h
+++ b/sandbox/linux/syscall_broker/broker_policy.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_POLICY_H_
#define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_POLICY_H_
-#include <stddef.h>
-
#include <string>
#include <vector>
diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc
index 1b63f6a..9ad0e71 100644
--- a/sandbox/linux/syscall_broker/broker_process_unittest.cc
+++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc
@@ -7,7 +7,6 @@
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
-#include <stddef.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/sandbox/linux/system_headers/arm64_linux_ucontext.h b/sandbox/linux/system_headers/arm64_linux_ucontext.h
index 48303ba..46e0407 100644
--- a/sandbox/linux/system_headers/arm64_linux_ucontext.h
+++ b/sandbox/linux/system_headers/arm64_linux_ucontext.h
@@ -8,7 +8,6 @@
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#include <asm/sigcontext.h>
#include <signal.h>
-#include <stdint.h>
// We also need greg_t for the sandbox, include it in this header as well.
typedef uint64_t greg_t;
diff --git a/sandbox/linux/system_headers/arm_linux_ucontext.h b/sandbox/linux/system_headers/arm_linux_ucontext.h
index 35208fa..0eb723a 100644
--- a/sandbox/linux/system_headers/arm_linux_ucontext.h
+++ b/sandbox/linux/system_headers/arm_linux_ucontext.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_UCONTEXT_H_
-#include <stddef.h>
-
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#if !defined(__native_client_nonsfi__)
#include <asm/sigcontext.h>
diff --git a/sandbox/linux/system_headers/i386_linux_ucontext.h b/sandbox/linux/system_headers/i386_linux_ucontext.h
index f438033..61d9f7a 100644
--- a/sandbox/linux/system_headers/i386_linux_ucontext.h
+++ b/sandbox/linux/system_headers/i386_linux_ucontext.h
@@ -5,9 +5,6 @@
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ANDROID_I386_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_ANDROID_I386_UCONTEXT_H_
-#include <stddef.h>
-#include <stdint.h>
-
// We do something compatible with glibc. Hopefully, at some point Android will
// provide that for us, and __BIONIC_HAVE_UCONTEXT_T should be defined.
// This is mostly copied from breakpad (common/android/include/sys/ucontext.h),
diff --git a/sandbox/linux/system_headers/linux_signal.h b/sandbox/linux/system_headers/linux_signal.h
index fb9a47b..6801b71 100644
--- a/sandbox/linux/system_headers/linux_signal.h
+++ b/sandbox/linux/system_headers/linux_signal.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SIGNAL_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SIGNAL_H_
-#include <stdint.h>
-
// NOTE: On some toolchains, signal related ABI is incompatible with Linux's
// (not undefined, but defined different values and in different memory
// layouts). So, fill the gap here.
diff --git a/sandbox/linux/system_headers/mips_linux_ucontext.h b/sandbox/linux/system_headers/mips_linux_ucontext.h
index 774bf31..27b3763 100644
--- a/sandbox/linux/system_headers/mips_linux_ucontext.h
+++ b/sandbox/linux/system_headers/mips_linux_ucontext.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
-#include <stdint.h>
-
// This is mostly copied from breakpad (common/android/include/sys/ucontext.h),
// except we do use sigset_t for uc_sigmask instead of a custom type.
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
diff --git a/sandbox/linux/system_headers/x86_64_linux_ucontext.h b/sandbox/linux/system_headers/x86_64_linux_ucontext.h
index 1f1abe6..57b8919 100644
--- a/sandbox/linux/system_headers/x86_64_linux_ucontext.h
+++ b/sandbox/linux/system_headers/x86_64_linux_ucontext.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_UCONTEXT_H_
-#include <stdint.h>
-
// We do something compatible with glibc. Hopefully, at some point Android will
// provide that for us, and __BIONIC_HAVE_UCONTEXT_T should be defined.
// Spec:
diff --git a/sandbox/linux/tests/scoped_temporary_file_unittest.cc b/sandbox/linux/tests/scoped_temporary_file_unittest.cc
index 9e8ff44..44a2ecb 100644
--- a/sandbox/linux/tests/scoped_temporary_file_unittest.cc
+++ b/sandbox/linux/tests/scoped_temporary_file_unittest.cc
@@ -6,7 +6,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc
index 8734bd1..7ea2815 100644
--- a/sandbox/linux/tests/unit_tests.cc
+++ b/sandbox/linux/tests/unit_tests.cc
@@ -5,12 +5,11 @@
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
-#include <stddef.h>
#include <stdio.h>
#include <sys/resource.h>
-#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/time.h>
#include <time.h>
#include <unistd.h>
diff --git a/sandbox/mac/bootstrap_sandbox.cc b/sandbox/mac/bootstrap_sandbox.cc
index d006f3f..e8997f9 100644
--- a/sandbox/mac/bootstrap_sandbox.cc
+++ b/sandbox/mac/bootstrap_sandbox.cc
@@ -5,13 +5,11 @@
#include "sandbox/mac/bootstrap_sandbox.h"
#include <servers/bootstrap.h>
-#include <stdint.h>
#include <unistd.h>
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mach_logging.h"
-#include "base/macros.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "sandbox/mac/launchd_interception_server.h"
diff --git a/sandbox/mac/bootstrap_sandbox.h b/sandbox/mac/bootstrap_sandbox.h
index 2ae4513..6e823a4 100644
--- a/sandbox/mac/bootstrap_sandbox.h
+++ b/sandbox/mac/bootstrap_sandbox.h
@@ -6,7 +6,6 @@
#define SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_
#include <mach/mach.h>
-#include <stdint.h>
#include <map>
#include <string>
diff --git a/sandbox/mac/launchd_interception_server.cc b/sandbox/mac/launchd_interception_server.cc
index b793b03..6ce61f6 100644
--- a/sandbox/mac/launchd_interception_server.cc
+++ b/sandbox/mac/launchd_interception_server.cc
@@ -5,8 +5,6 @@
#include "sandbox/mac/launchd_interception_server.h"
#include <servers/bootstrap.h>
-#include <stddef.h>
-#include <stdint.h>
#include "base/logging.h"
#include "base/mac/mac_util.h"
diff --git a/sandbox/mac/mach_message_server.cc b/sandbox/mac/mach_message_server.cc
index 20bd94c..7cfcecc 100644
--- a/sandbox/mac/mach_message_server.cc
+++ b/sandbox/mac/mach_message_server.cc
@@ -6,7 +6,6 @@
#include <bsm/libbsm.h>
#include <servers/bootstrap.h>
-#include <stddef.h>
#include <string>
diff --git a/sandbox/mac/mach_message_server.h b/sandbox/mac/mach_message_server.h
index cf5b36f..20a543b 100644
--- a/sandbox/mac/mach_message_server.h
+++ b/sandbox/mac/mach_message_server.h
@@ -6,7 +6,6 @@
#define SANDBOX_MAC_MACH_MESSAGE_SERVER_H_
#include <mach/mach.h>
-#include <stddef.h>
#include "base/mac/dispatch_source_mach.h"
#include "base/mac/scoped_mach_port.h"
diff --git a/sandbox/mac/os_compatibility.cc b/sandbox/mac/os_compatibility.cc
index 5ddf6a5..f1ad528 100644
--- a/sandbox/mac/os_compatibility.cc
+++ b/sandbox/mac/os_compatibility.cc
@@ -5,8 +5,6 @@
#include "sandbox/mac/os_compatibility.h"
#include <servers/bootstrap.h>
-#include <stddef.h>
-#include <stdint.h>
#include <unistd.h>
#include "base/mac/mac_util.h"
diff --git a/sandbox/mac/os_compatibility.h b/sandbox/mac/os_compatibility.h
index 4f18c34..a1f51f2 100644
--- a/sandbox/mac/os_compatibility.h
+++ b/sandbox/mac/os_compatibility.h
@@ -13,7 +13,6 @@
#define SANDBOX_MAC_OS_COMPATIBILITY_H_
#include <mach/mach.h>
-#include <stdint.h>
#include <string>
diff --git a/sandbox/mac/pre_exec_delegate.cc b/sandbox/mac/pre_exec_delegate.cc
index 9d777d3..adf40a0 100644
--- a/sandbox/mac/pre_exec_delegate.cc
+++ b/sandbox/mac/pre_exec_delegate.cc
@@ -6,7 +6,6 @@
#include <mach/mach.h>
#include <servers/bootstrap.h>
-#include <stdint.h>
#include "base/logging.h"
#include "base/mac/mac_util.h"
diff --git a/sandbox/mac/pre_exec_delegate.h b/sandbox/mac/pre_exec_delegate.h
index 4ed41db..b84082e 100644
--- a/sandbox/mac/pre_exec_delegate.h
+++ b/sandbox/mac/pre_exec_delegate.h
@@ -5,9 +5,6 @@
#ifndef SANDBOX_MAC_PRE_EXEC_DELEGATE_H_
#define SANDBOX_MAC_PRE_EXEC_DELEGATE_H_
-#include <stdint.h>
-
-#include "base/macros.h"
#include "base/process/launch.h"
#include "sandbox/mac/xpc.h"
diff --git a/sandbox/mac/xpc_message_server.h b/sandbox/mac/xpc_message_server.h
index 94c8858..48209a6 100644
--- a/sandbox/mac/xpc_message_server.h
+++ b/sandbox/mac/xpc_message_server.h
@@ -9,7 +9,6 @@
#include "base/mac/dispatch_source_mach.h"
#include "base/mac/scoped_mach_port.h"
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "sandbox/mac/message_server.h"
#include "sandbox/mac/xpc.h"
diff --git a/sandbox/mac/xpc_message_server_unittest.cc b/sandbox/mac/xpc_message_server_unittest.cc
index 585a627..26e4ad0 100644
--- a/sandbox/mac/xpc_message_server_unittest.cc
+++ b/sandbox/mac/xpc_message_server_unittest.cc
@@ -7,7 +7,6 @@
#include <Block.h>
#include <mach/mach.h>
#include <servers/bootstrap.h>
-#include <stdint.h>
#include "base/command_line.h"
#include "base/logging.h"
diff --git a/sandbox/mac/xpc_stubs_header.fragment b/sandbox/mac/xpc_stubs_header.fragment
index 2aa81cc..977ffe7 100644
--- a/sandbox/mac/xpc_stubs_header.fragment
+++ b/sandbox/mac/xpc_stubs_header.fragment
@@ -6,8 +6,6 @@
#define SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_
#include <bsm/libbsm.h>
-#include <stddef.h>
-#include <stdint.h>
#include "sandbox/sandbox_export.h"
diff --git a/sandbox/win/sandbox_poc/main_ui_window.cc b/sandbox/win/sandbox_poc/main_ui_window.cc
index c000ce1..8d67cec 100644
--- a/sandbox/win/sandbox_poc/main_ui_window.cc
+++ b/sandbox/win/sandbox_poc/main_ui_window.cc
@@ -2,13 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sandbox/win/sandbox_poc/main_ui_window.h"
-
#include <windows.h>
#include <CommCtrl.h>
#include <commdlg.h>
#include <stdarg.h>
-#include <stddef.h>
#include <time.h>
#include <windowsx.h>
#include <atlbase.h>
@@ -16,6 +13,7 @@
#include <algorithm>
#include <sstream>
+#include "sandbox/win/sandbox_poc/main_ui_window.h"
#include "base/logging.h"
#include "sandbox/win/sandbox_poc/resource.h"
#include "sandbox/win/src/acl.h"
diff --git a/sandbox/win/sandbox_poc/main_ui_window.h b/sandbox/win/sandbox_poc/main_ui_window.h
index ad99873..84fb986 100644
--- a/sandbox/win/sandbox_poc/main_ui_window.h
+++ b/sandbox/win/sandbox_poc/main_ui_window.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
namespace sandbox {
diff --git a/sandbox/win/sandbox_poc/pocdll/utils.h b/sandbox/win/sandbox_poc/pocdll/utils.h
index 0a6ad37..7588962 100644
--- a/sandbox/win/sandbox_poc/pocdll/utils.h
+++ b/sandbox/win/sandbox_poc/pocdll/utils.h
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <io.h>
+#include "base/basictypes.h"
#include "base/macros.h"
diff --git a/sandbox/win/src/Wow64.cc b/sandbox/win/src/Wow64.cc
index 306b9c1..24facfc 100644
--- a/sandbox/win/src/Wow64.cc
+++ b/sandbox/win/src/Wow64.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/wow64.h"
-#include <stddef.h>
-
#include <sstream>
#include "base/logging.h"
diff --git a/sandbox/win/src/Wow64.h b/sandbox/win/src/Wow64.h
index acabc35..5858ed8 100644
--- a/sandbox/win/src/Wow64.h
+++ b/sandbox/win/src/Wow64.h
@@ -7,7 +7,7 @@
#include <windows.h>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/app_container.cc b/sandbox/win/src/app_container.cc
index a51f092..f8d7541 100644
--- a/sandbox/win/src/app_container.cc
+++ b/sandbox/win/src/app_container.cc
@@ -5,7 +5,6 @@
#include "sandbox/win/src/app_container.h"
#include <Sddl.h>
-#include <stddef.h>
#include <vector>
#include "base/logging.h"
diff --git a/sandbox/win/src/app_container.h b/sandbox/win/src/app_container.h
index fe2b189..a08c01b 100644
--- a/sandbox/win/src/app_container.h
+++ b/sandbox/win/src/app_container.h
@@ -9,7 +9,6 @@
#include <vector>
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/broker_services.cc b/sandbox/win/src/broker_services.cc
index c3df2ef..5e6494f 100644
--- a/sandbox/win/src/broker_services.cc
+++ b/sandbox/win/src/broker_services.cc
@@ -5,7 +5,6 @@
#include "sandbox/win/src/broker_services.h"
#include <AclAPI.h>
-#include <stddef.h>
#include "base/logging.h"
#include "base/macros.h"
@@ -18,8 +17,8 @@
#include "base/win/windows_version.h"
#include "sandbox/win/src/app_container.h"
#include "sandbox/win/src/process_mitigations.h"
-#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/sandbox_policy_base.h"
+#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/target_process.h"
#include "sandbox/win/src/win2k_threadpool.h"
#include "sandbox/win/src/win_utils.h"
diff --git a/sandbox/win/src/broker_services.h b/sandbox/win/src/broker_services.h
index 6c8f523..b16d5fc 100644
--- a/sandbox/win/src/broker_services.h
+++ b/sandbox/win/src/broker_services.h
@@ -9,8 +9,8 @@
#include <map>
#include <set>
#include <utility>
+#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/job.h"
diff --git a/sandbox/win/src/crosscall_client.h b/sandbox/win/src/crosscall_client.h
index 60ff243..777bab7 100644
--- a/sandbox/win/src/crosscall_client.h
+++ b/sandbox/win/src/crosscall_client.h
@@ -5,9 +5,6 @@
#ifndef SANDBOX_SRC_CROSSCALL_CLIENT_H_
#define SANDBOX_SRC_CROSSCALL_CLIENT_H_
-#include <stddef.h>
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_params.h"
#include "sandbox/win/src/sandbox.h"
diff --git a/sandbox/win/src/crosscall_params.h b/sandbox/win/src/crosscall_params.h
index eb59c44..c060c60 100644
--- a/sandbox/win/src/crosscall_params.h
+++ b/sandbox/win/src/crosscall_params.h
@@ -7,12 +7,11 @@
#include <windows.h>
#include <lmaccess.h>
-#include <stddef.h>
#include <stdint.h>
#include <memory>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/internal_types.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/crosscall_server.cc b/sandbox/win/src/crosscall_server.cc
index 9f71f33..f0e1183 100644
--- a/sandbox/win/src/crosscall_server.cc
+++ b/sandbox/win/src/crosscall_server.cc
@@ -4,15 +4,12 @@
#include "sandbox/win/src/crosscall_server.h"
-#include <stddef.h>
-#include <stdint.h>
-
#include <string>
#include <vector>
-#include "base/logging.h"
-#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/crosscall_params.h"
+#include "sandbox/win/src/crosscall_client.h"
+#include "base/logging.h"
// This code performs the ipc message validation. Potential security flaws
// on the ipc are likelier to be found in this code than in the rest of
diff --git a/sandbox/win/src/crosscall_server.h b/sandbox/win/src/crosscall_server.h
index 0820ac4..9779c11 100644
--- a/sandbox/win/src/crosscall_server.h
+++ b/sandbox/win/src/crosscall_server.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_SRC_CROSSCALL_SERVER_H_
#define SANDBOX_SRC_CROSSCALL_SERVER_H_
-#include <stdint.h>
-
#include <string>
#include <vector>
diff --git a/sandbox/win/src/eat_resolver.cc b/sandbox/win/src/eat_resolver.cc
index 48681e8..1675ce8 100644
--- a/sandbox/win/src/eat_resolver.cc
+++ b/sandbox/win/src/eat_resolver.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/eat_resolver.h"
-#include <stddef.h>
-
#include "base/win/pe_image.h"
#include "sandbox/win/src/sandbox_nt_util.h"
diff --git a/sandbox/win/src/eat_resolver.h b/sandbox/win/src/eat_resolver.h
index a45d006..1d9d430 100644
--- a/sandbox/win/src/eat_resolver.h
+++ b/sandbox/win/src/eat_resolver.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_EAT_RESOLVER_H__
#define SANDBOX_SRC_EAT_RESOLVER_H__
-#include <stddef.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/resolver.h"
diff --git a/sandbox/win/src/filesystem_dispatcher.cc b/sandbox/win/src/filesystem_dispatcher.cc
index 6f96be2..d4ef796 100644
--- a/sandbox/win/src/filesystem_dispatcher.cc
+++ b/sandbox/win/src/filesystem_dispatcher.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/filesystem_dispatcher.h"
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/filesystem_interception.h"
#include "sandbox/win/src/filesystem_policy.h"
@@ -88,12 +86,12 @@ bool FilesystemDispatcher::SetupService(InterceptionManager* manager,
bool FilesystemDispatcher::NtCreateFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t file_attributes,
- uint32_t share_access,
- uint32_t create_disposition,
- uint32_t create_options) {
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 file_attributes,
+ uint32 share_access,
+ uint32 create_disposition,
+ uint32 create_options) {
if (!PreProcessName(name)) {
// The path requested might contain a reparse point.
ipc->return_info.nt_status = STATUS_ACCESS_DENIED;
@@ -102,7 +100,7 @@ bool FilesystemDispatcher::NtCreateFile(IPCInfo* ipc,
const wchar_t* filename = name->c_str();
- uint32_t broker = TRUE;
+ uint32 broker = TRUE;
CountedParameterSet<OpenFile> params;
params[OpenFile::NAME] = ParamPickerMake(filename);
params[OpenFile::ACCESS] = ParamPickerMake(desired_access);
@@ -136,10 +134,10 @@ bool FilesystemDispatcher::NtCreateFile(IPCInfo* ipc,
bool FilesystemDispatcher::NtOpenFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t share_access,
- uint32_t open_options) {
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 share_access,
+ uint32 open_options) {
if (!PreProcessName(name)) {
// The path requested might contain a reparse point.
ipc->return_info.nt_status = STATUS_ACCESS_DENIED;
@@ -148,8 +146,8 @@ bool FilesystemDispatcher::NtOpenFile(IPCInfo* ipc,
const wchar_t* filename = name->c_str();
- uint32_t broker = TRUE;
- uint32_t create_disposition = FILE_OPEN;
+ uint32 broker = TRUE;
+ uint32 create_disposition = FILE_OPEN;
CountedParameterSet<OpenFile> params;
params[OpenFile::NAME] = ParamPickerMake(filename);
params[OpenFile::ACCESS] = ParamPickerMake(desired_access);
@@ -181,7 +179,7 @@ bool FilesystemDispatcher::NtOpenFile(IPCInfo* ipc,
bool FilesystemDispatcher::NtQueryAttributesFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
CountedBuffer* info) {
if (sizeof(FILE_BASIC_INFORMATION) != info->Size())
return false;
@@ -192,7 +190,7 @@ bool FilesystemDispatcher::NtQueryAttributesFile(IPCInfo* ipc,
return true;
}
- uint32_t broker = TRUE;
+ uint32 broker = TRUE;
const wchar_t* filename = name->c_str();
CountedParameterSet<FileName> params;
params[FileName::NAME] = ParamPickerMake(filename);
@@ -221,7 +219,7 @@ bool FilesystemDispatcher::NtQueryAttributesFile(IPCInfo* ipc,
bool FilesystemDispatcher::NtQueryFullAttributesFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
CountedBuffer* info) {
if (sizeof(FILE_NETWORK_OPEN_INFORMATION) != info->Size())
return false;
@@ -232,7 +230,7 @@ bool FilesystemDispatcher::NtQueryFullAttributesFile(IPCInfo* ipc,
return true;
}
- uint32_t broker = TRUE;
+ uint32 broker = TRUE;
const wchar_t* filename = name->c_str();
CountedParameterSet<FileName> params;
params[FileName::NAME] = ParamPickerMake(filename);
@@ -265,8 +263,8 @@ bool FilesystemDispatcher::NtSetInformationFile(IPCInfo* ipc,
HANDLE handle,
CountedBuffer* status,
CountedBuffer* info,
- uint32_t length,
- uint32_t info_class) {
+ uint32 length,
+ uint32 info_class) {
if (sizeof(IO_STATUS_BLOCK) != status->Size())
return false;
if (length != info->Size())
@@ -287,7 +285,7 @@ bool FilesystemDispatcher::NtSetInformationFile(IPCInfo* ipc,
return true;
}
- uint32_t broker = TRUE;
+ uint32 broker = TRUE;
const wchar_t* filename = name.c_str();
CountedParameterSet<FileName> params;
params[FileName::NAME] = ParamPickerMake(filename);
diff --git a/sandbox/win/src/filesystem_dispatcher.h b/sandbox/win/src/filesystem_dispatcher.h
index 61d918e..192d36c 100644
--- a/sandbox/win/src/filesystem_dispatcher.h
+++ b/sandbox/win/src/filesystem_dispatcher.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__
#define SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy_base.h"
@@ -27,33 +25,33 @@ class FilesystemDispatcher : public Dispatcher {
// Processes IPC requests coming from calls to NtCreateFile in the target.
bool NtCreateFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t file_attributes,
- uint32_t share_access,
- uint32_t create_disposition,
- uint32_t create_options);
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 file_attributes,
+ uint32 share_access,
+ uint32 create_disposition,
+ uint32 create_options);
// Processes IPC requests coming from calls to NtOpenFile in the target.
bool NtOpenFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t share_access,
- uint32_t create_options);
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 share_access,
+ uint32 create_options);
// Processes IPC requests coming from calls to NtQueryAttributesFile in the
// target.
bool NtQueryAttributesFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
CountedBuffer* info);
// Processes IPC requests coming from calls to NtQueryFullAttributesFile in
// the target.
bool NtQueryFullAttributesFile(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
CountedBuffer* info);
// Processes IPC requests coming from calls to NtSetInformationFile with the
@@ -62,8 +60,8 @@ class FilesystemDispatcher : public Dispatcher {
HANDLE handle,
CountedBuffer* status,
CountedBuffer* info,
- uint32_t length,
- uint32_t info_class);
+ uint32 length,
+ uint32 info_class);
PolicyBase* policy_base_;
DISALLOW_COPY_AND_ASSIGN(FilesystemDispatcher);
diff --git a/sandbox/win/src/filesystem_interception.cc b/sandbox/win/src/filesystem_interception.cc
index 26d790c..459f7ac 100644
--- a/sandbox/win/src/filesystem_interception.cc
+++ b/sandbox/win/src/filesystem_interception.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/filesystem_interception.h"
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_params.h"
@@ -48,16 +46,16 @@ NTSTATUS WINAPI TargetNtCreateFile(NtCreateFileFunction orig_CreateFile,
if (NULL == memory)
break;
- uint32_t attributes = 0;
+ uint32 attributes = 0;
NTSTATUS ret = AllocAndCopyName(object_attributes, &name, &attributes,
NULL);
if (!NT_SUCCESS(ret) || NULL == name)
break;
- uint32_t desired_access_uint32 = desired_access;
- uint32_t options_uint32 = options;
- uint32_t disposition_uint32 = disposition;
- uint32_t broker = FALSE;
+ uint32 desired_access_uint32 = desired_access;
+ uint32 options_uint32 = options;
+ uint32 disposition_uint32 = disposition;
+ uint32 broker = FALSE;
CountedParameterSet<OpenFile> params;
params[OpenFile::NAME] = ParamPickerMake(name);
params[OpenFile::ACCESS] = ParamPickerMake(desired_access_uint32);
@@ -124,16 +122,16 @@ NTSTATUS WINAPI TargetNtOpenFile(NtOpenFileFunction orig_OpenFile, PHANDLE file,
if (NULL == memory)
break;
- uint32_t attributes;
+ uint32 attributes;
NTSTATUS ret = AllocAndCopyName(object_attributes, &name, &attributes,
NULL);
if (!NT_SUCCESS(ret) || NULL == name)
break;
- uint32_t desired_access_uint32 = desired_access;
- uint32_t options_uint32 = options;
- uint32_t disposition_uint32 = FILE_OPEN;
- uint32_t broker = FALSE;
+ uint32 desired_access_uint32 = desired_access;
+ uint32 options_uint32 = options;
+ uint32 disposition_uint32 = FILE_OPEN;
+ uint32 broker = FALSE;
CountedParameterSet<OpenFile> params;
params[OpenFile::NAME] = ParamPickerMake(name);
params[OpenFile::ACCESS] = ParamPickerMake(desired_access_uint32);
@@ -194,7 +192,7 @@ NTSTATUS WINAPI TargetNtQueryAttributesFile(
if (NULL == memory)
break;
- uint32_t attributes = 0;
+ uint32 attributes = 0;
NTSTATUS ret = AllocAndCopyName(object_attributes, &name, &attributes,
NULL);
if (!NT_SUCCESS(ret) || NULL == name)
@@ -203,7 +201,7 @@ NTSTATUS WINAPI TargetNtQueryAttributesFile(
InOutCountedBuffer file_info(file_attributes,
sizeof(FILE_BASIC_INFORMATION));
- uint32_t broker = FALSE;
+ uint32 broker = FALSE;
CountedParameterSet<FileName> params;
params[FileName::NAME] = ParamPickerMake(name);
params[FileName::BROKER] = ParamPickerMake(broker);
@@ -253,7 +251,7 @@ NTSTATUS WINAPI TargetNtQueryFullAttributesFile(
if (NULL == memory)
break;
- uint32_t attributes = 0;
+ uint32 attributes = 0;
NTSTATUS ret = AllocAndCopyName(object_attributes, &name, &attributes,
NULL);
if (!NT_SUCCESS(ret) || NULL == name)
@@ -262,7 +260,7 @@ NTSTATUS WINAPI TargetNtQueryFullAttributesFile(
InOutCountedBuffer file_info(file_attributes,
sizeof(FILE_NETWORK_OPEN_INFORMATION));
- uint32_t broker = FALSE;
+ uint32 broker = FALSE;
CountedParameterSet<FileName> params;
params[FileName::NAME] = ParamPickerMake(name);
params[FileName::BROKER] = ParamPickerMake(broker);
@@ -335,7 +333,7 @@ NTSTATUS WINAPI TargetNtSetInformationFile(
if (!NT_SUCCESS(ret) || !name)
break;
- uint32_t broker = FALSE;
+ uint32 broker = FALSE;
CountedParameterSet<FileName> params;
params[FileName::NAME] = ParamPickerMake(name);
params[FileName::BROKER] = ParamPickerMake(broker);
diff --git a/sandbox/win/src/filesystem_policy.cc b/sandbox/win/src/filesystem_policy.cc
index 60d7409..eb6b197 100644
--- a/sandbox/win/src/filesystem_policy.cc
+++ b/sandbox/win/src/filesystem_policy.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stdint.h>
-
#include <string>
#include "sandbox/win/src/filesystem_policy.h"
@@ -14,8 +12,8 @@
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_engine_opcodes.h"
#include "sandbox/win/src/policy_params.h"
-#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/sandbox_utils.h"
+#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/win_utils.h"
namespace {
@@ -241,16 +239,16 @@ bool FileSystemPolicy::SetInitialRules(LowLevelPolicy* policy) {
bool FileSystemPolicy::CreateFileAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t file_attributes,
- uint32_t share_access,
- uint32_t create_disposition,
- uint32_t create_options,
- HANDLE* handle,
+ const base::string16 &file,
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 file_attributes,
+ uint32 share_access,
+ uint32 create_disposition,
+ uint32 create_options,
+ HANDLE *handle,
NTSTATUS* nt_status,
- ULONG_PTR* io_information) {
+ ULONG_PTR *io_information) {
// The only action supported is ASK_BROKER which means create the requested
// file as specified.
if (ASK_BROKER != eval_result) {
@@ -275,14 +273,14 @@ bool FileSystemPolicy::CreateFileAction(EvalResult eval_result,
bool FileSystemPolicy::OpenFileAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t share_access,
- uint32_t open_options,
- HANDLE* handle,
+ const base::string16 &file,
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 share_access,
+ uint32 open_options,
+ HANDLE *handle,
NTSTATUS* nt_status,
- ULONG_PTR* io_information) {
+ ULONG_PTR *io_information) {
// The only action supported is ASK_BROKER which means open the requested
// file as specified.
if (ASK_BROKER != eval_result) {
@@ -310,8 +308,8 @@ bool FileSystemPolicy::OpenFileAction(EvalResult eval_result,
bool FileSystemPolicy::QueryAttributesFileAction(
EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
+ const base::string16 &file,
+ uint32 attributes,
FILE_BASIC_INFORMATION* file_info,
NTSTATUS* nt_status) {
// The only action supported is ASK_BROKER which means query the requested
@@ -338,8 +336,8 @@ bool FileSystemPolicy::QueryAttributesFileAction(
bool FileSystemPolicy::QueryFullAttributesFileAction(
EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
+ const base::string16 &file,
+ uint32 attributes,
FILE_NETWORK_OPEN_INFORMATION* file_info,
NTSTATUS* nt_status) {
// The only action supported is ASK_BROKER which means query the requested
@@ -363,14 +361,11 @@ bool FileSystemPolicy::QueryFullAttributesFileAction(
return true;
}
-bool FileSystemPolicy::SetInformationFileAction(EvalResult eval_result,
- const ClientInfo& client_info,
- HANDLE target_file_handle,
- void* file_info,
- uint32_t length,
- uint32_t info_class,
- IO_STATUS_BLOCK* io_block,
- NTSTATUS* nt_status) {
+bool FileSystemPolicy::SetInformationFileAction(
+ EvalResult eval_result, const ClientInfo& client_info,
+ HANDLE target_file_handle, void* file_info, uint32 length,
+ uint32 info_class, IO_STATUS_BLOCK* io_block,
+ NTSTATUS* nt_status) {
// The only action supported is ASK_BROKER which means open the requested
// file as specified.
if (ASK_BROKER != eval_result) {
diff --git a/sandbox/win/src/filesystem_policy.h b/sandbox/win/src/filesystem_policy.h
index c2ee160..4103ad6 100644
--- a/sandbox/win/src/filesystem_policy.h
+++ b/sandbox/win/src/filesystem_policy.h
@@ -5,10 +5,9 @@
#ifndef SANDBOX_SRC_FILESYSTEM_POLICY_H__
#define SANDBOX_SRC_FILESYSTEM_POLICY_H__
-#include <stdint.h>
-
#include <string>
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/nt_internals.h"
@@ -41,13 +40,13 @@ class FileSystemPolicy {
// 'file' : The target file or directory.
static bool CreateFileAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t file_attributes,
- uint32_t share_access,
- uint32_t create_disposition,
- uint32_t create_options,
+ const base::string16 &file,
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 file_attributes,
+ uint32 share_access,
+ uint32 create_disposition,
+ uint32 create_options,
HANDLE* handle,
NTSTATUS* nt_status,
ULONG_PTR* io_information);
@@ -59,11 +58,11 @@ class FileSystemPolicy {
// 'file' : The target file or directory.
static bool OpenFileAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
- uint32_t desired_access,
- uint32_t share_access,
- uint32_t open_options,
+ const base::string16 &file,
+ uint32 attributes,
+ uint32 desired_access,
+ uint32 share_access,
+ uint32 open_options,
HANDLE* handle,
NTSTATUS* nt_status,
ULONG_PTR* io_information);
@@ -72,8 +71,8 @@ class FileSystemPolicy {
// API that is compatible with the IPC-received parameters.
static bool QueryAttributesFileAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
+ const base::string16 &file,
+ uint32 attributes,
FILE_BASIC_INFORMATION* file_info,
NTSTATUS* nt_status);
@@ -82,8 +81,8 @@ class FileSystemPolicy {
static bool QueryFullAttributesFileAction(
EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& file,
- uint32_t attributes,
+ const base::string16 &file,
+ uint32 attributes,
FILE_NETWORK_OPEN_INFORMATION* file_info,
NTSTATUS* nt_status);
@@ -93,8 +92,8 @@ class FileSystemPolicy {
const ClientInfo& client_info,
HANDLE target_file_handle,
void* file_info,
- uint32_t length,
- uint32_t info_class,
+ uint32 length,
+ uint32 info_class,
IO_STATUS_BLOCK* io_block,
NTSTATUS* nt_status);
};
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc
index f2012b7..2e3a782 100644
--- a/sandbox/win/src/handle_closer.cc
+++ b/sandbox/win/src/handle_closer.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/handle_closer.h"
-#include <stddef.h>
-
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/win/windows_version.h"
diff --git a/sandbox/win/src/handle_closer.h b/sandbox/win/src/handle_closer.h
index 9592230..2b43a6e 100644
--- a/sandbox/win/src/handle_closer.h
+++ b/sandbox/win/src/handle_closer.h
@@ -5,12 +5,10 @@
#ifndef SANDBOX_SRC_HANDLE_CLOSER_H_
#define SANDBOX_SRC_HANDLE_CLOSER_H_
-#include <stddef.h>
-
#include <map>
#include <set>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/interception.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/handle_closer_agent.cc b/sandbox/win/src/handle_closer_agent.cc
index 5face9b..b26fb15 100644
--- a/sandbox/win/src/handle_closer_agent.cc
+++ b/sandbox/win/src/handle_closer_agent.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/handle_closer_agent.h"
-#include <stddef.h>
-
#include "base/logging.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/win_utils.h"
diff --git a/sandbox/win/src/handle_closer_agent.h b/sandbox/win/src/handle_closer_agent.h
index 042c98e..ca0a6cf 100644
--- a/sandbox/win/src/handle_closer_agent.h
+++ b/sandbox/win/src/handle_closer_agent.h
@@ -5,7 +5,7 @@
#ifndef SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
#define SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/handle_closer.h"
diff --git a/sandbox/win/src/handle_closer_test.cc b/sandbox/win/src/handle_closer_test.cc
index c144ac3..10ebe3b 100644
--- a/sandbox/win/src/handle_closer_test.cc
+++ b/sandbox/win/src/handle_closer_test.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-
#include "base/strings/stringprintf.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/handle_closer_agent.h"
diff --git a/sandbox/win/src/handle_dispatcher.cc b/sandbox/win/src/handle_dispatcher.cc
index 4b98acd..fb640ba 100644
--- a/sandbox/win/src/handle_dispatcher.cc
+++ b/sandbox/win/src/handle_dispatcher.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/handle_dispatcher.h"
-#include <stdint.h>
-
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/handle_interception.h"
#include "sandbox/win/src/handle_policy.h"
@@ -43,9 +41,9 @@ bool HandleDispatcher::SetupService(InterceptionManager* manager,
bool HandleDispatcher::DuplicateHandleProxy(IPCInfo* ipc,
HANDLE source_handle,
- uint32_t target_process_id,
- uint32_t desired_access,
- uint32_t options) {
+ uint32 target_process_id,
+ uint32 desired_access,
+ uint32 options) {
static NtQueryObject QueryObject = NULL;
if (!QueryObject)
ResolveNTFunctionPtr("NtQueryObject", &QueryObject);
diff --git a/sandbox/win/src/handle_dispatcher.h b/sandbox/win/src/handle_dispatcher.h
index 24dcdac..84a22e1 100644
--- a/sandbox/win/src/handle_dispatcher.h
+++ b/sandbox/win/src/handle_dispatcher.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_HANDLE_DISPATCHER_H_
#define SANDBOX_SRC_HANDLE_DISPATCHER_H_
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy_base.h"
@@ -27,9 +25,9 @@ class HandleDispatcher : public Dispatcher {
// TargetServices::DuplicateHandle() in the target.
bool DuplicateHandleProxy(IPCInfo* ipc,
HANDLE source_handle,
- uint32_t target_process_id,
- uint32_t desired_access,
- uint32_t options);
+ uint32 target_process_id,
+ uint32 desired_access,
+ uint32 options);
PolicyBase* policy_base_;
DISALLOW_COPY_AND_ASSIGN(HandleDispatcher);
diff --git a/sandbox/win/src/handle_policy.h b/sandbox/win/src/handle_policy.h
index 29ce5ab..ffe54b8 100644
--- a/sandbox/win/src/handle_policy.h
+++ b/sandbox/win/src/handle_policy.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/basictypes.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/policy_low_level.h"
#include "sandbox/win/src/sandbox_policy.h"
diff --git a/sandbox/win/src/interception.cc b/sandbox/win/src/interception.cc
index f0a2a61..1d858be 100644
--- a/sandbox/win/src/interception.cc
+++ b/sandbox/win/src/interception.cc
@@ -5,8 +5,6 @@
// For information about interceptions as a whole see
// http://dev.chromium.org/developers/design-documents/sandbox .
-#include <stddef.h>
-
#include <set>
#include "sandbox/win/src/interception.h"
diff --git a/sandbox/win/src/interception.h b/sandbox/win/src/interception.h
index 4d1ee82..728dc74 100644
--- a/sandbox/win/src/interception.h
+++ b/sandbox/win/src/interception.h
@@ -9,13 +9,11 @@
#ifndef SANDBOX_SRC_INTERCEPTION_H_
#define SANDBOX_SRC_INTERCEPTION_H_
-#include <stddef.h>
-
#include <list>
#include <string>
+#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
-#include "base/macros.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/interception_agent.cc b/sandbox/win/src/interception_agent.cc
index 1ef6886..b2a66c4 100644
--- a/sandbox/win/src/interception_agent.cc
+++ b/sandbox/win/src/interception_agent.cc
@@ -7,13 +7,11 @@
#include "sandbox/win/src/interception_agent.h"
-#include <stddef.h>
-
-#include "sandbox/win/src/eat_resolver.h"
#include "sandbox/win/src/interception_internal.h"
#include "sandbox/win/src/interceptors.h"
-#include "sandbox/win/src/sandbox_nt_util.h"
+#include "sandbox/win/src/eat_resolver.h"
#include "sandbox/win/src/sidestep_resolver.h"
+#include "sandbox/win/src/sandbox_nt_util.h"
namespace {
diff --git a/sandbox/win/src/interception_agent.h b/sandbox/win/src/interception_agent.h
index b2bce08..2762c61 100644
--- a/sandbox/win/src/interception_agent.h
+++ b/sandbox/win/src/interception_agent.h
@@ -9,7 +9,7 @@
#ifndef SANDBOX_SRC_INTERCEPTION_AGENT_H__
#define SANDBOX_SRC_INTERCEPTION_AGENT_H__
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/interception_internal.h b/sandbox/win/src/interception_internal.h
index 45a0557..810478a 100644
--- a/sandbox/win/src/interception_internal.h
+++ b/sandbox/win/src/interception_internal.h
@@ -9,8 +9,6 @@
#ifndef SANDBOX_SRC_INTERCEPTION_INTERNAL_H_
#define SANDBOX_SRC_INTERCEPTION_INTERNAL_H_
-#include <stddef.h>
-
#include "sandbox/win/src/sandbox_types.h"
namespace sandbox {
diff --git a/sandbox/win/src/interception_unittest.cc b/sandbox/win/src/interception_unittest.cc
index 7b7932af..9b282df 100644
--- a/sandbox/win/src/interception_unittest.cc
+++ b/sandbox/win/src/interception_unittest.cc
@@ -6,17 +6,16 @@
// The tests require private information so the whole interception.cc file is
// included from this file.
-#include <windows.h>
-#include <stddef.h>
-
#include <algorithm>
#include <set>
+#include <windows.h>
+
#include "base/bits.h"
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/src/interception.h"
-#include "sandbox/win/src/interception_internal.h"
#include "sandbox/win/src/interceptors.h"
+#include "sandbox/win/src/interception_internal.h"
#include "sandbox/win/src/target_process.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/sandbox/win/src/internal_types.h b/sandbox/win/src/internal_types.h
index e102818..026bedb 100644
--- a/sandbox/win/src/internal_types.h
+++ b/sandbox/win/src/internal_types.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_WIN_SRC_INTERNAL_TYPES_H_
#define SANDBOX_WIN_SRC_INTERNAL_TYPES_H_
-#include <stdint.h>
-
namespace sandbox {
const wchar_t kNtdllName[] = L"ntdll.dll";
@@ -30,16 +28,18 @@ enum ArgType {
// Encapsulates a pointer to a buffer and the size of the buffer.
class CountedBuffer {
public:
- CountedBuffer(void* buffer, uint32_t size) : size_(size), buffer_(buffer) {}
+ CountedBuffer(void* buffer, uint32 size) : size_(size), buffer_(buffer) {}
- uint32_t Size() const { return size_; }
+ uint32 Size() const {
+ return size_;
+ }
void* Buffer() const {
return buffer_;
}
private:
- uint32_t size_;
+ uint32 size_;
void* buffer_;
};
diff --git a/sandbox/win/src/ipc_unittest.cc b/sandbox/win/src/ipc_unittest.cc
index c41720d..9b61a43 100644
--- a/sandbox/win/src/ipc_unittest.cc
+++ b/sandbox/win/src/ipc_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
#include <stdint.h>
#include "sandbox/win/src/crosscall_client.h"
diff --git a/sandbox/win/src/job.cc b/sandbox/win/src/job.cc
index adf392d..9c854e5 100644
--- a/sandbox/win/src/job.cc
+++ b/sandbox/win/src/job.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/job.h"
-#include <stddef.h>
-
#include "base/win/windows_version.h"
#include "sandbox/win/src/restricted_token.h"
diff --git a/sandbox/win/src/job.h b/sandbox/win/src/job.h
index ad3dd41..4b7cb72 100644
--- a/sandbox/win/src/job.h
+++ b/sandbox/win/src/job.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_JOB_H_
#define SANDBOX_SRC_JOB_H_
-#include <stddef.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/restricted_token_utils.h"
diff --git a/sandbox/win/src/named_pipe_dispatcher.cc b/sandbox/win/src/named_pipe_dispatcher.cc
index ea8d380..53bb7c4 100644
--- a/sandbox/win/src/named_pipe_dispatcher.cc
+++ b/sandbox/win/src/named_pipe_dispatcher.cc
@@ -4,8 +4,7 @@
#include "sandbox/win/src/named_pipe_dispatcher.h"
-#include <stdint.h>
-
+#include "base/basictypes.h"
#include "base/strings/string_split.h"
#include "sandbox/win/src/crosscall_client.h"
@@ -48,12 +47,12 @@ bool NamedPipeDispatcher::SetupService(InterceptionManager* manager,
bool NamedPipeDispatcher::CreateNamedPipe(IPCInfo* ipc,
base::string16* name,
- uint32_t open_mode,
- uint32_t pipe_mode,
- uint32_t max_instances,
- uint32_t out_buffer_size,
- uint32_t in_buffer_size,
- uint32_t default_timeout) {
+ uint32 open_mode,
+ uint32 pipe_mode,
+ uint32 max_instances,
+ uint32 out_buffer_size,
+ uint32 in_buffer_size,
+ uint32 default_timeout) {
ipc->return_info.win32_result = ERROR_ACCESS_DENIED;
ipc->return_info.handle = INVALID_HANDLE_VALUE;
diff --git a/sandbox/win/src/named_pipe_dispatcher.h b/sandbox/win/src/named_pipe_dispatcher.h
index 83f45e0..1c02199 100644
--- a/sandbox/win/src/named_pipe_dispatcher.h
+++ b/sandbox/win/src/named_pipe_dispatcher.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_NAMED_PIPE_DISPATCHER_H__
#define SANDBOX_SRC_NAMED_PIPE_DISPATCHER_H__
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy_base.h"
@@ -28,12 +26,12 @@ class NamedPipeDispatcher : public Dispatcher {
// target.
bool CreateNamedPipe(IPCInfo* ipc,
base::string16* name,
- uint32_t open_mode,
- uint32_t pipe_mode,
- uint32_t max_instances,
- uint32_t out_buffer_size,
- uint32_t in_buffer_size,
- uint32_t default_timeout);
+ uint32 open_mode,
+ uint32 pipe_mode,
+ uint32 max_instances,
+ uint32 out_buffer_size,
+ uint32 in_buffer_size,
+ uint32 default_timeout);
PolicyBase* policy_base_;
DISALLOW_COPY_AND_ASSIGN(NamedPipeDispatcher);
diff --git a/sandbox/win/src/named_pipe_policy.h b/sandbox/win/src/named_pipe_policy.h
index 02aa26c..c904aa3 100644
--- a/sandbox/win/src/named_pipe_policy.h
+++ b/sandbox/win/src/named_pipe_policy.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/policy_low_level.h"
diff --git a/sandbox/win/src/nt_internals.h b/sandbox/win/src/nt_internals.h
index 2a39d5b..010f7cb 100644
--- a/sandbox/win/src/nt_internals.h
+++ b/sandbox/win/src/nt_internals.h
@@ -8,7 +8,6 @@
#define SANDBOX_WIN_SRC_NT_INTERNALS_H__
#include <windows.h>
-#include <stddef.h>
typedef LONG NTSTATUS;
#define NT_SUCCESS(st) (st >= 0)
diff --git a/sandbox/win/src/policy_broker.cc b/sandbox/win/src/policy_broker.cc
index a946ebc..c2d25bd 100644
--- a/sandbox/win/src/policy_broker.cc
+++ b/sandbox/win/src/policy_broker.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-
#include <map>
#include "sandbox/win/src/policy_broker.h"
diff --git a/sandbox/win/src/policy_engine_opcodes.cc b/sandbox/win/src/policy_engine_opcodes.cc
index 8dca0d9..dfe42c0 100644
--- a/sandbox/win/src/policy_engine_opcodes.cc
+++ b/sandbox/win/src/policy_engine_opcodes.cc
@@ -4,9 +4,7 @@
#include "sandbox/win/src/policy_engine_opcodes.h"
-#include <stddef.h>
-#include <stdint.h>
-
+#include "base/basictypes.h"
#include "sandbox/win/src/sandbox_nt_types.h"
#include "sandbox/win/src/sandbox_types.h"
@@ -50,7 +48,7 @@ EvalResult OpcodeEval(PolicyOpcode* opcode, const ParameterSet* pp,
// Opcode OpAlwaysFalse:
// Does not require input parameter.
-PolicyOpcode* OpcodeFactory::MakeOpAlwaysFalse(uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpAlwaysFalse(uint32 options) {
return MakeBase(OP_ALWAYS_FALSE, options, -1);
}
@@ -65,7 +63,7 @@ EvalResult OpcodeEval<OP_ALWAYS_FALSE>(PolicyOpcode* opcode,
// Opcode OpAlwaysTrue:
// Does not require input parameter.
-PolicyOpcode* OpcodeFactory::MakeOpAlwaysTrue(uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpAlwaysTrue(uint32 options) {
return MakeBase(OP_ALWAYS_TRUE, options, -1);
}
@@ -81,7 +79,8 @@ EvalResult OpcodeEval<OP_ALWAYS_TRUE>(PolicyOpcode* opcode,
// Does not require input parameter.
// Argument 0 contains the actual action to return.
-PolicyOpcode* OpcodeFactory::MakeOpAction(EvalResult action, uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpAction(EvalResult action,
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_ACTION, options, 0);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, action);
@@ -99,13 +98,13 @@ EvalResult OpcodeEval<OP_ACTION>(PolicyOpcode* opcode,
//////////////////////////////////////////////////////////////////////////////
// Opcode OpNumberMatch:
-// Requires a uint32_t or void* in selected_param
+// Requires a uint32 or void* in selected_param
// Argument 0 is the stored number to match.
// Argument 1 is the C++ type of the 0th argument.
-PolicyOpcode* OpcodeFactory::MakeOpNumberMatch(int16_t selected_param,
- uint32_t match,
- uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpNumberMatch(int16 selected_param,
+ uint32 match,
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_NUMBER_MATCH, options, selected_param);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, match);
@@ -113,9 +112,9 @@ PolicyOpcode* OpcodeFactory::MakeOpNumberMatch(int16_t selected_param,
return opcode;
}
-PolicyOpcode* OpcodeFactory::MakeOpVoidPtrMatch(int16_t selected_param,
+PolicyOpcode* OpcodeFactory::MakeOpVoidPtrMatch(int16 selected_param,
const void* match,
- uint32_t options) {
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_NUMBER_MATCH, options, selected_param);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, match);
@@ -127,9 +126,9 @@ template <>
EvalResult OpcodeEval<OP_NUMBER_MATCH>(PolicyOpcode* opcode,
const ParameterSet* param,
MatchContext* context) {
- uint32_t value_uint32 = 0;
+ uint32 value_uint32 = 0;
if (param->Get(&value_uint32)) {
- uint32_t match_uint32 = 0;
+ uint32 match_uint32 = 0;
opcode->GetArgument(0, &match_uint32);
return (match_uint32 != value_uint32)? EVAL_FALSE : EVAL_TRUE;
} else {
@@ -145,14 +144,14 @@ EvalResult OpcodeEval<OP_NUMBER_MATCH>(PolicyOpcode* opcode,
//////////////////////////////////////////////////////////////////////////////
// Opcode OpNumberMatchRange
-// Requires a uint32_t in selected_param.
+// Requires a uint32 in selected_param.
// Argument 0 is the stored lower bound to match.
// Argument 1 is the stored upper bound to match.
-PolicyOpcode* OpcodeFactory::MakeOpNumberMatchRange(int16_t selected_param,
- uint32_t lower_bound,
- uint32_t upper_bound,
- uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpNumberMatchRange(int16 selected_param,
+ uint32 lower_bound,
+ uint32 upper_bound,
+ uint32 options) {
if (lower_bound > upper_bound) {
return NULL;
}
@@ -168,11 +167,11 @@ template <>
EvalResult OpcodeEval<OP_NUMBER_MATCH_RANGE>(PolicyOpcode* opcode,
const ParameterSet* param,
MatchContext* context) {
- uint32_t value = 0;
+ uint32 value = 0;
if (!param->Get(&value)) return EVAL_ERROR;
- uint32_t lower_bound = 0;
- uint32_t upper_bound = 0;
+ uint32 lower_bound = 0;
+ uint32 upper_bound = 0;
opcode->GetArgument(0, &lower_bound);
opcode->GetArgument(1, &upper_bound);
return((lower_bound <= value) && (upper_bound >= value))?
@@ -181,12 +180,12 @@ EvalResult OpcodeEval<OP_NUMBER_MATCH_RANGE>(PolicyOpcode* opcode,
//////////////////////////////////////////////////////////////////////////////
// Opcode OpNumberAndMatch:
-// Requires a uint32_t in selected_param.
+// Requires a uint32 in selected_param.
// Argument 0 is the stored number to match.
-PolicyOpcode* OpcodeFactory::MakeOpNumberAndMatch(int16_t selected_param,
- uint32_t match,
- uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpNumberAndMatch(int16 selected_param,
+ uint32 match,
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_NUMBER_AND_MATCH, options, selected_param);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, match);
@@ -197,10 +196,10 @@ template <>
EvalResult OpcodeEval<OP_NUMBER_AND_MATCH>(PolicyOpcode* opcode,
const ParameterSet* param,
MatchContext* context) {
- uint32_t value = 0;
+ uint32 value = 0;
if (!param->Get(&value)) return EVAL_ERROR;
- uint32_t number = 0;
+ uint32 number = 0;
opcode->GetArgument(0, &number);
return (number & value)? EVAL_TRUE : EVAL_FALSE;
}
@@ -214,11 +213,11 @@ EvalResult OpcodeEval<OP_NUMBER_AND_MATCH>(PolicyOpcode* opcode,
// as noted in the header file.
// Argument 3 is the string matching options.
-PolicyOpcode* OpcodeFactory::MakeOpWStringMatch(int16_t selected_param,
+PolicyOpcode* OpcodeFactory::MakeOpWStringMatch(int16 selected_param,
const wchar_t* match_str,
int start_position,
StringMatchOptions match_opts,
- uint32_t options) {
+ uint32 options) {
if (NULL == match_str) {
return NULL;
}
@@ -342,8 +341,8 @@ EvalResult OpcodeEval<OP_WSTRING_MATCH>(PolicyOpcode* opcode,
// OpcodeMaker (other member functions).
PolicyOpcode* OpcodeFactory::MakeBase(OpcodeID opcode_id,
- uint32_t options,
- int16_t selected_param) {
+ uint32 options,
+ int16 selected_param) {
if (memory_size() < sizeof(PolicyOpcode)) {
return NULL;
}
diff --git a/sandbox/win/src/policy_engine_opcodes.h b/sandbox/win/src/policy_engine_opcodes.h
index 11a9c81..17d1764 100644
--- a/sandbox/win/src/policy_engine_opcodes.h
+++ b/sandbox/win/src/policy_engine_opcodes.h
@@ -5,10 +5,7 @@
#ifndef SANDBOX_WIN_SRC_POLICY_ENGINE_OPCODES_H_
#define SANDBOX_WIN_SRC_POLICY_ENGINE_OPCODES_H_
-#include <stddef.h>
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/numerics/safe_conversions.h"
#include "sandbox/win/src/policy_engine_params.h"
@@ -87,22 +84,22 @@ enum OpcodeID {
// Options that apply to every opcode. They are specified when creating
// each opcode using OpcodeFactory::MakeOpXXXXX() family of functions
// Do nothing special.
-const uint32_t kPolNone = 0;
+const uint32 kPolNone = 0;
// Convert EVAL_TRUE into EVAL_FALSE and vice-versa. This allows to express
// negated conditions such as if ( a && !b).
-const uint32_t kPolNegateEval = 1;
+const uint32 kPolNegateEval = 1;
// Zero the MatchContext context structure. This happens after the opcode
// is evaluated.
-const uint32_t kPolClearContext = 2;
+const uint32 kPolClearContext = 2;
// Use OR when evaluating this set of opcodes. The policy evaluator by default
// uses AND when evaluating. Very helpful when
// used with kPolNegateEval. For example if you have a condition best expressed
// as if(! (a && b && c)), the use of this flags allows it to be expressed as
// if ((!a) || (!b) || (!c)).
-const uint32_t kPolUseOREval = 4;
+const uint32 kPolUseOREval = 4;
// Keeps the evaluation state between opcode evaluations. This is used
// for string matching where the next opcode needs to continue matching
@@ -111,7 +108,7 @@ const uint32_t kPolUseOREval = 4;
// as an option kPolClearContext.
struct MatchContext {
size_t position;
- uint32_t options;
+ uint32 options;
MatchContext() {
Clear();
@@ -193,11 +190,13 @@ class PolicyOpcode {
}
// Returns the stored options such as kPolNegateEval and others.
- uint32_t GetOptions() const { return options_; }
+ uint32 GetOptions() const {
+ return options_;
+ }
// Sets the stored options such as kPolNegateEval.
- void SetOptions(uint32_t options) {
- options_ = base::checked_cast<uint16_t>(options);
+ void SetOptions(uint32 options) {
+ options_ = base::checked_cast<uint16>(options);
}
private:
@@ -219,11 +218,11 @@ class PolicyOpcode {
EvalResult EvaluateHelper(const ParameterSet* parameters,
MatchContext* match);
OpcodeID opcode_id_;
- int16_t parameter_;
- // TODO(cpu): Making |options_| a uint32_t would avoid casting, but causes
- // test failures. Somewhere code is relying on the size of this struct.
+ int16 parameter_;
+ // TODO(cpu): Making |options_| a uint32 would avoid casting, but causes test
+ // failures. Somewhere code is relying on the size of this struct.
// http://crbug.com/420296
- uint16_t options_;
+ uint16 options_;
OpcodeArgument arguments_[PolicyOpcode::kArgumentCount];
};
@@ -298,39 +297,39 @@ class OpcodeFactory {
}
// Creates an OpAlwaysFalse opcode.
- PolicyOpcode* MakeOpAlwaysFalse(uint32_t options);
+ PolicyOpcode* MakeOpAlwaysFalse(uint32 options);
// Creates an OpAlwaysFalse opcode.
- PolicyOpcode* MakeOpAlwaysTrue(uint32_t options);
+ PolicyOpcode* MakeOpAlwaysTrue(uint32 options);
// Creates an OpAction opcode.
// action: The action to return when Evaluate() is called.
- PolicyOpcode* MakeOpAction(EvalResult action, uint32_t options);
+ PolicyOpcode* MakeOpAction(EvalResult action, uint32 options);
// Creates an OpNumberMatch opcode.
- // selected_param: index of the input argument. It must be a uint32_t or the
+ // selected_param: index of the input argument. It must be a uint32 or the
// evaluation result will generate a EVAL_ERROR.
// match: the number to compare against the selected_param.
- PolicyOpcode* MakeOpNumberMatch(int16_t selected_param,
- uint32_t match,
- uint32_t options);
+ PolicyOpcode* MakeOpNumberMatch(int16 selected_param,
+ uint32 match,
+ uint32 options);
// Creates an OpNumberMatch opcode (void pointers are cast to numbers).
// selected_param: index of the input argument. It must be an void* or the
// evaluation result will generate a EVAL_ERROR.
// match: the pointer numeric value to compare against selected_param.
- PolicyOpcode* MakeOpVoidPtrMatch(int16_t selected_param,
+ PolicyOpcode* MakeOpVoidPtrMatch(int16 selected_param,
const void* match,
- uint32_t options);
+ uint32 options);
// Creates an OpNumberMatchRange opcode using the memory passed in the ctor.
- // selected_param: index of the input argument. It must be a uint32_t or the
+ // selected_param: index of the input argument. It must be a uint32 or the
// evaluation result will generate a EVAL_ERROR.
// lower_bound, upper_bound: the range to compare against selected_param.
- PolicyOpcode* MakeOpNumberMatchRange(int16_t selected_param,
- uint32_t lower_bound,
- uint32_t upper_bound,
- uint32_t options);
+ PolicyOpcode* MakeOpNumberMatchRange(int16 selected_param,
+ uint32 lower_bound,
+ uint32 upper_bound,
+ uint32 options);
// Creates an OpWStringMatch opcode using the raw memory passed in the ctor.
// selected_param: index of the input argument. It must be a wide string
@@ -345,27 +344,26 @@ class OpcodeFactory {
// current implementation.
// match_opts: Indicates additional matching flags. Currently CaseInsensitive
// is supported.
- PolicyOpcode* MakeOpWStringMatch(int16_t selected_param,
+ PolicyOpcode* MakeOpWStringMatch(int16 selected_param,
const wchar_t* match_str,
int start_position,
StringMatchOptions match_opts,
- uint32_t options);
+ uint32 options);
// Creates an OpNumberAndMatch opcode using the raw memory passed in the ctor.
- // selected_param: index of the input argument. It must be uint32_t or the
+ // selected_param: index of the input argument. It must be uint32 or the
// evaluation result will generate a EVAL_ERROR.
// match: the value to bitwise AND against selected_param.
- PolicyOpcode* MakeOpNumberAndMatch(int16_t selected_param,
- uint32_t match,
- uint32_t options);
+ PolicyOpcode* MakeOpNumberAndMatch(int16 selected_param,
+ uint32 match,
+ uint32 options);
private:
// Constructs the common part of every opcode. selected_param is the index
// of the input param to use when evaluating the opcode. Pass -1 in
// selected_param to indicate that no input parameter is required.
- PolicyOpcode* MakeBase(OpcodeID opcode_id,
- uint32_t options,
- int16_t selected_param);
+ PolicyOpcode* MakeBase(OpcodeID opcode_id, uint32 options,
+ int16 selected_param);
// Allocates (and copies) a string (of size length) inside the buffer and
// returns the displacement with respect to start.
diff --git a/sandbox/win/src/policy_engine_params.h b/sandbox/win/src/policy_engine_params.h
index fb4c00e..5b3c5ef 100644
--- a/sandbox/win/src/policy_engine_params.h
+++ b/sandbox/win/src/policy_engine_params.h
@@ -5,8 +5,7 @@
#ifndef SANDBOX_SRC_POLICY_ENGINE_PARAMS_H__
#define SANDBOX_SRC_POLICY_ENGINE_PARAMS_H__
-#include <stdint.h>
-
+#include "base/basictypes.h"
#include "sandbox/win/src/internal_types.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/sandbox_nt_util.h"
@@ -62,11 +61,11 @@ class ParameterSet {
ParameterSet() : real_type_(INVALID_TYPE), address_(NULL) {}
// Retrieve the stored parameter. If the type does not match ulong fail.
- bool Get(uint32_t* destination) const {
+ bool Get(uint32* destination) const {
if (real_type_ != UINT32_TYPE) {
return false;
}
- *destination = Void2TypePointerCopy<uint32_t>();
+ *destination = Void2TypePointerCopy<uint32>();
return true;
}
@@ -153,8 +152,9 @@ class ParameterSetEx<wchar_t const*> : public ParameterSet {
: ParameterSet(WCHAR_TYPE, address) {}
};
-template <>
-class ParameterSetEx<uint32_t> : public ParameterSet {
+
+template<>
+class ParameterSetEx<uint32> : public ParameterSet {
public:
ParameterSetEx(const void* address)
: ParameterSet(UINT32_TYPE, address) {}
diff --git a/sandbox/win/src/policy_engine_processor.cc b/sandbox/win/src/policy_engine_processor.cc
index 960db08..7ca25b2 100644
--- a/sandbox/win/src/policy_engine_processor.cc
+++ b/sandbox/win/src/policy_engine_processor.cc
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-#include <stdint.h>
-
#include "sandbox/win/src/policy_engine_processor.h"
namespace sandbox {
@@ -26,7 +23,7 @@ EvalResult PolicyProcessor::GetAction() const {
bool SkipOpcode(const PolicyOpcode& opcode, MatchContext* context,
bool* keep_skipping) {
if (opcode.IsAction()) {
- uint32_t options = context->options;
+ uint32 options = context->options;
context->Clear();
*keep_skipping = false;
return (kPolUseOREval != options);
@@ -35,7 +32,7 @@ bool SkipOpcode(const PolicyOpcode& opcode, MatchContext* context,
return true;
}
-PolicyResult PolicyProcessor::Evaluate(uint32_t options,
+PolicyResult PolicyProcessor::Evaluate(uint32 options,
ParameterSet* parameters,
size_t param_count) {
if (NULL == policy_) {
diff --git a/sandbox/win/src/policy_engine_processor.h b/sandbox/win/src/policy_engine_processor.h
index 0d56896..9e416bd 100644
--- a/sandbox/win/src/policy_engine_processor.h
+++ b/sandbox/win/src/policy_engine_processor.h
@@ -5,12 +5,9 @@
#ifndef SANDBOX_SRC_POLICY_ENGINE_PROCESSOR_H__
#define SANDBOX_SRC_POLICY_ENGINE_PROCESSOR_H__
-#include <stddef.h>
-#include <stdint.h>
-
-#include "base/macros.h"
-#include "sandbox/win/src/policy_engine_opcodes.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/policy_engine_params.h"
+#include "sandbox/win/src/policy_engine_opcodes.h"
namespace sandbox {
@@ -69,15 +66,15 @@ enum PolicyResult {
// TODO(cpu): implement the options kStopOnErrors & kRankedEval.
//
// Stop evaluating as soon as an error is encountered.
-const uint32_t kStopOnErrors = 1;
+const uint32 kStopOnErrors = 1;
// Ignore all non fatal opcode evaluation errors.
-const uint32_t kIgnoreErrors = 2;
+const uint32 kIgnoreErrors = 2;
// Short-circuit evaluation: Only evaluate until opcode group that
// evaluated to true has been found.
-const uint32_t kShortEval = 4;
+const uint32 kShortEval = 4;
// Discussed briefly at the policy design meeting. It will evaluate
// all rules and then return the 'best' rule that evaluated true.
-const uint32_t kRankedEval = 8;
+const uint32 kRankedEval = 8;
// This class evaluates a policy-opcode stream given the memory where the
// opcodes are and an input 'parameter set'.
@@ -122,7 +119,7 @@ class PolicyProcessor {
// Evaluates a policy-opcode stream. See the comments at the top of this
// class for more info. Returns POLICY_MATCH if a rule set was found that
// matches an active policy.
- PolicyResult Evaluate(uint32_t options,
+ PolicyResult Evaluate(uint32 options,
ParameterSet* parameters,
size_t parameter_count);
diff --git a/sandbox/win/src/policy_engine_unittest.cc b/sandbox/win/src/policy_engine_unittest.cc
index 5572bdc..325a101 100644
--- a/sandbox/win/src/policy_engine_unittest.cc
+++ b/sandbox/win/src/policy_engine_unittest.cc
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-#include <stdint.h>
-
#include "sandbox/win/src/policy_engine_params.h"
#include "sandbox/win/src/policy_engine_processor.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -64,8 +61,8 @@ TEST(PolicyEngineTest, Rules1) {
policy->opcode_count = 7;
const wchar_t* filename = L"c:\\Documents and Settings\\Microsoft\\BLAH.txt";
- uint32_t creation_mode = OPEN_EXISTING;
- uint32_t flags = FILE_ATTRIBUTE_NORMAL;
+ uint32 creation_mode = OPEN_EXISTING;
+ uint32 flags = FILE_ATTRIBUTE_NORMAL;
void* security_descriptor = NULL;
POLPARAMS_BEGIN(eval_params)
diff --git a/sandbox/win/src/policy_low_level.cc b/sandbox/win/src/policy_low_level.cc
index 526b23d..739321c 100644
--- a/sandbox/win/src/policy_low_level.cc
+++ b/sandbox/win/src/policy_low_level.cc
@@ -4,11 +4,10 @@
#include "sandbox/win/src/policy_low_level.h"
-#include <stddef.h>
-#include <stdint.h>
-
-#include <map>
#include <string>
+#include <map>
+
+#include "base/basictypes.h"
namespace {
@@ -24,11 +23,11 @@ namespace {
// The category of the last character seen by the string matching opcode
// generator.
- const uint32_t kLastCharIsNone = 0;
- const uint32_t kLastCharIsAlpha = 1;
- const uint32_t kLastCharIsWild = 2;
- const uint32_t kLastCharIsAsterisk = kLastCharIsWild + 4;
- const uint32_t kLastCharIsQuestionM = kLastCharIsWild + 8;
+ const uint32 kLastCharIsNone = 0;
+ const uint32 kLastCharIsAlpha = 1;
+ const uint32 kLastCharIsWild = 2;
+ const uint32 kLastCharIsAsterisk = kLastCharIsWild + 4;
+ const uint32 kLastCharIsQuestionM = kLastCharIsWild + 8;
}
namespace sandbox {
@@ -69,7 +68,7 @@ LowLevelPolicy::~LowLevelPolicy() {
bool LowLevelPolicy::Done() {
typedef std::list<RuleNode> RuleNodes;
typedef std::list<const PolicyRule*> RuleList;
- typedef std::map<uint32_t, RuleList> Mmap;
+ typedef std::map<uint32, RuleList> Mmap;
Mmap mmap;
for (RuleNodes::iterator it = rules_.begin(); it != rules_.end(); ++it) {
@@ -82,7 +81,7 @@ bool LowLevelPolicy::Done() {
size_t avail_size = policy_store_->data_size;
for (Mmap::iterator it = mmap.begin(); it != mmap.end(); ++it) {
- uint32_t service = (*it).first;
+ uint32 service = (*it).first;
if (service >= kMaxServiceCount) {
return false;
}
@@ -156,16 +155,14 @@ PolicyRule::PolicyRule(const PolicyRule& other) {
// to zero.
bool PolicyRule::GenStringOpcode(RuleType rule_type,
StringMatchOptions match_opts,
- uint16_t parameter,
- int state,
- bool last_call,
- int* skip_count,
- base::string16* fragment) {
+ uint16 parameter, int state, bool last_call,
+ int* skip_count, base::string16* fragment) {
+
// The last opcode must:
// 1) Always clear the context.
// 2) Preserve the negation.
// 3) Remove the 'OR' mode flag.
- uint32_t options = kPolNone;
+ uint32 options = kPolNone;
if (last_call) {
if (IF_NOT == rule_type) {
options = kPolClearContext | kPolNegateEval;
@@ -222,8 +219,7 @@ bool PolicyRule::GenStringOpcode(RuleType rule_type,
return true;
}
-bool PolicyRule::AddStringMatch(RuleType rule_type,
- int16_t parameter,
+bool PolicyRule::AddStringMatch(RuleType rule_type, int16 parameter,
const wchar_t* string,
StringMatchOptions match_opts) {
if (done_) {
@@ -232,7 +228,7 @@ bool PolicyRule::AddStringMatch(RuleType rule_type,
}
const wchar_t* current_char = string;
- uint32_t last_char = kLastCharIsNone;
+ uint32 last_char = kLastCharIsNone;
int state = PENDING_NONE;
int skip_count = 0; // counts how many '?' we have seen in a row.
base::string16 fragment; // accumulates the non-wildcard part.
@@ -284,14 +280,14 @@ bool PolicyRule::AddStringMatch(RuleType rule_type,
}
bool PolicyRule::AddNumberMatch(RuleType rule_type,
- int16_t parameter,
- uint32_t number,
+ int16 parameter,
+ uint32 number,
RuleOp comparison_op) {
if (done_) {
// Do not allow to add more rules after generating the action opcode.
return false;
}
- uint32_t opts = (rule_type == IF_NOT) ? kPolNegateEval : kPolNone;
+ uint32 opts = (rule_type == IF_NOT)? kPolNegateEval : kPolNone;
if (EQUAL == comparison_op) {
if (NULL == opcode_factory_->MakeOpNumberMatch(parameter, number, opts)) {
diff --git a/sandbox/win/src/policy_low_level.h b/sandbox/win/src/policy_low_level.h
index f77787c..6a62631 100644
--- a/sandbox/win/src/policy_low_level.h
+++ b/sandbox/win/src/policy_low_level.h
@@ -5,16 +5,13 @@
#ifndef SANDBOX_SRC_POLICY_LOW_LEVEL_H__
#define SANDBOX_SRC_POLICY_LOW_LEVEL_H__
-#include <stddef.h>
-#include <stdint.h>
-
#include <list>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/ipc_tags.h"
-#include "sandbox/win/src/policy_engine_opcodes.h"
#include "sandbox/win/src/policy_engine_params.h"
+#include "sandbox/win/src/policy_engine_opcodes.h"
// Low level policy classes.
// Built on top of the PolicyOpcode and OpcodeFatory, the low level policy
@@ -139,10 +136,8 @@ class PolicyRule {
// in a 'create file' service the file name argument can be at index 0.
// string: is the desired matching pattern.
// match_opts: if the pattern matching is case sensitive or not.
- bool AddStringMatch(RuleType rule_type,
- int16_t parameter,
- const wchar_t* string,
- StringMatchOptions match_opts);
+ bool AddStringMatch(RuleType rule_type, int16 parameter,
+ const wchar_t* string, StringMatchOptions match_opts);
// Adds a number match comparison to the rule.
// rule_type: possible values are IF and IF_NOT.
@@ -150,8 +145,8 @@ class PolicyRule {
// number: the value to compare the input to.
// comparison_op: the comparison kind (equal, logical and, etc).
bool AddNumberMatch(RuleType rule_type,
- int16_t parameter,
- uint32_t number,
+ int16 parameter,
+ uint32 number,
RuleOp comparison_op);
// Returns the number of opcodes generated so far.
@@ -168,13 +163,9 @@ class PolicyRule {
// Called in a loop from AddStringMatch to generate the required string
// match opcodes. rule_type, match_opts and parameter are the same as
// in AddStringMatch.
- bool GenStringOpcode(RuleType rule_type,
- StringMatchOptions match_opts,
- uint16_t parameter,
- int state,
- bool last_call,
- int* skip_count,
- base::string16* fragment);
+ bool GenStringOpcode(RuleType rule_type, StringMatchOptions match_opts,
+ uint16 parameter, int state, bool last_call,
+ int* skip_count, base::string16* fragment);
// Loop over all generated opcodes and copy them to increasing memory
// addresses from opcode_start and copy the extra data (strings usually) into
diff --git a/sandbox/win/src/policy_low_level_unittest.cc b/sandbox/win/src/policy_low_level_unittest.cc
index fd67469..88b9c43 100644
--- a/sandbox/win/src/policy_low_level_unittest.cc
+++ b/sandbox/win/src/policy_low_level_unittest.cc
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-#include <stdint.h>
-
#include "sandbox/win/src/policy_engine_params.h"
#include "sandbox/win/src/policy_engine_processor.h"
#include "sandbox/win/src/policy_low_level.h"
@@ -59,7 +56,7 @@ TEST(PolicyEngineTest, SimpleStrMatch) {
CASE_INSENSITIVE));
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kFakeService = 2;
+ const uint32 kFakeService = 2;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
@@ -92,7 +89,7 @@ TEST(PolicyEngineTest, SimpleIfNotStrMatch) {
CASE_SENSITIVE));
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kFakeService = 2;
+ const uint32 kFakeService = 2;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
@@ -130,7 +127,7 @@ TEST(PolicyEngineTest, SimpleIfNotStrMatchWild1) {
CASE_SENSITIVE));
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kFakeService = 3;
+ const uint32 kFakeService = 3;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
@@ -163,7 +160,7 @@ TEST(PolicyEngineTest, SimpleIfNotStrMatchWild2) {
CASE_SENSITIVE));
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kFakeService = 3;
+ const uint32 kFakeService = 3;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
@@ -202,14 +199,14 @@ TEST(PolicyEngineTest, IfNotStrMatchTwoRulesWild1) {
EXPECT_TRUE(pr.AddNumberMatch(IF, 1, 24, EQUAL));
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kFakeService = 3;
+ const uint32 kFakeService = 3;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
const wchar_t* filename = NULL;
- uint32_t access = 0;
+ uint32 access = 0;
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
POLPARAM(access) // Argument 1
@@ -251,15 +248,15 @@ TEST(PolicyEngineTest, IfNotStrMatchTwoRulesWild2) {
EXPECT_TRUE(pr.AddNumberMatch(IF, 2, 66, EQUAL));
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kFakeService = 3;
+ const uint32 kFakeService = 3;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kFakeService, &pr));
EXPECT_TRUE(policyGen.Done());
const wchar_t* filename = NULL;
- uint32_t access = 0;
- uint32_t sharing = 66;
+ uint32 access = 0;
+ uint32 sharing = 66;
POLPARAMS_BEGIN(eval_params)
POLPARAM(filename) // Argument 0
@@ -325,15 +322,15 @@ TEST(PolicyEngineTest, OneRuleTest) {
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kNtFakeCreateFile = 7;
+ const uint32 kNtFakeCreateFile = 7;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kNtFakeCreateFile, &pr));
EXPECT_TRUE(policyGen.Done());
const wchar_t* filename = L"c:\\Documents and Settings\\Microsoft\\BLAH.txt";
- uint32_t creation_mode = OPEN_EXISTING;
- uint32_t flags = FILE_ATTRIBUTE_NORMAL;
+ uint32 creation_mode = OPEN_EXISTING;
+ uint32 flags = FILE_ATTRIBUTE_NORMAL;
void* security_descriptor = NULL;
POLPARAMS_BEGIN(eval_params)
@@ -431,9 +428,9 @@ TEST(PolicyEngineTest, ThreeRulesTest) {
PolicyGlobal* policy = MakePolicyMemory();
- const uint32_t kNtFakeNone = 4;
- const uint32_t kNtFakeCreateFile = 5;
- const uint32_t kNtFakeOpenFile = 6;
+ const uint32 kNtFakeNone = 4;
+ const uint32 kNtFakeCreateFile = 5;
+ const uint32 kNtFakeOpenFile = 6;
LowLevelPolicy policyGen(policy);
EXPECT_TRUE(policyGen.AddRule(kNtFakeCreateFile, &pr_pipe));
@@ -489,8 +486,8 @@ TEST(PolicyEngineTest, ThreeRulesTest) {
// Test the policy evaluation.
const wchar_t* filename = L"";
- uint32_t creation_mode = OPEN_EXISTING;
- uint32_t flags = FILE_ATTRIBUTE_NORMAL;
+ uint32 creation_mode = OPEN_EXISTING;
+ uint32 flags = FILE_ATTRIBUTE_NORMAL;
void* security_descriptor = NULL;
POLPARAMS_BEGIN(params)
diff --git a/sandbox/win/src/policy_opcodes_unittest.cc b/sandbox/win/src/policy_opcodes_unittest.cc
index f8c210e..954aa44 100644
--- a/sandbox/win/src/policy_opcodes_unittest.cc
+++ b/sandbox/win/src/policy_opcodes_unittest.cc
@@ -2,13 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-#include <stdint.h>
-
-#include "sandbox/win/src/policy_engine_opcodes.h"
-#include "sandbox/win/src/policy_engine_params.h"
-#include "sandbox/win/src/sandbox_nt_types.h"
#include "sandbox/win/src/sandbox_types.h"
+#include "sandbox/win/src/sandbox_nt_types.h"
+#include "sandbox/win/src/policy_engine_params.h"
+#include "sandbox/win/src/policy_engine_opcodes.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -48,7 +45,7 @@ TEST(PolicyEngineTest, ParameterSetTest) {
// Test that we can store and retrieve a void pointer:
const void* result1 =0;
- uint32_t result2 = 0;
+ uint32 result2 = 0;
EXPECT_TRUE(pset1.Get(&result1));
EXPECT_TRUE(pv1 == result1);
EXPECT_FALSE(pset1.Get(&result2));
@@ -56,8 +53,8 @@ TEST(PolicyEngineTest, ParameterSetTest) {
EXPECT_TRUE(pv2 == result1);
EXPECT_FALSE(pset2.Get(&result2));
- // Test that we can store and retrieve a uint32_t:
- uint32_t number = 12747;
+ // Test that we can store and retrieve a uint32:
+ uint32 number = 12747;
ParameterSet pset3 = ParamPickerMake(number);
EXPECT_FALSE(pset3.Get(&result1));
EXPECT_TRUE(pset3.Get(&result2));
@@ -184,8 +181,8 @@ TEST(PolicyEngineTest, OpcodeMakerCase2) {
TEST(PolicyEngineTest, IntegerOpcodes) {
const wchar_t* txt = L"abcdef";
- uint32_t num1 = 42;
- uint32_t num2 = 113377;
+ uint32 num1 = 42;
+ uint32 num2 = 113377;
ParameterSet pp_wrong1 = ParamPickerMake(txt);
ParameterSet pp_num1 = ParamPickerMake(num1);
@@ -224,7 +221,7 @@ TEST(PolicyEngineTest, LogicalOpcodes) {
char memory[kOpcodeMemory];
OpcodeFactory opcode_maker(memory, sizeof(memory));
- uint32_t num1 = 0x10100702;
+ uint32 num1 = 0x10100702;
ParameterSet pp_num1 = ParamPickerMake(num1);
PolicyOpcode* op_and1 =
diff --git a/sandbox/win/src/policy_target.cc b/sandbox/win/src/policy_target.cc
index 568fe2f..fb464cc 100644
--- a/sandbox/win/src/policy_target.cc
+++ b/sandbox/win/src/policy_target.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/policy_target.h"
-#include <stddef.h>
-
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_engine_processor.h"
diff --git a/sandbox/win/src/process_mitigations.cc b/sandbox/win/src/process_mitigations.cc
index 6ca8a8d..8072440 100644
--- a/sandbox/win/src/process_mitigations.cc
+++ b/sandbox/win/src/process_mitigations.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/process_mitigations.h"
-#include <stddef.h>
-
#include <algorithm>
#include "base/win/windows_version.h"
diff --git a/sandbox/win/src/process_mitigations.h b/sandbox/win/src/process_mitigations.h
index 8bee024..9039ad6 100644
--- a/sandbox/win/src/process_mitigations.h
+++ b/sandbox/win/src/process_mitigations.h
@@ -6,8 +6,8 @@
#define SANDBOX_SRC_WIN_PROCESS_MITIGATIONS_H_
#include <windows.h>
-#include <stddef.h>
+#include "base/basictypes.h"
#include "sandbox/win/src/security_level.h"
namespace sandbox {
diff --git a/sandbox/win/src/process_mitigations_win32k_dispatcher.h b/sandbox/win/src/process_mitigations_win32k_dispatcher.h
index 55a84a7..2e1e1a8 100644
--- a/sandbox/win/src/process_mitigations_win32k_dispatcher.h
+++ b/sandbox/win/src/process_mitigations_win32k_dispatcher.h
@@ -5,7 +5,7 @@
#ifndef SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_DISPATCHER_H_
#define SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_DISPATCHER_H_
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/sandbox_policy_base.h"
namespace sandbox {
diff --git a/sandbox/win/src/process_mitigations_win32k_interception.h b/sandbox/win/src/process_mitigations_win32k_interception.h
index 0b295ea..bf7b551 100644
--- a/sandbox/win/src/process_mitigations_win32k_interception.h
+++ b/sandbox/win/src/process_mitigations_win32k_interception.h
@@ -6,6 +6,7 @@
#define SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_
#include <windows.h>
+#include "base/basictypes.h"
#include "sandbox/win/src/sandbox_types.h"
namespace sandbox {
diff --git a/sandbox/win/src/process_mitigations_win32k_policy.h b/sandbox/win/src/process_mitigations_win32k_policy.h
index 32af168..078ed2b 100644
--- a/sandbox/win/src/process_mitigations_win32k_policy.h
+++ b/sandbox/win/src/process_mitigations_win32k_policy.h
@@ -5,6 +5,7 @@
#ifndef SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_POLICY_H_
#define SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_POLICY_H_
+#include "base/basictypes.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/policy_low_level.h"
#include "sandbox/win/src/sandbox_policy.h"
diff --git a/sandbox/win/src/process_thread_dispatcher.cc b/sandbox/win/src/process_thread_dispatcher.cc
index 8debd1e..90cad63 100644
--- a/sandbox/win/src/process_thread_dispatcher.cc
+++ b/sandbox/win/src/process_thread_dispatcher.cc
@@ -4,9 +4,7 @@
#include "sandbox/win/src/process_thread_dispatcher.h"
-#include <stddef.h>
-#include <stdint.h>
-
+#include "base/basictypes.h"
#include "base/logging.h"
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/interception.h"
@@ -154,8 +152,8 @@ bool ThreadProcessDispatcher::SetupService(InterceptionManager* manager,
}
bool ThreadProcessDispatcher::NtOpenThread(IPCInfo* ipc,
- uint32_t desired_access,
- uint32_t thread_id) {
+ uint32 desired_access,
+ uint32 thread_id) {
HANDLE handle;
NTSTATUS ret = ProcessPolicy::OpenThreadAction(*ipc->client_info,
desired_access, thread_id,
@@ -166,8 +164,8 @@ bool ThreadProcessDispatcher::NtOpenThread(IPCInfo* ipc,
}
bool ThreadProcessDispatcher::NtOpenProcess(IPCInfo* ipc,
- uint32_t desired_access,
- uint32_t process_id) {
+ uint32 desired_access,
+ uint32 process_id) {
HANDLE handle;
NTSTATUS ret = ProcessPolicy::OpenProcessAction(*ipc->client_info,
desired_access, process_id,
@@ -179,7 +177,7 @@ bool ThreadProcessDispatcher::NtOpenProcess(IPCInfo* ipc,
bool ThreadProcessDispatcher::NtOpenProcessToken(IPCInfo* ipc,
HANDLE process,
- uint32_t desired_access) {
+ uint32 desired_access) {
HANDLE handle;
NTSTATUS ret = ProcessPolicy::OpenProcessTokenAction(*ipc->client_info,
process, desired_access,
@@ -191,8 +189,8 @@ bool ThreadProcessDispatcher::NtOpenProcessToken(IPCInfo* ipc,
bool ThreadProcessDispatcher::NtOpenProcessTokenEx(IPCInfo* ipc,
HANDLE process,
- uint32_t desired_access,
- uint32_t attributes) {
+ uint32 desired_access,
+ uint32 attributes) {
HANDLE handle;
NTSTATUS ret = ProcessPolicy::OpenProcessTokenExAction(*ipc->client_info,
process,
diff --git a/sandbox/win/src/process_thread_dispatcher.h b/sandbox/win/src/process_thread_dispatcher.h
index 008385f..2bb3b6e 100644
--- a/sandbox/win/src/process_thread_dispatcher.h
+++ b/sandbox/win/src/process_thread_dispatcher.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_PROCESS_THREAD_DISPATCHER_H_
#define SANDBOX_SRC_PROCESS_THREAD_DISPATCHER_H_
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy_base.h"
@@ -25,23 +23,19 @@ class ThreadProcessDispatcher : public Dispatcher {
private:
// Processes IPC requests coming from calls to NtOpenThread() in the target.
- bool NtOpenThread(IPCInfo* ipc, uint32_t desired_access, uint32_t thread_id);
+ bool NtOpenThread(IPCInfo* ipc, uint32 desired_access, uint32 thread_id);
// Processes IPC requests coming from calls to NtOpenProcess() in the target.
- bool NtOpenProcess(IPCInfo* ipc,
- uint32_t desired_access,
- uint32_t process_id);
+ bool NtOpenProcess(IPCInfo* ipc, uint32 desired_access, uint32 process_id);
// Processes IPC requests from calls to NtOpenProcessToken() in the target.
- bool NtOpenProcessToken(IPCInfo* ipc,
- HANDLE process,
- uint32_t desired_access);
+ bool NtOpenProcessToken(IPCInfo* ipc, HANDLE process, uint32 desired_access);
// Processes IPC requests from calls to NtOpenProcessTokenEx() in the target.
bool NtOpenProcessTokenEx(IPCInfo* ipc,
HANDLE process,
- uint32_t desired_access,
- uint32_t attributes);
+ uint32 desired_access,
+ uint32 attributes);
// Processes IPC requests coming from calls to CreateProcessW() in the target.
bool CreateProcessW(IPCInfo* ipc,
diff --git a/sandbox/win/src/process_thread_interception.cc b/sandbox/win/src/process_thread_interception.cc
index bbf753e..2d459b6 100644
--- a/sandbox/win/src/process_thread_interception.cc
+++ b/sandbox/win/src/process_thread_interception.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/process_thread_interception.h"
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_params.h"
@@ -36,7 +34,7 @@ NTSTATUS WINAPI TargetNtOpenThread(NtOpenThreadFunction orig_OpenThread,
if (!client_id)
break;
- uint32_t thread_id = 0;
+ uint32 thread_id = 0;
bool should_break = false;
__try {
// We support only the calls for the current process
@@ -54,8 +52,8 @@ NTSTATUS WINAPI TargetNtOpenThread(NtOpenThreadFunction orig_OpenThread,
}
}
- thread_id = static_cast<uint32_t>(
- reinterpret_cast<ULONG_PTR>(client_id->UniqueThread));
+ thread_id = static_cast<uint32>(
+ reinterpret_cast<ULONG_PTR>(client_id->UniqueThread));
} __except(EXCEPTION_EXECUTE_HANDLER) {
break;
}
@@ -118,7 +116,7 @@ NTSTATUS WINAPI TargetNtOpenProcess(NtOpenProcessFunction orig_OpenProcess,
if (!client_id)
break;
- uint32_t process_id = 0;
+ uint32 process_id = 0;
bool should_break = false;
__try {
// Object attributes should be NULL or empty.
@@ -132,8 +130,8 @@ NTSTATUS WINAPI TargetNtOpenProcess(NtOpenProcessFunction orig_OpenProcess,
}
}
- process_id = static_cast<uint32_t>(
- reinterpret_cast<ULONG_PTR>(client_id->UniqueProcess));
+ process_id = static_cast<uint32>(
+ reinterpret_cast<ULONG_PTR>(client_id->UniqueProcess));
} __except(EXCEPTION_EXECUTE_HANDLER) {
break;
}
diff --git a/sandbox/win/src/process_thread_policy.cc b/sandbox/win/src/process_thread_policy.cc
index b4976c0b..b58a287 100644
--- a/sandbox/win/src/process_thread_policy.cc
+++ b/sandbox/win/src/process_thread_policy.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/process_thread_policy.h"
-#include <stdint.h>
-
#include <string>
#include "base/memory/scoped_ptr.h"
@@ -103,8 +101,8 @@ bool ProcessPolicy::GenerateRules(const wchar_t* name,
}
NTSTATUS ProcessPolicy::OpenThreadAction(const ClientInfo& client_info,
- uint32_t desired_access,
- uint32_t thread_id,
+ uint32 desired_access,
+ uint32 thread_id,
HANDLE* handle) {
*handle = NULL;
@@ -134,8 +132,8 @@ NTSTATUS ProcessPolicy::OpenThreadAction(const ClientInfo& client_info,
}
NTSTATUS ProcessPolicy::OpenProcessAction(const ClientInfo& client_info,
- uint32_t desired_access,
- uint32_t process_id,
+ uint32 desired_access,
+ uint32 process_id,
HANDLE* handle) {
*handle = NULL;
@@ -166,7 +164,7 @@ NTSTATUS ProcessPolicy::OpenProcessAction(const ClientInfo& client_info,
NTSTATUS ProcessPolicy::OpenProcessTokenAction(const ClientInfo& client_info,
HANDLE process,
- uint32_t desired_access,
+ uint32 desired_access,
HANDLE* handle) {
*handle = NULL;
NtOpenProcessTokenFunction NtOpenProcessToken = NULL;
@@ -190,8 +188,8 @@ NTSTATUS ProcessPolicy::OpenProcessTokenAction(const ClientInfo& client_info,
NTSTATUS ProcessPolicy::OpenProcessTokenExAction(const ClientInfo& client_info,
HANDLE process,
- uint32_t desired_access,
- uint32_t attributes,
+ uint32 desired_access,
+ uint32 attributes,
HANDLE* handle) {
*handle = NULL;
NtOpenProcessTokenExFunction NtOpenProcessTokenEx = NULL;
diff --git a/sandbox/win/src/process_thread_policy.h b/sandbox/win/src/process_thread_policy.h
index a66b52e..2871dca 100644
--- a/sandbox/win/src/process_thread_policy.h
+++ b/sandbox/win/src/process_thread_policy.h
@@ -5,12 +5,11 @@
#ifndef SANDBOX_SRC_PROCESS_THREAD_POLICY_H_
#define SANDBOX_SRC_PROCESS_THREAD_POLICY_H_
-#include <stdint.h>
-
#include <string>
#include "sandbox/win/src/policy_low_level.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy.h"
@@ -37,16 +36,16 @@ class ProcessPolicy {
// is the thread_id to be opened.
// The function returns the return value of NtOpenThread.
static NTSTATUS OpenThreadAction(const ClientInfo& client_info,
- uint32_t desired_access,
- uint32_t thread_id,
+ uint32 desired_access,
+ uint32 thread_id,
HANDLE* handle);
// Opens the process id passed in and returns the duplicated handle to
// the child. We only allow the child processes to open themselves. Any other
// pid open is denied.
static NTSTATUS OpenProcessAction(const ClientInfo& client_info,
- uint32_t desired_access,
- uint32_t process_id,
+ uint32 desired_access,
+ uint32 process_id,
HANDLE* handle);
// Opens the token associated with the process and returns the duplicated
@@ -54,7 +53,7 @@ class ProcessPolicy {
// token (using ::GetCurrentProcess()).
static NTSTATUS OpenProcessTokenAction(const ClientInfo& client_info,
HANDLE process,
- uint32_t desired_access,
+ uint32 desired_access,
HANDLE* handle);
// Opens the token associated with the process and returns the duplicated
@@ -62,8 +61,8 @@ class ProcessPolicy {
// token (using ::GetCurrentProcess()).
static NTSTATUS OpenProcessTokenExAction(const ClientInfo& client_info,
HANDLE process,
- uint32_t desired_access,
- uint32_t attributes,
+ uint32 desired_access,
+ uint32 attributes,
HANDLE* handle);
// Processes a 'CreateProcessW()' request from the target.
diff --git a/sandbox/win/src/registry_dispatcher.cc b/sandbox/win/src/registry_dispatcher.cc
index fef727d..267a592 100644
--- a/sandbox/win/src/registry_dispatcher.cc
+++ b/sandbox/win/src/registry_dispatcher.cc
@@ -4,20 +4,18 @@
#include "sandbox/win/src/registry_dispatcher.h"
-#include <stdint.h>
-
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/interception.h"
#include "sandbox/win/src/interceptors.h"
#include "sandbox/win/src/ipc_tags.h"
+#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/policy_broker.h"
#include "sandbox/win/src/policy_params.h"
+#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/registry_interception.h"
#include "sandbox/win/src/registry_policy.h"
-#include "sandbox/win/src/sandbox.h"
-#include "sandbox/win/src/sandbox_nt_util.h"
namespace {
@@ -81,11 +79,11 @@ bool RegistryDispatcher::SetupService(InterceptionManager* manager,
bool RegistryDispatcher::NtCreateKey(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
HANDLE root,
- uint32_t desired_access,
- uint32_t title_index,
- uint32_t create_options) {
+ uint32 desired_access,
+ uint32 title_index,
+ uint32 create_options) {
base::win::ScopedHandle root_handle;
base::string16 real_path = *name;
@@ -131,9 +129,9 @@ bool RegistryDispatcher::NtCreateKey(IPCInfo* ipc,
bool RegistryDispatcher::NtOpenKey(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
HANDLE root,
- uint32_t desired_access) {
+ uint32 desired_access) {
base::win::ScopedHandle root_handle;
base::string16 real_path = *name;
diff --git a/sandbox/win/src/registry_dispatcher.h b/sandbox/win/src/registry_dispatcher.h
index cb5af0c..83811a9 100644
--- a/sandbox/win/src/registry_dispatcher.h
+++ b/sandbox/win/src/registry_dispatcher.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_REGISTRY_DISPATCHER_H_
#define SANDBOX_SRC_REGISTRY_DISPATCHER_H_
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy_base.h"
@@ -27,18 +25,18 @@ class RegistryDispatcher : public Dispatcher {
// Processes IPC requests coming from calls to NtCreateKey in the target.
bool NtCreateKey(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
HANDLE root,
- uint32_t desired_access,
- uint32_t title_index,
- uint32_t create_options);
+ uint32 desired_access,
+ uint32 title_index,
+ uint32 create_options);
// Processes IPC requests coming from calls to NtOpenKey in the target.
bool NtOpenKey(IPCInfo* ipc,
base::string16* name,
- uint32_t attributes,
+ uint32 attributes,
HANDLE root,
- uint32_t desired_access);
+ uint32 desired_access);
PolicyBase* policy_base_;
DISALLOW_COPY_AND_ASSIGN(RegistryDispatcher);
diff --git a/sandbox/win/src/registry_interception.cc b/sandbox/win/src/registry_interception.cc
index e44099c..4a1a846 100644
--- a/sandbox/win/src/registry_interception.cc
+++ b/sandbox/win/src/registry_interception.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/registry_interception.h"
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_params.h"
@@ -53,14 +51,14 @@ NTSTATUS WINAPI TargetNtCreateKey(NtCreateKeyFunction orig_CreateKey,
break;
wchar_t* name;
- uint32_t attributes = 0;
+ uint32 attributes = 0;
HANDLE root_directory = 0;
NTSTATUS ret = AllocAndCopyName(object_attributes, &name, &attributes,
&root_directory);
if (!NT_SUCCESS(ret) || NULL == name)
break;
- uint32_t desired_access_uint32 = desired_access;
+ uint32 desired_access_uint32 = desired_access;
CountedParameterSet<OpenKey> params;
params[OpenKey::ACCESS] = ParamPickerMake(desired_access_uint32);
@@ -135,14 +133,14 @@ NTSTATUS WINAPI CommonNtOpenKey(NTSTATUS status, PHANDLE key,
break;
wchar_t* name;
- uint32_t attributes;
+ uint32 attributes;
HANDLE root_directory;
NTSTATUS ret = AllocAndCopyName(object_attributes, &name, &attributes,
&root_directory);
if (!NT_SUCCESS(ret) || NULL == name)
break;
- uint32_t desired_access_uint32 = desired_access;
+ uint32 desired_access_uint32 = desired_access;
CountedParameterSet<OpenKey> params;
params[OpenKey::ACCESS] = ParamPickerMake(desired_access_uint32);
diff --git a/sandbox/win/src/registry_policy.cc b/sandbox/win/src/registry_policy.cc
index ec66380..58e4e20 100644
--- a/sandbox/win/src/registry_policy.cc
+++ b/sandbox/win/src/registry_policy.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stdint.h>
-
#include <string>
#include "sandbox/win/src/registry_policy.h"
@@ -12,13 +10,13 @@
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_engine_opcodes.h"
#include "sandbox/win/src/policy_params.h"
-#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/sandbox_utils.h"
+#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/win_utils.h"
namespace {
-static const uint32_t kAllowedRegFlags =
+static const uint32 kAllowedRegFlags =
KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | KEY_READ |
GENERIC_READ | GENERIC_EXECUTE | READ_CONTROL;
@@ -139,7 +137,7 @@ bool RegistryPolicy::GenerateRules(const wchar_t* name,
// We consider all flags that are not known to be readonly as potentially
// used for write. Here we also support MAXIMUM_ALLOWED, but we are going
// to expand it to read-only before the call.
- uint32_t restricted_flags = ~(kAllowedRegFlags | MAXIMUM_ALLOWED);
+ uint32 restricted_flags = ~(kAllowedRegFlags | MAXIMUM_ALLOWED);
open.AddNumberMatch(IF_NOT, OpenKey::ACCESS, restricted_flags, AND);
create.AddNumberMatch(IF_NOT, OpenKey::ACCESS, restricted_flags, AND);
break;
@@ -168,12 +166,12 @@ bool RegistryPolicy::GenerateRules(const wchar_t* name,
bool RegistryPolicy::CreateKeyAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& key,
- uint32_t attributes,
+ const base::string16 &key,
+ uint32 attributes,
HANDLE root_directory,
- uint32_t desired_access,
- uint32_t title_index,
- uint32_t create_options,
+ uint32 desired_access,
+ uint32 title_index,
+ uint32 create_options,
HANDLE* handle,
NTSTATUS* nt_status,
ULONG* disposition) {
@@ -202,10 +200,10 @@ bool RegistryPolicy::CreateKeyAction(EvalResult eval_result,
bool RegistryPolicy::OpenKeyAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& key,
- uint32_t attributes,
+ const base::string16 &key,
+ uint32 attributes,
HANDLE root_directory,
- uint32_t desired_access,
+ uint32 desired_access,
HANDLE* handle,
NTSTATUS* nt_status) {
// The only action supported is ASK_BROKER which means open the requested
diff --git a/sandbox/win/src/registry_policy.h b/sandbox/win/src/registry_policy.h
index ddea1bf..69af841 100644
--- a/sandbox/win/src/registry_policy.h
+++ b/sandbox/win/src/registry_policy.h
@@ -5,10 +5,9 @@
#ifndef SANDBOX_SRC_REGISTRY_POLICY_H__
#define SANDBOX_SRC_REGISTRY_POLICY_H__
-#include <stdint.h>
-
#include <string>
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/nt_internals.h"
@@ -32,12 +31,12 @@ class RegistryPolicy {
// API that is compatible with the IPC-received parameters.
static bool CreateKeyAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& key,
- uint32_t attributes,
+ const base::string16 &key,
+ uint32 attributes,
HANDLE root_directory,
- uint32_t desired_access,
- uint32_t title_index,
- uint32_t create_options,
+ uint32 desired_access,
+ uint32 title_index,
+ uint32 create_options,
HANDLE* handle,
NTSTATUS* nt_status,
ULONG* disposition);
@@ -45,13 +44,13 @@ class RegistryPolicy {
// Performs the desired policy action on an open request with an
// API that is compatible with the IPC-received parameters.
static bool OpenKeyAction(EvalResult eval_result,
- const ClientInfo& client_info,
- const base::string16& key,
- uint32_t attributes,
- HANDLE root_directory,
- uint32_t desired_access,
- HANDLE* handle,
- NTSTATUS* nt_status);
+ const ClientInfo& client_info,
+ const base::string16 &key,
+ uint32 attributes,
+ HANDLE root_directory,
+ uint32 desired_access,
+ HANDLE* handle,
+ NTSTATUS* nt_status);
};
} // namespace sandbox
diff --git a/sandbox/win/src/resolver.cc b/sandbox/win/src/resolver.cc
index d1719da..6616fa5 100644
--- a/sandbox/win/src/resolver.cc
+++ b/sandbox/win/src/resolver.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/resolver.h"
-#include <stddef.h>
-
#include "base/win/pe_image.h"
#include "sandbox/win/src/sandbox_nt_util.h"
diff --git a/sandbox/win/src/resolver.h b/sandbox/win/src/resolver.h
index 9424060..85f1e91 100644
--- a/sandbox/win/src/resolver.h
+++ b/sandbox/win/src/resolver.h
@@ -6,9 +6,7 @@
// For more details see
// http://dev.chromium.org/developers/design-documents/sandbox .
-#include <stddef.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/nt_internals.h"
#ifndef SANDBOX_SRC_RESOLVER_H__
diff --git a/sandbox/win/src/resolver_32.cc b/sandbox/win/src/resolver_32.cc
index 25df11c..a591a8b 100644
--- a/sandbox/win/src/resolver_32.cc
+++ b/sandbox/win/src/resolver_32.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/resolver.h"
-#include <stddef.h>
-
// For placement new. This file must not depend on the CRT at runtime, but
// placement operator new is inline.
#include <new>
diff --git a/sandbox/win/src/resolver_64.cc b/sandbox/win/src/resolver_64.cc
index 6a99735..f1f135e 100644
--- a/sandbox/win/src/resolver_64.cc
+++ b/sandbox/win/src/resolver_64.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/resolver.h"
-#include <stddef.h>
-
// For placement new. This file must not depend on the CRT at runtime, but
// placement operator new is inline.
#include <new>
diff --git a/sandbox/win/src/restricted_token.cc b/sandbox/win/src/restricted_token.cc
index 1940ae3..f0fc4cb 100644
--- a/sandbox/win/src/restricted_token.cc
+++ b/sandbox/win/src/restricted_token.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/restricted_token.h"
-#include <stddef.h>
-
#include <vector>
#include "base/logging.h"
diff --git a/sandbox/win/src/restricted_token.h b/sandbox/win/src/restricted_token.h
index d302f86..b9a2d4b 100644
--- a/sandbox/win/src/restricted_token.h
+++ b/sandbox/win/src/restricted_token.h
@@ -8,7 +8,7 @@
#include <windows.h>
#include <vector>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/restricted_token_utils.h"
diff --git a/sandbox/win/src/sandbox.h b/sandbox/win/src/sandbox.h
index 193605d..e326194 100644
--- a/sandbox/win/src/sandbox.h
+++ b/sandbox/win/src/sandbox.h
@@ -21,6 +21,7 @@
#include <windows.h>
+#include "base/basictypes.h"
#include "sandbox/win/src/sandbox_policy.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/sandbox_factory.h b/sandbox/win/src/sandbox_factory.h
index f5888ff..7a0280f 100644
--- a/sandbox/win/src/sandbox_factory.h
+++ b/sandbox/win/src/sandbox_factory.h
@@ -5,7 +5,6 @@
#ifndef SANDBOX_SRC_SANDBOX_FACTORY_H__
#define SANDBOX_SRC_SANDBOX_FACTORY_H__
-#include "base/macros.h"
#include "sandbox/win/src/sandbox.h"
// SandboxFactory is a set of static methods to get access to the broker
diff --git a/sandbox/win/src/sandbox_nt_util.cc b/sandbox/win/src/sandbox_nt_util.cc
index 62f2422..35b9e73 100644
--- a/sandbox/win/src/sandbox_nt_util.cc
+++ b/sandbox/win/src/sandbox_nt_util.cc
@@ -4,9 +4,6 @@
#include "sandbox/win/src/sandbox_nt_util.h"
-#include <stddef.h>
-#include <stdint.h>
-
#include <string>
#include "base/win/pe_image.h"
diff --git a/sandbox/win/src/sandbox_nt_util.h b/sandbox/win/src/sandbox_nt_util.h
index 3e02382..17e5027 100644
--- a/sandbox/win/src/sandbox_nt_util.h
+++ b/sandbox/win/src/sandbox_nt_util.h
@@ -6,7 +6,6 @@
#define SANDBOX_SRC_SANDBOX_NT_UTIL_H_
#include <intrin.h>
-#include <stddef.h>
#include <stdint.h>
#include "base/macros.h"
diff --git a/sandbox/win/src/sandbox_policy.h b/sandbox/win/src/sandbox_policy.h
index cc39c62..0c3e847 100644
--- a/sandbox/win/src/sandbox_policy.h
+++ b/sandbox/win/src/sandbox_policy.h
@@ -5,11 +5,9 @@
#ifndef SANDBOX_WIN_SRC_SANDBOX_POLICY_H_
#define SANDBOX_WIN_SRC_SANDBOX_POLICY_H_
-#include <stddef.h>
-#include <stdint.h>
-
#include <string>
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/security_level.h"
@@ -132,8 +130,7 @@ class TargetPolicy {
// http://msdn2.microsoft.com/en-us/library/ms684152.aspx
//
// Note: the recommended level is JOB_RESTRICTED or JOB_LOCKDOWN.
- virtual ResultCode SetJobLevel(JobLevel job_level,
- uint32_t ui_exceptions) = 0;
+ virtual ResultCode SetJobLevel(JobLevel job_level, uint32 ui_exceptions) = 0;
// Sets a hard limit on the size of the commit set for the sandboxed process.
// If the limit is reached, the process will be terminated with
diff --git a/sandbox/win/src/sandbox_policy_base.cc b/sandbox/win/src/sandbox_policy_base.cc
index 28662b4..bcb7587 100644
--- a/sandbox/win/src/sandbox_policy_base.cc
+++ b/sandbox/win/src/sandbox_policy_base.cc
@@ -5,9 +5,8 @@
#include "sandbox/win/src/sandbox_policy_base.h"
#include <sddl.h>
-#include <stddef.h>
-#include <stdint.h>
+#include "base/basictypes.h"
#include "base/callback.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -183,7 +182,7 @@ TokenLevel PolicyBase::GetLockdownTokenLevel() const{
return lockdown_level_;
}
-ResultCode PolicyBase::SetJobLevel(JobLevel job_level, uint32_t ui_exceptions) {
+ResultCode PolicyBase::SetJobLevel(JobLevel job_level, uint32 ui_exceptions) {
if (memory_limit_ && job_level == JOB_NONE) {
return SBOX_ERROR_BAD_PARAMS;
}
diff --git a/sandbox/win/src/sandbox_policy_base.h b/sandbox/win/src/sandbox_policy_base.h
index b2d1b7c..751b0d8 100644
--- a/sandbox/win/src/sandbox_policy_base.h
+++ b/sandbox/win/src/sandbox_policy_base.h
@@ -6,14 +6,12 @@
#define SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_
#include <windows.h>
-#include <stddef.h>
-#include <stdint.h>
#include <list>
#include <vector>
+#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/win/scoped_handle.h"
@@ -44,7 +42,7 @@ class PolicyBase final : public TargetPolicy {
ResultCode SetTokenLevel(TokenLevel initial, TokenLevel lockdown) override;
TokenLevel GetInitialTokenLevel() const override;
TokenLevel GetLockdownTokenLevel() const override;
- ResultCode SetJobLevel(JobLevel job_level, uint32_t ui_exceptions) override;
+ ResultCode SetJobLevel(JobLevel job_level, uint32 ui_exceptions) override;
ResultCode SetJobMemoryLimit(size_t memory_limit) override;
ResultCode SetAlternateDesktop(bool alternate_winstation) override;
base::string16 GetAlternateDesktop() const override;
@@ -131,7 +129,7 @@ class PolicyBase final : public TargetPolicy {
TokenLevel lockdown_level_;
TokenLevel initial_level_;
JobLevel job_level_;
- uint32_t ui_exceptions_;
+ uint32 ui_exceptions_;
size_t memory_limit_;
bool use_alternate_desktop_;
bool use_alternate_winstation_;
diff --git a/sandbox/win/src/sandbox_rand.h b/sandbox/win/src/sandbox_rand.h
index 7c4febc..7f48287 100644
--- a/sandbox/win/src/sandbox_rand.h
+++ b/sandbox/win/src/sandbox_rand.h
@@ -5,6 +5,7 @@
#ifndef SANDBOX_SRC_SANDBOX_RAND_H_
#define SANDBOX_SRC_SANDBOX_RAND_H_
+#include "base/basictypes.h"
namespace sandbox {
diff --git a/sandbox/win/src/sandbox_utils.h b/sandbox/win/src/sandbox_utils.h
index b1c1f31..fc3100d 100644
--- a/sandbox/win/src/sandbox_utils.h
+++ b/sandbox/win/src/sandbox_utils.h
@@ -8,6 +8,7 @@
#include <windows.h>
#include <string>
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/nt_internals.h"
diff --git a/sandbox/win/src/security_level.h b/sandbox/win/src/security_level.h
index 26ec306..c89bbb4 100644
--- a/sandbox/win/src/security_level.h
+++ b/sandbox/win/src/security_level.h
@@ -5,7 +5,7 @@
#ifndef SANDBOX_SRC_SECURITY_LEVEL_H_
#define SANDBOX_SRC_SECURITY_LEVEL_H_
-#include <stdint.h>
+#include "base/basictypes.h"
namespace sandbox {
@@ -138,7 +138,7 @@ enum JobLevel {
// Flags that are unsupported for the target OS will be silently ignored.
// Flags that are invalid for their application (pre or post startup) will
// return SBOX_ERROR_BAD_PARAMS.
-typedef uint64_t MitigationFlags;
+typedef uint64 MitigationFlags;
// Permanently enables DEP for the target process. Corresponds to
// PROCESS_CREATION_MITIGATION_POLICY_DEP_ENABLE.
diff --git a/sandbox/win/src/service_resolver.h b/sandbox/win/src/service_resolver.h
index 7ac5a24..08a45ba 100644
--- a/sandbox/win/src/service_resolver.h
+++ b/sandbox/win/src/service_resolver.h
@@ -5,8 +5,6 @@
#ifndef SANDBOX_SRC_SERVICE_RESOLVER_H__
#define SANDBOX_SRC_SERVICE_RESOLVER_H__
-#include <stddef.h>
-
#include "base/macros.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/resolver.h"
diff --git a/sandbox/win/src/service_resolver_32.cc b/sandbox/win/src/service_resolver_32.cc
index 4fc96d3..b0c6ca6 100644
--- a/sandbox/win/src/service_resolver_32.cc
+++ b/sandbox/win/src/service_resolver_32.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/service_resolver.h"
-#include <stddef.h>
-
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/src/win_utils.h"
diff --git a/sandbox/win/src/service_resolver_64.cc b/sandbox/win/src/service_resolver_64.cc
index 25ee9db..8dcea7d 100644
--- a/sandbox/win/src/service_resolver_64.cc
+++ b/sandbox/win/src/service_resolver_64.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/service_resolver.h"
-#include <stddef.h>
-
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/win_utils.h"
diff --git a/sandbox/win/src/service_resolver_unittest.cc b/sandbox/win/src/service_resolver_unittest.cc
index 421b814..2ae3e47 100644
--- a/sandbox/win/src/service_resolver_unittest.cc
+++ b/sandbox/win/src/service_resolver_unittest.cc
@@ -4,9 +4,7 @@
// This file contains unit tests for ServiceResolverThunk.
-#include <stddef.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/win/windows_version.h"
#include "sandbox/win/src/resolver.h"
diff --git a/sandbox/win/src/sharedmem_ipc_client.cc b/sandbox/win/src/sharedmem_ipc_client.cc
index eac1393..8f79109 100644
--- a/sandbox/win/src/sharedmem_ipc_client.cc
+++ b/sandbox/win/src/sharedmem_ipc_client.cc
@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
#include <string.h>
-
-#include "base/logging.h"
+#include "sandbox/win/src/sharedmem_ipc_client.h"
+#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/crosscall_params.h"
-#include "sandbox/win/src/sandbox.h"
-#include "sandbox/win/src/sharedmem_ipc_client.h"
+#include "base/logging.h"
namespace sandbox {
diff --git a/sandbox/win/src/sharedmem_ipc_client.h b/sandbox/win/src/sharedmem_ipc_client.h
index 67fd063..9eec74a 100644
--- a/sandbox/win/src/sharedmem_ipc_client.h
+++ b/sandbox/win/src/sharedmem_ipc_client.h
@@ -5,9 +5,6 @@
#ifndef SANDBOX_SRC_SHAREDMEM_IPC_CLIENT_H__
#define SANDBOX_SRC_SHAREDMEM_IPC_CLIENT_H__
-#include <stddef.h>
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_params.h"
#include "sandbox/win/src/sandbox.h"
@@ -84,7 +81,7 @@ struct ChannelControl {
// the client waits on the pong event for the IPC answer back
HANDLE pong_event;
// the IPC unique identifier
- uint32_t ipc_tag;
+ uint32 ipc_tag;
};
struct IPCControl {
diff --git a/sandbox/win/src/sharedmem_ipc_server.cc b/sandbox/win/src/sharedmem_ipc_server.cc
index cf2d800..ea1793c 100644
--- a/sandbox/win/src/sharedmem_ipc_server.cc
+++ b/sandbox/win/src/sharedmem_ipc_server.cc
@@ -2,19 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-#include <stdint.h>
-
#include "base/callback.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
-#include "sandbox/win/src/crosscall_params.h"
-#include "sandbox/win/src/crosscall_server.h"
+#include "sandbox/win/src/sharedmem_ipc_server.h"
+#include "sandbox/win/src/sharedmem_ipc_client.h"
#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/sandbox_types.h"
-#include "sandbox/win/src/sharedmem_ipc_client.h"
-#include "sandbox/win/src/sharedmem_ipc_server.h"
+#include "sandbox/win/src/crosscall_params.h"
+#include "sandbox/win/src/crosscall_server.h"
namespace {
// This handle must not be closed.
@@ -65,9 +62,8 @@ SharedMemIPCServer::~SharedMemIPCServer() {
::UnmapViewOfFile(client_control_);
}
-bool SharedMemIPCServer::Init(void* shared_mem,
- uint32_t shared_size,
- uint32_t channel_size) {
+bool SharedMemIPCServer::Init(void* shared_mem, uint32 shared_size,
+ uint32 channel_size) {
// The shared memory needs to be at least as big as a channel.
if (shared_size < channel_size) {
return false;
@@ -167,8 +163,8 @@ bool GetArgs(CrossCallParamsEx* params, IPCParams* ipc_params,
if (kMaxIpcParams < params->GetParamsCount())
return false;
- for (uint32_t i = 0; i < params->GetParamsCount(); i++) {
- uint32_t size;
+ for (uint32 i = 0; i < params->GetParamsCount(); i++) {
+ uint32 size;
ArgType type;
args[i] = params->GetRawParameter(i, &size, &type);
if (args[i]) {
@@ -185,7 +181,7 @@ bool GetArgs(CrossCallParamsEx* params, IPCParams* ipc_params,
break;
}
case UINT32_TYPE: {
- uint32_t data;
+ uint32 data;
if (!params->GetParameter32(i, &data)) {
ReleaseArgs(ipc_params, args);
return false;
@@ -224,7 +220,7 @@ bool SharedMemIPCServer::InvokeCallback(const ServerControl* service_context,
CrossCallReturn* call_result) {
// Set the default error code;
SetCallError(SBOX_ERROR_INVALID_IPC, call_result);
- uint32_t output_size = 0;
+ uint32 output_size = 0;
// Parse, verify and copy the message. The handler operates on a copy
// of the message so the client cannot play dirty tricks by changing the
// data in the channel while the IPC is being processed.
@@ -235,7 +231,7 @@ bool SharedMemIPCServer::InvokeCallback(const ServerControl* service_context,
if (!params.get())
return false;
- uint32_t tag = params->GetTag();
+ uint32 tag = params->GetTag();
static_assert(0 == INVALID_TYPE, "incorrect type enum");
IPCParams ipc_params = {0};
ipc_params.ipc_tag = tag;
diff --git a/sandbox/win/src/sharedmem_ipc_server.h b/sandbox/win/src/sharedmem_ipc_server.h
index 5afca1d..cb40bca 100644
--- a/sandbox/win/src/sharedmem_ipc_server.h
+++ b/sandbox/win/src/sharedmem_ipc_server.h
@@ -5,12 +5,10 @@
#ifndef SANDBOX_SRC_SHAREDMEM_IPC_SERVER_H_
#define SANDBOX_SRC_SHAREDMEM_IPC_SERVER_H_
-#include <stdint.h>
-
#include <list>
+#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
-#include "base/macros.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/crosscall_params.h"
#include "sandbox/win/src/crosscall_server.h"
@@ -55,7 +53,7 @@ class SharedMemIPCServer {
// Initializes the server structures, shared memory structures and
// creates the kernels events used to signal the IPC.
- bool Init(void* shared_mem, uint32_t shared_size, uint32_t channel_size);
+ bool Init(void* shared_mem, uint32 shared_size, uint32 channel_size);
private:
// Allow tests to be marked DISABLED_. Note that FLAKY_ and FAILS_ prefixes
@@ -87,7 +85,7 @@ class SharedMemIPCServer {
// This channel server pong event.
base::win::ScopedHandle pong_event;
// The size of this channel.
- uint32_t channel_size;
+ uint32 channel_size;
// The pointer to the actual channel data.
char* channel_buffer;
// The pointer to the base of the shared memory.
diff --git a/sandbox/win/src/sidestep/preamble_patcher_with_stub.cpp b/sandbox/win/src/sidestep/preamble_patcher_with_stub.cpp
index b501600..999d76b 100644
--- a/sandbox/win/src/sidestep/preamble_patcher_with_stub.cpp
+++ b/sandbox/win/src/sidestep/preamble_patcher_with_stub.cpp
@@ -6,8 +6,6 @@
#include "sandbox/win/src/sidestep/preamble_patcher.h"
-#include <stddef.h>
-
#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/sidestep/mini_disassembler.h"
diff --git a/sandbox/win/src/sidestep_resolver.cc b/sandbox/win/src/sidestep_resolver.cc
index d5da2fb..828c000 100644
--- a/sandbox/win/src/sidestep_resolver.cc
+++ b/sandbox/win/src/sidestep_resolver.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/sidestep_resolver.h"
-#include <stddef.h>
-
#include "base/win/pe_image.h"
#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/sidestep/preamble_patcher.h"
diff --git a/sandbox/win/src/sidestep_resolver.h b/sandbox/win/src/sidestep_resolver.h
index 8088272..cf03d6e 100644
--- a/sandbox/win/src/sidestep_resolver.h
+++ b/sandbox/win/src/sidestep_resolver.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_SIDESTEP_RESOLVER_H__
#define SANDBOX_SRC_SIDESTEP_RESOLVER_H__
-#include <stddef.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/resolver.h"
diff --git a/sandbox/win/src/sync_dispatcher.cc b/sandbox/win/src/sync_dispatcher.cc
index 2e5d1c5..a638d3d 100644
--- a/sandbox/win/src/sync_dispatcher.cc
+++ b/sandbox/win/src/sync_dispatcher.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/sync_dispatcher.h"
-#include <stdint.h>
-
#include "base/win/windows_version.h"
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/interception.h"
@@ -44,8 +42,8 @@ bool SyncDispatcher::SetupService(InterceptionManager* manager,
bool SyncDispatcher::CreateEvent(IPCInfo* ipc,
base::string16* name,
- uint32_t event_type,
- uint32_t initial_state) {
+ uint32 event_type,
+ uint32 initial_state) {
const wchar_t* event_name = name->c_str();
CountedParameterSet<NameBased> params;
params[NameBased::NAME] = ParamPickerMake(event_name);
@@ -62,7 +60,7 @@ bool SyncDispatcher::CreateEvent(IPCInfo* ipc,
bool SyncDispatcher::OpenEvent(IPCInfo* ipc,
base::string16* name,
- uint32_t desired_access) {
+ uint32 desired_access) {
const wchar_t* event_name = name->c_str();
CountedParameterSet<OpenEventParams> params;
diff --git a/sandbox/win/src/sync_dispatcher.h b/sandbox/win/src/sync_dispatcher.h
index 8a2a0e5..29c6c1e 100644
--- a/sandbox/win/src/sync_dispatcher.h
+++ b/sandbox/win/src/sync_dispatcher.h
@@ -5,9 +5,7 @@
#ifndef SANDBOX_SRC_SYNC_DISPATCHER_H_
#define SANDBOX_SRC_SYNC_DISPATCHER_H_
-#include <stdint.h>
-
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/sandbox_policy_base.h"
@@ -25,13 +23,13 @@ class SyncDispatcher : public Dispatcher {
private:
// Processes IPC requests coming from calls to CreateEvent in the target.
- bool CreateEvent(IPCInfo* ipc,
- base::string16* name,
- uint32_t event_type,
- uint32_t initial_state);
+ bool CreateEvent(IPCInfo* ipc,
+ base::string16* name,
+ uint32 event_type,
+ uint32 initial_state);
// Processes IPC requests coming from calls to OpenEvent in the target.
- bool OpenEvent(IPCInfo* ipc, base::string16* name, uint32_t desired_access);
+ bool OpenEvent(IPCInfo* ipc, base::string16* name, uint32 desired_access);
PolicyBase* policy_base_;
DISALLOW_COPY_AND_ASSIGN(SyncDispatcher);
diff --git a/sandbox/win/src/sync_interception.cc b/sandbox/win/src/sync_interception.cc
index 420d185..da612a5 100644
--- a/sandbox/win/src/sync_interception.cc
+++ b/sandbox/win/src/sync_interception.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/sync_interception.h"
-#include <stdint.h>
-
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/ipc_tags.h"
#include "sandbox/win/src/policy_params.h"
@@ -18,7 +16,7 @@
namespace sandbox {
ResultCode ProxyCreateEvent(LPCWSTR name,
- uint32_t initial_state,
+ uint32 initial_state,
EVENT_TYPE event_type,
void* ipc_memory,
CrossCallReturn* answer) {
@@ -35,7 +33,7 @@ ResultCode ProxyCreateEvent(LPCWSTR name,
}
ResultCode ProxyOpenEvent(LPCWSTR name,
- uint32_t desired_access,
+ uint32 desired_access,
void* ipc_memory,
CrossCallReturn* answer) {
CountedParameterSet<OpenEventParams> params;
@@ -81,7 +79,7 @@ NTSTATUS WINAPI TargetNtCreateEvent(NtCreateEventFunction orig_CreateEvent,
object_attribs_copy.RootDirectory = NULL;
wchar_t* name = NULL;
- uint32_t attributes = 0;
+ uint32 attributes = 0;
NTSTATUS ret = AllocAndCopyName(&object_attribs_copy, &name, &attributes,
NULL);
if (!NT_SUCCESS(ret) || name == NULL)
@@ -134,7 +132,7 @@ NTSTATUS WINAPI TargetNtOpenEvent(NtOpenEventFunction orig_OpenEvent,
object_attribs_copy.RootDirectory = NULL;
wchar_t* name = NULL;
- uint32_t attributes = 0;
+ uint32 attributes = 0;
NTSTATUS ret = AllocAndCopyName(&object_attribs_copy, &name, &attributes,
NULL);
if (!NT_SUCCESS(ret) || name == NULL)
diff --git a/sandbox/win/src/sync_policy.cc b/sandbox/win/src/sync_policy.cc
index 7ef094f..379e8f4 100644
--- a/sandbox/win/src/sync_policy.cc
+++ b/sandbox/win/src/sync_policy.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stdint.h>
-
#include <string>
#include "sandbox/win/src/sync_policy.h"
@@ -147,8 +145,8 @@ bool SyncPolicy::GenerateRules(const wchar_t* name,
if (TargetPolicy::EVENTS_ALLOW_READONLY == semantics) {
// We consider all flags that are not known to be readonly as potentially
// used for write.
- uint32_t allowed_flags = SYNCHRONIZE | GENERIC_READ | READ_CONTROL;
- uint32_t restricted_flags = ~allowed_flags;
+ uint32 allowed_flags = SYNCHRONIZE | GENERIC_READ | READ_CONTROL;
+ uint32 restricted_flags = ~allowed_flags;
open.AddNumberMatch(IF_NOT, OpenEventParams::ACCESS, restricted_flags, AND);
}
@@ -170,10 +168,10 @@ bool SyncPolicy::GenerateRules(const wchar_t* name,
NTSTATUS SyncPolicy::CreateEventAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& event_name,
- uint32_t event_type,
- uint32_t initial_state,
- HANDLE* handle) {
+ const base::string16 &event_name,
+ uint32 event_type,
+ uint32 initial_state,
+ HANDLE *handle) {
NtCreateEventFunction NtCreateEvent = NULL;
ResolveNTFunctionPtr("NtCreateEvent", &NtCreateEvent);
@@ -209,9 +207,9 @@ NTSTATUS SyncPolicy::CreateEventAction(EvalResult eval_result,
NTSTATUS SyncPolicy::OpenEventAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& event_name,
- uint32_t desired_access,
- HANDLE* handle) {
+ const base::string16 &event_name,
+ uint32 desired_access,
+ HANDLE *handle) {
NtOpenEventFunction NtOpenEvent = NULL;
ResolveNTFunctionPtr("NtOpenEvent", &NtOpenEvent);
diff --git a/sandbox/win/src/sync_policy.h b/sandbox/win/src/sync_policy.h
index 24e5c7d..e370e4b 100644
--- a/sandbox/win/src/sync_policy.h
+++ b/sandbox/win/src/sync_policy.h
@@ -5,10 +5,9 @@
#ifndef SANDBOX_SRC_SYNC_POLICY_H__
#define SANDBOX_SRC_SYNC_POLICY_H__
-#include <stdint.h>
-
#include <string>
+#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/nt_internals.h"
@@ -36,15 +35,15 @@ class SyncPolicy {
// eval_result is the desired policy action to accomplish.
static NTSTATUS CreateEventAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& event_name,
- uint32_t event_type,
- uint32_t initial_state,
- HANDLE* handle);
+ const base::string16 &event_name,
+ uint32 event_type,
+ uint32 initial_state,
+ HANDLE *handle);
static NTSTATUS OpenEventAction(EvalResult eval_result,
const ClientInfo& client_info,
- const base::string16& event_name,
- uint32_t desired_access,
- HANDLE* handle);
+ const base::string16 &event_name,
+ uint32 desired_access,
+ HANDLE *handle);
};
} // namespace sandbox
diff --git a/sandbox/win/src/target_process.cc b/sandbox/win/src/target_process.cc
index e27655e..8645e75 100644
--- a/sandbox/win/src/target_process.cc
+++ b/sandbox/win/src/target_process.cc
@@ -4,16 +4,14 @@
#include "sandbox/win/src/target_process.h"
-#include <stddef.h>
-#include <stdint.h>
-
+#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/win/pe_image.h"
#include "base/win/startup_information.h"
#include "base/win/windows_version.h"
-#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/crosscall_server.h"
+#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/policy_low_level.h"
#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/sharedmem_ipc_server.h"
@@ -268,10 +266,8 @@ ResultCode TargetProcess::TransferVariable(const char* name, void* address,
// Construct the IPC server and the IPC dispatcher. When the target does
// an IPC it will eventually call the dispatcher.
-DWORD TargetProcess::Init(Dispatcher* ipc_dispatcher,
- void* policy,
- uint32_t shared_IPC_size,
- uint32_t shared_policy_size) {
+DWORD TargetProcess::Init(Dispatcher* ipc_dispatcher, void* policy,
+ uint32 shared_IPC_size, uint32 shared_policy_size) {
// We need to map the shared memory on the target. This is necessary for
// any IPC that needs to take place, even if the target has not yet hit
// the main( ) function or even has initialized the CRT. So here we set
diff --git a/sandbox/win/src/target_process.h b/sandbox/win/src/target_process.h
index c00f2ce..59e6aea 100644
--- a/sandbox/win/src/target_process.h
+++ b/sandbox/win/src/target_process.h
@@ -6,10 +6,8 @@
#define SANDBOX_WIN_SRC_TARGET_PROCESS_H_
#include <windows.h>
-#include <stddef.h>
-#include <stdint.h>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/win/scoped_handle.h"
#include "base/win/scoped_process_information.h"
@@ -62,10 +60,8 @@ class TargetProcess {
// Creates the IPC objects such as the BrokerDispatcher and the
// IPC server. The IPC server uses the services of the thread_pool.
- DWORD Init(Dispatcher* ipc_dispatcher,
- void* policy,
- uint32_t shared_IPC_size,
- uint32_t shared_policy_size);
+ DWORD Init(Dispatcher* ipc_dispatcher, void* policy,
+ uint32 shared_IPC_size, uint32 shared_policy_size);
// Returns the handle to the target process.
HANDLE Process() const {
diff --git a/sandbox/win/src/target_services.cc b/sandbox/win/src/target_services.cc
index 7537245..e10f7ca 100644
--- a/sandbox/win/src/target_services.cc
+++ b/sandbox/win/src/target_services.cc
@@ -7,8 +7,8 @@
#include <new>
#include <process.h>
-#include <stdint.h>
+#include "base/basictypes.h"
#include "base/win/windows_version.h"
#include "sandbox/win/src/crosscall_client.h"
#include "sandbox/win/src/handle_closer_agent.h"
@@ -17,9 +17,9 @@
#include "sandbox/win/src/process_mitigations.h"
#include "sandbox/win/src/restricted_token_utils.h"
#include "sandbox/win/src/sandbox.h"
-#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/sharedmem_ipc_client.h"
+#include "sandbox/win/src/sandbox_nt_util.h"
namespace {
@@ -168,8 +168,8 @@ bool TargetServicesBase::TestIPCPing(int version) {
CrossCallReturn answer = {0};
if (1 == version) {
- uint32_t tick1 = ::GetTickCount();
- uint32_t cookie = 717115;
+ uint32 tick1 = ::GetTickCount();
+ uint32 cookie = 717115;
ResultCode code = CrossCall(ipc, IPC_PING1_TAG, cookie, &answer);
if (SBOX_ALL_OK != code) {
@@ -182,7 +182,7 @@ bool TargetServicesBase::TestIPCPing(int version) {
}
// We test the first extended answer to be within the bounds of the tick
// count only if there was no tick count wraparound.
- uint32_t tick2 = ::GetTickCount();
+ uint32 tick2 = ::GetTickCount();
if (tick2 >= tick1) {
if ((answer.extended[0].unsigned_int < tick1) ||
(answer.extended[0].unsigned_int > tick2)) {
@@ -194,7 +194,7 @@ bool TargetServicesBase::TestIPCPing(int version) {
return false;
}
} else if (2 == version) {
- uint32_t cookie = 717111;
+ uint32 cookie = 717111;
InOutCountedBuffer counted_buffer(&cookie, sizeof(cookie));
ResultCode code = CrossCall(ipc, IPC_PING2_TAG, counted_buffer, &answer);
diff --git a/sandbox/win/src/target_services.h b/sandbox/win/src/target_services.h
index 3716948..c80a90d 100644
--- a/sandbox/win/src/target_services.h
+++ b/sandbox/win/src/target_services.h
@@ -5,7 +5,7 @@
#ifndef SANDBOX_SRC_TARGET_SERVICES_H__
#define SANDBOX_SRC_TARGET_SERVICES_H__
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/win_utils.h"
diff --git a/sandbox/win/src/threadpool_unittest.cc b/sandbox/win/src/threadpool_unittest.cc
index d32fdda..4f3b0df 100644
--- a/sandbox/win/src/threadpool_unittest.cc
+++ b/sandbox/win/src/threadpool_unittest.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stdint.h>
-
#include "sandbox/win/src/win2k_threadpool.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,7 +24,7 @@ TEST(IPCTest, ThreadPoolRegisterTest1) {
HANDLE event1 = ::CreateEventW(NULL, FALSE, FALSE, NULL);
HANDLE event2 = ::CreateEventW(NULL, FALSE, FALSE, NULL);
- uint32_t context = 0;
+ uint32 context = 0;
EXPECT_FALSE(thread_pool.RegisterWait(0, event1, EmptyCallBack, &context));
EXPECT_EQ(0u, thread_pool.OutstandingWaits());
@@ -49,9 +47,9 @@ TEST(IPCTest, ThreadPoolRegisterTest2) {
HANDLE event1 = ::CreateEventW(NULL, FALSE, FALSE, NULL);
HANDLE event2 = ::CreateEventW(NULL, FALSE, FALSE, NULL);
- uint32_t context = 0;
- uint32_t c1 = 0;
- uint32_t c2 = 0;
+ uint32 context = 0;
+ uint32 c1 = 0;
+ uint32 c2 = 0;
EXPECT_TRUE(thread_pool.RegisterWait(&c1, event1, EmptyCallBack, &context));
EXPECT_EQ(1u, thread_pool.OutstandingWaits());
diff --git a/sandbox/win/src/top_level_dispatcher.cc b/sandbox/win/src/top_level_dispatcher.cc
index e6e224b..19a5f05 100644
--- a/sandbox/win/src/top_level_dispatcher.cc
+++ b/sandbox/win/src/top_level_dispatcher.cc
@@ -4,9 +4,9 @@
#include "sandbox/win/src/top_level_dispatcher.h"
-#include <stdint.h>
#include <string.h>
+#include "base/basictypes.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/src/crosscall_server.h"
@@ -116,7 +116,7 @@ bool TopLevelDispatcher::Ping(IPCInfo* ipc, void* arg1) {
switch (ipc->ipc_tag) {
case IPC_PING1_TAG: {
IPCInt ipc_int(arg1);
- uint32_t cookie = ipc_int.As32Bit();
+ uint32 cookie = ipc_int.As32Bit();
ipc->return_info.extended_count = 2;
ipc->return_info.extended[0].unsigned_int = ::GetTickCount();
ipc->return_info.extended[1].unsigned_int = 2 * cookie;
@@ -124,10 +124,10 @@ bool TopLevelDispatcher::Ping(IPCInfo* ipc, void* arg1) {
}
case IPC_PING2_TAG: {
CountedBuffer* io_buffer = reinterpret_cast<CountedBuffer*>(arg1);
- if (sizeof(uint32_t) != io_buffer->Size())
+ if (sizeof(uint32) != io_buffer->Size())
return false;
- uint32_t* cookie = reinterpret_cast<uint32_t*>(io_buffer->Buffer());
+ uint32* cookie = reinterpret_cast<uint32*>(io_buffer->Buffer());
*cookie = (*cookie) * 3;
return true;
}
diff --git a/sandbox/win/src/win2k_threadpool.cc b/sandbox/win/src/win2k_threadpool.cc
index 35de38a..051cfc1 100644
--- a/sandbox/win/src/win2k_threadpool.cc
+++ b/sandbox/win/src/win2k_threadpool.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/win2k_threadpool.h"
-#include <stddef.h>
-
#include "sandbox/win/src/win_utils.h"
namespace sandbox {
diff --git a/sandbox/win/src/win2k_threadpool.h b/sandbox/win/src/win2k_threadpool.h
index c4d539d..be2791f 100644
--- a/sandbox/win/src/win2k_threadpool.h
+++ b/sandbox/win/src/win2k_threadpool.h
@@ -5,11 +5,8 @@
#ifndef SANDBOX_SRC_WIN2K_THREADPOOL_H_
#define SANDBOX_SRC_WIN2K_THREADPOOL_H_
-#include <stddef.h>
-
-#include <algorithm>
#include <list>
-#include "base/macros.h"
+#include <algorithm>
#include "sandbox/win/src/crosscall_server.h"
namespace sandbox {
diff --git a/sandbox/win/src/win_utils.cc b/sandbox/win/src/win_utils.cc
index 8465a2b..e09c680 100644
--- a/sandbox/win/src/win_utils.cc
+++ b/sandbox/win/src/win_utils.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/src/win_utils.h"
-#include <stddef.h>
-
#include <map>
#include "base/memory/scoped_ptr.h"
diff --git a/sandbox/win/src/win_utils.h b/sandbox/win/src/win_utils.h
index f7895c1..bf3ed84 100644
--- a/sandbox/win/src/win_utils.h
+++ b/sandbox/win/src/win_utils.h
@@ -6,10 +6,9 @@
#define SANDBOX_SRC_WIN_UTILS_H_
#include <windows.h>
-#include <stddef.h>
#include <string>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "base/strings/string16.h"
namespace sandbox {
diff --git a/sandbox/win/tests/common/test_utils.cc b/sandbox/win/tests/common/test_utils.cc
index 4ec47bc..cdd86de 100644
--- a/sandbox/win/tests/common/test_utils.cc
+++ b/sandbox/win/tests/common/test_utils.cc
@@ -4,7 +4,6 @@
#include "sandbox/win/tests/common/test_utils.h"
-#include <stddef.h>
#include <winioctl.h>
typedef struct _REPARSE_DATA_BUFFER {
diff --git a/sandbox/win/tests/integration_tests/integration_tests_test.cc b/sandbox/win/tests/integration_tests/integration_tests_test.cc
index 4acadb9..44055d3 100644
--- a/sandbox/win/tests/integration_tests/integration_tests_test.cc
+++ b/sandbox/win/tests/integration_tests/integration_tests_test.cc
@@ -4,13 +4,11 @@
// Some tests for the framework itself.
-#include <stddef.h>
-
+#include "testing/gtest/include/gtest/gtest.h"
#include "sandbox/win/src/sandbox.h"
-#include "sandbox/win/src/sandbox_factory.h"
#include "sandbox/win/src/target_services.h"
+#include "sandbox/win/src/sandbox_factory.h"
#include "sandbox/win/tests/common/controller.h"
-#include "testing/gtest/include/gtest/gtest.h"
namespace sandbox {
diff --git a/sandbox/win/tests/validation_tests/commands.cc b/sandbox/win/tests/validation_tests/commands.cc
index f0c8828..10a4a13 100644
--- a/sandbox/win/tests/validation_tests/commands.cc
+++ b/sandbox/win/tests/validation_tests/commands.cc
@@ -4,7 +4,6 @@
#include <Aclapi.h>
#include <windows.h>
-#include <stddef.h>
#include <string>
#include "sandbox/win/tests/validation_tests/commands.h"
diff --git a/sandbox/win/tests/validation_tests/suite.cc b/sandbox/win/tests/validation_tests/suite.cc
index 9fe25ce..df2cb3e 100644
--- a/sandbox/win/tests/validation_tests/suite.cc
+++ b/sandbox/win/tests/validation_tests/suite.cc
@@ -7,11 +7,10 @@
// sandbox.
#include <shlwapi.h>
-#include <stddef.h>
#include "base/win/windows_version.h"
-#include "sandbox/win/tests/common/controller.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "sandbox/win/tests/common/controller.h"
#pragma comment(lib, "shlwapi.lib")
diff --git a/sandbox/win/wow_helper/service64_resolver.cc b/sandbox/win/wow_helper/service64_resolver.cc
index 32c9829..033b9d7 100644
--- a/sandbox/win/wow_helper/service64_resolver.cc
+++ b/sandbox/win/wow_helper/service64_resolver.cc
@@ -4,8 +4,6 @@
#include "sandbox/win/wow_helper/service64_resolver.h"
-#include <stddef.h>
-
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/wow_helper/target_code.h"
diff --git a/sandbox/win/wow_helper/service64_resolver.h b/sandbox/win/wow_helper/service64_resolver.h
index 32ee46f..abd7efd 100644
--- a/sandbox/win/wow_helper/service64_resolver.h
+++ b/sandbox/win/wow_helper/service64_resolver.h
@@ -5,9 +5,6 @@
#ifndef SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
#define SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
-#include <stddef.h>
-
-#include "base/macros.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/resolver.h"
diff --git a/sandbox/win/wow_helper/wow_helper.cc b/sandbox/win/wow_helper/wow_helper.cc
index af76cbc..e349337 100644
--- a/sandbox/win/wow_helper/wow_helper.cc
+++ b/sandbox/win/wow_helper/wow_helper.cc
@@ -9,7 +9,6 @@
// setup the interceptions (32-bit) properly on the target.
#include <windows.h>
-#include <stddef.h>
#include <string>