debugging message

hii … I am building my umd driver taking r200 umd sample driver as base. but due to some problem I am not able to load it. So I want to write debugging message at various point in the code so that I can trace the problem. Message Box is not applicable in UMD so how can I write debuggimg message in the code means by which command and by using which library.
thanx
Prashant

Dear Prashant, Team,

I just gave a glance to R200 and found that the output is a dynamic link library.

If you are installing this dll and the corresponding driver related files using the Found New Hardware wizard, instead of keeping debugging messages, one can directly debug the code using Visual Studio IDE.

Recently I debugged a USB UMDF driver using Visual Studio.

What is the OS and how you are loading the driver. If you provide more details, the necessary steps to debug the driver dll can be obtained easily.

Regards.

thanx Uday for reply … you are right the output is dynamic link library. Actually I am loading in vista OS. Its been called by called by dispaly miniport driver and than Direct3d runtime loads this dll. But due to some problem loading ie being failed. thats why I want to wite debuggging message.

regards

The basic answer is OutputDebugString()

void WINAPI OutputDebugString(LPCTSTR lpOutputString);

[http://msdn2.microsoft.com/en-us/library/aa363362.aspx]

Personally, I wonder why a WDK sample has no trace statements.

Video is not by a long shot my thing, so I am assuming that this is a
user mode display driver will not pose any problems with OutputDebugString.

This will write lpOutputString to the system debugger, unless a user
mode debugger is present, in which case it will go there. In practice,
the user mode debugger will be either WinDbg or Visual Studio, and the
system debugger will be WinDbg/Kd. If all you are looking for is debug
output, then I would probably use DebugView, as it catches both user
mode and kernel mode trace statements, and is more configurable when it
comes to trace output, but this is all that it does.

[http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx]

In practice, you’ll probably want to create your own function to call
instead of OutputDebugString, one that takes a variable number of
arguments, so that it may be used more like printf(). Also, you
definitely will want to call a macro that expands to a call to your
function/OutputDebugString only when _DEBUG is defined, rather than
calling your function/OutputDebugString directly. This is so that only
CHECKED builds of this dll will produce debug output. Something like this:

int PrintU(const char * Spec, …);

#ifdef _DEBUG
#define UDPRINT(X) PrintU##X
#else
#define UDPRINT(X)
#endif

Good luck,

mm

xxxxx@gmail.com wrote:

thanx Uday for reply … you are right the output is dynamic link library. Actually I am loading in vista OS. Its been called by called by dispaly miniport driver and than Direct3d runtime loads this dll. But due to some problem
loading ie being failed. thats why I want to wite debuggging message.

regards

Thanks MM.

Yes. DebugView is the best option.

You can also give a try to the following:

Using Visual Studio, Keep a break point at DLLMain routine in d3dumode.cpp file.

Enable the user mode debugging key by setting the following value to some number in the registry

HKLM-Software-Microsoft-WindowsNT-Current Version-WUDF-Services-{193a1820…}-HostProcessDbgBreakOnStart

You need to attach the dll calling process to Visual Studio. But I am not familiar with this Direct3d runtime. Is it an executable or some system process.

Regards.

I found that Direct3D is 3D API for rendering three dimensional graphics in the application. In such case it should be our application which is loading the DLL.

So we need to attach application as a process in order to debug from DLLMain function.

Regards.

Thanks uday, i will try as you mentioned