| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "sandbox/src/policy_engine_opcodes.h" | 5 #include "sandbox/win/src/policy_engine_opcodes.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "sandbox/src/sandbox_nt_types.h" | 8 #include "sandbox/win/src/sandbox_nt_types.h" |
| 9 #include "sandbox/src/sandbox_types.h" | 9 #include "sandbox/win/src/sandbox_types.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 const unsigned short kMaxUniStrSize = 0xfffc; | 12 const unsigned short kMaxUniStrSize = 0xfffc; |
| 13 | 13 |
| 14 bool InitStringUnicode(const wchar_t* source, size_t length, | 14 bool InitStringUnicode(const wchar_t* source, size_t length, |
| 15 UNICODE_STRING* ustring) { | 15 UNICODE_STRING* ustring) { |
| 16 ustring->Buffer = const_cast<wchar_t*>(source); | 16 ustring->Buffer = const_cast<wchar_t*>(source); |
| 17 ustring->Length = static_cast<USHORT>(length) * sizeof(wchar_t); | 17 ustring->Length = static_cast<USHORT>(length) * sizeof(wchar_t); |
| 18 if (length > kMaxUniStrSize) { | 18 if (length > kMaxUniStrSize) { |
| 19 return false; | 19 return false; |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 OPCODE_EVAL(OP_ULONG_AND_MATCH, this, parameters, match); | 445 OPCODE_EVAL(OP_ULONG_AND_MATCH, this, parameters, match); |
| 446 OPCODE_EVAL(OP_ACTION, this, parameters, match); | 446 OPCODE_EVAL(OP_ACTION, this, parameters, match); |
| 447 default: | 447 default: |
| 448 return EVAL_ERROR; | 448 return EVAL_ERROR; |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 #undef OPCODE_EVAL | 452 #undef OPCODE_EVAL |
| 453 | 453 |
| 454 } // namespace sandbox | 454 } // namespace sandbox |
| OLD | NEW |