[NTOS]: Aleksey wants an easy way to see debug messages coming from one process vs...
authorSir Richard <sir_richard@svn.reactos.org>
Sat, 7 Aug 2010 16:16:17 +0000 (16:16 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Sat, 7 Aug 2010 16:16:17 +0000 (16:16 +0000)
svn path=/trunk/; revision=48479

reactos/ntoskrnl/kd/kdio.c

index db48c31..77531f3 100644 (file)
@@ -350,9 +350,14 @@ KdpPrintString(LPSTR String,
 {
     PLIST_ENTRY CurrentEntry;
     PKD_DISPATCH_TABLE CurrentTable;
 {
     PLIST_ENTRY CurrentEntry;
     PKD_DISPATCH_TABLE CurrentTable;
-
+    CHAR Buffer[32];
     if (!KdpDebugMode.Value) return 0;
 
     if (!KdpDebugMode.Value) return 0;
 
+    /* Build process name and PID/TID buffer */
+    sprintf(Buffer, "[%s (%p:%p)]: ",
+            PsGetCurrentProcess()->ImageFileName,
+            PsGetCurrentProcessId(), PsGetCurrentThreadId());
+
     /* Call the registered handlers */
     CurrentEntry = KdProviders.Flink;
     while (CurrentEntry != &KdProviders)
     /* Call the registered handlers */
     CurrentEntry = KdProviders.Flink;
     while (CurrentEntry != &KdProviders)
@@ -361,6 +366,9 @@ KdpPrintString(LPSTR String,
         CurrentTable = CONTAINING_RECORD(CurrentEntry,
                                          KD_DISPATCH_TABLE,
                                          KdProvidersList);
         CurrentTable = CONTAINING_RECORD(CurrentEntry,
                                          KD_DISPATCH_TABLE,
                                          KdProvidersList);
+                                         
+        /* Send the process name */
+        CurrentTable->KdpPrintRoutine(Buffer, sizeof(Buffer));
 
         /* Call it */
         CurrentTable->KdpPrintRoutine(String, Length);
 
         /* Call it */
         CurrentTable->KdpPrintRoutine(String, Length);
@@ -371,7 +379,13 @@ KdpPrintString(LPSTR String,
 
     /* Call the Wrapper Routine */
     if (WrapperTable.KdpPrintRoutine)
 
     /* Call the Wrapper Routine */
     if (WrapperTable.KdpPrintRoutine)
+    {
+        /* Send the process name */
+        WrapperTable.KdpPrintRoutine(Buffer, sizeof(Buffer));
+        
+        /* Send the message */
         WrapperTable.KdpPrintRoutine(String, Length);
         WrapperTable.KdpPrintRoutine(String, Length);
+    }
 
     /* Return the Length */
     return Length;
 
     /* Return the Length */
     return Length;