From 78a50b48b4db2b5cabf3d9c058b6342477e158fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Tue, 29 Apr 2003 22:39:57 +0000 Subject: [PATCH] All IsBadXxxxPtr return values were backward (TRUE when they should be FALSE and vv.) svn path=/trunk/; revision=4618 --- reactos/lib/kernel32/mem/isbad.c | 41 +++++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/reactos/lib/kernel32/mem/isbad.c b/reactos/lib/kernel32/mem/isbad.c index 0aa171b4254..da4bcd350eb 100644 --- a/reactos/lib/kernel32/mem/isbad.c +++ b/reactos/lib/kernel32/mem/isbad.c @@ -1,4 +1,4 @@ -/* $Id: isbad.c,v 1.5 2003/01/15 21:24:34 chorns Exp $ +/* $Id: isbad.c,v 1.6 2003/04/29 22:39:57 gvg Exp $ * * lib/kernel32/mem/isbad.c * @@ -7,6 +7,9 @@ */ #include +#define NDEBUG +#include + /* FIXME: Stubs. What is it for? */ UINT wcsnlen ( @@ -14,6 +17,8 @@ wcsnlen ( UINT ucchMax ) { + DPRINT1("wcsnlen stub called\n"); + return 0; } @@ -25,6 +30,8 @@ strnlen ( UINT uiMax ) { + DPRINT1("strnlen stub called\n"); + return 0; } @@ -41,7 +48,7 @@ IsBadReadPtr ( if ( ucb == 0 ) { - return FALSE; + return TRUE; } VirtualQuery ( @@ -52,25 +59,25 @@ IsBadReadPtr ( if ( MemoryInformation.State != MEM_COMMIT ) { - return FALSE; + return TRUE; } if ( MemoryInformation.RegionSize < ucb ) { - return FALSE; + return TRUE; } if ( MemoryInformation.Protect == PAGE_EXECUTE ) { - return FALSE; + return TRUE; } if ( MemoryInformation.Protect == PAGE_NOACCESS ) { - return FALSE; + return TRUE; } - return TRUE; + return FALSE; } @@ -103,17 +110,17 @@ IsBadCodePtr ( if ( MemoryInformation.State != MEM_COMMIT ) { - return FALSE; + return TRUE; } if ( (MemoryInformation.Protect == PAGE_EXECUTE) || (MemoryInformation.Protect == PAGE_EXECUTE_READ) ) { - return TRUE; + return FALSE; } - return FALSE; + return TRUE; } @@ -128,7 +135,7 @@ IsBadWritePtr ( if ( ucb == 0 ) { - return FALSE; + return TRUE; } VirtualQuery ( @@ -139,33 +146,33 @@ IsBadWritePtr ( if ( MemoryInformation.State != MEM_COMMIT ) { - return FALSE; + return TRUE; } if ( MemoryInformation.RegionSize < ucb ) { - return FALSE; + return TRUE; } if ( MemoryInformation.Protect == PAGE_READONLY) { - return FALSE; + return TRUE; } if ( (MemoryInformation.Protect == PAGE_EXECUTE) || (MemoryInformation.Protect == PAGE_EXECUTE_READ) ) { - return FALSE; + return TRUE; } if ( MemoryInformation.Protect == PAGE_NOACCESS ) { - return FALSE; + return TRUE; } - return TRUE; + return FALSE; }