16#define MODULE_INVOLVED_IN_ARM3
41#define COOKIE_MAX 0x0000FFFFFFFFFFFFll
42#define DEFAULT_SECURITY_COOKIE 0x00002B992DDFA232ll
44#define DEFAULT_SECURITY_COOKIE 0xBB40E64E
73 return DebugDirectory;
93 PMMPTE PointerPte, LastPte;
149 DPRINT1(
"MmMapViewOfSection failed with status 0x%x\n",
Status);
159 DPRINT1(
"MiReserveSystemPtes failed\n");
165 LastPte = PointerPte + PteCount;
169 *ImageBase = DriverBase;
170 DPRINT1(
"Loading: %wZ at %p with %lx pages\n",
FileName, DriverBase, PteCount);
177 while (PointerPte < LastPte)
218#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
238 High = NumberOfNames - 1;
268 return OrdinalTable[Mid];
331 if (!ExportDirectory)
347 return NotFoundStatus;
351 return NotFoundStatus;
355 FunctionAddress = (
ULONG_PTR)
RVA(ImageBase, ExportTable[Ordinal]);
360 *IsForwarder =
FALSE;
361 if ((FunctionAddress > (
ULONG_PTR)ExportDirectory) &&
362 (FunctionAddress < (
ULONG_PTR)ExportDirectory + ExportSize))
423 DPRINT1(
"RtlFindExportedRoutineByName does not support forwarders!\n",
FALSE);
438 L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
453 ImportName.
Length = LdrEntry->BaseDllName.Length;
454 ImportName.
MaximumLength = LdrEntry->BaseDllName.MaximumLength;
455 ImportName.
Buffer = LdrEntry->BaseDllName.Buffer;
483 DPRINT(
"Calling DllInit(%wZ)\n", &RegPath);
484 Status = DllInit(&RegPath);
517 ASSERT(LdrEntry->LoadCount == 0);
518 LdrEntry->LoadCount = 1;
532 PVOID CurrentImports;
538 (ImportList->Count == 0))
548 SingleEntry.
Count = 1;
552 ImportList = &SingleEntry;
556 for (
i = 0; (
i < ImportList->Count) && (ImportList->Entry[
i]);
i++)
559 LdrEntry = ImportList->Entry[
i];
668#ifdef _WORKING_LINKER_
679 for (NextEntry = LoaderBlock->LoadOrderListHead.
Flink;
680 NextEntry != &LoaderBlock->LoadOrderListHead;
681 NextEntry = NextEntry->
Flink)
687#ifdef _WORKING_LINKER_
693 if (!ImageThunk)
continue;
697 for (
i = 0;
i < ImportSize;
i++, ImageThunk++)
700 if ((*ImageThunk >= (
ULONG_PTR)OldBase) && (*ImageThunk <= OldBaseTop))
703 DPRINT(
"[Mm0]: Updating IAT at: %p. Old Entry: %p. New Entry: %p.\n",
704 ImageThunk, *ImageThunk, *ImageThunk +
Delta);
705 *ImageThunk +=
Delta;
714 if (!ImportDescriptor)
continue;
718 while ((ImportDescriptor->
Name) &&
727 if ((*ImageThunk >= (
ULONG_PTR)OldBase) && (*ImageThunk <= OldBaseTop))
730 DPRINT(
"[Mm0]: Updating IAT at: %p. Old Entry: %p. New Entry: %p.\n",
731 ImageThunk, *ImageThunk, *ImageThunk +
Delta);
732 *ImageThunk +=
Delta;
764 PCHAR MissingForwarder;
771 ULONG ForwardExportSize;
781 if ((IsOrdinal) && !(SnapForwarder))
785 ExportDirectory->Base);
791 if (!SnapForwarder)
Name->u1.AddressOfData += (
ULONG_PTR)ImageBase;
800 DPRINT(
"Import name: %s\n", NameImport->
Name);
802 ExportDirectory->AddressOfNames);
804 ExportDirectory->AddressOfNameOrdinals);
807 Hint = NameImport->
Hint;
808 if ((Hint < ExportDirectory->NumberOfNames) &&
812 Ordinal = OrdinalTable[Hint];
819 ExportDirectory->NumberOfNames,
826 DPRINT1(
"Warning: Driver failed to load, %s not found\n", NameImport->
Name);
833 if (Ordinal >= ExportDirectory->NumberOfFunctions)
841 MissingForwarder = NameBuffer;
845 ExportDirectory->AddressOfFunctions);
889 ForwardExportDirectory =
894 if (!ForwardExportDirectory)
break;
900 sizeof(*ForwardName) +
903 if (!ForwardName)
break;
909 ForwardName->
Hint = 0;
919 ForwardExportDirectory,
931 NextEntry = NextEntry->
Flink;
1042 PCHAR MissingApiBuffer = *MissingApi, ImportName;
1044 ULONG ImportSize, ImportCount = 0, LoadedImportsSize, ExportSize;
1052 PVOID ImportBase, DllBase;
1060 DPRINT(
"%s - ImageBase: %p. ImageFileDirectory: %wZ\n",
1077 for (CurrentImport = ImportDescriptor;
1089 LoadedImportsSize = ImportCount *
sizeof(
PVOID) +
sizeof(
SIZE_T);
1097 LoadedImports->
Count = ImportCount;
1103 LoadedImports =
NULL;
1107 GdiLink = NormalLink =
FALSE;
1115 GdiLink = GdiLink ||
1116 !(
_strnicmp(ImportName,
"win32k",
sizeof(
"win32k") - 1));
1119 NormalLink = NormalLink ||
1120 ((
_strnicmp(ImportName,
"win32k",
sizeof(
"win32k") - 1)) &&
1121 (
_strnicmp(ImportName,
"dxapi",
sizeof(
"dxapi") - 1)) &&
1122 (
_strnicmp(ImportName,
"coverage",
sizeof(
"coverage") - 1)) &&
1123 (
_strnicmp(ImportName,
"irt",
sizeof(
"irt") - 1)));
1126 if (GdiLink && NormalLink)
1134 if (!(
_strnicmp(ImportName,
"ntdll",
sizeof(
"ntdll") - 1)) ||
1135 !(
_strnicmp(ImportName,
"winsrv",
sizeof(
"winsrv") - 1)) ||
1136 !(
_strnicmp(ImportName,
"advapi32",
sizeof(
"advapi32") - 1)) ||
1137 !(
_strnicmp(ImportName,
"kernel32",
sizeof(
"kernel32") - 1)) ||
1138 !(
_strnicmp(ImportName,
"user32",
sizeof(
"user32") - 1)) ||
1139 !(
_strnicmp(ImportName,
"gdi32",
sizeof(
"gdi32") - 1)))
1147 if (!(
_strnicmp(ImportName,
"ntoskrnl",
sizeof(
"ntoskrnl") - 1)) ||
1148 !(
_strnicmp(ImportName,
"win32k",
sizeof(
"win32k") - 1)) ||
1149 !(
_strnicmp(ImportName,
"hal",
sizeof(
"hal") - 1)))
1152 ReferenceNeeded =
FALSE;
1157 ReferenceNeeded =
TRUE;
1170 if (NamePrefix)
DPRINT1(
"Name Prefix not yet supported!\n");
1190 ImportBase = LdrEntry->
DllBase;
1193 if (!(
Loaded) && (ReferenceNeeded))
1208 NextEntry = NextEntry->
Flink;
1216 ImageFileDirectory->Length +
1281 *MissingDriver = DllName.
Buffer;
1282 *(
PULONG)MissingDriver |= 1;
1285 DPRINT1(
"Failed to load dependency: %wZ\n", &DllName);
1302 ASSERT(DllBase == DllEntry->DllBase);
1319 if ((ReferenceNeeded) && (LoadedImports))
1325 LoadedImports->
Entry[ImportCount] = LdrEntry;
1339 if (!ExportDirectory)
1342 DPRINT1(
"Warning: Driver failed to load, %S not found\n", *MissingDriver);
1375 *MissingApi = MissingApiBuffer;
1388 for (
i = 0;
i < LoadedImports->
Count;
i++)
1390 if (LoadedImports->
Entry[
i])
1406 else if (ImportCount == 1)
1412 else if (ImportCount != LoadedImports->
Count)
1415 LoadedImportsSize = ImportCount *
sizeof(
PVOID) +
sizeof(
SIZE_T);
1422 NewImports->
Count = 0;
1425 for (
i = 0;
i < LoadedImports->
Count;
i++)
1428 if (LoadedImports->
Entry[
i])
1432 NewImports->
Count++;
1438 LoadedImports = NewImports;
1443 *LoadImports = LoadedImports;
1493 ULONG_PTR DllBase, InitStart, InitEnd, ImageEnd, InitCode;
1528 NextEntry = NextEntry->
Flink;
1537 NextEntry = NextEntry->
Flink;
1545 while (SectionCount > 0)
1556 InitSection = Section;
1576 if (SectionCount == 1)
1579 LastSection = Section;
1593 LastSection = Section;
1601 while (SectionCount > 1);
1614 if (SectionCount != 1)
1627 if (InitStart < InitEnd)
1630 if ((InitCode >= InitStart) && (InitCode < InitEnd))
1634 *StartVa = (
PVOID)InitStart;
1635 *EndVa = (
PVOID)InitEnd;
1641 DPRINT(
"Freeing init code: %p-%p ('%wZ' @%p : '%s')\n",
1658 NextEntry = NextEntry->
Flink;
1683 DllBase = LdrEntry->DllBase;
1684 PageCount = LdrEntry->SizeOfImage >>
PAGE_SHIFT;
1691 if (!NtHeader)
return;
1695 DiscardSection =
NULL;
1703 DiscardSection = Section;
1713 if (!DiscardSection)
return;
1722 if (!PageCount)
return;
1740 PVOID DllBase, NewImageAddress;
1742 PMMPTE PointerPte, StartPte, LastPte;
1748 for (NextEntry = LoaderBlock->LoadOrderListHead.
Flink;
1749 NextEntry != &LoaderBlock->LoadOrderListHead;
1750 NextEntry = NextEntry->
Flink)
1759 DPRINT(
"[Mm0]: Driver at: %p ending at: %p for module: %wZ\n",
1767 LastPte = StartPte + PteCount;
1771 while (PointerPte < LastPte)
1784 if (
i <= 4)
continue;
1787 if (!NtHeader)
continue;
1801 ValidRelocs =
FALSE;
1821 PointerPte = StartPte;
1822 while (PointerPte < LastPte)
1839 ERROR_FATAL(
"[Mm0]: Couldn't allocate driver section!\n");
1844 LastPte = PointerPte + PteCount;
1848 DPRINT(
"[Mm0]: Copying from: %p to: %p\n", DllBase, NewImageAddress);
1853 while (PointerPte < LastPte)
1871 PointerPte -= PteCount;
1898 LdrEntry->
DllBase = NewImageAddress;
1928 ULONG LoadedImportsSize, ImportSize;
1935 KernelEntry = HalEntry = LastEntry =
NULL;
1950 KernelEntry = LdrEntry;
1955 HalEntry = LdrEntry;
1962 if ((LdrEntry == HalEntry) || (LdrEntry == KernelEntry))
1983 NextEntry = NextEntry->
Flink;
2002#ifdef _WORKING_LOADER_
2015 if (!ImportDescriptor)
2020 NextEntry = NextEntry->
Flink;
2026#ifdef _WORKING_LOADER_
2030 for (
i = 0, DllBase = 0, DllEnd = 0;
i < ImportSize;
i++, ImageThunk++)
2032 DllBase = DllEnd =
i = 0;
2033 while ((ImportDescriptor->
Name) &&
2046 if ((*ImageThunk >= DllBase) && (*ImageThunk < DllEnd))
2070 if ((*ImageThunk >= DllBase) && (*ImageThunk < DllEnd))
2074 EntryArray[
j] = LdrEntry2;
2079 NextEntry2 = NextEntry2->
Flink;
2084 if ((*ImageThunk < DllBase) || (*ImageThunk >= DllEnd))
2090 ERROR_FATAL(
"Broken IAT entry for %p at %p (%lx)\n",
2091 LdrEntry, ImageThunk, *ImageThunk);
2097#ifndef _WORKING_LOADER_
2107 for (
i = 0, ImportSize = 0;
i < Modules;
i++)
2110 if ((EntryArray[
i]) &&
2111 (EntryArray[
i] != HalEntry) &&
2112 (EntryArray[
i] != KernelEntry))
2115 LastEntry = EntryArray[
i];
2126 else if (ImportSize == 1)
2135 LoadedImportsSize = ImportSize *
sizeof(
PVOID) +
sizeof(
SIZE_T);
2142 LoadedImports->
Count = ImportSize;
2145 for (
i = 0,
j = 0;
i < Modules;
i++)
2148 if ((EntryArray[
i]) &&
2149 (EntryArray[
i] != HalEntry) &&
2150 (EntryArray[
i] != KernelEntry))
2154 LoadedImports->
Entry[
j] = EntryArray[
i];
2166 NextEntry = NextEntry->
Flink;
2199 Sections > 0; --Sections, ++SectionHeader)
2213 else if (*(
PULONG)SectionHeader->
Name ==
'LOOP')
2216 if (*(
PULONG)&SectionHeader->
Name[4] ==
'EDOC')
2222 else if (*(
PUSHORT)&SectionHeader->
Name[4] ==
'MI')
2229 else if ((*(
PULONG)SectionHeader->
Name ==
'YSIM') &&
2230 (*(
PULONG)&SectionHeader->
Name[4] ==
'ETPS'))
2254 ListHead = &LoaderBlock->LoadOrderListHead;
2255 NextEntry = ListHead->
Flink;
2265 while (NextEntry != ListHead)
2276 NextEntry = NextEntry->
Flink;
2285 if (!NewEntry)
return FALSE;
2288 *NewEntry = *LdrEntry;
2319 NextEntry = NextEntry->
Flink;
2428 NextEntry = NextEntry->
Flink;
2436 DPRINT1(
"Large pages not supported!\n");
2451 for (PointerPte = FirstPte; PointerPte <= LastPte; PointerPte++)
2459 DPRINT1(
"CORE-16449: FirstPte=%p, LastPte=%p, Protection=%lx\n", FirstPte, LastPte, Protection);
2460 DPRINT1(
"CORE-16449: PointerPte=%p, TempPte=%lx\n", PointerPte,
TempPte.u.Long);
2461 DPRINT1(
"CORE-16449: Please issue the 'mod' and 'bt' (KDBG) or 'lm' and 'kp' (WinDbg) commands. Then report this in Jira.\n");
2468#if _MI_HAS_NO_EXECUTE
2487 PVOID SectionBase, SectionEnd;
2490 PMMPTE FirstPte, LastPte;
2507 if (NtHeaders ==
NULL)
2509 DPRINT1(
"Failed to get NT headers for image @ %p\n", ImageBase);
2517 DPRINT1(
"Skipping NT 4 driver @ %p\n", ImageBase);
2531 if (LastPte >= FirstPte)
2540 Section = &SectionHeaders[
i];
2548 if (FirstPte == LastPte)
2564 SectionEnd =
Add2Ptr(SectionBase, SectionSize - 1);
2569 if (LastPte < FirstPte)
2586 DPRINT1(
"ImageBase 0x%p ImageSize 0x%lx Section %u VA 0x%lx Raw 0x%lx virt 0x%lx\n",
2601#ifdef ENABLE_MISETPAGINGOFDRIVER
2611#ifndef ENABLE_MISETPAGINGOFDRIVER
2613 DPRINT1(
"WARNING: MiSetPagingOfDriver() called, but paging is broken! ignoring!\n");
2626 while (PointerPte <= LastPte)
2629 if (PointerPte->u.Hard.Valid == 1)
2667 ImageBase = (
ULONG_PTR)LdrEntry->DllBase;
2669 if (!NtHeaders)
return;
2767 Status = ZwCreateSection(&SectionHandle,
2776 DPRINT1(
"ZwCreateSection failed with status 0x%x\n",
Status);
2784 Status = ZwMapViewOfSection(SectionHandle,
2797 DPRINT1(
"ZwMapViewOfSection failed with status 0x%x\n",
Status);
2804 Status = ZwQueryInformationFile(ImageHandle,
2807 sizeof(FileStandardInfo),
2918 if (NewCookie > COOKIE_MAX)
2924 if ((NewCookie == 0) || (NewCookie == *
Cookie))
2956 PWCHAR MissingDriverName, PrefixedBuffer =
NULL;
2995 BaseLength *=
sizeof(
WCHAR);
3046 if (!PrefixedBuffer)
3053 PrefixName.
Buffer = PrefixedBuffer;
3063 BaseName.
Length += NamePrefix->Length;
3068 if (LoadedName) BaseName = *LoadedName;
3074 DPRINT1(
"MM:SYSLDR Loading %wZ (%wZ) %s\n",
3075 &PrefixName, &BaseName,
Flags ?
"in session space" :
"");
3104 NextEntry = NextEntry->
Flink;
3122 *ModuleObject = LdrEntry;
3123 *ImageBaseAddress = LdrEntry->
DllBase;
3168 DPRINT1(
"ZwOpenFile failed for '%wZ' with status 0x%x\n",
3203 Status = ZwCreateSection(&SectionHandle,
3212 DPRINT1(
"ZwCreateSection failed with status 0x%x\n",
Status);
3275 DPRINT1(
"MiLoadImageSection failed with status 0x%x\n",
Status);
3288 DPRINT1(
"LdrRelocateImageWithBias failed with status 0x%x\n",
Status);
3324 LdrEntry->
DllBase = ModuleLoadBase;
3371 MissingDriverName =
NULL;
3383 if (*(
ULONG_PTR*)&MissingDriverName & 1)
3385 NeedToFreeString =
TRUE;
3389 DPRINT1(
"MiResolveImageReferences failed with status 0x%x\n",
Status);
3390 DPRINT1(
" Missing driver '%ls', missing API '%s'\n",
3391 MissingDriverName, MissingApiName);
3393 if (NeedToFreeString)
3418 LdrEntry->
Flags &= ~LDRP_LOAD_IN_PROGRESS;
3444#ifdef __ROS_ROSSYM__
3460 UnicodeTemp = PrefixName;
3461 UnicodeTemp.
Buffer += 11;
3491 *ModuleObject = LdrEntry;
3492 *ImageBaseAddress = LdrEntry->
DllBase;
3538 FoundEntry = LdrEntry;
3543 NextEntry = NextEntry->
Flink;
3565 if (!LdrEntry)
return NULL;
3575 KeFlushQueuedDpcs();
3657 if (ProcAddress)
break;
3658 if (Modules == 2)
break;
3662 NextEntry = NextEntry->
Flink;
NTSTATUS NTAPI MmUnmapViewOfSection(IN PEPROCESS Process, IN PVOID BaseAddress)
#define ALIGN_DOWN_BY(size, align)
#define ALIGN_UP_BY(size, align)
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
HARDWARE_PTE_ARMV6 TempPte
#define OBJ_NAME_PATH_SEPARATOR
struct _LDR_DATA_TABLE_ENTRY LDR_DATA_TABLE_ENTRY
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
#define IMAGE_DIRECTORY_ENTRY_EXPORT
#define IMAGE_DIRECTORY_ENTRY_DEBUG
#define RtlImageDirectoryEntryToData
#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG
#define _strnicmp(_String1, _String2, _MaxCount)
#define UNIMPLEMENTED_DBGBREAK(...)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define PsGetCurrentThread()
#define MAXIMUM_FILENAME_LENGTH
NTSTATUS ExInitializeResourceLite(PULONG res)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeReleaseSpinLock(sl, irql)
#define KeGetCurrentIrql()
#define ExAcquireResourceExclusiveLite(res, wait)
#define InitializeListHead(ListHead)
#define ExAcquireResourceSharedLite(res, wait)
#define KeInitializeSpinLock(sl)
#define BooleanFlagOn(F, SF)
struct _FileName FileName
_Inout_opt_ PUNICODE_STRING Extension
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
union Alignment_ Alignment
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
KIRQL FASTCALL KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock)
LARGE_INTEGER NTAPI KeQueryPerformanceCounter(IN PLARGE_INTEGER PerformanceFreq)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define FLG_SHOW_LDR_SNAPS
#define FLG_ENABLE_KDEBUG_SYMBOL_LOAD
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define EXCEPTION_EXECUTE_HANDLER
#define IMAGE_ADDRESSING_MODE_32BIT
#define InterlockedExchangeAdd
__INTRIN_INLINE unsigned long __readcr4(void)
#define Add2Ptr(PTR, INC)
static BOOLEAN LoadSymbols
BOOLEAN KdDebuggerNotPresent
BOOLEAN KdDebuggerEnabled
LIST_ENTRY * ModuleListHead
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
BOOLEAN MiLargePageAllDrivers
LIST_ENTRY MiLargePageDriverList
BOOLEAN NTAPI LdrVerifyMappedImageMatchesChecksum(_In_ PVOID BaseAddress, _In_ SIZE_T NumberOfBytes, _In_ ULONG FileLength)
#define LDRP_DRIVER_DEPENDENT_DLL
#define LDRP_DEBUG_SYMBOLS_LOADED
#define LDRP_ENTRY_PROCESSED
#define LDRP_ENTRY_NATIVE
#define LDRP_SYSTEM_MAPPED
#define LDRP_LOAD_IN_PROGRESS
struct _LOAD_IMPORTS * PLOAD_IMPORTS
FORCEINLINE BOOLEAN MI_IS_PHYSICAL_ADDRESS(IN PVOID Address)
#define IMAGE_SCN_PROTECTION_MASK
FORCEINLINE VOID MiLockWorkingSet(IN PETHREAD Thread, IN PMMSUPPORT WorkingSet)
#define MI_IS_SESSION_IMAGE_ADDRESS(Address)
#define MI_IS_SESSION_ADDRESS(Address)
#define MI_GET_NEXT_COLOR()
PFN_NUMBER NTAPI MiRemoveAnyPage(IN ULONG Color)
FORCEINLINE VOID MI_MAKE_HARDWARE_PTE_KERNEL(IN PMMPTE NewPte, IN PMMPTE MappingPte, IN ULONG_PTR ProtectionMask, IN PFN_NUMBER PageFrameNumber)
ULONG MmTotalFreeSystemPtes[MaximumPtePoolTypes]
#define MM_SYSLDR_NO_IMPORTS
FORCEINLINE VOID MiUnlockWorkingSet(IN PETHREAD Thread, IN PMMSUPPORT WorkingSet)
PMMPTE NTAPI MiReserveSystemPtes(IN ULONG NumberOfPtes, IN MMSYSTEM_PTE_POOL_TYPE SystemPtePoolType)
FORCEINLINE VOID MI_UPDATE_VALID_PTE(IN PMMPTE PointerPte, IN MMPTE TempPte)
FORCEINLINE VOID MI_WRITE_VALID_PTE(IN PMMPTE PointerPte, IN MMPTE TempPte)
VOID NTAPI MiInitializePfn(IN PFN_NUMBER PageFrameIndex, IN PMMPTE PointerPte, IN BOOLEAN Modified)
PFN_COUNT NTAPI MiDeleteSystemPageableVm(IN PMMPTE PointerPte, IN PFN_NUMBER PageCount, IN ULONG Flags, OUT PPFN_NUMBER ValidPages)
#define MM_SYSLDR_BOOT_LOADED
#define MM_SYSLDR_SINGLE_ENTRY
#define MiAddressToPte(x)
#define ExFreePoolWithTag(_P, _T)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
ULONG NTAPI LdrRelocateImageWithBias(_In_ PVOID BaseAddress, _In_ LONGLONG AdditionalBias, _In_opt_ PCSTR LoaderName, _In_ ULONG Success, _In_ ULONG Conflict, _In_ ULONG Invalid)
VOID NTAPI DbgUnLoadImageSymbols(_In_ PSTRING Name, _In_ PVOID Base, _In_ ULONG_PTR ProcessId)
VOID NTAPI DbgLoadImageSymbols(_In_ PSTRING Name, _In_ PVOID Base, _In_ ULONG_PTR ProcessId)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define SECTION_MAP_EXECUTE
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
#define SECTION_ALL_ACCESS
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define NtCurrentProcess()
#define FILE_SHARE_DELETE
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
#define UNREFERENCED_PARAMETER(P)
#define IMAGE_SCN_MEM_WRITE
#define IMAGE_SNAP_BY_ORDINAL(Ordinal)
#define IMAGE_SCN_MEM_EXECUTE
#define IMAGE_FIRST_SECTION(NtHeader)
#define IMAGE_SCN_MEM_DISCARDABLE
#define IMAGE_SCN_MEM_READ
#define IMAGE_NT_OPTIONAL_HDR_MAGIC
ULONG ExpInitializationPhase
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
#define MmSystemRangeStart
#define MiPteToAddress(_Pte)
VOID NTAPI KeFlushCurrentTb(VOID)
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
struct _MM_IMAGE_SECTION_OBJECT * PMM_IMAGE_SECTION_OBJECT
UCHAR MmDisablePagingExecutive
_Out_ PKAPC_STATE ApcState
static const WCHAR ServicesKeyName[]
VOID NTAPI KeFlushEntireTb(IN BOOLEAN Invalid, IN BOOLEAN AllProcessors)
LONG NTAPI KeReleaseMutant(IN PKMUTANT Mutant, IN KPRIORITY Increment, IN BOOLEAN Abandon, IN BOOLEAN Wait)
MMSUPPORT MmSystemCacheWs
HANDLE NTAPI PsGetCurrentProcessId(VOID)
#define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND
#define STATUS_IMAGE_CHECKSUM_MISMATCH
#define STATUS_IMAGE_MP_UP_MISMATCH
#define STATUS_INVALID_IMAGE_FORMAT
#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH
#define STATUS_IMAGE_ALREADY_LOADED
#define STATUS_ALREADY_COMMITTED
#define STATUS_INVALID_IMAGE_PROTECT
#define STATUS_ENTRYPOINT_NOT_FOUND
#define STATUS_PROCEDURE_NOT_FOUND
#define STATUS_DRIVER_ORDINAL_NOT_FOUND
#define STATUS_CONFLICTING_ADDRESSES
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
#define IMAGE_DIRECTORY_ENTRY_IMPORT
#define IMAGE_DIRECTORY_ENTRY_IAT
#define IMAGE_DIRECTORY_ENTRY_BASERELOC
struct _IMAGE_IMPORT_BY_NAME * PIMAGE_IMPORT_BY_NAME
#define IMAGE_FILE_RELOCS_STRIPPED
#define IMAGE_FILE_UP_SYSTEM_ONLY
#define IMAGE_ORDINAL(Ordinal)
VOID NTAPI KeStackAttachProcess(IN PKPROCESS Process, OUT PRKAPC_STATE ApcState)
VOID NTAPI KeUnstackDetachProcess(IN PRKAPC_STATE ApcState)
#define FileStandardInformation
BOOLEAN PsImageNotifyEnabled
FORCEINLINE VOID PspRunLoadImageNotifyRoutines(PUNICODE_STRING FullImageName, HANDLE ProcessId, PIMAGE_INFO ImageInfo)
#define _SEH2_EXCEPT(...)
PEPROCESS PsInitialSystemProcess
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define ERROR_DBGBREAK(...)
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
POBJECT_TYPE MmSectionObjectType
PULONG MinorVersion OPTIONAL
DWORD AddressOfNameOrdinals
ULONG ImageAddressingMode
union _IMAGE_THUNK_DATA32::@2141 u1
UNICODE_STRING FullDllName
LIST_ENTRY InLoadOrderLinks
UNICODE_STRING BaseDllName
struct _LIST_ENTRY * Flink
PLDR_DATA_TABLE_ENTRY Entry[1]
static LARGE_INTEGER Counter
ULONG_PTR ExPoolCodeStart
NTSTATUS NTAPI MiBuildImportsForBootDrivers(VOID)
NTSTATUS NTAPI MiSnapThunk(IN PVOID DllBase, IN PVOID ImageBase, IN PIMAGE_THUNK_DATA Name, IN PIMAGE_THUNK_DATA Address, IN PIMAGE_EXPORT_DIRECTORY ExportDirectory, IN ULONG ExportSize, IN BOOLEAN SnapForwarder, OUT PCHAR *MissingApi)
VOID NTAPI MiLocateKernelSections(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
NTSTATUS NTAPI MiDereferenceImports(IN PLOAD_IMPORTS ImportList)
BOOLEAN NTAPI MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
VOID NTAPI MmMakeKernelResourceSectionWritable(VOID)
NTSTATUS NTAPI MmLoadSystemImage(IN PUNICODE_STRING FileName, IN PUNICODE_STRING NamePrefix OPTIONAL, IN PUNICODE_STRING LoadedName OPTIONAL, IN ULONG Flags, OUT PVOID *ModuleObject, OUT PVOID *ImageBaseAddress)
KSPIN_LOCK PsLoadedModuleSpinLock
LIST_ENTRY PsLoadedModuleList
BOOLEAN NTAPI MmVerifyImageIsOkForMpUse(IN PVOID BaseAddress)
VOID NTAPI MiSetPagingOfDriver(IN PMMPTE PointerPte, IN PMMPTE LastPte)
LIST_ENTRY MmLoadedUserImageList
USHORT NTAPI NameToOrdinal(_In_ PCSTR ExportName, _In_ PVOID ImageBase, _In_ ULONG NumberOfNames, _In_ PULONG NameTable, _In_ PUSHORT OrdinalTable)
NTSTATUS NTAPI MiResolveImageReferences(IN PVOID ImageBase, IN PUNICODE_STRING ImageFileDirectory, IN PUNICODE_STRING NamePrefix OPTIONAL, OUT PCHAR *MissingApi, OUT PWCHAR *MissingDriver, OUT PLOAD_IMPORTS *LoadImports)
BOOLEAN MmEnforceWriteProtection
ERESOURCE PsLoadedModuleResource
VOID NTAPI MmFreeDriverInitialization(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
PVOID NTAPI LdrpInitSecurityCookie(PLDR_DATA_TABLE_ENTRY LdrEntry)
VOID NTAPI MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
VOID NTAPI MiWriteProtectSystemImage(_In_ PVOID ImageBase)
VOID NTAPI MiEnablePagingOfDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
#define DEFAULT_SECURITY_COOKIE
ULONG_PTR MmPoolCodeStart
NTSTATUS NTAPI RtlpFindExportedRoutineByName(_In_ PVOID ImageBase, _In_ PCSTR ExportName, _Out_ PVOID *Function, _Out_opt_ PBOOLEAN IsForwarder, _In_ NTSTATUS NotFoundStatus)
ReactOS-only helper routine for RtlFindExportedRoutineByName(), that provides a finer granularity reg...
VOID NTAPI MiFindInitializationCode(OUT PVOID *StartVa, OUT PVOID *EndVa)
PVOID MmLastUnloadedDrivers
NTSTATUS NTAPI MmCallDllInitialize(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry, _In_ PLIST_ENTRY ModuleListHead)
PVOID NTAPI LdrpFetchAddressOfSecurityCookie(PVOID BaseAddress, ULONG SizeOfImage)
NTSTATUS NTAPI MmUnloadSystemImage(IN PVOID ImageHandle)
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
VOID NTAPI MiFreeInitializationCode(IN PVOID InitStart, IN PVOID InitEnd)
BOOLEAN MiCallDllUnloadAndUnloadDll(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
VOID NTAPI MiProcessLoaderEntry(IN PLDR_DATA_TABLE_ENTRY LdrEntry, IN BOOLEAN Insert)
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
PFN_NUMBER MmTotalSystemDriverPages
PMMPTE MiKernelResourceEndPte
PVOID NTAPI MiCacheImageSymbols(IN PVOID BaseAddress)
PVOID NTAPI MmPageEntireDriver(IN PVOID AddressWithinSection)
NTSTATUS NTAPI MiLoadImageSection(_Inout_ PSECTION *SectionPtr, _Out_ PVOID *ImageBase, _In_ PUNICODE_STRING FileName, _In_ BOOLEAN SessionLoad, _In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
VOID NTAPI MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PVOID OldBase, IN PVOID NewBase, IN ULONG Size)
VOID NTAPI MiSetSystemCodeProtection(_In_ PMMPTE FirstPte, _In_ PMMPTE LastPte, _In_ ULONG Protection)
PVOID NTAPI RtlFindExportedRoutineByName(_In_ PVOID ImageBase, _In_ PCSTR ExportName)
Finds the address of a given named exported routine in a loaded image. Note that this function does n...
NTSTATUS NTAPI MmCheckSystemImage(IN HANDLE ImageHandle, IN BOOLEAN PurgeSection)
VOID NTAPI MmResetDriverPaging(IN PVOID AddressWithinSection)
PMMPTE MiKernelResourceStartPte
PLDR_DATA_TABLE_ENTRY NTAPI MiLookupDataTableEntry(IN PVOID Address)
VOID NTAPI MiClearImports(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
LOGICAL NTAPI MiUseLargeDriverPage(IN ULONG NumberOfPtes, IN OUT PVOID *ImageBaseAddress, IN PUNICODE_STRING BaseImageName, IN BOOLEAN BootDriver)
ULONG_PTR PsNtosImageBase
#define TAG_MODULE_OBJECT
#define RTL_CONSTANT_STRING(s)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
#define ALIGN_UP_POINTER_BY(ptr, align)
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_Must_inspect_result_ _In_ ULONG Flags
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie
NTSTATUS(NTAPI * PMM_DLL_UNLOAD)(VOID)
NTSTATUS(NTAPI * PMM_DLL_INITIALIZE)(_In_ PUNICODE_STRING RegistryPath)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define ROUND_TO_PAGES(Size)
#define ObDereferenceObject
#define PsGetCurrentProcess