Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenldrtypes.h
Go to the documentation of this file.
00001 /*++ NDK Version: 0098 00002 00003 Copyright (c) Alex Ionescu. All rights reserved. 00004 00005 Header Name: 00006 00007 ldrtypes.h 00008 00009 Abstract: 00010 00011 Type definitions for the Loader. 00012 00013 Author: 00014 00015 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006 00016 00017 --*/ 00018 00019 #ifndef _LDRTYPES_H 00020 #define _LDRTYPES_H 00021 00022 // 00023 // Dependencies 00024 // 00025 #include <umtypes.h> 00026 00027 // 00028 // Resource Type Levels 00029 // 00030 #define RESOURCE_TYPE_LEVEL 0 00031 #define RESOURCE_NAME_LEVEL 1 00032 #define RESOURCE_LANGUAGE_LEVEL 2 00033 #define RESOURCE_DATA_LEVEL 3 00034 00035 // 00036 // Loader Data Table Entry Flags 00037 // 00038 #define LDRP_STATIC_LINK 0x00000002 00039 #define LDRP_IMAGE_DLL 0x00000004 00040 #define LDRP_LOAD_IN_PROGRESS 0x00001000 00041 #define LDRP_UNLOAD_IN_PROGRESS 0x00002000 00042 #define LDRP_ENTRY_PROCESSED 0x00004000 00043 #define LDRP_ENTRY_INSERTED 0x00008000 00044 #define LDRP_CURRENT_LOAD 0x00010000 00045 #define LDRP_FAILED_BUILTIN_LOAD 0x00020000 00046 #define LDRP_DONT_CALL_FOR_THREADS 0x00040000 00047 #define LDRP_PROCESS_ATTACH_CALLED 0x00080000 00048 #define LDRP_DEBUG_SYMBOLS_LOADED 0x00100000 00049 #define LDRP_IMAGE_NOT_AT_BASE 0x00200000 00050 #define LDRP_COR_IMAGE 0x00400000 00051 #define LDR_COR_OWNS_UNMAP 0x00800000 00052 #define LDRP_SYSTEM_MAPPED 0x01000000 00053 #define LDRP_IMAGE_VERIFYING 0x02000000 00054 #define LDRP_DRIVER_DEPENDENT_DLL 0x04000000 00055 #define LDRP_ENTRY_NATIVE 0x08000000 00056 #define LDRP_REDIRECTED 0x10000000 00057 #define LDRP_NON_PAGED_DEBUG_INFO 0x20000000 00058 #define LDRP_MM_LOADED 0x40000000 00059 #define LDRP_COMPAT_DATABASE_PROCESSED 0x80000000 00060 00061 // 00062 // Dll Characteristics for LdrLoadDll 00063 // 00064 #define LDR_IGNORE_CODE_AUTHZ_LEVEL 0x00001000 00065 00066 // 00067 // LdrAddRef Flags 00068 // 00069 #define LDR_ADDREF_DLL_PIN 0x00000001 00070 00071 // 00072 // LdrLockLoaderLock Flags 00073 // 00074 #define LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS 0x00000001 00075 #define LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY 0x00000002 00076 00077 // 00078 // LdrUnlockLoaderLock Flags 00079 // 00080 #define LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS 0x00000001 00081 00082 // 00083 // LdrGetDllHandleEx Flags 00084 // 00085 #define LDR_GET_DLL_HANDLE_EX_UNCHANGED_REFCOUNT 0x00000001 00086 #define LDR_GET_DLL_HANDLE_EX_PIN 0x00000002 00087 00088 00089 #define LDR_LOCK_LOADER_LOCK_DISPOSITION_INVALID 0 00090 #define LDR_LOCK_LOADER_LOCK_DISPOSITION_LOCK_ACQUIRED 1 00091 #define LDR_LOCK_LOADER_LOCK_DISPOSITION_LOCK_NOT_ACQUIRED 2 00092 00093 // 00094 // FIXME: THIS SHOULD *NOT* BE USED! 00095 // 00096 #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 00097 00098 // 00099 // Loader datafile/imagemapping macros 00100 // 00101 #define LDR_IS_DATAFILE(handle) (((ULONG_PTR)(handle)) & (ULONG_PTR)1) 00102 #define LDR_IS_IMAGEMAPPING(handle) (((ULONG_PTR)(handle)) & (ULONG_PTR)2) 00103 #define LDR_IS_RESOURCE(handle) (LDR_IS_IMAGEMAPPING(handle) || LDR_IS_DATAFILE(handle)) 00104 00105 // 00106 // Loader Data stored in the PEB 00107 // 00108 typedef struct _PEB_LDR_DATA 00109 { 00110 ULONG Length; 00111 BOOLEAN Initialized; 00112 PVOID SsHandle; 00113 LIST_ENTRY InLoadOrderModuleList; 00114 LIST_ENTRY InMemoryOrderModuleList; 00115 LIST_ENTRY InInitializationOrderModuleList; 00116 PVOID EntryInProgress; 00117 #if (NTDDI_VERSION >= NTDDI_WIN7) 00118 UCHAR ShutdownInProgress; 00119 PVOID ShutdownThreadId; 00120 #endif 00121 } PEB_LDR_DATA, *PPEB_LDR_DATA; 00122 00123 // 00124 // Loader Data Table Entry 00125 // 00126 typedef struct _LDR_DATA_TABLE_ENTRY 00127 { 00128 LIST_ENTRY InLoadOrderLinks; 00129 LIST_ENTRY InMemoryOrderModuleList; 00130 LIST_ENTRY InInitializationOrderModuleList; 00131 PVOID DllBase; 00132 PVOID EntryPoint; 00133 ULONG SizeOfImage; 00134 UNICODE_STRING FullDllName; 00135 UNICODE_STRING BaseDllName; 00136 ULONG Flags; 00137 USHORT LoadCount; 00138 USHORT TlsIndex; 00139 union 00140 { 00141 LIST_ENTRY HashLinks; 00142 struct 00143 { 00144 PVOID SectionPointer; 00145 ULONG CheckSum; 00146 }; 00147 }; 00148 union 00149 { 00150 ULONG TimeDateStamp; 00151 PVOID LoadedImports; 00152 }; 00153 PVOID EntryPointActivationContext; 00154 PVOID PatchInformation; 00155 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; 00156 00157 // 00158 // Loaded Imports Reference Counting in Kernel 00159 // 00160 typedef struct _LOAD_IMPORTS 00161 { 00162 SIZE_T Count; 00163 PLDR_DATA_TABLE_ENTRY Entry[1]; 00164 } LOAD_IMPORTS, *PLOAD_IMPORTS; 00165 00166 // 00167 // Loader Resource Information 00168 // 00169 typedef struct _LDR_RESOURCE_INFO 00170 { 00171 ULONG_PTR Type; 00172 ULONG_PTR Name; 00173 ULONG Language; 00174 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO; 00175 00176 // 00177 // DLL Notifications 00178 // 00179 typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA 00180 { 00181 ULONG Flags; 00182 PUNICODE_STRING FullDllName; 00183 PUNICODE_STRING BaseDllName; 00184 PVOID DllBase; 00185 ULONG SizeOfImage; 00186 } LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA; 00187 00188 typedef VOID 00189 (NTAPI *PLDR_DLL_LOADED_NOTIFICATION_CALLBACK)( 00190 IN BOOLEAN Type, 00191 IN struct _LDR_DLL_LOADED_NOTIFICATION_DATA *Data 00192 ); 00193 00194 typedef struct _LDR_DLL_LOADED_NOTIFICATION_ENTRY 00195 { 00196 LIST_ENTRY NotificationListEntry; 00197 PLDR_DLL_LOADED_NOTIFICATION_CALLBACK Callback; 00198 } LDR_DLL_LOADED_NOTIFICATION_ENTRY, *PLDR_DLL_LOADED_NOTIFICATION_ENTRY; 00199 00200 // 00201 // Alternate Resources Support 00202 // 00203 typedef struct _ALT_RESOURCE_MODULE 00204 { 00205 LANGID LangId; 00206 PVOID ModuleBase; 00207 #if (NTDDI_VERSION >= NTDDI_LONGHORN) 00208 PVOID ModuleManifest; 00209 #endif 00210 PVOID AlternateModule; 00211 #if (NTDDI_VERSION >= NTDDI_LONGHORN) 00212 HANDLE AlternateFileHandle; 00213 ULONG ModuleCheckSum; 00214 ULONG ErrorCode; 00215 #endif 00216 } ALT_RESOURCE_MODULE, *PALT_RESOURCE_MODULE; 00217 00218 // 00219 // Callback function for LdrEnumerateLoadedModules 00220 // 00221 typedef VOID (NTAPI LDR_ENUM_CALLBACK)(IN PLDR_DATA_TABLE_ENTRY ModuleInformation, IN PVOID Parameter, OUT BOOLEAN *Stop); 00222 typedef LDR_ENUM_CALLBACK *PLDR_ENUM_CALLBACK; 00223 00224 // 00225 // DLL Main Routine 00226 // 00227 typedef BOOLEAN 00228 (NTAPI *PDLL_INIT_ROUTINE)( 00229 IN PVOID DllHandle, 00230 IN ULONG Reason, 00231 IN PCONTEXT Context OPTIONAL 00232 ); 00233 00234 #endif Generated on Fri May 25 2012 04:29:31 for ReactOS by
1.7.6.1
|