mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[NTOSKRNL]
Revert r51108. ProbeForRead doesn't check if memory is readable. Improve comments and replace trick raising exception with call to ExRaiseAccessViolation. [WIN32K] Remove ASSERTs in IntSetSysColors: this function is only called in NtUserSetSysColors in SEH block. It shouldn't crash for NULL pointers. svn path=/trunk/; revision=51126
This commit is contained in:
parent
2165af8818
commit
cd22887a97
2 changed files with 1 additions and 14 deletions
|
@ -104,7 +104,6 @@ ProbeForRead(IN CONST VOID *Address,
|
||||||
IN ULONG Alignment)
|
IN ULONG Alignment)
|
||||||
{
|
{
|
||||||
ULONG_PTR Last, Current = (ULONG_PTR)Address;
|
ULONG_PTR Last, Current = (ULONG_PTR)Address;
|
||||||
CHAR Temp;
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Only probe if we have a valid length */
|
/* Only probe if we have a valid length */
|
||||||
|
@ -132,16 +131,7 @@ ProbeForRead(IN CONST VOID *Address,
|
||||||
ExRaiseAccessViolation();
|
ExRaiseAccessViolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Round down to the last page */
|
/* ProbeForRead doesn't check if memory pages are readable! */
|
||||||
Last = PAGE_ROUND_DOWN(Last) + PAGE_SIZE;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
/* Attempt a read */
|
|
||||||
Temp = *(volatile CHAR*)Current;
|
|
||||||
|
|
||||||
/* Go to the next address */
|
|
||||||
Current = PAGE_ROUND_DOWN(Current) + PAGE_SIZE;
|
|
||||||
} while (Current != Last);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,9 +221,6 @@ IntSetSysColors(UINT nColors, CONST INT *Elements, CONST COLORREF *Colors)
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
ASSERT(Elements);
|
|
||||||
ASSERT(Colors);
|
|
||||||
|
|
||||||
for (i = 0; i < nColors; i++)
|
for (i = 0; i < nColors; i++)
|
||||||
{
|
{
|
||||||
if ((UINT)(*Elements) < NUM_SYSCOLORS)
|
if ((UINT)(*Elements) < NUM_SYSCOLORS)
|
||||||
|
|
Loading…
Reference in a new issue