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

Side by Side Diff: sandbox/win/src/sandbox_types.h

Issue 1923653002: Wire up process launch error codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sandbox/win/src/sandbox_policy_base.cc ('k') | sandbox/win/src/target_process.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SANDBOX_WIN_SRC_SANDBOX_TYPES_H_ 5 #ifndef SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
6 #define SANDBOX_WIN_SRC_SANDBOX_TYPES_H_ 6 #define SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
7 7
8 #include "base/process/launch.h"
9
8 namespace sandbox { 10 namespace sandbox {
9 11
10 // Operation result codes returned by the sandbox API. 12 // Operation result codes returned by the sandbox API.
11 enum ResultCode { 13 //
14 // Note: These codes are listed in a histogram and any new codes should be added
15 // at the end.
16 //
17 enum ResultCode : int {
12 SBOX_ALL_OK = 0, 18 SBOX_ALL_OK = 0,
13 // Error is originating on the win32 layer. Call GetlastError() for more 19 // Error is originating on the win32 layer. Call GetlastError() for more
14 // information. 20 // information.
15 SBOX_ERROR_GENERIC = 1, 21 SBOX_ERROR_GENERIC,
16 // An invalid combination of parameters was given to the API. 22 // An invalid combination of parameters was given to the API.
17 SBOX_ERROR_BAD_PARAMS = 2, 23 SBOX_ERROR_BAD_PARAMS,
18 // The desired operation is not supported at this time. 24 // The desired operation is not supported at this time.
19 SBOX_ERROR_UNSUPPORTED = 3, 25 SBOX_ERROR_UNSUPPORTED,
20 // The request requires more memory that allocated or available. 26 // The request requires more memory that allocated or available.
21 SBOX_ERROR_NO_SPACE = 4, 27 SBOX_ERROR_NO_SPACE,
22 // The ipc service requested does not exist. 28 // The ipc service requested does not exist.
23 SBOX_ERROR_INVALID_IPC = 5, 29 SBOX_ERROR_INVALID_IPC,
24 // The ipc service did not complete. 30 // The ipc service did not complete.
25 SBOX_ERROR_FAILED_IPC = 6, 31 SBOX_ERROR_FAILED_IPC,
26 // The requested handle was not found. 32 // The requested handle was not found.
27 SBOX_ERROR_NO_HANDLE = 7, 33 SBOX_ERROR_NO_HANDLE,
28 // This function was not expected to be called at this time. 34 // This function was not expected to be called at this time.
29 SBOX_ERROR_UNEXPECTED_CALL = 8, 35 SBOX_ERROR_UNEXPECTED_CALL,
30 // WaitForAllTargets is already called. 36 // WaitForAllTargets is already called.
31 SBOX_ERROR_WAIT_ALREADY_CALLED = 9, 37 SBOX_ERROR_WAIT_ALREADY_CALLED,
32 // A channel error prevented DoCall from executing. 38 // A channel error prevented DoCall from executing.
33 SBOX_ERROR_CHANNEL_ERROR = 10, 39 SBOX_ERROR_CHANNEL_ERROR,
34 // Failed to create the alternate desktop. 40 // Failed to create the alternate desktop.
35 SBOX_ERROR_CANNOT_CREATE_DESKTOP = 11, 41 SBOX_ERROR_CANNOT_CREATE_DESKTOP,
36 // Failed to create the alternate window station. 42 // Failed to create the alternate window station.
37 SBOX_ERROR_CANNOT_CREATE_WINSTATION = 12, 43 SBOX_ERROR_CANNOT_CREATE_WINSTATION,
38 // Failed to switch back to the interactive window station. 44 // Failed to switch back to the interactive window station.
39 SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION = 13, 45 SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION,
40 // The supplied AppContainer is not valid. 46 // The supplied AppContainer is not valid.
41 SBOX_ERROR_INVALID_APP_CONTAINER = 14, 47 SBOX_ERROR_INVALID_APP_CONTAINER,
42 // The supplied capability is not valid. 48 // The supplied capability is not valid.
43 SBOX_ERROR_INVALID_CAPABILITY = 15, 49 SBOX_ERROR_INVALID_CAPABILITY,
44 // There is a failure initializing the AppContainer. 50 // There is a failure initializing the AppContainer.
45 SBOX_ERROR_CANNOT_INIT_APPCONTAINER = 16, 51 SBOX_ERROR_CANNOT_INIT_APPCONTAINER,
46 // Initializing or updating ProcThreadAttributes failed. 52 // Initializing or updating ProcThreadAttributes failed.
47 SBOX_ERROR_PROC_THREAD_ATTRIBUTES = 17, 53 SBOX_ERROR_PROC_THREAD_ATTRIBUTES,
48 // Error in creating process. 54 // Error in creating process.
49 SBOX_ERROR_CREATE_PROCESS = 18, 55 SBOX_ERROR_CREATE_PROCESS,
Alexei Svitkine (slow) 2016/05/03 17:06:57 Nit: For a long list like this, I actually find th
Will Harris 2016/05/03 17:26:52 Done.
56 // Failure calling delegate PreSpawnTarget.
57 SBOX_ERROR_DELEGATE_PRE_SPAWN,
58 // Could not assign process to job object.
59 SBOX_ERROR_ASSIGN_PROCESS_TO_JOB_OBJECT,
60 // Could not assign process to job object.
61 SBOX_ERROR_SET_THREAD_TOKEN,
62 // Could not get thread context of new process.
63 SBOX_ERROR_GET_THREAD_CONTEXT,
64 // Could not duplicate target info of new process.
65 SBOX_ERROR_DUPLICATE_TARGET_INFO,
66 // Could not set low box token.
67 SBOX_ERROR_SET_LOW_BOX_TOKEN,
68 // Could not create file mapping for IPC dispatcher.
69 SBOX_ERROR_CREATE_FILE_MAPPING,
70 // Could not duplicate shared section into target process for IPC dispatcher.
71 SBOX_ERROR_DUPLICATE_SHARED_SECTION,
72 // Could not map view of shared memory in broker.
73 SBOX_ERROR_MAP_VIEW_OF_SHARED_SECTION,
74 // Could not apply ASLR mitigations to target process.
75 SBOX_ERROR_APPLY_ASLR_MITIGATIONS,
76 // Could not setup one of the required interception services.
77 SBOX_ERROR_SETUP_BASIC_INTERCEPTIONS,
78 // Could not setup basic interceptions.
79 SBOX_ERROR_SETUP_INTERCEPTION_SERVICE,
80 // Could not initialize interceptions. This usually means 3rd party software
81 // is stomping on our hooks, or can sometimes mean the syscall format has
82 // changed.
83 SBOX_ERROR_INITIALIZE_INTERCEPTIONS,
84 // Could not setup the imports for ntdll in target process.
85 SBOX_ERROR_SETUP_NTDLL_IMPORTS,
86 // Could not setup the handle closer in target process.
87 SBOX_ERROR_SETUP_HANDLE_CLOSER,
50 // Placeholder for last item of the enum. 88 // Placeholder for last item of the enum.
51 SBOX_ERROR_LAST 89 SBOX_ERROR_LAST
52 }; 90 };
53 91
54 // If the sandbox cannot create a secure environment for the target, the 92 // If the sandbox cannot create a secure environment for the target, the
55 // target will be forcibly terminated. These are the process exit codes. 93 // target will be forcibly terminated. These are the process exit codes.
56 enum TerminationCodes { 94 enum TerminationCodes {
57 SBOX_FATAL_INTEGRITY = 7006, // Could not set the integrity level. 95 SBOX_FATAL_INTEGRITY = 7006, // Could not set the integrity level.
58 SBOX_FATAL_DROPTOKEN = 7007, // Could not lower the token. 96 SBOX_FATAL_DROPTOKEN = 7007, // Could not lower the token.
59 SBOX_FATAL_FLUSHANDLES = 7008, // Failed to flush registry handles. 97 SBOX_FATAL_FLUSHANDLES = 7008, // Failed to flush registry handles.
(...skipping 26 matching lines...) Expand all
86 INTERCEPTION_EAT, 124 INTERCEPTION_EAT,
87 INTERCEPTION_SIDESTEP, // Preamble patch 125 INTERCEPTION_SIDESTEP, // Preamble patch
88 INTERCEPTION_SMART_SIDESTEP, // Preamble patch but bypass internal calls 126 INTERCEPTION_SMART_SIDESTEP, // Preamble patch but bypass internal calls
89 INTERCEPTION_UNLOAD_MODULE, // Unload the module (don't patch) 127 INTERCEPTION_UNLOAD_MODULE, // Unload the module (don't patch)
90 INTERCEPTION_LAST // Placeholder for last item in the enumeration 128 INTERCEPTION_LAST // Placeholder for last item in the enumeration
91 }; 129 };
92 130
93 } // namespace sandbox 131 } // namespace sandbox
94 132
95 #endif // SANDBOX_WIN_SRC_SANDBOX_TYPES_H_ 133 #endif // SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
OLDNEW
« no previous file with comments | « sandbox/win/src/sandbox_policy_base.cc ('k') | sandbox/win/src/target_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698