OLD | NEW |
1 // Copyright (c) 2011 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 #include "sandbox/src/win_utils.h" | 5 #include "sandbox/win/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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "sandbox/src/internal_types.h" | 11 #include "sandbox/win/src/internal_types.h" |
12 #include "sandbox/src/nt_internals.h" | 12 #include "sandbox/win/src/nt_internals.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Holds the information about a known registry key. | 16 // Holds the information about a known registry key. |
17 struct KnownReservedKey { | 17 struct KnownReservedKey { |
18 const wchar_t* name; | 18 const wchar_t* name; |
19 HKEY key; | 19 HKEY key; |
20 }; | 20 }; |
21 | 21 |
22 // Contains all the known registry key by name and by handle. | 22 // Contains all the known registry key by name and by handle. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 for (int tries = 1; !(*function_ptr) && tries < max_tries; ++tries) { | 315 for (int tries = 1; !(*function_ptr) && tries < max_tries; ++tries) { |
316 if (tries >= sleep_threshold) | 316 if (tries >= sleep_threshold) |
317 ::Sleep(1); | 317 ::Sleep(1); |
318 ntdll = ::GetModuleHandle(sandbox::kNtdllName); | 318 ntdll = ::GetModuleHandle(sandbox::kNtdllName); |
319 *function_ptr = ::GetProcAddress(ntdll, name); | 319 *function_ptr = ::GetProcAddress(ntdll, name); |
320 } | 320 } |
321 | 321 |
322 CHECK(*function_ptr); | 322 CHECK(*function_ptr); |
323 } | 323 } |
OLD | NEW |