ReactOS 0.4.15-dev-6675-gcbc63d8
ntdllp.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS System Libraries
4 * FILE: dll/ntdll/include/ntdllp.h
5 * PURPOSE: Native Library Internal Header
6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7 */
8
9#pragma once
10
11#define LDR_HASH_TABLE_ENTRIES 32
12#define LDR_GET_HASH_ENTRY(x) (RtlUpcaseUnicodeChar((x)) & (LDR_HASH_TABLE_ENTRIES - 1))
13
14/* LdrpUpdateLoadCount2 flags */
15#define LDRP_UPDATE_REFCOUNT 0x01
16#define LDRP_UPDATE_DEREFCOUNT 0x02
17#define LDRP_UPDATE_PIN 0x03
18
19/* Loader flags */
20#define IMAGE_LOADER_FLAGS_COMPLUS 0x00000001
21#define IMAGE_LOADER_FLAGS_SYSTEM_GLOBAL 0x01000000
22
23/* Page heap flags */
24#define DPH_FLAG_DLL_NOTIFY 0x40
25
26typedef struct _LDRP_TLS_DATA
27{
31
32typedef
36 _In_ PCWSTR DllName,
38 _Inout_opt_ PULONG DllCharacteristics,
40 _Outptr_ PWSTR* EffectiveDllPath);
41
42/* Global data */
45extern PVOID LdrpHeap;
47extern BOOLEAN ShowSnaps;
69
70/* ldrinit.c */
82
83/* ldrpe.c */
86LdrpSnapThunk(IN PVOID ExportBase,
87 IN PVOID ImportBase,
88 IN PIMAGE_THUNK_DATA OriginalThunk,
90 IN PIMAGE_EXPORT_DIRECTORY ExportEntry,
91 IN ULONG ExportSize,
93 IN LPSTR DllName);
94
97 IN PLDR_DATA_TABLE_ENTRY LdrEntry);
98
99
100/* ldrutils.c */
104 IN ULONG Ordinal,
105 OUT PVOID *ProcedureAddress,
106 IN BOOLEAN ExecuteInit);
107
110
113
115LdrpLoadDll(IN BOOLEAN Redirected,
117 IN PULONG DllCharacteristics OPTIONAL,
118 IN PUNICODE_STRING DllName,
120 IN BOOLEAN CallInit);
121
124 IN ULONG Flags);
125
128
130NTAPI
131LdrpSetProtection(PVOID ViewBase,
132 BOOLEAN Restore);
133
135NTAPI
137 OUT PLDR_DATA_TABLE_ENTRY *LdrEntry);
138
141 IN PUNICODE_STRING DllName,
143 IN BOOLEAN RedirectedDll,
144 OUT PLDR_DATA_TABLE_ENTRY *LdrEntry);
145
148 IN PWSTR DllPath2,
149 IN PWSTR DllName OPTIONAL,
150 IN PULONG DllCharacteristics,
152 IN BOOLEAN Redirect,
153 OUT PLDR_DATA_TABLE_ENTRY *DataTableEntry);
154
157
160
163
166
167VOID
168NTAPI
170 IN PUNICODE_STRING ProcessImage,
171 IN PVOID pShimData);
172
175
176/* verifier.c */
177
180 IN PPEB Peb,
181 IN BOOLEAN SystemWide,
182 IN BOOLEAN ReadAdvancedOptions);
183
186
189
192
195
196
197/* FIXME: Cleanup this mess */
200 PVOID ImageBase,
201 HANDLE SectionHandle,
202 PIMAGE_NT_HEADERS NTHeaders);
204 PHANDLE NTDllSectionHandle);
205ULONG
207
209NTAPI
211 IN LPSTR ImportName,
212 OUT PLDR_DATA_TABLE_ENTRY *DataTableEntry,
213 OUT PBOOLEAN Existing);
214
215VOID
216NTAPI
218
219
220/* path.c */
222NTAPI
225);
226
227/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
struct _PEB * PPEB
#define NTSTATUS
Definition: precomp.h:21
PPEB Peb
Definition: dllmain.c:27
struct tagCallbackData CallbackData
Definition: fltkernel.h:2090
Status
Definition: gdiplustypes.h:25
BOOLEAN(NTAPI * PDLL_INIT_ROUTINE)(_In_ PVOID DllHandle, _In_ ULONG Reason, _In_opt_ PCONTEXT Context)
Definition: ldrtypes.h:254
VOID NTAPI LdrpUnloadShimEngine()
Definition: ldrutils.c:2796
VOID NTAPI LdrpGetShimEngineInterface()
Definition: ldrutils.c:2711
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:47
static const char const char * DllPath
Definition: image.c:34
static const char * ImageName
Definition: image.c:34
#define _Outptr_
Definition: ms_sal.h:427
#define _Inout_opt_
Definition: ms_sal.h:379
#define _In_
Definition: ms_sal.h:308
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439
BOOLEAN LdrpInLdrInit
Definition: ldrinit.c:30
VOID NTAPI LdrpCallTlsInitializers(IN PLDR_DATA_TABLE_ENTRY LdrEntry, IN ULONG Reason)
Definition: ldrutils.c:473
NTSTATUS NTAPI LdrpInitializeApplicationVerifierPackage(IN HANDLE KeyHandle, IN PPEB Peb, IN BOOLEAN SystemWide, IN BOOLEAN ReadAdvancedOptions)
BOOLEAN NTAPI RtlDoesFileExists_UStr(IN PUNICODE_STRING FileName)
Definition: path.c:1503
ULONG LdrpGetResidentSize(PIMAGE_NT_HEADERS NTHeaders)
BOOLEAN LdrpShutdownInProgress
Definition: ldrinit.c:34
VOID NTAPI LdrpFreeUnicodeString(PUNICODE_STRING String)
PVOID g_pfnSE_InstallBeforeInit
Definition: ldrutils.c:25
NTSTATUS NTAPI LdrpMapDll(IN PWSTR SearchPath OPTIONAL, IN PWSTR DllPath2, IN PWSTR DllName OPTIONAL, IN PULONG DllCharacteristics, IN BOOLEAN Static, IN BOOLEAN Redirect, OUT PLDR_DATA_TABLE_ENTRY *DataTableEntry)
Definition: ldrutils.c:1023
PVOID g_pfnSE_InstallAfterInit
Definition: ldrutils.c:26
UNICODE_STRING LdrpDefaultPath
Definition: ldrinit.c:65
VOID NTAPI LdrpLoadShimEngine(IN PWSTR ImageName, IN PUNICODE_STRING ProcessImage, IN PVOID pShimData)
Definition: ldrutils.c:2771
BOOLEAN NTAPI LdrpCheckForLoadedDllHandle(IN PVOID Base, OUT PLDR_DATA_TABLE_ENTRY *LdrEntry)
Definition: ldrutils.c:1621
NTSTATUS NTAPI LdrpLoadDll(IN BOOLEAN Redirected, IN PWSTR DllPath OPTIONAL, IN PULONG DllCharacteristics OPTIONAL, IN PUNICODE_STRING DllName, OUT PVOID *BaseAddress, IN BOOLEAN CallInit)
Definition: ldrutils.c:2429
ULONG RtlpDphGlobalFlags
Definition: heappage.c:108
PVOID g_pShimEngineModule
Definition: ldrutils.c:22
VOID NTAPI LdrpFreeTls(VOID)
Definition: ldrinit.c:1380
NTSTATUS NTAPI LdrpWalkImportDescriptor(IN LPWSTR DllPath OPTIONAL, IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: ldrpe.c:670
PVOID g_pfnSE_ProcessDying
Definition: ldrutils.c:27
NTSTATUS NTAPI AVrfInitializeVerifier(VOID)
Definition: verifier.c:612
ULONG LdrpNumberOfProcessors
Definition: ldrinit.c:55
VOID NTAPI LdrpUpdateLoadCount2(IN PLDR_DATA_TABLE_ENTRY LdrEntry, IN ULONG Flags)
Definition: ldrutils.c:460
PVOID LdrpHeap
Definition: ldrinit.c:59
UNICODE_STRING LdrApiDefaultExtension
Definition: ldrapi.c:22
#define LDR_HASH_TABLE_ENTRIES
Definition: ntdllp.h:11
PLDR_DATA_TABLE_ENTRY LdrpCurrentDllInitializer
Definition: ldrinit.c:43
ULONG LdrpActiveUnloadCount
Definition: ldrinit.c:84
NTSTATUS(NTAPI * PEPFUNC)(PPEB)
Definition: ntdllp.h:198
NTSTATUS LdrMapNTDllForProcess(HANDLE ProcessHandle, PHANDLE NTDllSectionHandle)
VOID NTAPI LdrpFinalizeAndDeallocateDataTableEntry(IN PLDR_DATA_TABLE_ENTRY Entry)
Definition: ldrutils.c:1598
NTSTATUS(NTAPI * PLDR_APP_COMPAT_DLL_REDIRECTION_CALLBACK_FUNCTION)(_In_ ULONG Flags, _In_ PCWSTR DllName, _In_ PCWSTR DllPath OPTIONAL, _Inout_opt_ PULONG DllCharacteristics, _In_ PVOID CallbackData, _Outptr_ PWSTR *EffectiveDllPath)
Definition: ntdllp.h:34
PLDR_DATA_TABLE_ENTRY LdrpGetModuleHandleCache
Definition: ldrutils.c:19
NTSTATUS NTAPI LdrpLoadImportModule(IN PWSTR DllPath OPTIONAL, IN LPSTR ImportName, OUT PLDR_DATA_TABLE_ENTRY *DataTableEntry, OUT PBOOLEAN Existing)
Definition: ldrpe.c:808
VOID NTAPI LdrpInsertMemoryTableEntry(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: ldrutils.c:1582
ULONG LdrpFatalHardErrorCount
Definition: ldrinit.c:83
NTSTATUS LdrMapSections(HANDLE ProcessHandle, PVOID ImageBase, HANDLE SectionHandle, PIMAGE_NT_HEADERS NTHeaders)
NTSTATUS NTAPI LdrpSetProtection(PVOID ViewBase, BOOLEAN Restore)
Definition: ldrutils.c:947
struct _LDRP_TLS_DATA * PLDRP_TLS_DATA
VOID NTAPI LdrpValidateImageForMp(IN PLDR_DATA_TABLE_ENTRY LdrDataTableEntry)
Definition: ldrinit.c:1535
BOOLEAN NTAPI LdrpCheckForLoadedDll(IN PWSTR DllPath, IN PUNICODE_STRING DllName, IN BOOLEAN Flag, IN BOOLEAN RedirectedDll, OUT PLDR_DATA_TABLE_ENTRY *LdrEntry)
Definition: ldrutils.c:1979
NTSTATUS NTAPI LdrpGetProcedureAddress(IN PVOID BaseAddress, IN PANSI_STRING Name, IN ULONG Ordinal, OUT PVOID *ProcedureAddress, IN BOOLEAN ExecuteInit)
Definition: ldrutils.c:2252
BOOLEAN NTAPI LdrpCallInitRoutine(IN PDLL_INIT_ROUTINE EntryPoint, IN PVOID BaseAddress, IN ULONG Reason, IN PVOID Context)
Definition: ldrutils.c:100
LIST_ENTRY LdrpHashTable[LDR_HASH_TABLE_ENTRIES]
Definition: ldrinit.c:60
UNICODE_STRING LdrpKnownDllPath
Definition: ldrinit.c:63
PVOID NTAPI LdrpFetchAddressOfEntryPoint(PVOID ImageBase)
NTSTATUS NTAPI LdrpInitializeProcess(IN PCONTEXT Context, IN PVOID SystemArgument1)
Definition: ldrinit.c:1753
NTSTATUS NTAPI LdrpRunInitializeRoutines(IN PCONTEXT Context OPTIONAL)
Definition: ldrinit.c:637
BOOLEAN RtlpPageHeapEnabled
Definition: heappage.c:107
PLDR_DATA_TABLE_ENTRY NTAPI LdrpAllocateDataTableEntry(IN PVOID BaseAddress)
Definition: ldrutils.c:1549
BOOLEAN LdrpLdrDatabaseIsSetup
Definition: ldrinit.c:33
VOID NTAPI AVrfDllUnloadNotification(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:328
BOOLEAN ShowSnaps
Definition: ldrinit.c:81
HANDLE LdrpKnownDllObjectDirectory
Definition: ldrinit.c:62
VOID NTAPI LdrpRecordUnloadEvent(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: trace.c:28
BOOLEAN g_ShimsEnabled
Definition: ldrutils.c:21
RTL_CRITICAL_SECTION LdrpLoaderLock
Definition: ldrinit.c:70
VOID NTAPI LdrpInitFailure(NTSTATUS Status)
Definition: ldrinit.c:2535
PUNICODE_STRING LdrpTopLevelDllBeingLoaded
Definition: ldrinit.c:40
VOID NTAPI AVrfDllLoadNotification(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:294
NTSTATUS NTAPI LdrpInitializeTls(VOID)
Definition: ldrinit.c:1254
VOID NTAPI LdrpEnsureLoaderLockIsHeld(VOID)
Definition: ldrinit.c:405
NTSTATUS NTAPI LdrpSnapThunk(IN PVOID ExportBase, IN PVOID ImportBase, IN PIMAGE_THUNK_DATA OriginalThunk, IN OUT PIMAGE_THUNK_DATA Thunk, IN PIMAGE_EXPORT_DIRECTORY ExportEntry, IN ULONG ExportSize, IN BOOLEAN Static, IN LPSTR DllName)
Definition: ldrpe.c:950
ULONG NTAPI LdrpClearLoadInProgress(VOID)
Definition: ldrutils.c:2663
struct _LDRP_TLS_DATA LDRP_TLS_DATA
PVOID g_pfnSE_DllUnloaded
Definition: ldrutils.c:24
VOID NTAPI AVrfPageHeapDllNotification(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: verifier.c:361
VOID NTAPI LdrpInitializeThread(IN PCONTEXT Context)
Definition: ldrinit.c:502
PLDR_DATA_TABLE_ENTRY LdrpLoadedDllHandleCache
Definition: ntdllp.h:59
PVOID g_pfnSE_DllLoaded
Definition: ldrutils.c:23
NTSTATUS NTAPI LdrpAllocateTls(VOID)
Definition: ldrinit.c:1317
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
base of all file and directory entries
Definition: entries.h:83
Definition: xml2sdb.h:80
Definition: window.h:585
IMAGE_TLS_DIRECTORY TlsDirectory
Definition: ntdllp.h:29
LIST_ENTRY TlsLinks
Definition: ntdllp.h:28
Definition: btrfs_drv.h:1876
Definition: typedefs.h:120
uint16_t * PWSTR
Definition: typedefs.h:56
#define OPTIONAL
Definition: typedefs.h:41
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
#define SearchPath
Definition: winbase.h:3825
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:676
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184