Dear Sir:

I try to add below code to my driver source, and add sys to
vista.
But No Message output. What's wrong with me?
Please help me to solve it.

//----------------------------------------------------------------------------------------------------------------------//

ULONG DebugLevel = TRACE_LEVEL_INFORMATION;
ULONG DebugFlag = DBG_INIT|DBG_PNP|DBG_POWER|DBG_CREATE_CLOSE|
DBG_IOCTLS|DBG_WRITE|DBG_READ|DBG_DPC|DBG_INTERRUPT|DBG_HW_ACCESS;


VOID
SerialDbgPrintEx (
IN ULONG TraceEventsLevel,
IN ULONG TraceEventsFlag,
IN PCCHAR DebugMessage,
...
)

{

#if DBG

#define TEMP_BUFFER_SIZE 1024

va_list list;
CHAR debugMessageBuffer [TEMP_BUFFER_SIZE];
NTSTATUS status;

va_start(list, DebugMessage);

if (DebugMessage) {
status = RtlStringCbVPrintfA( debugMessageBuffer,
sizeof(debugMessageBuffer),
DebugMessage,
list );
if(!NT_SUCCESS(status)) {
KdPrint((_DRIVER_NAME_": RtlStringCbVPrintfA failed %x\n",
status));
return;
}
if (TraceEventsLevel < TRACE_LEVEL_INFORMATION ||
(TraceEventsLevel <= DebugLevel &&
((TraceEventsFlag & DebugFlag) == TraceEventsFlag))) {

KdPrint((debugMessageBuffer));
}
}
va_end(list);

return;

#else

UNREFERENCED_PARAMETER(TraceEventsLevel);
UNREFERENCED_PARAMETER(TraceEventsFlag);
UNREFERENCED_PARAMETER(DebugMessage);

#endif
}

and

I call
SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_PNP, "-->
SerialEvtDeviceAdd\n");
but NO message shows on DebugView

Re: DebugView Can't work at Vista? by Peter

Peter
Thu Mar 13 09:19:32 CDT 2008

You need to add a key named in HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager named Debug Print Filter. In this key, add the following DWORD
value:

DEFAULT : REG_DWORD : 0xFFFFFFFF

Then, reboot the system. The key and DWORD value are case-sensitive.

Good luck!

<bluestar8783@gmail.com> wrote in message
news:fef2b65e-a2b9-4326-845c-654338ca03e1@h11g2000prf.googlegroups.com...
> Dear Sir:
>
> I try to add below code to my driver source, and add sys to
> vista.
> But No Message output. What's wrong with me?
> Please help me to solve it.
>
> //----------------------------------------------------------------------------------------------------------------------//
>
> ULONG DebugLevel = TRACE_LEVEL_INFORMATION;
> ULONG DebugFlag = DBG_INIT|DBG_PNP|DBG_POWER|DBG_CREATE_CLOSE|
> DBG_IOCTLS|DBG_WRITE|DBG_READ|DBG_DPC|DBG_INTERRUPT|DBG_HW_ACCESS;
>
>
> VOID
> SerialDbgPrintEx (
> IN ULONG TraceEventsLevel,
> IN ULONG TraceEventsFlag,
> IN PCCHAR DebugMessage,
> ...
> )
>
> {
>
> #if DBG
>
> #define TEMP_BUFFER_SIZE 1024
>
> va_list list;
> CHAR debugMessageBuffer [TEMP_BUFFER_SIZE];
> NTSTATUS status;
>
> va_start(list, DebugMessage);
>
> if (DebugMessage) {
> status = RtlStringCbVPrintfA( debugMessageBuffer,
> sizeof(debugMessageBuffer),
> DebugMessage,
> list );
> if(!NT_SUCCESS(status)) {
> KdPrint((_DRIVER_NAME_": RtlStringCbVPrintfA failed %x\n",
> status));
> return;
> }
> if (TraceEventsLevel < TRACE_LEVEL_INFORMATION ||
> (TraceEventsLevel <= DebugLevel &&
> ((TraceEventsFlag & DebugFlag) == TraceEventsFlag))) {
>
> KdPrint((debugMessageBuffer));
> }
> }
> va_end(list);
>
> return;
>
> #else
>
> UNREFERENCED_PARAMETER(TraceEventsLevel);
> UNREFERENCED_PARAMETER(TraceEventsFlag);
> UNREFERENCED_PARAMETER(DebugMessage);
>
> #endif
> }
>
> and
>
> I call
> SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_PNP, "-->
> SerialEvtDeviceAdd\n");
> but NO message shows on DebugView



