From d68a820d81a428c6709ea1e4e024f751f724cf4c Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Fri, 19 Feb 2010 17:54:16 +0000 Subject: [PATCH] [NTOS]: Fix an off-by-one-error which incorrectly causes GUI promotion to fail if the first GUI call is "0", since the limit on the GUI descriptor table will also be "0". We should check if the limit is equal to or lower, not just if it's lower. Thanks to Physicus and Fireball for reporting and working this out. Should fix the "ArwinSS" problem. svn path=/trunk/; revision=45621 --- reactos/ntoskrnl/ke/i386/traphdlr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/i386/traphdlr.c b/reactos/ntoskrnl/ke/i386/traphdlr.c index 3b2f81b00a4..6c777643bd6 100644 --- a/reactos/ntoskrnl/ke/i386/traphdlr.c +++ b/reactos/ntoskrnl/ke/i386/traphdlr.c @@ -1401,7 +1401,7 @@ KiSystemCall(IN ULONG SystemCallNumber, DescriptorTable = (PVOID)((ULONG_PTR)Thread->ServiceTable + Offset); /* Validate the system call number */ - if (__builtin_expect(Id > DescriptorTable->Limit, 0)) + if (__builtin_expect(Id >= DescriptorTable->Limit, 0)) { /* Check if this is a GUI call */ if (__builtin_expect(!(Offset & SERVICE_TABLE_TEST), 0))