Printing wide characters in coinstaller

I’ve tried every defined and documented method of trying to print a wide
character string from within my CoInstaller DLL. Has anyone successfully
printed a debug string containing a wide character string and if so what
format specification worked?

“Del Fredricks” wrote in message
news:xxxxx@ntdev…
>
> I’ve tried every defined and documented method of trying to print a wide
> character string from within my CoInstaller DLL. Has anyone successfully
> printed a debug string containing a wide character string and if so what
> format specification worked?

Try this, it’s a clip from a DriverEntry I use:
// arg2 is a pointer to the Registry Path, (PUNICODE_STRING)

DriverEntry ( PVOID arg1, PVOID arg2 )

{ // DriverEntry

DbgPrint ( DRIVERNAME " Driver Object = %X\n"

" Registry Path = %S\n", arg1, arg2 );

%ls.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marc Reinig
Sent: Thursday, January 02, 2003 7:26 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Printing wide characters in coinstaller

“Del Fredricks” wrote in message
news:xxxxx@ntdev…
>
> I’ve tried every defined and documented method of trying to print a
> wide character string from within my CoInstaller DLL. Has anyone
> successfully printed a debug string containing a wide character string

> and if so what format specification worked?

Try this, it’s a clip from a DriverEntry I use:
// arg2 is a pointer to the Registry Path, (PUNICODE_STRING)

DriverEntry ( PVOID arg1, PVOID arg2 )

{ // DriverEntry

DbgPrint ( DRIVERNAME " Driver Object = %X\n"

" Registry Path = %S\n", arg1, arg2 );


You are currently subscribed to ntdev as: xxxxx@dchbk.us
To unsubscribe send a blank email to xxxxx@lists.osr.com

Please re-read my post, I am not talking about the driver.

The “%ws” for wide character strings or “%wZ” for UNICODE strings works just
fine in kernel mode debug. It’s the CoInstaller DLL running in user mode
providing property page support for the Device Manager which does not appear
to properly accept any of the wide character format specifications for debug
output.

“Marc Reinig” wrote in message news:xxxxx@ntdev…
>
>
> “Del Fredricks” wrote in message
> news:xxxxx@ntdev…
> >
> > I’ve tried every defined and documented method of trying to print a wide
> > character string from within my CoInstaller DLL. Has anyone
successfully
> > printed a debug string containing a wide character string and if so what
> > format specification worked?
>
> Try this, it’s a clip from a DriverEntry I use:
> // arg2 is a pointer to the Registry Path, (PUNICODE_STRING)
>
> DriverEntry ( PVOID arg1, PVOID arg2 )
>
> { // DriverEntry
>
> DbgPrint ( DRIVERNAME " Driver Object = %X\n"
>
> " Registry Path = %S\n", arg1, arg2 );
>
>
>
>
>
>
>
>

Nope, none of the format specifications “%ws”, “%ls”, or “%wZ” work in the
CoInstaller, all I get is garbage from the debug snapshot. If I set a
breakpoint there I can verify that the string is there and properly set to
show what I want to see, it’s just that the debug print mucks it up.
Perhaps it’s a bug in the beta DDK’s compiler that it can not generate
usermode code to properly output the strings.

“benson” wrote in message news:xxxxx@ntdev…
>
> %ls.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Marc Reinig
> Sent: Thursday, January 02, 2003 7:26 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Printing wide characters in coinstaller
>
>
>
> “Del Fredricks” wrote in message
> news:xxxxx@ntdev…
> >
> > I’ve tried every defined and documented method of trying to print a
> > wide character string from within my CoInstaller DLL. Has anyone
> > successfully printed a debug string containing a wide character string
>
> > and if so what format specification worked?
>
> Try this, it’s a clip from a DriverEntry I use:
> // arg2 is a pointer to the Registry Path, (PUNICODE_STRING)
>
> DriverEntry ( PVOID arg1, PVOID arg2 )
>
> { // DriverEntry
>
> DbgPrint ( DRIVERNAME " Driver Object = %X\n"
>
> " Registry Path = %S\n", arg1, arg2 );
>
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@dchbk.us
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>

CoInstallers and Property Pages Providers obey the Win32 API rules.
Try “OutputDebugStringA ( mb_string )” and “OutputDebugStringW ( wc_string )”.

Part of the documentation says :
"OutputDebugString does not support the variable arguments… "

----- Original Message -----
From: “Del Fredricks”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Friday, January 03, 2003 5:19 PM
Subject: [ntdev] Re: Printing wide characters in coinstaller

> Nope, none of the format specifications “%ws”, “%ls”, or “%wZ” work in the
> CoInstaller, all I get is garbage from the debug snapshot. If I set a
> breakpoint there I can verify that the string is there and properly set to
> show what I want to see, it’s just that the debug print mucks it up.
> Perhaps it’s a bug in the beta DDK’s compiler that it can not generate
> usermode code to properly output the strings.
>
> “benson” wrote in message news:xxxxx@ntdev…
> >
> > %ls.
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Marc Reinig
> > Sent: Thursday, January 02, 2003 7:26 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Printing wide characters in coinstaller
> >
> >
> >
> > “Del Fredricks” wrote in message
> > news:xxxxx@ntdev…
> > >
> > > I’ve tried every defined and documented method of trying to print a
> > > wide character string from within my CoInstaller DLL. Has anyone
> > > successfully printed a debug string containing a wide character string
> >
> > > and if so what format specification worked?
> >
> > Try this, it’s a clip from a DriverEntry I use:
> > // arg2 is a pointer to the Registry Path, (PUNICODE_STRING)
> >
> > DriverEntry ( PVOID arg1, PVOID arg2 )
> >
> > { // DriverEntry
> >
> > DbgPrint ( DRIVERNAME " Driver Object = %X\n"
> >
> > " Registry Path = %S\n", arg1, arg2 );
> >
> >
> >
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@dchbk.us
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

OutputDebugString is linked to OutputDebugStringW when UNICODE strings are used.

Also, my code does convert the variable string to a literal string. This literal string is then passed as the actual argument to OutputDebugString, thus conforming to the documentation.
“Christiaan Ghijselinck” wrote in message news:xxxxx@ntdev…

CoInstallers and Property Pages Providers obey the Win32 API rules.
Try “OutputDebugStringA ( mb_string )” and “OutputDebugStringW ( wc_string )”.

Part of the documentation says :
"OutputDebugString does not support the variable arguments… "