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

Side by Side Diff: sandbox/src/sandbox_utils.h

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/src/process_policy_test.cc ('k') | sandbox/src/sandbox_utils.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_UTILS_H__ 5 #ifndef SANDBOX_SRC_SANDBOX_UTILS_H__
6 #define SANDBOX_SRC_SANDBOX_UTILS_H__ 6 #define SANDBOX_SRC_SANDBOX_UTILS_H__
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
26 // the functionality exposed by GetModuleHandleEx. 26 // the functionality exposed by GetModuleHandleEx.
27 bool GetModuleHandleHelper(DWORD flags, const wchar_t* module_name, 27 bool GetModuleHandleHelper(DWORD flags, const wchar_t* module_name,
28 HMODULE* module); 28 HMODULE* module);
29 29
30 // Returns true if the current OS is Windows XP SP2 or later. 30 // Returns true if the current OS is Windows XP SP2 or later.
31 bool IsXPSP2OrLater(); 31 bool IsXPSP2OrLater();
32 32
33 void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root, 33 void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root,
34 OBJECT_ATTRIBUTES* obj_attr, UNICODE_STRING* uni_name); 34 OBJECT_ATTRIBUTES* obj_attr, UNICODE_STRING* uni_name);
35 35
36 // The next 2 functions are copied from base\string_util.h and have been
37 // slighty modified because we don't want to depend on ICU.
38 template <class string_type>
39 inline typename string_type::value_type* WriteInto(string_type* str,
40 size_t length_with_null) {
41 str->reserve(length_with_null);
42 str->resize(length_with_null - 1);
43 return &((*str)[0]);
44 }
45
46 std::string WideToMultiByte(const std::wstring& wide);
47
48 }; // namespace sandbox 36 }; // namespace sandbox
49 37
50 #endif // SANDBOX_SRC_SANDBOX_UTILS_H__ 38 #endif // SANDBOX_SRC_SANDBOX_UTILS_H__
OLDNEW
« no previous file with comments | « sandbox/src/process_policy_test.cc ('k') | sandbox/src/sandbox_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698