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/win_utils.h" | 5 #include "sandbox/src/win_utils.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/scoped_ptr.h" |
10 #include "sandbox/src/internal_types.h" | 11 #include "sandbox/src/internal_types.h" |
11 #include "sandbox/src/nt_internals.h" | 12 #include "sandbox/src/nt_internals.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 // Holds the information about a known registry key. | 16 // Holds the information about a known registry key. |
16 struct KnownReservedKey { | 17 struct KnownReservedKey { |
17 const wchar_t* name; | 18 const wchar_t* name; |
18 HKEY key; | 19 HKEY key; |
19 }; | 20 }; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 208 |
208 FARPROC* function_ptr = reinterpret_cast<FARPROC*>(ptr); | 209 FARPROC* function_ptr = reinterpret_cast<FARPROC*>(ptr); |
209 *function_ptr = (*function_map)[name]; | 210 *function_ptr = (*function_map)[name]; |
210 if (*function_ptr) | 211 if (*function_ptr) |
211 return; | 212 return; |
212 | 213 |
213 *function_ptr = ::GetProcAddress(ntdll, name); | 214 *function_ptr = ::GetProcAddress(ntdll, name); |
214 (*function_map)[name] = *function_ptr; | 215 (*function_map)[name] = *function_ptr; |
215 DCHECK(*function_ptr); | 216 DCHECK(*function_ptr); |
216 } | 217 } |
OLD | NEW |