How to print user mode driver debug print in WinDBG.

Hi All,

I am writing kernal mode as well as user mode driver for windows 7 .I am getting the kernal mode driver print messages in WinDbg but i am not getting user mode driver.
i am using OutputDebugStringA function in user mode driver.

what would be the reason for this?.

Thanks in advance,
Santosh

xxxxx@rediffmail.com wrote:

Hi All,

I am writing kernal mode as well as user mode driver for windows 7 .I am getting the kernal mode driver print messages in WinDbg but i am not getting user mode driver.
i am using OutputDebugStringA function in user mode driver.

what would be the reason for this?.

Thanks in advance,
Santosh

You can call vDbgPrintExWithPrefix or DbgPrintEx in usermode, like this:

ULONG ( __stdcall *f_vDbgPrintExWithPrefix)(IN PCCH pref, ULONG
ComponentId, ULONG Level, PCCH Fmt, va_list arglist) = 0;


HMODULE hm = GetModuleHandle(“ntdll.dll”);

*(PVOID*)f_vDbgPrintExWithPrefix =
GetProcAddress( hm, “vDbgPrintExWithPrefix” );

ULONG
__cdecl
DbgPrintExWithPrefix(
IN PCCH pref, ULONG ComponentId, ULONG Level, PCCH Fmt, …)
{
ULONG n;
va_list arglist;
va_start( arglist, Fmt );
n = f_vDbgPrintExWithPrefix( pref, ComponentId, Level, Fmt, arglist );
va_end( arglist );
return n;
}

– pa

Hi Pavel,

Thanks a lot for information.I will try it today and let you know the result.

Santosh

Hi Pavel,

I tried by using the above code still i am not able to get the usermode driver print.
I have created a reg entry under CCR\Session manager for debug filttering (set to 0xFFFFFFF).
I tried with OutPutDebugPrint(Text(“…”)); function also.
still not able to get the user mode display driver print in the windbg for windows 7.
Should i need to do anyother setting in registry or i need to use any command in WinDbg.

Thanks in advance,
Santosh

(2nd attempt - the previous reply got lost somehow)

On win7 RC, the vDbgPrintExWithPrefix from usermode to windbg
works fine for me.
But could not make it to show up in dbgview.

Regards,
– PA

wrote in message news:xxxxx@windbg…
> Hi Pavel,
>
>
> I tried by using the above code still i am not able to get the usermode
> driver print.
> I have created a reg entry under CCR\Session manager for debug filttering
> (set to 0xFFFFFFF).
> I tried with OutPutDebugPrint(Text(“…”)); function also.
> still not able to get the user mode display driver print in the windbg for
> windows 7.
> Should i need to do anyother setting in registry or i need to use any
> command in WinDbg.
>
> Thanks in advance,
> Santosh
>

Have u checked with cmd “DbgPrint” in WinDbg on host machine.

On Sun, May 24, 2009 at 2:43 AM, Pavel A. wrote:

> (2nd attempt - the previous reply got lost somehow)
>
> On win7 RC, the vDbgPrintExWithPrefix from usermode to windbg
> works fine for me.
> But could not make it to show up in dbgview.
>
> Regards,
> – PA
>
> wrote in message news:xxxxx@windbg…
>
>> Hi Pavel,
>>
>>
>> I tried by using the above code still i am not able to get the usermode
>> driver print.
>> I have created a reg entry under CCR\Session manager for debug filttering
>> (set to 0xFFFFFFF).
>> I tried with OutPutDebugPrint(Text(“…”)); function also.
>> still not able to get the user mode display driver print in the windbg for
>> windows 7.
>> Should i need to do anyother setting in registry or i need to use any
>> command in WinDbg.
>>
>> Thanks in advance,
>> Santosh
>>
>>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>



With Best Regards
Vijay Kumar

Pavel and Vijay,

Thanks for response.The issue is that user mode driver is not loading.Once it get loaded ,hopefully i will get the debug print.