none
Debugging V4 Printer Driver Render Filter. RRS feed

  • Question

  • Hi all,

    I am trying to create a sample v4 printer driver using the v4 printer driver template in visual studio.I have followed the steps mentioned in following link:-

    https://docs.microsoft.com/en-us/windows-hardware/drivers/print/building-a-basic-v4-printer-driver

    Except Last two steps i.e:-

    1)Configure the driver solution for debugging and deployment(I am doing manual installation)
    2)Configure Driver Signing(I have disabled driver signature enforcement)

    I was able to successfully build it and manually install the driver on win10 32 bit PC.

    I have added some debug messages using OutputDebugString in DllGetClassObject function of v4 render filter project.

    When i am giving print job the print job is added and immediately removed from spooler but i was unable to see any debug messages in DbgView.

    Any one has any idea why i was not able to see the logs?

    Can i use OutputDebugString in render to collect the log or there is some other method for this?

    Note:I am running DbgView as administrator and also i have enabled all the captures. 

    Any help will be appreciated.

    Regards,

    Prakhar


    Wednesday, July 4, 2018 10:52 AM

Answers

  • Are you building by any chance with 'Multi-threaded Debug DLL (/MDd)'?
    Then your second box may miss the debug C++ runtime libraries.
    Would try 'Multi-threaded Debug (/MTd)'.
    By the way, looks like the project is prepared for 'WPP Tracing e.g.:
    DoTraceMessage(RENDERFILTER_TRACE_INFO, L"Instantiating class factory");

    To get output, you may probably want to start a Traceview session:


    With kind regards


    Friday, July 6, 2018 7:39 AM

All replies

  • Are you able to debug v4-filter with windbg (user-mode) following
    https://docs.microsoft.com/en-us/windows-hardware/drivers/print/debugging-xpsdrv-printer-drivers

    With kind regards


    Wednesday, July 4, 2018 6:21 PM
  • Hi,

    Thanks for the reply.I installed same installer package on two different PC with different environment and i found different results for both.Following are the scenario:-

    1)Win 10 64 bit PC with visual studio 2015,SDk and WDK installed.

    On giving print job I was able to debug using visual studio as well as using windbg and also there was debug messages in DbgView.

    2)Win 10 64 bit PC with visual studio 2015,SDk and WDK not installed.

    On giving print job obviously i can't debug using visual studio or windbg but i added debug messages in the render function so there should be debug message in Dbgview but i found no messages in dbgview.

    I am not getting why there is different behavior?

    Why there is no debug messages on PC where i haven't installed VS,wdk and sdk?

    Note:I am running DbgView as administrator and also i have enabled all the captures. 

    Any help will be appreciated.

    Regards,

    Prakhar


    Friday, July 6, 2018 5:35 AM
  • Are you building by any chance with 'Multi-threaded Debug DLL (/MDd)'?
    Then your second box may miss the debug C++ runtime libraries.
    Would try 'Multi-threaded Debug (/MTd)'.
    By the way, looks like the project is prepared for 'WPP Tracing e.g.:
    DoTraceMessage(RENDERFILTER_TRACE_INFO, L"Instantiating class factory");

    To get output, you may probably want to start a Traceview session:


    With kind regards


    Friday, July 6, 2018 7:39 AM
  • Hi,

    Thanks for the reply.

    I am able to use trace view session and see the logs.

    Regards.

    Prakhar

    Friday, July 6, 2018 10:42 AM