Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2011 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_SRC_SANDBOX_TYPES_H_ | 5 #ifndef SANDBOX_SRC_SANDBOX_TYPES_H_ |
| 6 #define SANDBOX_SRC_SANDBOX_TYPES_H_ | 6 #define SANDBOX_SRC_SANDBOX_TYPES_H_ |
| 7 | 7 |
| 8 namespace sandbox { | 8 namespace sandbox { |
| 9 | 9 |
| 10 // Operation result codes returned by the sandbox API. | 10 // Operation result codes returned by the sandbox API. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 enum TerminationCodes { | 46 enum TerminationCodes { |
| 47 SBOX_FATAL_INTEGRITY = 7006, // Could not set the integrity level. | 47 SBOX_FATAL_INTEGRITY = 7006, // Could not set the integrity level. |
| 48 SBOX_FATAL_DROPTOKEN = 7007, // Could not lower the token. | 48 SBOX_FATAL_DROPTOKEN = 7007, // Could not lower the token. |
| 49 SBOX_FATAL_FLUSHANDLES = 7008, // Failed to flush registry handles. | 49 SBOX_FATAL_FLUSHANDLES = 7008, // Failed to flush registry handles. |
| 50 SBOX_FATAL_CACHEDISABLE = 7009 // Failed to forbid HCKU caching. | 50 SBOX_FATAL_CACHEDISABLE = 7009 // Failed to forbid HCKU caching. |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 class TargetServices; | 53 class TargetServices; |
| 54 class BrokerServices; | 54 class BrokerServices; |
| 55 | 55 |
| 56 // Contains the pointer to a target or broker service. | 56 // Contains the pointer to a target or broker service. Older code used |
| 57 // a union so the |legacy| member is there for us to detect we are | |
| 58 // being passed a SandboxInterfaceInfo by old code. If legacy is not | |
| 59 // null it means we are dealing with old code a must copy this value | |
| 60 // into both |broker_services| and |target_services|. | |
| 57 struct SandboxInterfaceInfo { | 61 struct SandboxInterfaceInfo { |
| 62 void* legacy; | |
|
amit
2011/02/25 21:31:04
nit: why not have the exact same union as 'legacy'
| |
| 63 BrokerServices* broker_services; | |
| 58 TargetServices* target_services; | 64 TargetServices* target_services; |
| 59 BrokerServices* broker_services; | |
| 60 }; | 65 }; |
| 61 | 66 |
| 62 #if SANDBOX_EXPORTS | 67 #if SANDBOX_EXPORTS |
| 63 #define SANDBOX_INTERCEPT extern "C" __declspec(dllexport) | 68 #define SANDBOX_INTERCEPT extern "C" __declspec(dllexport) |
| 64 #else | 69 #else |
| 65 #define SANDBOX_INTERCEPT extern "C" | 70 #define SANDBOX_INTERCEPT extern "C" |
| 66 #endif | 71 #endif |
| 67 | 72 |
| 68 enum InterceptionType { | 73 enum InterceptionType { |
| 69 INTERCEPTION_INVALID = 0, | 74 INTERCEPTION_INVALID = 0, |
| 70 INTERCEPTION_SERVICE_CALL, // Trampoline of an NT native call | 75 INTERCEPTION_SERVICE_CALL, // Trampoline of an NT native call |
| 71 INTERCEPTION_EAT, | 76 INTERCEPTION_EAT, |
| 72 INTERCEPTION_SIDESTEP, // Preamble patch | 77 INTERCEPTION_SIDESTEP, // Preamble patch |
| 73 INTERCEPTION_SMART_SIDESTEP, // Preamble patch but bypass internal calls | 78 INTERCEPTION_SMART_SIDESTEP, // Preamble patch but bypass internal calls |
| 74 INTERCEPTION_UNLOAD_MODULE, // Unload the module (don't patch) | 79 INTERCEPTION_UNLOAD_MODULE, // Unload the module (don't patch) |
| 75 INTERCEPTION_LAST // Placeholder for last item in the enumeration | 80 INTERCEPTION_LAST // Placeholder for last item in the enumeration |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 } // namespace sandbox | 83 } // namespace sandbox |
| 79 | 84 |
| 80 #endif // SANDBOX_SRC_SANDBOX_TYPES_H_ | 85 #endif // SANDBOX_SRC_SANDBOX_TYPES_H_ |
| OLD | NEW |