[wdmaudiodev] Re: How to concatenate a number to PWCHAR string whichis used by InstallSubDevice()

  • From: Matt Gonzalez <matt@xxxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 21 Apr 2004 07:51:39 -0700

What I've found is that Windows seems to keep the pointer you pass to it in InstallSubdevice; using a temp pointer and printing to it may get you in trouble. I had all kinds of random blue screens until I figured this out.

I ended up using an array of strings that exist for the life of the driver.

If you need string functions, then the 2003 Server DDK has a set of new, safe string handling functions that prevent buffer overflows. Here's the link:

http://www.osr.com/ddk/kmarch/other_4tgn.htm

Matt


Eshanye.K.P wrote:


Hi,

I want to concatenate a number to a PWCHAR string. Like Wave1, Wave2
etc.
The string available for me is an initialized PWCHAR. What is the
function in kernel, I can use to concatenate a number to this PWCHAR ?
If such a function is not available then, is there any way I can
implement this. I have to pass a PWCHAR to the function
InstallSubdevice() which has PWCHAR Name as one of the parameters.
Currently, I'm doing like :-

PWCHAR tecmpstr = L"Wave1";
InstallSubdevice(....,...., tempstr,....);

But the tempstr keeps changing depending on some index which should be
concatenated with the name. There are no functions in ddk to convert an
integer to wide character also to concatenate wide characters. How do I
achieve  this ?

Regards
Esha

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/




******************


WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/

Other related posts:

  • » [wdmaudiodev] Re: How to concatenate a number to PWCHAR string whichis used by InstallSubDevice()