Re: DebugView Can't work at Vista? by bluestar

bluestar
Thu Mar 13 20:41:06 CDT 2008

On 3$B7n(B13$BF|(B, $B2<8a(B10$B;~(B19$BJ,(B, "Peter" <ImInSoq...@nospam.nospam> wrote:
> You need to add a key named in HKLM\SYSTEM\CurrentControlSet\Control\Session
> Manager named Debug Print Filter. In this key, add the following DWORD
> value:
>
> DEFAULT : REG_DWORD : 0xFFFFFFFF
>
> Then, reboot the system. The key and DWORD value are case-sensitive.
>
> Good luck!
>
> <bluestar8...@gmail.com> wrote in message
>
> news:fef2b65e-a2b9-4326-845c-654338ca03e1@h11g2000prf.googlegroups.com...
>
>
>
> > Dear Sir:
>
> > I try to add below code to my driver source, and add sys to
> > vista.
> > But No Message output. What's wrong with me?
> > Please help me to solve it.
>
> > //-----------------------------------------------------------------------------------------------------------------------//
>
> > ULONG DebugLevel = TRACE_LEVEL_INFORMATION;
> > ULONG DebugFlag = DBG_INIT|DBG_PNP|DBG_POWER|DBG_CREATE_CLOSE|
> > DBG_IOCTLS|DBG_WRITE|DBG_READ|DBG_DPC|DBG_INTERRUPT|DBG_HW_ACCESS;
>
> > VOID
> > SerialDbgPrintEx (
> > IN ULONG TraceEventsLevel,
> > IN ULONG TraceEventsFlag,
> > IN PCCHAR DebugMessage,
> > ...
> > )
>
> > {
>
> > #if DBG
>
> > #define TEMP_BUFFER_SIZE 1024
>
> > va_list list;
> > CHAR debugMessageBuffer [TEMP_BUFFER_SIZE];
> > NTSTATUS status;
>
> > va_start(list, DebugMessage);
>
> > if (DebugMessage) {
> > status = RtlStringCbVPrintfA( debugMessageBuffer,
> > sizeof(debugMessageBuffer),
> > DebugMessage,
> > list );
> > if(!NT_SUCCESS(status)) {
> > KdPrint((_DRIVER_NAME_": RtlStringCbVPrintfA failed %x\n",
> > status));
> > return;
> > }
> > if (TraceEventsLevel < TRACE_LEVEL_INFORMATION ||
> > (TraceEventsLevel <= DebugLevel &&
> > ((TraceEventsFlag & DebugFlag) == TraceEventsFlag))) {
>
> > KdPrint((debugMessageBuffer));
> > }
> > }
> > va_end(list);
>
> > return;
>
> > #else
>
> > UNREFERENCED_PARAMETER(TraceEventsLevel);
> > UNREFERENCED_PARAMETER(TraceEventsFlag);
> > UNREFERENCED_PARAMETER(DebugMessage);
>
> > #endif
> > }
>
> > and
>
> > I call
> > SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_PNP, "-->
> > SerialEvtDeviceAdd\n");
> > but NO message shows on DebugView- $Bp,i6Ho0zMQJ8;z(B -
>
> - $Bp}<(Ho0zMQJ8;z(B -

Dear Peter:

It works well.
Thanks for your kindly help.