revised direct sound capture patches

Robert Reif reif at earthlink.net
Mon Feb 10 20:30:55 CST 2003


Yes it's correct as is but I made the change to prevent possible
problems if the name changes here or when it's cut and pasted
into another driver.  Just trying to prevent a possible future bug.

Dmitry Timoshkov wrote:

> "Robert Reif" <reif at earthlink.net> wrote:
>
> > wineoss.diff starts to add support for a real direct sound capture
> > driver. It also
> > changes the capture fragment size but this still  needs tuning for best
> > performance.
>
> > @@ -534,11 +536,11 @@
> > #ifdef EMULATE_SB16
> > ossdev->in_caps.wMid = 0x0002;
> > ossdev->in_caps.wPid = 0x0004;
> > - strcpy(ossdev->in_caps.szPname, "SB16 Wave In");
> > + strncpy(ossdev->in_caps.szPname, "SB16 Wave In",MAXPNAMELEN-1);
> > #else
> > ossdev->in_caps.wMid = 0x00FF; /* Manufac ID */
> > ossdev->in_caps.wPid = 0x0001; /* Product ID */
> > - strcpy(ossdev->in_caps.szPname, "OpenSoundSystem WAVIN Driver");
> > + strncpy(ossdev->in_caps.szPname, "OpenSoundSystem WAVIN Driver",MAXPNAMELEN-1);
>
> Why do you need these changes? MAXPNAMELEN in include/mmsystem.h is defined as
> #define MAXPNAMELEN      32     /* max product name length (including NULL) */
>
> so it's perfectly correct to use strcpy here.
>
> --
> Dmitry.




More information about the wine-devel mailing list