3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: main.c,v 1.142 2002/11/14 18:21:07 chorns Exp $
21 * PROJECT: ReactOS kernel
22 * FILE: ntoskrnl/ke/main.c
23 * PURPOSE: Initalizes the kernel
24 * PROGRAMMER: David Welch (welch@cwcom.net)
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
32 #include <internal/ntoskrnl.h>
33 #include <reactos/resource.h>
34 #include <internal/mm.h>
35 #include <internal/ifs.h>
36 #include <internal/module.h>
37 #include <internal/ldr.h>
38 #include <internal/ex.h>
39 #include <internal/ps.h>
40 #include <internal/ke.h>
41 #include <internal/io.h>
42 #include <internal/po.h>
43 #include <internal/cc.h>
44 #include <internal/se.h>
45 #include <internal/v86m.h>
46 #include <internal/kd.h>
47 #include <internal/trap.h>
48 #include "../dbg/kdb.h"
49 #include <internal/registry.h>
50 #include <reactos/bugcodes.h>
53 #include <internal/ntosdbg.h>
59 #include <internal/debug.h>
61 /* GLOBALS *******************************************************************/
63 ULONG EXPORTED NtBuildNumber
= KERNEL_VERSION_BUILD
;
64 ULONG EXPORTED NtGlobalFlag
= 0;
65 CHAR EXPORTED KeNumberProcessors
;
66 LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock
;
67 ULONG EXPORTED KeDcacheFlushCount
= 0;
68 ULONG EXPORTED KeIcacheFlushCount
= 0;
69 static LOADER_MODULE KeLoaderModules
[64];
70 static UCHAR KeLoaderModuleStrings
[64][256];
71 static UCHAR KeLoaderCommandLine
[256];
72 static ADDRESS_RANGE KeMemoryMap
[64];
73 static ULONG KeMemoryMapRangeCount
;
74 static ULONG FirstKrnlPhysAddr
;
75 static ULONG LastKrnlPhysAddr
;
76 static ULONG LastKernelAddress
;
77 volatile BOOLEAN Initialized
= FALSE
;
79 extern PVOID Ki386InitialStackArray
[MAXIMUM_PROCESSORS
];
82 /* FUNCTIONS ****************************************************************/
85 RtlpCheckFileNameExtension(PCHAR FileName
,
90 Ext
= strrchr(FileName
, '.');
91 if ((Extension
== NULL
) || (*Extension
== 0))
98 if (*Extension
!= '.')
101 if (_stricmp(Ext
, Extension
) == 0)
109 InitSystemSharedUserPage (PCSZ ParameterLine
)
111 UNICODE_STRING ArcDeviceName
;
112 UNICODE_STRING ArcName
;
113 UNICODE_STRING BootPath
;
114 UNICODE_STRING DriveDeviceName
;
115 UNICODE_STRING DriveName
;
116 WCHAR DriveNameBuffer
[20];
118 PWCHAR ArcNameBuffer
;
122 OBJECT_ATTRIBUTES ObjectAttributes
;
125 BOOLEAN BootDriveFound
;
129 * The shared user page has been zeroed-out right after creation.
130 * There is NO need to do this again.
133 SharedUserData
->NtProductType
= NtProductWinNt
;
135 BootDriveFound
= FALSE
;
138 * Retrieve the current dos system path
139 * (e.g.: C:\reactos) from the given arc path
140 * (e.g.: multi(0)disk(0)rdisk(0)partititon(1)\reactos)
141 * Format: "<arc_name>\<path> [options...]"
144 /* create local parameter line copy */
145 ParamBuffer
= ExAllocatePool (PagedPool
, 256);
146 strcpy (ParamBuffer
, (char *)ParameterLine
);
147 DPRINT("%s\n", ParamBuffer
);
149 /* cut options off */
150 p
= strchr (ParamBuffer
, ' ');
155 DPRINT("%s\n", ParamBuffer
);
158 p
= strchr (ParamBuffer
, '\\');
161 DPRINT("Boot path: %s\n", p
);
162 RtlCreateUnicodeStringFromAsciiz (&BootPath
, p
);
167 DPRINT("Boot path: %s\n", "\\");
168 RtlCreateUnicodeStringFromAsciiz (&BootPath
, "\\");
170 DPRINT("Arc name: %s\n", ParamBuffer
);
172 /* Only arc name left - build full arc name */
173 ArcNameBuffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
174 swprintf (ArcNameBuffer
, L
"\\ArcName\\%S", ParamBuffer
);
175 RtlInitUnicodeString (&ArcName
, ArcNameBuffer
);
176 DPRINT("Arc name: %wZ\n", &ArcName
);
178 /* free ParamBuffer */
179 ExFreePool (ParamBuffer
);
181 /* allocate arc device name string */
182 ArcDeviceName
.Length
= 0;
183 ArcDeviceName
.MaximumLength
= 256 * sizeof(WCHAR
);
184 ArcDeviceName
.Buffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
186 InitializeObjectAttributes (&ObjectAttributes
,
192 Status
= NtOpenSymbolicLinkObject (&Handle
,
193 SYMBOLIC_LINK_ALL_ACCESS
,
195 RtlFreeUnicodeString (&ArcName
);
196 if (!NT_SUCCESS(Status
))
198 RtlFreeUnicodeString (&BootPath
);
199 RtlFreeUnicodeString (&ArcDeviceName
);
200 CPRINT("NtOpenSymbolicLinkObject() failed (Status %x)\n",
206 Status
= NtQuerySymbolicLinkObject (Handle
,
210 if (!NT_SUCCESS(Status
))
212 RtlFreeUnicodeString (&BootPath
);
213 RtlFreeUnicodeString (&ArcDeviceName
);
214 CPRINT("NtQuerySymbolicObject() failed (Status %x)\n",
219 DPRINT("Length: %lu ArcDeviceName: %wZ\n", Length
, &ArcDeviceName
);
222 /* allocate device name string */
223 DriveDeviceName
.Length
= 0;
224 DriveDeviceName
.MaximumLength
= 256 * sizeof(WCHAR
);
225 DriveDeviceName
.Buffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
227 for (i
= 0; i
< 26; i
++)
229 swprintf (DriveNameBuffer
, L
"\\??\\%C:", 'A' + i
);
230 RtlInitUnicodeString (&DriveName
,
233 InitializeObjectAttributes (&ObjectAttributes
,
239 Status
= NtOpenSymbolicLinkObject (&Handle
,
240 SYMBOLIC_LINK_ALL_ACCESS
,
242 if (!NT_SUCCESS(Status
))
244 DPRINT("Failed to open link %wZ\n",
249 Status
= NtQuerySymbolicLinkObject (Handle
,
252 if (!NT_SUCCESS(Status
))
254 DPRINT("Failed query open link %wZ\n",
258 DPRINT("Opened link: %wZ ==> %wZ\n",
259 &DriveName
, &DriveDeviceName
);
261 if (!RtlCompareUnicodeString (&ArcDeviceName
, &DriveDeviceName
, FALSE
))
263 DPRINT("DOS Boot path: %c:%wZ\n", 'A' + i
, &BootPath
);
264 swprintf(SharedUserData
->NtSystemRoot
,
265 L
"%C:%wZ", 'A' + i
, &BootPath
);
267 BootDriveFound
= TRUE
;
273 RtlFreeUnicodeString (&BootPath
);
274 RtlFreeUnicodeString (&DriveDeviceName
);
275 RtlFreeUnicodeString (&ArcDeviceName
);
277 DPRINT("DosDeviceMap: 0x%x\n", SharedUserData
->DosDeviceMap
);
279 if (BootDriveFound
== FALSE
)
281 DbgPrint("No system drive found!\n");
288 ExpInitializeExecutive(VOID
)
290 LARGE_INTEGER Timeout
;
291 HANDLE ProcessHandle
;
293 ULONG BootDriverCount
;
302 * Fail at runtime if someone has changed various structures without
303 * updating the offsets used for the assembler code.
305 assert(FIELD_OFFSET(KTHREAD
, InitialStack
) == KTHREAD_INITIAL_STACK
);
306 assert(FIELD_OFFSET(KTHREAD
, Teb
) == KTHREAD_TEB
);
307 assert(FIELD_OFFSET(KTHREAD
, KernelStack
) == KTHREAD_KERNEL_STACK
);
308 assert(FIELD_OFFSET(KTHREAD
, PreviousMode
) == KTHREAD_PREVIOUS_MODE
);
309 assert(FIELD_OFFSET(KTHREAD
, TrapFrame
) == KTHREAD_TRAP_FRAME
);
310 assert(FIELD_OFFSET(KTHREAD
, CallbackStack
) == KTHREAD_CALLBACK_STACK
);
311 assert(FIELD_OFFSET(ETHREAD
, ThreadsProcess
) == ETHREAD_THREADS_PROCESS
);
312 assert(FIELD_OFFSET(KPROCESS
, DirectoryTableBase
) ==
313 KPROCESS_DIRECTORY_TABLE_BASE
);
314 assert(FIELD_OFFSET(KTRAP_FRAME
, Reserved9
) == KTRAP_FRAME_RESERVED9
);
315 assert(FIELD_OFFSET(KV86M_TRAP_FRAME
, regs
) == TF_REGS
);
316 assert(FIELD_OFFSET(KV86M_TRAP_FRAME
, orig_ebp
) == TF_ORIG_EBP
);
318 assert(FIELD_OFFSET(KPCR
, ExceptionList
) == KPCR_EXCEPTION_LIST
);
319 assert(FIELD_OFFSET(KPCR
, Self
) == KPCR_SELF
);
320 assert(FIELD_OFFSET(KPCR
, CurrentThread
) == KPCR_CURRENT_THREAD
);
324 KeLowerIrql(DISPATCH_LEVEL
);
328 MmInit1(FirstKrnlPhysAddr
,
331 (PADDRESS_RANGE
)&KeMemoryMap
,
332 KeMemoryMapRangeCount
);
334 /* create default nls tables */
338 * Initialize the kernel debugger
340 KdInitSystem (0, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
345 KeLowerIrql(PASSIVE_LEVEL
);
348 KeBugCheck(SECURITY_INITIALIZATION_FAILED
);
353 KeBugCheck(SECURITY1_INITIALIZATION_FAILED
);
355 PiInitProcessManager();
359 if (KdPollBreakIn ())
361 DbgBreakPointWithStatus (DBG_STATUS_CONTROL_C
);
365 * Display version number and copyright/warranty message
367 HalDisplayString("Starting ReactOS "KERNEL_VERSION_STR
" (Build "
368 KERNEL_VERSION_BUILD_STR
")\n");
369 HalDisplayString(RES_STR_LEGAL_COPYRIGHT
);
370 HalDisplayString("\n\nReactOS is free software, covered by the GNU General "
371 "Public License, and you\n");
372 HalDisplayString("are welcome to change it and/or distribute copies of it "
374 HalDisplayString("conditions. There is absolutely no warranty for "
377 /* Initialize all processors */
378 KeNumberProcessors
= 0;
380 while (!HalAllProcessorsStarted())
382 PVOID ProcessorStack
;
384 if (KeNumberProcessors
!= 0)
386 KePrepareForApplicationProcessorInit(KeNumberProcessors
);
387 PsPrepareForApplicationProcessorInit(KeNumberProcessors
);
389 /* Allocate a stack for use when booting the processor */
390 /* FIXME: The nonpaged memory for the stack is not released after use */
392 ExAllocatePool(NonPagedPool
, MM_STACK_SIZE
) + MM_STACK_SIZE
;
393 Ki386InitialStackArray
[((int)KeNumberProcessors
)] =
394 (PVOID
)(ProcessorStack
- MM_STACK_SIZE
);
395 HalInitializeProcessor(KeNumberProcessors
, ProcessorStack
);
396 KeNumberProcessors
++;
399 if (KeNumberProcessors
> 1)
402 "Found %d system processors. [%u MB Memory]\n",
404 (KeLoaderBlock
.MemHigher
+ 1088)/ 1024);
409 "Found 1 system processor. [%u MB Memory]\n",
410 (KeLoaderBlock
.MemHigher
+ 1088)/ 1024);
412 HalDisplayString(str
);
415 * Initialize various critical subsystems
417 HalInitSystem(1, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
422 LdrInitModuleManagement();
423 CmInitializeRegistry();
428 FsRtlpInitFileLockingImplementation();
430 /* Report all resources used by hal */
431 HalReportResourceUsage();
434 * Initalize services loaded at boot time
436 DPRINT("%d files loaded\n",KeLoaderBlock
.ModsCount
);
437 for (i
=0; i
< KeLoaderBlock
.ModsCount
; i
++)
439 CPRINT("Module: '%s' at %08lx, length 0x%08lx\n",
440 KeLoaderModules
[i
].String
,
441 KeLoaderModules
[i
].ModStart
,
442 KeLoaderModules
[i
].ModEnd
- KeLoaderModules
[i
].ModStart
);
445 /* Pass 1: load nls files */
446 for (i
= 1; i
< KeLoaderBlock
.ModsCount
; i
++)
448 name
= (PCHAR
)KeLoaderModules
[i
].String
;
449 if (RtlpCheckFileNameExtension(name
, ".nls"))
456 name
= (PCHAR
)KeLoaderModules
[i
+1].String
;
457 if (RtlpCheckFileNameExtension(name
, ".nls"))
459 Mod2Start
= (ULONG
)KeLoaderModules
[i
+1].ModStart
;
460 Mod2End
= (ULONG
)KeLoaderModules
[i
+1].ModEnd
;
462 name
= (PCHAR
)KeLoaderModules
[i
+2].String
;
463 if (RtlpCheckFileNameExtension(name
, ".nls"))
465 Mod3Start
= (ULONG
)KeLoaderModules
[i
+2].ModStart
;
466 Mod3End
= (ULONG
)KeLoaderModules
[i
+2].ModEnd
;
470 /* Initialize nls sections */
471 RtlpInitNlsSections((ULONG
)KeLoaderModules
[i
].ModStart
,
472 (ULONG
)KeLoaderModules
[i
].ModEnd
,
481 /* Pass 2: load registry chunks passed in */
482 for (i
= 1; i
< KeLoaderBlock
.ModsCount
; i
++)
484 start
= KeLoaderModules
[i
].ModStart
;
485 length
= KeLoaderModules
[i
].ModEnd
- start
;
486 name
= (PCHAR
)KeLoaderModules
[i
].String
;
487 if (RtlpCheckFileNameExtension(name
, "") ||
488 RtlpCheckFileNameExtension(name
, ".hiv"))
490 CPRINT("Process registry chunk at %08lx\n", start
);
491 CmImportHive((PCHAR
)start
, length
);
495 /* Initialize volatile registry settings */
496 CmInit2((PCHAR
)KeLoaderBlock
.CommandLine
);
499 * Enter the kernel debugger before starting up the boot drivers
505 IoCreateDriverList();
507 /* Pass 3: process boot loaded drivers */
509 for (i
=1; i
< KeLoaderBlock
.ModsCount
; i
++)
511 start
= KeLoaderModules
[i
].ModStart
;
512 length
= KeLoaderModules
[i
].ModEnd
- start
;
513 name
= (PCHAR
)KeLoaderModules
[i
].String
;
514 if (RtlpCheckFileNameExtension(name
, ".sys") ||
515 RtlpCheckFileNameExtension(name
, ".sym"))
517 CPRINT("Initializing driver '%s' at %08lx, length 0x%08lx\n",
518 name
, start
, length
);
519 LdrInitializeBootStartDriver((PVOID
)start
, name
, length
);
521 if (RtlpCheckFileNameExtension(name
, ".sys"))
525 if (BootDriverCount
== 0)
527 DbgPrint("No boot drivers available.\n");
531 /* Create ARC names for boot devices */
534 /* Create the SystemRoot symbolic link */
535 CPRINT("CommandLine: %s\n", (PUCHAR
)KeLoaderBlock
.CommandLine
);
536 Status
= IoCreateSystemRootLink((PUCHAR
)KeLoaderBlock
.CommandLine
);
537 if (!NT_SUCCESS(Status
))
538 KeBugCheck(INACCESSIBLE_BOOT_DEVICE
);
540 #ifdef DBGPRINT_FILE_LOG
541 /* On the assumption that we can now access disks start up the debug
544 #endif /* DBGPRINT_FILE_LOG */
547 PiInitDefaultLocale();
550 * Start the motherboard enumerator (the HAL)
552 HalInitSystem(2, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
555 * Load boot start drivers
557 IopLoadBootStartDrivers();
560 * Load Auto configured drivers
562 LdrLoadAutoConfigDrivers();
565 IoDestroyDriverList();
568 * Assign drive letters
570 IoAssignDriveLetters ((PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
,
576 * Initialize shared user page:
577 * - set dos system path, dos device map, etc.
579 InitSystemSharedUserPage ((PUCHAR
)KeLoaderBlock
.CommandLine
);
582 * Launch initial process
584 Status
= LdrLoadInitialProcess(&ProcessHandle
,
586 if (!NT_SUCCESS(Status
))
588 KeBugCheckEx(SESSION4_INITIALIZATION_FAILED
, Status
, 0, 0, 0);
592 * Crash the system if the initial process terminates within 5 seconds.
594 Timeout
.QuadPart
= 50000000;
595 Status
= NtWaitForSingleObject(ProcessHandle
,
598 if (Status
!= STATUS_TIMEOUT
)
600 KeBugCheckEx(SESSION5_INITIALIZATION_FAILED
, Status
, 0, 0, 0);
603 NtClose(ThreadHandle
);
604 NtClose(ProcessHandle
);
606 PsTerminateSystemThread(STATUS_SUCCESS
);
611 KiSystemStartup(BOOLEAN BootProcessor
)
613 HalInitSystem (0, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
618 ExpInitializeExecutive();
621 /* Do application processor initialization */
622 KeApplicationProcessorInit();
623 PsApplicationProcessorInit();
624 KeLowerIrql(PASSIVE_LEVEL
);
625 PsIdleThreadMain(NULL
);
631 _main (ULONG MultiBootMagic
, PLOADER_PARAMETER_BLOCK _LoaderBlock
)
633 * FUNCTION: Called by the boot loader to start the kernel
635 * LoaderBlock = Pointer to boot parameters initialized by the boot
637 * NOTE: The boot parameters are stored in low memory which will become
638 * invalid after the memory managment is initialized so we make a local copy.
643 ULONG last_kernel_address
;
644 extern ULONG _bss_end__
;
649 /* Low level architecture specific initialization */
653 * Copy the parameters to a local buffer because lowmem will go away
655 memcpy(&KeLoaderBlock
, _LoaderBlock
, sizeof(LOADER_PARAMETER_BLOCK
));
656 memcpy(&KeLoaderModules
[1], (PVOID
)KeLoaderBlock
.ModsAddr
,
657 sizeof(LOADER_MODULE
) * KeLoaderBlock
.ModsCount
);
658 KeLoaderBlock
.ModsCount
++;
659 KeLoaderBlock
.ModsAddr
= (ULONG
)&KeLoaderModules
;
662 * Convert a path specification in the grub format to one understood by the
663 * rest of the kernel.
665 if (((PUCHAR
)_LoaderBlock
->CommandLine
)[0] == '(')
667 ULONG DiskNumber
= 0, PartNumber
= 0;
673 if (((PUCHAR
)_LoaderBlock
->CommandLine
)[1] == 'h' &&
674 ((PUCHAR
)_LoaderBlock
->CommandLine
)[2] == 'd')
676 DiskNumber
= ((PUCHAR
)_LoaderBlock
->CommandLine
)[3] - '0';
677 PartNumber
= ((PUCHAR
)_LoaderBlock
->CommandLine
)[5] - '0';
679 strcpy(Temp
, &((PUCHAR
)_LoaderBlock
->CommandLine
)[7]);
680 if ((options
= strchr(Temp
, ' ')) != NULL
)
689 if ((s1
= strrchr(Temp
, '/')) != NULL
)
692 if ((s1
= strrchr(Temp
, '/')) != NULL
)
697 sprintf(KeLoaderCommandLine
,
698 "multi(0)disk(0)rdisk(%d)partition(%d)%s %s",
699 DiskNumber
, PartNumber
+ 1, Temp
, options
);
701 p
= KeLoaderCommandLine
;
702 while (*p
!= 0 && *p
!= ' ')
710 DPRINT1("Command Line: %s\n", KeLoaderCommandLine
);
714 strcpy(KeLoaderCommandLine
, (PUCHAR
)_LoaderBlock
->CommandLine
);
716 KeLoaderBlock
.CommandLine
= (ULONG
)KeLoaderCommandLine
;
718 strcpy(KeLoaderModuleStrings
[0], "ntoskrnl.exe");
719 KeLoaderModules
[0].String
= (ULONG
)KeLoaderModuleStrings
[0];
720 KeLoaderModules
[0].ModStart
= 0xC0000000;
721 KeLoaderModules
[0].ModEnd
= PAGE_ROUND_UP((ULONG
)&_bss_end__
);
722 for (i
= 1; i
< KeLoaderBlock
.ModsCount
; i
++)
725 if ((s
= strrchr((PUCHAR
)KeLoaderModules
[i
].String
, '/')) != 0)
727 strcpy(KeLoaderModuleStrings
[i
], s
+ 1);
731 strcpy(KeLoaderModuleStrings
[i
], (PUCHAR
)KeLoaderModules
[i
].String
);
733 KeLoaderModules
[i
].ModStart
-= 0x200000;
734 KeLoaderModules
[i
].ModStart
+= 0xc0000000;
735 KeLoaderModules
[i
].ModEnd
-= 0x200000;
736 KeLoaderModules
[i
].ModEnd
+= 0xc0000000;
737 KeLoaderModules
[i
].String
= (ULONG
)KeLoaderModuleStrings
[i
];
741 HalnInitializeDisplay((PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
744 HalBase
= KeLoaderModules
[1].ModStart
;
746 PAGE_ROUND_UP(KeLoaderModules
[KeLoaderBlock
.ModsCount
- 1].ModEnd
);
751 LdrSafePEProcessModule((PVOID
)HalBase
, (PVOID
)DriverBase
, (PVOID
)0xC0000000, &DriverSize
);
753 LdrHalBase
= (ULONG_PTR
)DriverBase
;
754 last_kernel_address
= DriverBase
+ DriverSize
;
757 * Process ntoskrnl.exe
759 LdrSafePEProcessModule((PVOID
)0xC0000000, (PVOID
)0xC0000000, (PVOID
)DriverBase
, &DriverSize
);
761 FirstKrnlPhysAddr
= KeLoaderModules
[0].ModStart
- 0xc0000000 + 0x200000;
762 LastKrnlPhysAddr
= last_kernel_address
- 0xc0000000 + 0x200000;
763 LastKernelAddress
= last_kernel_address
;
766 /* FIXME: VMware does not like it when ReactOS is using the BIOS memory map */
767 KeLoaderBlock
.Flags
&= ~MB_FLAGS_MMAP_INFO
;
770 KeMemoryMapRangeCount
= 0;
771 if (KeLoaderBlock
.Flags
& MB_FLAGS_MMAP_INFO
)
773 /* We have a memory map from the nice BIOS */
774 size
= *((PULONG
)(KeLoaderBlock
.MmapAddr
- sizeof(ULONG
)));
776 while (i
< KeLoaderBlock
.MmapLength
)
778 memcpy (&KeMemoryMap
[KeMemoryMapRangeCount
],
779 (PVOID
)(KeLoaderBlock
.MmapAddr
+ i
),
780 sizeof(ADDRESS_RANGE
));
781 KeMemoryMapRangeCount
++;