1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 #include "base/win/pe_image.h"
9 #include "chrome_elf/ntdll_cache.h"
11 FunctionLookupTable g_ntdll_lookup
;
15 bool EnumExportsCallback(const base::win::PEImage
& image
,
22 // Our lookup only cares about named functions that are in ntdll, so skip
23 // unnamed or forwarded exports.
24 if (name
&& function_addr
)
25 g_ntdll_lookup
[std::string(name
)] = function_addr
;
33 HMODULE ntdll_handle
= ::GetModuleHandle(L
"ntdll.dll");
35 base::win::PEImage
ntdll_image(ntdll_handle
);
37 ntdll_image
.EnumExports(EnumExportsCallback
, NULL
);