The DDK documentation states DbgPrint() is much like printf which is a
standard C library function. However, printf doesn't define such
format specifiers as %ws and %wZ. I know how to use these format
specifiers, but I can't find any definitive specification for them.

Where to find them? Thanks for any comments.

Re: Where can I find the definitive specification of DbgPrint()? by Don

Don
Wed Aug 22 13:18:27 CDT 2007

I do not believe there is such a specification Z is the only format type
that is not defined for printf, and it indicates counted strings (ANSI or
UNICODE). The other one most people encounter is the size specifiers: I,
I32, I64 where I is pointer size ints, I32 is 32 bit, and I64 is 64 bit.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"xmllmx" <xmllmx@gmail.com> wrote in message
news:1187806055.183760.274640@z24g2000prh.googlegroups.com...
> The DDK documentation states DbgPrint() is much like printf which is a
> standard C library function. However, printf doesn't define such
> format specifiers as %ws and %wZ. I know how to use these format
> specifiers, but I can't find any definitive specification for them.
>
> Where to find them? Thanks for any comments.
>



Re: Where can I find the definitive specification of DbgPrint()? by xmllmx

xmllmx
Wed Aug 22 13:37:56 CDT 2007

Besides %Z, I also can't find the format type %ws in the printf
definition.
(Though %s is defined)

For example, does %ws differ from %wS?


Re: Where can I find the definitive specification of DbgPrint()? by Don

Don
Wed Aug 22 13:42:56 CDT 2007

%wS is redundant since %S is for Unicode null terminated strings, %ws is
equivalant to %S.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"xmllmx" <xmllmx@gmail.com> wrote in message
news:1187807876.931666.87860@i38g2000prf.googlegroups.com...
> Besides %Z, I also can't find the format type %ws in the printf
> definition.
> (Though %s is defined)
>
> For example, does %ws differ from %wS?
>



Re: Where can I find the definitive specification of DbgPrint()? by xmllmx

xmllmx
Wed Aug 22 13:50:25 CDT 2007

However, the definition of printf doesn't say %ws is equivalent to %S.
Where can I find such a statement?


Re: Where can I find the definitive specification of DbgPrint()? by Skywing

Skywing
Wed Aug 22 13:52:36 CDT 2007

As an aside, the Microsoft printf implementation (much like DbgPrint) allows
you to use %Z / %wZ, though these are nonstandard. You can see how this
works by examining the printf source code included with Visual C++.

--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
"xmllmx" <xmllmx@gmail.com> wrote in message
news:1187807876.931666.87860@i38g2000prf.googlegroups.com...
> Besides %Z, I also can't find the format type %ws in the printf
> definition.
> (Though %s is defined)
>
> For example, does %ws differ from %wS?
>


Re: Where can I find the definitive specification of DbgPrint()? by Skywing

Skywing
Wed Aug 22 13:54:28 CDT 2007

Actually, that's incorrect. %S inverts the "wide-ness" of a string in
format strings. When used with "printf", "%S" means "unicode string" (e.g.
wchar_t*). When used with "wprintf", "%S" means "8-bit character string"
(e.g. char*).

--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:ueMyNxO5HHA.4164@TK2MSFTNGP04.phx.gbl...
> %wS is redundant since %S is for Unicode null terminated strings, %ws is
> equivalant to %S.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
> "xmllmx" <xmllmx@gmail.com> wrote in message
> news:1187807876.931666.87860@i38g2000prf.googlegroups.com...
>> Besides %Z, I also can't find the format type %ws in the printf
>> definition.
>> (Though %s is defined)
>>
>> For example, does %ws differ from %wS?
>>
>
>


Re: Where can I find the definitive specification of DbgPrint()? by xmllmx

xmllmx
Wed Aug 22 14:02:14 CDT 2007

Dear all,

Could you tell me whether the following equations are tenable or not?

%C = %wc

%S = %ws

%c = %lc

%s = %ls

I think the 'w' is not a standard format type, am I right?


Re: Where can I find the definitive specification of DbgPrint()? by Don

Don
Wed Aug 22 14:00:24 CDT 2007

And since DbgPrint uses sprintf underneath, my statement about redundancy
still stands.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Skywing [MVP]" <skywing_NO_SPAM_@valhallalegends.com> wrote in message
news:OwHMf3O5HHA.5796@TK2MSFTNGP05.phx.gbl...
> Actually, that's incorrect. %S inverts the "wide-ness" of a string in
> format strings. When used with "printf", "%S" means "unicode string"
> (e.g. wchar_t*). When used with "wprintf", "%S" means "8-bit character
> string" (e.g. char*).
>
> --
> Ken Johnson (Skywing)
> Windows SDK MVP
> http://www.nynaeve.net
> "Don Burn" <burn@stopspam.windrvr.com> wrote in message
> news:ueMyNxO5HHA.4164@TK2MSFTNGP04.phx.gbl...
>> %wS is redundant since %S is for Unicode null terminated strings, %ws is
>> equivalant to %S.
>>
>>
>> --
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>> Remove StopSpam to reply
>>
>> "xmllmx" <xmllmx@gmail.com> wrote in message
>> news:1187807876.931666.87860@i38g2000prf.googlegroups.com...
>>> Besides %Z, I also can't find the format type %ws in the printf
>>> definition.
>>> (Though %s is defined)
>>>
>>> For example, does %ws differ from %wS?
>>>
>>
>>
>



Re: Where can I find the definitive specification of DbgPrint()? by Maxim

Maxim
Wed Aug 22 19:09:46 CDT 2007

I only use KdPrint

%p is pointer, 32/64bit portable, a very good format spec
%ws and %wZ are PANSI_STRING and PUNICODE_STRING

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"xmllmx" <xmllmx@gmail.com> wrote in message
news:1187806055.183760.274640@z24g2000prh.googlegroups.com...
> The DDK documentation states DbgPrint() is much like printf which is a
> standard C library function. However, printf doesn't define such
> format specifiers as %ws and %wZ. I know how to use these format
> specifiers, but I can't find any definitive specification for them.
>
> Where to find them? Thanks for any comments.
>