[RTL]: Fix a bug introduced Mon Dec 6 00:25:14 1999 UTC (10 years, 10 months ago...
authorSir Richard <sir_richard@svn.reactos.org>
Sat, 16 Oct 2010 14:20:30 +0000 (14:20 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Sat, 16 Oct 2010 14:20:30 +0000 (14:20 +0000)
commit68e8260b9886032ebef1e95a9c8c905bcdc51b0e
tree98f98e0917c561901ec8b4eb267f1f2883f3d1fc
parent3b63f433a05228e31ec302607b8e077bd20353ff
[RTL]: Fix a bug introduced Mon Dec 6 00:25:14 1999 UTC (10 years, 10 months ago) in revision 828. NtFreeVirtualMemory takes a pointer to the address to free, not the address instead. For the last 11 years, freeing the process parameter block resulted in freeing whatever the first value in the structure is, which is MaximumLength and initialized to 0x1000. ReactOS would then free whatever random address was in that area. In real Windows, it is illegal to free an allocation in the middle of the base address, and this call failed with the new VAD code. ReactOS either leaked the memory or freed random data, who knows.
[RTL]: Make the PPB live in the Heap instead of having its own virtual allocation, fixing the issue above. Stop rounding it to a PAGE_SIZE, and just use the space required.

svn path=/trunk/; revision=49169
reactos/lib/rtl/ppb.c