ReactOS 0.4.16-dev-401-g45b008d
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
31
35 _In_ TYPE_OF_MEMORY MemoryType,
36 _Out_ PVOID* ImageBasePA);
37
41 _In_ TYPE_OF_MEMORY MemoryType,
42 _Out_ PVOID* ImageBasePA,
43 _In_ BOOLEAN KernelMapping);
44
48 IN PCCH BaseDllName,
50 IN PVOID BaseVA,
51 OUT PLDR_DATA_TABLE_ENTRY *NewEntry);
52
53VOID
55 // _In_ PLIST_ENTRY ModuleListHead,
57
61 IN PCCH DirectoryPath,
63
67 _In_ PCSTR DllName,
68 _Out_ PLDR_DATA_TABLE_ENTRY* LoadedEntry);
69
73
77 _In_ PCSTR BaseDllName,
78 _Out_ PVOID* ImageBase,
79 _Out_ PLDR_DATA_TABLE_ENTRY* DataTableEntry);
PCWSTR FilePath
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
struct _FileName FileName
Definition: fatprocs.h:897
LIST_ENTRY * ModuleListHead
Definition: kdpacket.c:23
_In_ PCWSTR FullDllName
Definition: ldrtypes.h:247
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
CONST CHAR * PCCH
Definition: ntbasedef.h:400
BOOLEAN PeLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead, IN PCCH DirectoryPath, IN PLDR_DATA_TABLE_ENTRY ScanDTE)
Definition: peloader.c:630
VOID PeLdrFreeDataTableEntry(_In_ PLDR_DATA_TABLE_ENTRY Entry)
Definition: peloader.c:827
PVOID PeLdrInitSecurityCookie(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
PELDR_IMPORTDLL_LOAD_CALLBACK PeLdrImportDllLoadCallback
Definition: peloader.c:30
BOOLEAN PeLdrAllocateDataTableEntry(IN OUT PLIST_ENTRY ModuleListHead, IN PCCH BaseDllName, IN PCCH FullDllName, IN PVOID BaseVA, OUT PLDR_DATA_TABLE_ENTRY *NewEntry)
Definition: peloader.c:710
VOID(NTAPI * PELDR_IMPORTDLL_LOAD_CALLBACK)(_In_ PCSTR FileName)
Definition: peloader.h:24
BOOLEAN PeLdrCheckForLoadedDll(_Inout_ PLIST_ENTRY ModuleListHead, _In_ PCSTR DllName, _Out_ PLDR_DATA_TABLE_ENTRY *LoadedEntry)
Definition: peloader.c:587
BOOLEAN PeLdrLoadBootImage(_In_ PCSTR FilePath, _In_ PCSTR BaseDllName, _Out_ PVOID *ImageBase, _Out_ PLDR_DATA_TABLE_ENTRY *DataTableEntry)
Definition: peloader.c:1053
BOOLEAN PeLdrInitializeModuleList(VOID)
Definition: peloader.c:525
BOOLEAN PeLdrLoadImageEx(_In_ PCSTR FilePath, _In_ TYPE_OF_MEMORY MemoryType, _Out_ PVOID *ImageBasePA, _In_ BOOLEAN KernelMapping)
Loads the specified image from the file.
Definition: peloader.c:852
BOOLEAN PeLdrLoadImage(_In_ PCSTR FilePath, _In_ TYPE_OF_MEMORY MemoryType, _Out_ PVOID *ImageBasePA)
Definition: peloader.c:1044
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