+Option '--debug-messages' (default off) - variable 'captive_debug_messages'
[reactos.git] / ntoskrnl / dbg / print.c
index f0c755d..eec9496 100644 (file)
@@ -32,6 +32,9 @@
 
 #include <ddk/ntddk.h>
 #include <internal/kd.h>
+#ifdef LIBCAPTIVE
+#include <glib/gtypes.h>       /* for gboolean */
+#endif /* LIBCAPTIVE */
 
 
 /* FUNCTIONS ****************************************************************/
@@ -53,6 +56,10 @@ __asm__ ("\n\t.global _DbgService\n\t"
  *       You'll only break the serial/bochs debugging feature!!!
  */
 
+#ifdef LIBCAPTIVE
+extern gboolean captive_debug_messages;
+#endif /* LIBCAPTIVE */
+
 ULONG 
 DbgPrint(PCH Format, ...)
 {
@@ -60,6 +67,11 @@ DbgPrint(PCH Format, ...)
    CHAR Buffer[1024];
    va_list ap;
 
+#ifdef LIBCAPTIVE
+   if (!captive_debug_messages)
+      return 0;
+#endif /* LIBCAPTIVE */
+
    /* init ansi string */
    DebugString.Buffer = Buffer;
    DebugString.MaximumLength = sizeof(Buffer);