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

Side by Side Diff: chrome_frame/crash_reporting/nt_loader.cc

Issue 882001: Utility functions to interact with the NT loader's data structures and associ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 9 months 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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"
5
6 #include <winnt.h>
7 #include <winternl.h>
8 #include "base/logging.h"
9
10 namespace nt_loader {
11
12 LDR_DATA_TABLE_ENTRY* GetLoaderEntry(HMODULE module) {
13 // Make sure we own the loader's lock on entry here.
14 DCHECK(OwnsCriticalSection(GetLoaderLock()));
amit 2010/03/11 16:08:51 Shouldn't this an 'if' instead? We probably do not
Sigurður Ásgeirsson 2010/03/11 16:16:35 The DCHECK is asserting on the documented precondi
15 PEB* peb = GetCurrentPeb();
16
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);
21
22 if (reinterpret_cast<HMODULE>(ldr_entry->DllBase) == module)
23 return ldr_entry;
24 }
25
26 return NULL;
27 }
28
29 } // namespace nt_loader
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698