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(
|
2005-11-22 04:57:45 +00:00
|
|
|
IN PVOID BaseAddress,
|
|
|
|
IN PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry,
|
2005-06-18 23:33:40 +00:00
|
|
|
OUT PVOID *Resource OPTIONAL,
|
|
|
|
OUT PULONG Size OPTIONAL
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
LdrFindResource_U(
|
2005-11-22 04:57:45 +00:00
|
|
|
IN PVOID BaseAddress,
|
|
|
|
IN PLDR_RESOURCE_INFO ResourceInfo,
|
|
|
|
IN ULONG Level,
|
2005-06-18 23:33:40 +00:00
|
|
|
OUT PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry
|
|
|
|
);
|
2005-06-25 17:01:17 +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(
|
|
|
|
IN PVOID BaseAddress,
|
|
|
|
IN PLDR_RESOURCE_INFO ResourceInfo,
|
|
|
|
IN ULONG Level,
|
|
|
|
OUT PIMAGE_RESOURCE_DIRECTORY *ResourceDirectory
|
|
|
|
);
|
|
|
|
|
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(
|
|
|
|
IN PVOID BaseAddress
|
|
|
|
);
|
|
|
|
|
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(
|
|
|
|
IN PVOID BaseAddress,
|
|
|
|
IN PANSI_STRING Name,
|
|
|
|
IN ULONG Ordinal,
|
|
|
|
OUT PVOID *ProcedureAddress
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
LdrRelocateImage(
|
|
|
|
IN PVOID NewBase,
|
|
|
|
IN PUCHAR LoaderName,
|
|
|
|
IN ULONG Success,
|
|
|
|
IN ULONG Conflict,
|
|
|
|
IN ULONG Invalid
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
2008-09-12 15:09:17 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
LdrLockLoaderLock(
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PULONG Disposition OPTIONAL,
|
|
|
|
OUT PULONG Cookie OPTIONAL
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrUnlockLoaderLock(
|
|
|
|
IN ULONG Flags,
|
|
|
|
IN ULONG Cookie OPTIONAL
|
|
|
|
);
|
|
|
|
|
2006-10-08 02:10:34 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
LdrVerifyMappedImageMatchesChecksum(
|
|
|
|
IN PVOID BaseAddress,
|
|
|
|
IN ULONG NumberOfBytes,
|
|
|
|
IN ULONG FileLength
|
|
|
|
);
|
|
|
|
|
2005-06-18 23:33:40 +00:00
|
|
|
#endif
|