Author: sir_richard
Date: Sat Aug 7 16:01:30 2010
New Revision: 48477
URL:
http://svn.reactos.org/svn/reactos?rev=48477&view=rev
Log:
[KERNEL32]: Aleksey wants debug channels, I agree this is the way forward. Leverage
existing NT infrastructure to enable Windows-compatible debug channel support, instead of
using a UNIX-based 3rd party library. Same debug channel names as before have been
re-added, but using NT Debug Filters.
Modified:
trunk/reactos/dll/win32/kernel32/file/bintype.c
trunk/reactos/dll/win32/kernel32/file/copy.c
trunk/reactos/dll/win32/kernel32/file/create.c
trunk/reactos/dll/win32/kernel32/file/curdir.c
trunk/reactos/dll/win32/kernel32/file/delete.c
trunk/reactos/dll/win32/kernel32/file/deviceio.c
trunk/reactos/dll/win32/kernel32/file/dir.c
trunk/reactos/dll/win32/kernel32/file/dosdev.c
trunk/reactos/dll/win32/kernel32/file/file.c
trunk/reactos/dll/win32/kernel32/file/find.c
trunk/reactos/dll/win32/kernel32/file/hardlink.c
trunk/reactos/dll/win32/kernel32/file/lock.c
trunk/reactos/dll/win32/kernel32/file/mailslot.c
trunk/reactos/dll/win32/kernel32/file/move.c
trunk/reactos/dll/win32/kernel32/file/npipe.c
trunk/reactos/dll/win32/kernel32/file/pipe.c
trunk/reactos/dll/win32/kernel32/file/rw.c
trunk/reactos/dll/win32/kernel32/file/volume.c
trunk/reactos/dll/win32/kernel32/include/kernel32.h
trunk/reactos/dll/win32/kernel32/misc/actctx.c
trunk/reactos/dll/win32/kernel32/misc/format_msg.c
trunk/reactos/dll/win32/kernel32/misc/lcformat.c
trunk/reactos/dll/win32/kernel32/misc/version.c
trunk/reactos/dll/win32/kernel32/process/session.c
trunk/reactos/include/reactos/debug.h
Modified: trunk/reactos/dll/win32/kernel32/file/bintype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/bi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/bintype.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/bintype.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -15,6 +15,8 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/co…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/copy.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/copy.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -15,6 +15,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/cr…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/create.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/create.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -17,6 +17,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
#define SYMLINK_FLAG_RELATIVE 1
Modified: trunk/reactos/dll/win32/kernel32/file/curdir.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/cu…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/curdir.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/curdir.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -19,6 +19,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* GLOBAL VARIABLES **********************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/delete.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/de…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/delete.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/delete.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -14,6 +14,7 @@
#include <k32.h>
#define NDEBUG
#include <reactos/debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/deviceio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/de…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/deviceio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/deviceio.c [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -10,7 +10,7 @@
#include <k32.h>
#define NDEBUG
-#include <reactos/debug.h>
+#include <debug.h>
/* FUNCTIONS ******************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/dir.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/di…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -18,6 +18,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
UNICODE_STRING DllDirectory = {0, 0, NULL};
Modified: trunk/reactos/dll/win32/kernel32/file/dosdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/do…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dosdev.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/dosdev.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -14,6 +14,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS *****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/fi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -15,6 +15,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* GLOBALS ******************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/find.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/fi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/find.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/find.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -14,6 +14,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* TYPES ********************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/hardlink.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/ha…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/hardlink.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/hardlink.c [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -14,6 +14,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/lock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/lo…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/lock.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/lock.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -16,6 +16,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/mailslot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/ma…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/mailslot.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/mailslot.c [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -13,6 +13,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/move.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/mo…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/move.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/move.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -19,6 +19,7 @@
#include <malloc.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* GLOBALS *****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/npipe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/np…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/npipe.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/npipe.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -12,6 +12,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
Modified: trunk/reactos/dll/win32/kernel32/file/pipe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/pi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/pipe.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/pipe.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -13,6 +13,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* GLOBALS ******************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/rw…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/rw.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/rw.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -14,6 +14,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
/* FUNCTIONS ****************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/vo…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/volume.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/volume.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -22,6 +22,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
#define MAX_DOS_DRIVES 26
Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -1,9 +1,19 @@
#pragma once
-#define TRACE DPRINT
-#define WARN DPRINT1
-#define FIXME DPRINT1
-#define ERR DPRINT1
+//
+// Kernel32 Filter IDs
+//
+#define kernel32file 200
+#define kernel32ver 201
+#define actctx 202
+#define resource 203
+#define kernel32session 204
+
+#define TRACE(fmt, ...) TRACE__(gDebugChannel, fmt, ##__VA_ARGS__)
+#define WARN(fmt, ...) WARN__(gDebugChannel, fmt, ##__VA_ARGS__)
+#define FIXME(fmt, ...) WARN__(gDebugChannel, fmt,## __VA_ARGS__)
+#define ERR(fmt, ...) ERR__(gDebugChannel, fmt, ##__VA_ARGS__)
+
#define debugstr_a
#define debugstr_w
#define wine_dbgstr_w
Modified: trunk/reactos/dll/win32/kernel32/misc/actctx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ac…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/actctx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/actctx.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -15,6 +15,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = actctx;
#define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa)
Modified: trunk/reactos/dll/win32/kernel32/misc/format_msg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/fo…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/format_msg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/format_msg.c [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -22,6 +22,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = resource;
struct format_args
{
Modified: trunk/reactos/dll/win32/kernel32/misc/lcformat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/lc…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/lcformat.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/lcformat.c [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -32,6 +32,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = resource;
#define DATE_DATEVARSONLY 0x0100 /* only date stuff: yMdg */
#define TIME_TIMEVARSONLY 0x0200 /* only time stuff: hHmst */
Modified: trunk/reactos/dll/win32/kernel32/misc/version.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ve…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/version.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/version.c [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -11,6 +11,7 @@
#include <reactos/buildno.h>
#define NDEBUG
#include <debug.h>
+static ULONG gDebugChannel = kernel32ver;
#define UNICODIZE1(x) L##x
#define UNICODIZE(x) UNICODIZE1(x)
Modified: trunk/reactos/dll/win32/kernel32/process/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/process/session.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/process/session.c [iso-8859-1] Sat Aug 7 16:01:30
2010
@@ -11,6 +11,7 @@
#include <k32.h>
#define NDEBUG
#include <debug.h>
+//static ULONG gDebugChannel = kernel32session; not actually used
DWORD ActiveConsoleSessionId = 0;
Modified: trunk/reactos/include/reactos/debug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/debug.h?re…
==============================================================================
--- trunk/reactos/include/reactos/debug.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/debug.h [iso-8859-1] Sat Aug 7 16:01:30 2010
@@ -107,6 +107,11 @@
#define WARN_(ch, fmt, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_WARNING_LEVEL,
"(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#define TRACE_(ch, fmt, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_TRACE_LEVEL,
"(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#define INFO_(ch, fmt, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_INFO_LEVEL,
"(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
+
+ #define ERR__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_ERROR_LEVEL, "(%s:%d)
" fmt, __FILE__, __LINE__, ##__VA_ARGS__)
+ #define WARN__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_WARNING_LEVEL, "(%s:%d)
" fmt, __FILE__, __LINE__, ##__VA_ARGS__)
+ #define TRACE__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_TRACE_LEVEL, "(%s:%d)
" fmt, __FILE__, __LINE__, ##__VA_ARGS__)
+ #define INFO__(ch, fmt, ...) DbgPrintEx(ch, DPFLTR_INFO_LEVEL, "(%s:%d) "
fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#else /* not DBG */
/* On non-debug builds, we never show these */
@@ -119,6 +124,11 @@
#define WARN_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
#define TRACE_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
#define INFO_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
+
+ #define ERR__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
+ #define WARN__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
+ #define TRACE__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
+ #define INFO__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
#endif /* not DBG */
#define ASSERT_IRQL_LESS_OR_EQUAL(x) ASSERT(KeGetCurrentIrql()<=(x))