Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / chrome_frame / crash_reporting / nt_loader.cc
blob3e5a99a6951b35c19c33bf1a0228330e08181b19
1 // Copyright (c) 2009 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.
4 #include "chrome_frame/crash_reporting/nt_loader.h"
6 #include <winnt.h>
7 #include <winternl.h>
8 #include "base/logging.h"
10 namespace nt_loader {
12 LDR_DATA_TABLE_ENTRY* GetLoaderEntry(HMODULE module) {
13 // Make sure we own the loader's lock on entry here.
14 DCHECK(OwnsCriticalSection(GetLoaderLock()));
15 PEB* peb = GetCurrentPeb();
17 LIST_ENTRY* head = &peb->Ldr->InLoadOrderModuleList;
18 for (LIST_ENTRY* entry = head->Flink; entry != head; entry = entry->Flink) {
19 LDR_DATA_TABLE_ENTRY* ldr_entry =
20 CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
22 if (reinterpret_cast<HMODULE>(ldr_entry->DllBase) == module)
23 return ldr_entry;
26 return NULL;
29 } // namespace nt_loader