Author: sginsberg
Date: Sun Jan 4 11:33:47 2009
New Revision: 38568
URL:
http://svn.reactos.org/svn/reactos?rev=38568&view=rev
Log:
- DbgkpSendApiMessage/DbgkpSendApiMessageLpc: Make sure the process is suspended before
resuming it. Also, DbgkpSendApiMessage takes a BOOLEAN as 2nd parameter.
- DbgkpWakeTarget: Correct a check for a Debug Event flag
Modified:
trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
trunk/reactos/ntoskrnl/include/internal/dbgk.h
Modified: trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/dbgkobj.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] Sun Jan 4 11:33:47 2009
@@ -209,10 +209,11 @@
{
NTSTATUS Status;
UCHAR Buffer[PORT_MAXIMUM_MESSAGE_LENGTH];
+ BOOLEAN Suspended = FALSE;
PAGED_CODE();
/* Suspend process if required */
- if (SuspendProcess) DbgkpSuspendProcess();
+ if (SuspendProcess) Suspended = DbgkpSuspendProcess();
/* Set return status */
Message->ReturnedStatus = STATUS_PENDING;
@@ -232,21 +233,22 @@
if (NT_SUCCESS(Status)) RtlCopyMemory(Message, Buffer, sizeof(DBGKM_MSG));
/* Resume the process if it was suspended */
- if (SuspendProcess) DbgkpResumeProcess();
+ if (Suspended) DbgkpResumeProcess();
return Status;
}
NTSTATUS
NTAPI
DbgkpSendApiMessage(IN OUT PDBGKM_MSG ApiMsg,
- IN ULONG Flags)
+ IN BOOLEAN SuspendProcess)
{
NTSTATUS Status;
+ BOOLEAN Suspended = FALSE;
PAGED_CODE();
- DBGKTRACE(DBGK_MESSAGE_DEBUG, "ApiMsg: %p Flags: %lx\n", ApiMsg, Flags);
+ DBGKTRACE(DBGK_MESSAGE_DEBUG, "ApiMsg: %p SuspendProcess: %lx\n", ApiMsg,
SuspendProcess);
/* Suspend process if required */
- if (Flags) DbgkpSuspendProcess();
+ if (SuspendProcess) Suspended = DbgkpSuspendProcess();
/* Set return status */
ApiMsg->ReturnedStatus = STATUS_PENDING;
@@ -265,7 +267,7 @@
ZwFlushInstructionCache(NtCurrentProcess(), NULL, 0);
/* Resume the process if it was suspended */
- if (Flags) DbgkpResumeProcess();
+ if (Suspended) DbgkpResumeProcess();
return Status;
}
@@ -426,7 +428,7 @@
DBGKTRACE(DBGK_OBJECT_DEBUG, "DebugEvent: %p\n", DebugEvent);
/* Check if we have to wake the thread */
- if (DebugEvent->Flags & 20) PsResumeThread(Thread, NULL);
+ if (DebugEvent->Flags & 0x20) PsResumeThread(Thread, NULL);
/* Check if we had locked the thread */
if (DebugEvent->Flags & 8)
Modified: trunk/reactos/ntoskrnl/include/internal/dbgk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/dbgk.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/dbgk.h [iso-8859-1] Sun Jan 4 11:33:47 2009
@@ -102,7 +102,7 @@
NTAPI
DbgkpSendApiMessage(
IN OUT PDBGKM_MSG ApiMsg,
- IN ULONG Flags
+ IN BOOLEAN SuspendProcess
);
HANDLE