Commit a9bf3813 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

wineoss.drv: Use CP_UNIXCP instead of CP_ACP for converting strings that come…

wineoss.drv: Use CP_UNIXCP instead of CP_ACP for converting strings that come from system library functions or system headers.
parent 466b682d
...@@ -183,17 +183,17 @@ static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1) ...@@ -183,17 +183,17 @@ static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{ {
TRACE("(%u, %p)\n", wDevID, dwParam1); TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].ossdev.interface_name, -1, *dwParam1 = MultiByteToWideChar(CP_UNIXCP, 0, WOutDev[wDevID].ossdev.interface_name, -1,
NULL, 0 ) * sizeof(WCHAR); NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{ {
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].ossdev.interface_name, -1, if (dwParam2 >= MultiByteToWideChar(CP_UNIXCP, 0, WOutDev[wDevID].ossdev.interface_name, -1,
NULL, 0 ) * sizeof(WCHAR)) NULL, 0 ) * sizeof(WCHAR))
{ {
MultiByteToWideChar(CP_ACP, 0, WOutDev[wDevID].ossdev.interface_name, -1, MultiByteToWideChar(CP_UNIXCP, 0, WOutDev[wDevID].ossdev.interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR)); dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
...@@ -205,17 +205,17 @@ static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1) ...@@ -205,17 +205,17 @@ static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1)
{ {
TRACE("(%u, %p)\n", wDevID, dwParam1); TRACE("(%u, %p)\n", wDevID, dwParam1);
*dwParam1 = MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].ossdev.interface_name, -1, *dwParam1 = MultiByteToWideChar(CP_UNIXCP, 0, WInDev[wDevID].ossdev.interface_name, -1,
NULL, 0 ) * sizeof(WCHAR); NULL, 0 ) * sizeof(WCHAR);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
{ {
if (dwParam2 >= MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].ossdev.interface_name, -1, if (dwParam2 >= MultiByteToWideChar(CP_UNIXCP, 0, WInDev[wDevID].ossdev.interface_name, -1,
NULL, 0 ) * sizeof(WCHAR)) NULL, 0 ) * sizeof(WCHAR))
{ {
MultiByteToWideChar(CP_ACP, 0, WInDev[wDevID].ossdev.interface_name, -1, MultiByteToWideChar(CP_UNIXCP, 0, WInDev[wDevID].ossdev.interface_name, -1,
dwParam1, dwParam2 / sizeof(WCHAR)); dwParam1, dwParam2 / sizeof(WCHAR));
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
...@@ -720,7 +720,7 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev) ...@@ -720,7 +720,7 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev)
if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) { if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) {
lstrcpynA(ossdev->ds_desc.szDesc, info.name, sizeof(info.name)); lstrcpynA(ossdev->ds_desc.szDesc, info.name, sizeof(info.name));
strcpy(ossdev->ds_desc.szDrvname, "wineoss.drv"); strcpy(ossdev->ds_desc.szDrvname, "wineoss.drv");
MultiByteToWideChar(CP_ACP, 0, info.name, sizeof(info.name), MultiByteToWideChar(CP_UNIXCP, 0, info.name, sizeof(info.name),
ossdev->out_caps.szPname, ossdev->out_caps.szPname,
sizeof(ossdev->out_caps.szPname) / sizeof(WCHAR)); sizeof(ossdev->out_caps.szPname) / sizeof(WCHAR));
TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc); TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc);
...@@ -741,7 +741,7 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev) ...@@ -741,7 +741,7 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev)
if (ioctl(mixer, SOUND_MIXER_INFO, &info) >= 0) { if (ioctl(mixer, SOUND_MIXER_INFO, &info) >= 0) {
lstrcpynA(ossdev->ds_desc.szDesc, info.name, sizeof(info.name)); lstrcpynA(ossdev->ds_desc.szDesc, info.name, sizeof(info.name));
strcpy(ossdev->ds_desc.szDrvname, "wineoss.drv"); strcpy(ossdev->ds_desc.szDrvname, "wineoss.drv");
MultiByteToWideChar(CP_ACP, 0, info.name, sizeof(info.name), MultiByteToWideChar(CP_UNIXCP, 0, info.name, sizeof(info.name),
ossdev->out_caps.szPname, ossdev->out_caps.szPname,
sizeof(ossdev->out_caps.szPname) / sizeof(WCHAR)); sizeof(ossdev->out_caps.szPname) / sizeof(WCHAR));
TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc); TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc);
...@@ -893,7 +893,7 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev) ...@@ -893,7 +893,7 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev)
oss_mixerinfo info; oss_mixerinfo info;
info.dev = 0; info.dev = 0;
if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) { if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) {
MultiByteToWideChar(CP_ACP, 0, info.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, info.name, -1,
ossdev->in_caps.szPname, ossdev->in_caps.szPname,
sizeof(ossdev->in_caps.szPname) / sizeof(WCHAR)); sizeof(ossdev->in_caps.szPname) / sizeof(WCHAR));
TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc); TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc);
...@@ -911,7 +911,7 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev) ...@@ -911,7 +911,7 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev)
if ((mixer = open(ossdev->mixer_name, O_RDONLY|O_NDELAY)) >= 0) { if ((mixer = open(ossdev->mixer_name, O_RDONLY|O_NDELAY)) >= 0) {
mixer_info info; mixer_info info;
if (ioctl(mixer, SOUND_MIXER_INFO, &info) >= 0) { if (ioctl(mixer, SOUND_MIXER_INFO, &info) >= 0) {
MultiByteToWideChar(CP_ACP, 0, info.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, info.name, -1,
ossdev->in_caps.szPname, ossdev->in_caps.szPname,
sizeof(ossdev->in_caps.szPname) / sizeof(WCHAR)); sizeof(ossdev->in_caps.szPname) / sizeof(WCHAR));
TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc); TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc);
......
...@@ -239,7 +239,7 @@ LRESULT OSS_MidiInit(void) ...@@ -239,7 +239,7 @@ LRESULT OSS_MidiInit(void)
MidiOutDev[i].caps.wNotes = 16; MidiOutDev[i].caps.wNotes = 16;
MidiOutDev[i].bEnabled = FALSE; MidiOutDev[i].bEnabled = FALSE;
} else { } else {
MultiByteToWideChar( CP_ACP, 0, sinfo.name, -1, MultiByteToWideChar( CP_UNIXCP, 0, sinfo.name, -1,
MidiOutDev[i].caps.szPname, MidiOutDev[i].caps.szPname,
sizeof(MidiOutDev[i].caps.szPname)/sizeof(WCHAR) ); sizeof(MidiOutDev[i].caps.szPname)/sizeof(WCHAR) );
...@@ -313,7 +313,7 @@ LRESULT OSS_MidiInit(void) ...@@ -313,7 +313,7 @@ LRESULT OSS_MidiInit(void)
wsprintfW(MidiOutDev[numsynthdevs + i].caps.szPname, fmt, numsynthdevs + i); wsprintfW(MidiOutDev[numsynthdevs + i].caps.szPname, fmt, numsynthdevs + i);
MidiOutDev[numsynthdevs + i].bEnabled = FALSE; MidiOutDev[numsynthdevs + i].bEnabled = FALSE;
} else { } else {
MultiByteToWideChar(CP_ACP, 0, minfo.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1,
MidiOutDev[numsynthdevs + i].caps.szPname, MidiOutDev[numsynthdevs + i].caps.szPname,
sizeof(MidiOutDev[numsynthdevs + i].caps.szPname) / sizeof(WCHAR)); sizeof(MidiOutDev[numsynthdevs + i].caps.szPname) / sizeof(WCHAR));
MidiOutDev[numsynthdevs + i].bEnabled = TRUE; MidiOutDev[numsynthdevs + i].bEnabled = TRUE;
...@@ -344,7 +344,7 @@ LRESULT OSS_MidiInit(void) ...@@ -344,7 +344,7 @@ LRESULT OSS_MidiInit(void)
wsprintfW(MidiInDev[i].caps.szPname, fmt, numsynthdevs + i); wsprintfW(MidiInDev[i].caps.szPname, fmt, numsynthdevs + i);
MidiInDev[i].state = -1; MidiInDev[i].state = -1;
} else { } else {
MultiByteToWideChar(CP_ACP, 0, minfo.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1,
MidiInDev[i].caps.szPname, MidiInDev[i].caps.szPname,
sizeof(MidiInDev[i].caps.szPname) / sizeof(WCHAR)); sizeof(MidiInDev[i].caps.szPname) / sizeof(WCHAR));
MidiInDev[i].state = 0; MidiInDev[i].state = 0;
......
...@@ -625,7 +625,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPSW lpCaps, DWORD dwSize) ...@@ -625,7 +625,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPSW lpCaps, DWORD dwSize)
capsW.wPid = WINE_MIXER_PRODUCT_ID; capsW.wPid = WINE_MIXER_PRODUCT_ID;
capsW.vDriverVersion = WINE_MIXER_VERSION; capsW.vDriverVersion = WINE_MIXER_VERSION;
if (!(name = mix->name)) name = WINE_MIXER_NAME; if (!(name = mix->name)) name = WINE_MIXER_NAME;
MultiByteToWideChar(CP_ACP, 0, name, -1, capsW.szPname, sizeof(capsW.szPname) / sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, name, -1, capsW.szPname, sizeof(capsW.szPname) / sizeof(WCHAR));
capsW.cDestinations = 2; /* speakers & record */ capsW.cDestinations = 2; /* speakers & record */
capsW.fdwSupport = 0; /* No bits defined yet */ capsW.fdwSupport = 0; /* No bits defined yet */
...@@ -665,8 +665,8 @@ static DWORD MIX_GetLineInfoDst(struct mixer* mix, LPMIXERLINEW lpMl, ...@@ -665,8 +665,8 @@ static DWORD MIX_GetLineInfoDst(struct mixer* mix, LPMIXERLINEW lpMl,
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
} }
lpMl->dwSource = 0xFFFFFFFF; lpMl->dwSource = 0xFFFFFFFF;
MultiByteToWideChar(CP_ACP, 0, MIX_Labels[j], -1, lpMl->szShortName, sizeof(lpMl->szShortName) / sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, MIX_Labels[j], -1, lpMl->szShortName, sizeof(lpMl->szShortName) / sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, MIX_Names[j], -1, lpMl->szName, sizeof(lpMl->szName) / sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, MIX_Names[j], -1, lpMl->szName, sizeof(lpMl->szName) / sizeof(WCHAR));
/* we have all connections found in the MIX_DevMask */ /* we have all connections found in the MIX_DevMask */
lpMl->cConnections = 0; lpMl->cConnections = 0;
...@@ -696,8 +696,8 @@ static DWORD MIX_GetLineInfoSrc(struct mixer* mix, LPMIXERLINEW lpMl, ...@@ -696,8 +696,8 @@ static DWORD MIX_GetLineInfoSrc(struct mixer* mix, LPMIXERLINEW lpMl,
TRACE("(%p, %p, %d, %08x)\n", mix, lpMl, idx, dst); TRACE("(%p, %p, %d, %08x)\n", mix, lpMl, idx, dst);
MultiByteToWideChar(CP_ACP, 0, MIX_Labels[idx], -1, lpMl->szShortName, sizeof(lpMl->szShortName) / sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, MIX_Labels[idx], -1, lpMl->szShortName, sizeof(lpMl->szShortName) / sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, MIX_Names[idx], -1, lpMl->szName, sizeof(lpMl->szName) / sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, MIX_Names[idx], -1, lpMl->szName, sizeof(lpMl->szName) / sizeof(WCHAR));
lpMl->dwLineID = MAKELONG(dst, idx); lpMl->dwLineID = MAKELONG(dst, idx);
lpMl->dwDestination = dst; lpMl->dwDestination = dst;
lpMl->cConnections = 1; lpMl->cConnections = 1;
...@@ -929,7 +929,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEW lpMl, DWORD fdwInfo) ...@@ -929,7 +929,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEW lpMl, DWORD fdwInfo)
lpMl->Target.wPid = WINE_MIXER_PRODUCT_ID; lpMl->Target.wPid = WINE_MIXER_PRODUCT_ID;
lpMl->Target.vDriverVersion = WINE_MIXER_VERSION; lpMl->Target.vDriverVersion = WINE_MIXER_VERSION;
if (!(name = mix->name)) name = WINE_MIXER_NAME; if (!(name = mix->name)) name = WINE_MIXER_NAME;
MultiByteToWideChar(CP_ACP, 0, name, -1, lpMl->Target.szPname, sizeof(lpMl->Target.szPname) / sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpMl->Target.szPname, sizeof(lpMl->Target.szPname) / sizeof(WCHAR));
} }
return ret; return ret;
...@@ -1236,7 +1236,7 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, ...@@ -1236,7 +1236,7 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd,
{ {
mcdlt[i].dwParam1 = MAKELONG(LINEID_RECORD, j); mcdlt[i].dwParam1 = MAKELONG(LINEID_RECORD, j);
mcdlt[i].dwParam2 = 0; mcdlt[i].dwParam2 = 0;
MultiByteToWideChar(CP_ACP, 0, MIX_Names[j], -1, MultiByteToWideChar(CP_UNIXCP, 0, MIX_Names[j], -1,
mcdlt[i].szName, sizeof(mcdlt[i]) / sizeof(WCHAR)); mcdlt[i].szName, sizeof(mcdlt[i]) / sizeof(WCHAR));
i++; i++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment