DebugView Can't work at Vista?

Discussion in 'Windows Vista Drivers' started by bluestar, Mar 13, 2008.

  1. bluestar

    bluestar Guest

    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
     
    bluestar, Mar 13, 2008
    #1
    1. Advertisements

  2. bluestar

    Peter Guest

    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!
     
    Peter, Mar 13, 2008
    #2
    1. Advertisements

  3. bluestar

    bluestar Guest

    Dear Peter:

    It works well.
    Thanks for your kindly help.
     
    bluestar, Mar 14, 2008
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.