2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
|
|
|
|
|
|
|
Header Name:
|
|
|
|
|
|
|
|
ldrfuncs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Functions definitions for the Loader.
|
|
|
|
|
|
|
|
Author:
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
--*/
|
|
|
|
|
2005-06-18 23:33:40 +00:00
|
|
|
#ifndef _LDRFUNCS_H
|
|
|
|
#define _LDRFUNCS_H
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <umtypes.h>
|
|
|
|
#include <ldrtypes.h>
|
2005-09-27 04:53:33 +00:00
|
|
|
#if defined(_MSC_VER) && !defined(NTOS_MODE_USER)
|
2005-09-06 15:57:42 +00:00
|
|
|
#include <ntimage.h>
|
2005-09-06 06:19:30 +00:00
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Resource Functions
|
|
|
|
//
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
LdrAccessResource(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry,
|
|
|
|
_Out_opt_ PVOID *Resource,
|
|
|
|
_Out_opt_ PULONG Size
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
LdrFindResource_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PLDR_RESOURCE_INFO ResourceInfo,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-25 17:01:17 +00:00
|
|
|
|
2012-10-13 12:53:09 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrEnumResources(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PLDR_RESOURCE_INFO ResourceInfo,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_Inout_ ULONG *ResourceCount,
|
2013-01-22 22:51:51 +00:00
|
|
|
_Out_writes_to_(*ResourceCount,*ResourceCount) LDR_ENUM_RESOURCE_INFO *Resources
|
2012-10-13 12:53:09 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2005-06-26 19:29:12 +00:00
|
|
|
NTSTATUS
|
2007-10-19 23:21:45 +00:00
|
|
|
NTAPI
|
2005-06-26 19:29:12 +00:00
|
|
|
LdrFindResourceDirectory_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PLDR_RESOURCE_INFO ResourceInfo,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_Out_ PIMAGE_RESOURCE_DIRECTORY *ResourceDirectory
|
2005-06-26 19:29:12 +00:00
|
|
|
);
|
|
|
|
|
2011-11-06 01:34:06 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrLoadAlternateResourceModule(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Module,
|
|
|
|
_In_ PWSTR Buffer
|
2011-11-06 01:34:06 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
BOOLEAN
|
2008-09-12 15:09:17 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
LdrUnloadAlternateResourceModule(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Misc. Functions
|
|
|
|
//
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-25 17:01:17 +00:00
|
|
|
LdrGetProcedureAddress(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PANSI_STRING Name,
|
|
|
|
_In_ ULONG Ordinal,
|
|
|
|
_Out_ PVOID *ProcedureAddress
|
2005-06-25 17:01:17 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
LdrRelocateImage(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID NewBase,
|
2016-01-21 16:16:12 +00:00
|
|
|
_In_ PCCH LoaderName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Success,
|
|
|
|
_In_ ULONG Conflict,
|
|
|
|
_In_ ULONG Invalid
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
2008-09-12 15:09:17 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
LdrLockLoaderLock(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_Out_opt_ PULONG Disposition,
|
2017-11-13 14:06:29 +00:00
|
|
|
_Out_opt_ PULONG_PTR Cookie
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrUnlockLoaderLock(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ ULONG Cookie
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2006-10-08 02:10:34 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
LdrVerifyMappedImageMatchesChecksum(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ SIZE_T NumberOfBytes,
|
|
|
|
_In_ ULONG FileLength
|
2006-10-08 02:10:34 +00:00
|
|
|
);
|
|
|
|
|
2010-08-23 01:18:09 +00:00
|
|
|
PIMAGE_BASE_RELOCATION
|
|
|
|
NTAPI
|
|
|
|
LdrProcessRelocationBlockLongLong(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG_PTR Address,
|
|
|
|
_In_ ULONG Count,
|
|
|
|
_In_ PUSHORT TypeOffset,
|
|
|
|
_In_ LONGLONG Delta
|
2010-08-23 01:18:09 +00:00
|
|
|
);
|
|
|
|
|
2011-03-30 21:33:57 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrEnumerateLoadedModules(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ BOOLEAN ReservedFlag,
|
|
|
|
_In_ PLDR_ENUM_CALLBACK EnumProc,
|
|
|
|
_In_ PVOID Context
|
2011-03-30 21:33:57 +00:00
|
|
|
);
|
|
|
|
|
2005-06-18 23:33:40 +00:00
|
|
|
#endif
|