ReactOS 0.4.15-dev-8127-g6338913
peloader.h
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Provides routines for loading PE files.
5 * (Deprecated remark) To be merged with arch/i386/loader.c in future.
6 *
7 * COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
8 * Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
9 *
10 * NOTES: The source code in this file is based on the work of respective
11 * authors of PE loading code in ReactOS and Brian Palmer and
12 * Alex Ionescu's arch/i386/loader.c, and my research project
13 * (creating a native EFI loader for Windows).
14 *
15 * This article was very handy during development:
16 * http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/
17 */
18
19#pragma once
20
21/* Optional user-provided callback used by the PE loader
22 * when it loads DLLs imported by a main image. */
23typedef VOID
26
28
32 _In_ TYPE_OF_MEMORY MemoryType,
33 _Out_ PVOID* ImageBasePA);
34
38 IN PCCH BaseDllName,
40 IN PVOID BasePA,
41 OUT PLDR_DATA_TABLE_ENTRY *NewEntry);
42
43VOID
45 // _In_ PLIST_ENTRY ModuleListHead,
47
51 IN PCCH DirectoryPath,
53
57 IN PCH DllName,
58 OUT PLDR_DATA_TABLE_ENTRY *LoadedEntry);
59
PCWSTR FilePath
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
struct _FileName FileName
Definition: fatprocs.h:896
LIST_ENTRY * ModuleListHead
Definition: kdpacket.c:23
_In_ PCWSTR FullDllName
Definition: ldrtypes.h:247
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
CHAR * PCH
Definition: ntbasedef.h:391
CONST CHAR * PCCH
Definition: ntbasedef.h:392
BOOLEAN PeLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead, IN PCCH DirectoryPath, IN PLDR_DATA_TABLE_ENTRY ScanDTE)
Definition: peloader.c:605
VOID PeLdrFreeDataTableEntry(_In_ PLDR_DATA_TABLE_ENTRY Entry)
Definition: peloader.c:798
BOOLEAN PeLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead, IN PCH DllName, OUT PLDR_DATA_TABLE_ENTRY *LoadedEntry)
Definition: peloader.c:561
PVOID PeLdrInitSecurityCookie(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
PELDR_IMPORTDLL_LOAD_CALLBACK PeLdrImportDllLoadCallback
Definition: peloader.c:28
VOID(NTAPI * PELDR_IMPORTDLL_LOAD_CALLBACK)(_In_ PCSTR FileName)
Definition: peloader.h:24
BOOLEAN PeLdrAllocateDataTableEntry(IN OUT PLIST_ENTRY ModuleListHead, IN PCCH BaseDllName, IN PCCH FullDllName, IN PVOID BasePA, OUT PLDR_DATA_TABLE_ENTRY *NewEntry)
Definition: peloader.c:681
BOOLEAN PeLdrLoadImage(_In_ PCSTR FilePath, _In_ TYPE_OF_MEMORY MemoryType, _Out_ PVOID *ImageBasePA)
Loads the specified image from the file.
Definition: peloader.c:823
enum _TYPE_OF_MEMORY TYPE_OF_MEMORY
base of all file and directory entries
Definition: entries.h:83
Definition: btrfs_drv.h:1876
Definition: typedefs.h:120
#define NTAPI
Definition: typedefs.h:36
const char * PCSTR
Definition: typedefs.h:52
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40