mirror of
https://github.com/reactos/reactos.git
synced 2024-11-07 07:00:19 +00:00
[SMSS]: Remove the ROS_DOESNT_SUCK hack, and correctly started subsystem processes with the first MB reserved.
[CSRSRV]: CSRSS was started with a free address space, and was able to map 0xA0000 into it by luck, because the ReactOS Mm allocator picks address ranges randomly, and it somehow managed to avoid the low 1MB addresses. Were this algorithm to change, or perhaps, were we to implement VADs for VM allocations, the 0xA0000 region might already be allocated (by an early-process-initialization allocation, such as the heap). This is what the flag referenced above was designed for, but it was not used. Using this flag, on the other hand, now makes CSRSS fail, because it attempts to map the RAM into 0xA0000, which fails since you can map a section on top of reserved memory. To work around this Brobdingnagian annoyance, CSRSS simply releases the first MB of memory that SMSS has nicely reserved for it, and then proceeds with the mapping. This fixes the issue of getting 0xA0000 by luck and now guarantees it can be mapped. svn path=/trunk/; revision=49133
This commit is contained in:
parent
8bfc61d69d
commit
6f0a1a3598
2 changed files with 16 additions and 3 deletions
|
@ -108,11 +108,11 @@ FailProcParams:
|
|||
__FUNCTION__, Status);
|
||||
return Status;
|
||||
}
|
||||
#ifdef ROS_DOESNT_SUCK
|
||||
|
||||
/* Reserve lower 1Mb, if requested */
|
||||
if (Flags & SM_CREATE_FLAG_RESERVE_1MB)
|
||||
ProcessParameters->Flags |= RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB;
|
||||
#endif
|
||||
|
||||
/* Create the user process */
|
||||
Status = RtlCreateUserProcess (& ImagePathString,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
|
|
|
@ -38,7 +38,20 @@ InitializeVideoAddressSpace(VOID)
|
|||
LARGE_INTEGER Offset;
|
||||
SIZE_T ViewSize;
|
||||
CHAR IVTAndBda[1024+256];
|
||||
|
||||
|
||||
/* Free the 1MB pre-reserved region. In reality, ReactOS should simply support us mapping the view into the reserved area, but it doesn't. */
|
||||
BaseAddress = 0;
|
||||
ViewSize = 1024 * 1024;
|
||||
Status = ZwFreeVirtualMemory(NtCurrentProcess(),
|
||||
&BaseAddress,
|
||||
&ViewSize,
|
||||
MEM_RELEASE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Couldn't unmap reserved memory (%x)\n", Status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Open the physical memory section */
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&PhysMemName,
|
||||
|
|
Loading…
Reference in a new issue