Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Problems adding WPP tracing to Mirror Driver sample

Reply
Thread Tools Display Modes

Problems adding WPP tracing to Mirror Driver sample

 
 
jrb1400
Guest
Posts: n/a

 
      03-21-2007
Hi,

I am getting compile errors when trying to add WPP tracing to the Mirror
driver sample. For now, I'm working on the miniport part of the driver. I
am using the command line build (build -ceZ). I get the same errors with
either the Checked or Free build environments

With the original build attempts, there were over 100 syntax errors parsing
<evnttrace.h>. (evnttrace.h is included by mirror.tmh - which is created by
WPP)
I tried to include <ntddk.h>, but then I get many (again over 100) multiply
defined items while parsing miniport.h


Two Questions:
1. Are there any special compiler / define flags to set when using tracing
with a mini driver ? Hoe can I get this to build ?
2. When can I call WPP_CLEANUP(DriverObject)? I don't see anytihing in the
VIDEO_HW_INITIALIZATION_DATA where I can define an Unload routine.

Thanks very much for any assistance,
Jay




Here are some clips from files I am using

- - - - - - - - - - - - - - - -
SOURCES (entire file)
- - - - - - - - - - - - - - - -
TARGETNAME=mirror
TARGETTYPE=DRIVER

TARGETLIBS=$(DDK_LIB_PATH)\videoprt.lib

AXP64_FLAGS=/QA21164

INCLUDES=..\inc;..\..\inc

SOURCES=mirror.c \
mirror.rc

#
# Generate WPP tracing code
# $(SOURCES) -- run software preprocessor on files listed in SOURCES
# -km -- use kernel mode
# -func -- define function we'll use for tracing
# This would map all TraceEvents calls to
# DoTraceMessage.
#
RUN_WPP= $(SOURCES) \
-km \
-func:TraceEvents(LEVEL,FLAGS,MSG,...) \
-gen:{km-WdfDefault.tpl}*.tmh


- - - - - - - - - - - - - - - -
MIRROR.C (just the beginning of it)
- - - - - - - - - - - - - - - -
// #include <ntddk.h> // tried with and without this
#include "dderror.h"
#include "devioctl.h"
#include "miniport.h"
#include "ntddvdeo.h"
#include "video.h"
#include "mirror.h"

#include "trace.h" // added for WPP tracing
#include "mirror.tmh" // added for WPP tracing



VOID DbgBreakPoint() {};

VOID
MirrorNotImplemented(
__in char *s
)
{
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT, "Mirror Sample: Not used
'%s'.\n", s);
}
.. . . . .


- - - - - - - - - - - - - - - -
TRACE.H (entire file)
- - - - - - - - - - - - - - - -
#define WPP_CHECK_FOR_NULL_STRING //to prevent exceptions due to NULL strings

#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID(igeMirrorMiniTraceGuid, (060C32B7, C530, 4d7b,
9A57, F2AA390A724F),\
WPP_DEFINE_BIT(DBG_INIT) /* bit 0 = 0x00000001 */ \
WPP_DEFINE_BIT(DBG_PNP) /* bit 1 = 0x00000002 */ \
WPP_DEFINE_BIT(DBG_POWER) /* bit 2 = 0x00000004 */ \
WPP_DEFINE_BIT(DBG_WMI) /* bit 3 = 0x00000008 */ \
WPP_DEFINE_BIT(DBG_CREATE_CLOSE) /* bit 4 = 0x00000010 */ \
WPP_DEFINE_BIT(DBG_IOCTLS) /* bit 5 = 0x00000020 */ \
WPP_DEFINE_BIT(DBG_WRITE) /* bit 6 = 0x00000040 */ \
WPP_DEFINE_BIT(DBG_READ) /* bit 7 = 0x00000080 */ \
WPP_DEFINE_BIT(DBG_DPC) /* bit 8 = 0x00000100 */ \
WPP_DEFINE_BIT(DBG_INTERRUPT) /* bit 9 = 0x00000200 */ \
WPP_DEFINE_BIT(DBG_LOCKS) /* bit 10 = 0x00000400 */ \
WPP_DEFINE_BIT(DBG_QUEUEING) /* bit 11 = 0x00000800 */ \
WPP_DEFINE_BIT(DBG_HW_ACCESS) /* bit 12 = 0x00001000 */ \
/* There is a limit of 32 defines. */\
)


#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)
#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) (WPP_LEVEL_ENABLED(flags) &&
WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)




 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DDK mirror driver sample fchen Windows Vista Drivers 2 10-12-2006 10:40 PM
Question about DDK mirror driver sample: how to tell which ATI driver has the drvenablePDEV function? lucy Windows Vista Drivers 8 08-25-2004 02:12 PM
Microsoft Mirror Sample Driver assaf Windows Vista Drivers 0 08-21-2004 02:15 PM
Microsoft Mirror Sample Driver assaf Windows Vista Drivers 0 08-15-2004 03:35 PM
Original DDK Mirror Driver Sample Bug assaf Windows Vista Drivers 0 07-28-2004 07:13 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59