Sends a string to the debugger for display.
void WINAPI OutputDebugString( __in_opt LPCTSTR lpOutputString );
The null-terminated string to be displayed.
This function does not return a value.
If the application has no debugger, the system debugger displays the string if the filter mask allows it. (Note that this function calls the DbgPrint function to display the string. For details on how the filter mask controls what the system debugger displays, see the DbgPrint function in the Windows Driver Kit on MSDN.) If the application has no debugger and the system debugger is not active, OutputDebugString does nothing.
Prior to Windows Vista: The system debugger does not filter content.
OutputDebugStringW converts the specified string based on the current system locale information and passes it to OutputDebugStringA to be displayed. As a result, some Unicode characters may not be displayed correctly.
Applications should send very minimal debug output and provide a way for the user to enable or disable its use. To provide more detailed tracing, see Event Tracing.
Declared in Winbase.h; include Windows.h.
Use Kernel32.lib.
Requires Kernel32.dll.
Implemented as OutputDebugStringW (Unicode) and OutputDebugStringA (ANSI).
Communicating with the DebuggerDebugging Functions
Send comments about this topic to Microsoft
Build date: 1/10/2008
OutputDebugString() doesn't seem to work on Vista 64-bit .
Is there a variant for Vista x64 that works similar to the Win32 OutputDebugString()?
I want to use the DebugView 4.64 to capture debug output on Vista x64 .
OK. GOT IT.!!
This is the SOLUTION:
In DebugView 4.64 , make sure that Capture Global Win32 is enabled. To do this, in the DebugView 4.64 main menu go to Capture and see if the Capture Global Win32 item is checked. If not, check it.
Upon doing this, you'll notice that OutputDebugString() output appears in DebugView 4.64 on Vista x64 . :)
The same problem is on Windows 2003 SP1 and R2 and it can be fixed in the same manner, this comment would be useful also for the .net developers (see System.Diagnostics Debug and Trace classes).
I connected Vista as Debuggee to WinDbg(6.6.7.5) bya 1394 and serial.
Connection was successful, But WinDbg does not display OutputDebugString from Debug Mode Vista.
It worked well on Windows XP. What is difference from XP Debug Mode and Visa Debug Mode?
[Answer]
In Vista, certain registry setting is required for Debug String Output.
HKLM\SYSTEM\CCS\Control\Session Manager\Debug Print Filter
Refer to below.
http://www.osronline.com/article.cfm?article=295
For implementation details, see also:
http://www.unixwiz.net/techtips/outputdebugstring.html
Brief summary: one global mutex serialising access, a 4KB shared memory buffer for the string, and a couple of events to signal who "owns" the buffer (reader or writer).