From 7909b7a822ce9c0584e4a07dcc1345f8ea0265ee Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Thu, 30 Nov 2006 19:52:49 +0000 Subject: [PATCH] - Properly set and check the image notification flag for the process in DbgkCreateThread. Patch by hto. See issue #1879 for more details. svn path=/trunk/; revision=25003 --- reactos/ntoskrnl/dbgk/dbgkutil.c | 10 ++++++---- reactos/ntoskrnl/tests/TestDebug.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/dbgk/dbgkutil.c b/reactos/ntoskrnl/dbgk/dbgkutil.c index 21452190eac..578b73d007f 100644 --- a/reactos/ntoskrnl/dbgk/dbgkutil.c +++ b/reactos/ntoskrnl/dbgk/dbgkutil.c @@ -104,10 +104,12 @@ DbgkCreateThread(PVOID StartAddress) PTEB Teb; PAGED_CODE(); - /* Check if this process has already been notified */ - ProcessFlags = InterlockedAnd((PLONG)&Process->Flags, - PSF_CREATE_REPORTED_BIT | - PSF_IMAGE_NOTIFY_DONE_BIT); + /* Try ORing in the create reported and image notify flags */ + ProcessFlags = InterlockedOr((PLONG)&Process->Flags, + PSF_CREATE_REPORTED_BIT | + PSF_IMAGE_NOTIFY_DONE_BIT); + + /* Check if we were the first to set them or if another thread raced us */ if (!(ProcessFlags & PSF_IMAGE_NOTIFY_DONE_BIT) && (PsImageNotifyEnabled)) { /* It hasn't.. set up the image info for the process */ diff --git a/reactos/ntoskrnl/tests/TestDebug.c b/reactos/ntoskrnl/tests/TestDebug.c index 8da141ceae9..8108436a99f 100644 --- a/reactos/ntoskrnl/tests/TestDebug.c +++ b/reactos/ntoskrnl/tests/TestDebug.c @@ -49,7 +49,7 @@ Main(VOID) &ClientId); Status = DbgUiDebugActiveProcess(hProcess); #else - Error = DebugActiveProcess(2648); + Error = DebugActiveProcess(168); #endif #if NATIVE