winmm: Only fill in the MIXERLINEA struct if the call to mixerGetLineInfoW succeeds.

This commit is contained in:
Huw Davies 2008-07-18 12:05:52 +01:00 committed by Alexandre Julliard
parent b2be840e47
commit 5798b95a51
1 changed files with 23 additions and 21 deletions

View File

@ -652,27 +652,29 @@ UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliA,
ret = mixerGetLineInfoW(hmix, &mliW, fdwInfo); ret = mixerGetLineInfoW(hmix, &mliW, fdwInfo);
lpmliA->dwDestination = mliW.dwDestination; if(ret == MMSYSERR_NOERROR)
lpmliA->dwSource = mliW.dwSource; {
lpmliA->dwLineID = mliW.dwLineID; lpmliA->dwDestination = mliW.dwDestination;
lpmliA->fdwLine = mliW.fdwLine; lpmliA->dwSource = mliW.dwSource;
lpmliA->dwUser = mliW.dwUser; lpmliA->dwLineID = mliW.dwLineID;
lpmliA->dwComponentType = mliW.dwComponentType; lpmliA->fdwLine = mliW.fdwLine;
lpmliA->cChannels = mliW.cChannels; lpmliA->dwUser = mliW.dwUser;
lpmliA->cConnections = mliW.cConnections; lpmliA->dwComponentType = mliW.dwComponentType;
lpmliA->cControls = mliW.cControls; lpmliA->cChannels = mliW.cChannels;
WideCharToMultiByte( CP_ACP, 0, mliW.szShortName, -1, lpmliA->szShortName, lpmliA->cConnections = mliW.cConnections;
sizeof(lpmliA->szShortName), NULL, NULL); lpmliA->cControls = mliW.cControls;
WideCharToMultiByte( CP_ACP, 0, mliW.szName, -1, lpmliA->szName, WideCharToMultiByte( CP_ACP, 0, mliW.szShortName, -1, lpmliA->szShortName,
sizeof(lpmliA->szName), NULL, NULL ); sizeof(lpmliA->szShortName), NULL, NULL);
lpmliA->Target.dwType = mliW.Target.dwType; WideCharToMultiByte( CP_ACP, 0, mliW.szName, -1, lpmliA->szName,
lpmliA->Target.dwDeviceID = mliW.Target.dwDeviceID; sizeof(lpmliA->szName), NULL, NULL );
lpmliA->Target.wMid = mliW.Target.wMid; lpmliA->Target.dwType = mliW.Target.dwType;
lpmliA->Target.wPid = mliW.Target.wPid; lpmliA->Target.dwDeviceID = mliW.Target.dwDeviceID;
lpmliA->Target.vDriverVersion = mliW.Target.vDriverVersion; lpmliA->Target.wMid = mliW.Target.wMid;
WideCharToMultiByte( CP_ACP, 0, mliW.Target.szPname, -1, lpmliA->Target.szPname, lpmliA->Target.wPid = mliW.Target.wPid;
sizeof(lpmliA->Target.szPname), NULL, NULL ); lpmliA->Target.vDriverVersion = mliW.Target.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, mliW.Target.szPname, -1, lpmliA->Target.szPname,
sizeof(lpmliA->Target.szPname), NULL, NULL );
}
return ret; return ret;
} }