Try %S ( capital s ), but it should be documented in ddk doc.
Here it is -
DbgPrint
In Microsoft Windows Server 2003 and earlier versions of Windows, the
DbgPrint routine sends a message to the kernel debugger. In Windows Vista
and later versions of Windows, DbgPrint sends a message only if certain
conditions apply.
ULONG
DbgPrint(
IN PCHAR Format,
. . . . [arguments]
);
Parameters
Format
Specifies a pointer to the format string to print. The Format string
supports all the printf-style formatting codes. However, the Unicode format
codes (%C, %S, %lc, %ls, %wc, %ws, and %wZ) can only be used with IRQL =
PASSIVE_LEVEL.
arguments
Specifies arguments for the format string, as in printf.
Return Value
If successful, DbgPrint returns the NTSTATUS code STATUS_SUCCESS; otherwise
it returns the appropriate error code.
Headers
This routine is defined in ntddk.h, wdm.h, and ndis.h. Include ntddk.h,
wdm.h, or ndis.h.
Comments
This routine can only be used in Microsoft Windows 2000 and later.
DbgPrint and DbgPrintEx can be called at IRQL<=DIRQL. However, Unicode
format codes (%wc and %ws) can be used only at IRQL PASSIVE_LEVEL. Also,
because the debugger uses interprocess interrupts (IPIs) to communicate with
other processors, calling DbgPrint at IRQL>DIRQL can cause deadlocks.
Only kernel-mode drivers can call the DbgPrint routine.
In Windows Vista and later versions of Windows, DbgPrint sends a message
only if certain conditions apply. Specifically, it behaves like the
DbgPrintEx routine with the DEFAULT component and a message importance level
of DPFLTR_INFO_LEVEL. In other words, the following two function calls are
identical:
DbgPrint ( Format, arguments )
DbgPrintEx ( DPFLTR_DEFAULT_ID, DPFLTR_INFO_LEVEL, Format, arguments )
For more information about message filtering, components, and message
importance level, see Reading and Filtering Debugging Messages.
Note Regardless of which version of Windows you are using, it is
recommended that you use DbgPrintEx instead of DbgPrint, since this allows
you to control the conditions under which the message is sent.
Unless it is absolutely necessary, you should not obtain a string from user
input or another process and pass it to DbgPrint. If you do use a string
that you did not create, you must verify that this is a valid format string,
and that the format codes match the argument list in type and quantity. The
best coding practice is for all Format strings to be static and defined at
compile time.
There is no upper limit to the size of the Format string or the number of
arguments. However, any single call to DbgPrint will only transmit 512 bytes
of information. There is also a limit to the size of the DbgPrint buffer.
See The DbgPrint Buffer and the Debugger for details.
See Also
DbgPrintEx, KdPrint, KdPrintEx
----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Thursday, November 22, 2007 7:27 AM
Subject: RE:[ntfsd] Get target file name from a rename operation
>I meant if I want to print the name which is WCHAR, how can print it?
> DbgPrint(“The Target File Name Is: %s”, &FileRenameInfo->FileName);
> doesn’t work.
>
> %s doesn’t show it.
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com