Sync to Wine-20050111:

Eric Pouech <pouech-eric@wanadoo.fr>
Filip Navara <xnavara@volny.cz>
- 32 bit low level drivers now use a Unicode interface (used to be ANSI):
- Send the *_GETDEVCAPS messages in unicode format from the
  *GetDevCapsW function and call the *GetDevCapsW from their respective
  Ansi versions.
- Modify all low level drivers to correctly process the *_GETDEVCAPS
  messages as unicode.
- *_GETDEVCAPS messages are now mapped from/to unicode for 16 bit code.
- Removed all SoundBlaster naming oldies.
  Better use of some unicode functions (instead of Ansi) in winmm.
Alexandre Julliard <julliard@winehq.org>
- Fixed header dependencies to be fully compatible with the Windows
  headers (with help from Dimitrie O. Paun).
- Get rid of the ThunkData stubs, these are not functions.
Jeff Smith <whydoubt@hotmail.com>
- Fix for MIDI Mapper.
Robert Reif <reif@earthlink.net>
- Return actual result on error.
- Return flag for DRVM_MAPPER_PREFERRED_GET.
Michael Stefaniuc <mstefani@redhat.de>
- Do not check for non NULL pointer before HeapFree'ing it. It's
  redundant.
Ge van Geldorp <gvg@reactos.com>
- Match PSDK definitions for LPCWAVEFORMATEX.

svn path=/trunk/; revision=13006
This commit is contained in:
Gé van Geldorp 2005-01-12 23:33:10 +00:00
parent 1141d723c3
commit b8ed66e011
15 changed files with 444 additions and 420 deletions

View file

@ -368,8 +368,8 @@ HDRVR WINAPI OpenDriverW(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lPa
ret = OpenDriverA(dn, sn, lParam); ret = OpenDriverA(dn, sn, lParam);
if (dn) HeapFree(GetProcessHeap(), 0, dn); HeapFree(GetProcessHeap(), 0, dn);
if (sn) HeapFree(GetProcessHeap(), 0, sn); HeapFree(GetProcessHeap(), 0, sn);
return ret; return ret;
} }

View file

@ -138,9 +138,9 @@ UINT WINAPI joyGetNumDevs(void)
} }
/************************************************************************** /**************************************************************************
* joyGetDevCapsA [WINMM.@] * joyGetDevCapsW [WINMM.@]
*/ */
MMRESULT WINAPI joyGetDevCapsA(UINT_PTR wID, LPJOYCAPSA lpCaps, UINT wSize) MMRESULT WINAPI joyGetDevCapsW(UINT_PTR wID, LPJOYCAPSW lpCaps, UINT wSize)
{ {
if (wID >= MAXJOYSTICK) return JOYERR_PARMS; if (wID >= MAXJOYSTICK) return JOYERR_PARMS;
if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER; if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER;
@ -152,43 +152,49 @@ MMRESULT WINAPI joyGetDevCapsA(UINT_PTR wID, LPJOYCAPSA lpCaps, UINT wSize)
} }
/************************************************************************** /**************************************************************************
* joyGetDevCapsW [WINMM.@] * joyGetDevCapsA [WINMM.@]
*/ */
MMRESULT WINAPI joyGetDevCapsW(UINT_PTR wID, LPJOYCAPSW lpCaps, UINT wSize) MMRESULT WINAPI joyGetDevCapsA(UINT_PTR wID, LPJOYCAPSA lpCaps, UINT wSize)
{ {
JOYCAPSA jca; JOYCAPSW jcw;
MMRESULT ret = joyGetDevCapsA(wID, &jca, sizeof(jca)); MMRESULT ret;
if (ret != JOYERR_NOERROR) return ret; if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
lpCaps->wMid = jca.wMid;
lpCaps->wPid = jca.wPid;
MultiByteToWideChar( CP_ACP, 0, jca.szPname, -1, lpCaps->szPname,
sizeof(lpCaps->szPname)/sizeof(WCHAR) );
lpCaps->wXmin = jca.wXmin;
lpCaps->wXmax = jca.wXmax;
lpCaps->wYmin = jca.wYmin;
lpCaps->wYmax = jca.wYmax;
lpCaps->wZmin = jca.wZmin;
lpCaps->wZmax = jca.wZmax;
lpCaps->wNumButtons = jca.wNumButtons;
lpCaps->wPeriodMin = jca.wPeriodMin;
lpCaps->wPeriodMax = jca.wPeriodMax;
if (wSize >= sizeof(JOYCAPSW)) { /* Win95 extensions ? */ ret = joyGetDevCapsW(wID, &jcw, sizeof(jcw));
lpCaps->wRmin = jca.wRmin;
lpCaps->wRmax = jca.wRmax; if (ret == JOYERR_NOERROR)
lpCaps->wUmin = jca.wUmin; {
lpCaps->wUmax = jca.wUmax; lpCaps->wMid = jcw.wMid;
lpCaps->wVmin = jca.wVmin; lpCaps->wPid = jcw.wPid;
lpCaps->wVmax = jca.wVmax; WideCharToMultiByte( CP_ACP, 0, jcw.szPname, -1, lpCaps->szPname,
lpCaps->wCaps = jca.wCaps; sizeof(lpCaps->szPname), NULL, NULL );
lpCaps->wMaxAxes = jca.wMaxAxes; lpCaps->wXmin = jcw.wXmin;
lpCaps->wNumAxes = jca.wNumAxes; lpCaps->wXmax = jcw.wXmax;
lpCaps->wMaxButtons = jca.wMaxButtons; lpCaps->wYmin = jcw.wYmin;
MultiByteToWideChar( CP_ACP, 0, jca.szRegKey, -1, lpCaps->szRegKey, lpCaps->wYmax = jcw.wYmax;
sizeof(lpCaps->szRegKey)/sizeof(WCHAR) ); lpCaps->wZmin = jcw.wZmin;
MultiByteToWideChar( CP_ACP, 0, jca.szOEMVxD, -1, lpCaps->szOEMVxD, lpCaps->wZmax = jcw.wZmax;
sizeof(lpCaps->szOEMVxD)/sizeof(WCHAR) ); lpCaps->wNumButtons = jcw.wNumButtons;
lpCaps->wPeriodMin = jcw.wPeriodMin;
lpCaps->wPeriodMax = jcw.wPeriodMax;
if (wSize >= sizeof(JOYCAPSA)) { /* Win95 extensions ? */
lpCaps->wRmin = jcw.wRmin;
lpCaps->wRmax = jcw.wRmax;
lpCaps->wUmin = jcw.wUmin;
lpCaps->wUmax = jcw.wUmax;
lpCaps->wVmin = jcw.wVmin;
lpCaps->wVmax = jcw.wVmax;
lpCaps->wCaps = jcw.wCaps;
lpCaps->wMaxAxes = jcw.wMaxAxes;
lpCaps->wNumAxes = jcw.wNumAxes;
lpCaps->wMaxButtons = jcw.wMaxButtons;
WideCharToMultiByte( CP_ACP, 0, jcw.szRegKey, -1, lpCaps->szRegKey,
sizeof(lpCaps->szRegKey), NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, jcw.szOEMVxD, -1, lpCaps->szOEMVxD,
sizeof(lpCaps->szOEMVxD), NULL, NULL );
}
} }
return ret; return ret;

View file

@ -504,6 +504,7 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1,
case DRVM_MAPPER_PREFERRED_GET: case DRVM_MAPPER_PREFERRED_GET:
/* FIXME: get from registry someday */ /* FIXME: get from registry someday */
*((LPDWORD)dwParam1) = -1; /* No preferred device */ *((LPDWORD)dwParam1) = -1; /* No preferred device */
*((LPDWORD)dwParam2) = 0;
break; break;
case DRV_QUERYDEVICEINTERFACE: case DRV_QUERYDEVICEINTERFACE:

View file

@ -415,10 +415,8 @@ static BOOL MCI_DeleteCommandTable(UINT uTbl)
return FALSE; return FALSE;
S_MciCmdTable[uTbl].lpTable = NULL; S_MciCmdTable[uTbl].lpTable = NULL;
if (S_MciCmdTable[uTbl].aVerbs) { HeapFree(GetProcessHeap(), 0, S_MciCmdTable[uTbl].aVerbs);
HeapFree(GetProcessHeap(), 0, S_MciCmdTable[uTbl].aVerbs); S_MciCmdTable[uTbl].aVerbs = 0;
S_MciCmdTable[uTbl].aVerbs = 0;
}
return TRUE; return TRUE;
} }
@ -1090,7 +1088,7 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPWSTR lpwstrRet,
if (lpwstrRet) if (lpwstrRet)
MultiByteToWideChar( CP_ACP, 0, lpstrRet, -1, lpwstrRet, uRetLen ); MultiByteToWideChar( CP_ACP, 0, lpstrRet, -1, lpwstrRet, uRetLen );
HeapFree(GetProcessHeap(), 0, lpstrCommand); HeapFree(GetProcessHeap(), 0, lpstrCommand);
if (lpstrRet) HeapFree(GetProcessHeap(), 0, lpstrRet); HeapFree(GetProcessHeap(), 0, lpstrRet);
return ret; return ret;
} }

View file

@ -1,7 +1,7 @@
/* -*- tab-width: 8; c-basic-offset: 4 -*- */ /* -*- tab-width: 8; c-basic-offset: 4 -*- */
/* /*
* MMSYTEM MCI and low level mapping functions * MMSYSTEM MCI and low level mapping functions
* *
* Copyright 1999 Eric Pouech * Copyright 1999 Eric Pouech
* *
@ -297,14 +297,14 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32A (UINT wMsg, LPDWORD lpdwUser, LP
case MODM_GETDEVCAPS: case MODM_GETDEVCAPS:
{ {
LPMIDIOUTCAPSA moc32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMIDIOUTCAPS16) + sizeof(MIDIOUTCAPSA)); LPMIDIOUTCAPSW moc32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMIDIOUTCAPS16) + sizeof(MIDIOUTCAPSW));
LPMIDIOUTCAPS16 moc16 = MapSL(*lpParam1); LPMIDIOUTCAPS16 moc16 = MapSL(*lpParam1);
if (moc32) { if (moc32) {
*(LPMIDIOUTCAPS16*)moc32 = moc16; *(LPMIDIOUTCAPS16*)moc32 = moc16;
moc32 = (LPMIDIOUTCAPSA)((LPSTR)moc32 + sizeof(LPMIDIOUTCAPS16)); moc32 = (LPMIDIOUTCAPSW)((LPSTR)moc32 + sizeof(LPMIDIOUTCAPS16));
*lpParam1 = (DWORD)moc32; *lpParam1 = (DWORD)moc32;
*lpParam2 = sizeof(MIDIOUTCAPSA); *lpParam2 = sizeof(MIDIOUTCAPSW);
ret = WINMM_MAP_OKMEM; ret = WINMM_MAP_OKMEM;
} else { } else {
@ -390,13 +390,14 @@ static WINMM_MapType MMDRV_MidiOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LP
case MODM_GETDEVCAPS: case MODM_GETDEVCAPS:
{ {
LPMIDIOUTCAPSA moc32 = (LPMIDIOUTCAPSA)(*lpParam1); LPMIDIOUTCAPSW moc32 = (LPMIDIOUTCAPSW)(*lpParam1);
LPMIDIOUTCAPS16 moc16 = *(LPMIDIOUTCAPS16*)((LPSTR)moc32 - sizeof(LPMIDIOUTCAPS16)); LPMIDIOUTCAPS16 moc16 = *(LPMIDIOUTCAPS16*)((LPSTR)moc32 - sizeof(LPMIDIOUTCAPS16));
moc16->wMid = moc32->wMid; moc16->wMid = moc32->wMid;
moc16->wPid = moc32->wPid; moc16->wPid = moc32->wPid;
moc16->vDriverVersion = moc32->vDriverVersion; moc16->vDriverVersion = moc32->vDriverVersion;
strcpy(moc16->szPname, moc32->szPname); WideCharToMultiByte( CP_ACP, 0, moc32->szPname, -1, moc16->szPname,
sizeof(moc16->szPname), NULL, NULL );
moc16->wTechnology = moc32->wTechnology; moc16->wTechnology = moc32->wTechnology;
moc16->wVoices = moc32->wVoices; moc16->wVoices = moc32->wVoices;
moc16->wNotes = moc32->wNotes; moc16->wNotes = moc32->wNotes;
@ -455,16 +456,16 @@ static WINMM_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LP
break; break;
case MODM_GETDEVCAPS: case MODM_GETDEVCAPS:
{ {
LPMIDIOUTCAPSA moc32 = (LPMIDIOUTCAPSA)*lpParam1; LPMIDIOUTCAPSW moc32 = (LPMIDIOUTCAPSW)*lpParam1;
LPSTR ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPMIDIOUTCAPSA)+sizeof(MIDIOUTCAPS16)); LPSTR ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPMIDIOUTCAPSW)+sizeof(MIDIOUTCAPS16));
if (ptr) { if (ptr) {
*(LPMIDIOUTCAPSA*)ptr = moc32; *(LPMIDIOUTCAPSW*)ptr = moc32;
ret = WINMM_MAP_OKMEM; ret = WINMM_MAP_OKMEM;
} else { } else {
ret = WINMM_MAP_NOMEM; ret = WINMM_MAP_NOMEM;
} }
*lpParam1 = (DWORD)MapLS(ptr) + sizeof(LPMIDIOUTCAPSA); *lpParam1 = (DWORD)MapLS(ptr) + sizeof(LPMIDIOUTCAPSW);
*lpParam2 = sizeof(MIDIOUTCAPS16); *lpParam2 = sizeof(MIDIOUTCAPS16);
} }
break; break;
@ -596,13 +597,14 @@ static WINMM_MapType MMDRV_MidiOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LP
case MODM_GETDEVCAPS: case MODM_GETDEVCAPS:
{ {
LPMIDIOUTCAPS16 moc16 = MapSL(*lpParam1); LPMIDIOUTCAPS16 moc16 = MapSL(*lpParam1);
LPSTR ptr = (LPSTR)moc16 - sizeof(LPMIDIOUTCAPSA); LPSTR ptr = (LPSTR)moc16 - sizeof(LPMIDIOUTCAPSW);
LPMIDIOUTCAPSA moc32 = *(LPMIDIOUTCAPSA*)ptr; LPMIDIOUTCAPSW moc32 = *(LPMIDIOUTCAPSW*)ptr;
moc32->wMid = moc16->wMid; moc32->wMid = moc16->wMid;
moc32->wPid = moc16->wPid; moc32->wPid = moc16->wPid;
moc32->vDriverVersion = moc16->vDriverVersion; moc32->vDriverVersion = moc16->vDriverVersion;
strcpy(moc32->szPname, moc16->szPname); WideCharToMultiByte( CP_ACP, 0, moc32->szPname, -1, moc16->szPname,
sizeof(moc16->szPname), NULL, NULL );
moc32->wTechnology = moc16->wTechnology; moc32->wTechnology = moc16->wTechnology;
moc32->wVoices = moc16->wVoices; moc32->wVoices = moc16->wVoices;
moc32->wNotes = moc16->wNotes; moc32->wNotes = moc16->wNotes;
@ -723,14 +725,14 @@ static WINMM_MapType MMDRV_WaveIn_Map16To32A (UINT wMsg, LPDWORD lpdwUser, LPD
break; break;
case WIDM_GETDEVCAPS: case WIDM_GETDEVCAPS:
{ {
LPWAVEINCAPSA wic32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWAVEINCAPS16) + sizeof(WAVEINCAPSA)); LPWAVEINCAPSW wic32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWAVEINCAPS16) + sizeof(WAVEINCAPSW));
LPWAVEINCAPS16 wic16 = MapSL(*lpParam1); LPWAVEINCAPS16 wic16 = MapSL(*lpParam1);
if (wic32) { if (wic32) {
*(LPWAVEINCAPS16*)wic32 = wic16; *(LPWAVEINCAPS16*)wic32 = wic16;
wic32 = (LPWAVEINCAPSA)((LPSTR)wic32 + sizeof(LPWAVEINCAPS16)); wic32 = (LPWAVEINCAPSW)((LPSTR)wic32 + sizeof(LPWAVEINCAPS16));
*lpParam1 = (DWORD)wic32; *lpParam1 = (DWORD)wic32;
*lpParam2 = sizeof(WAVEINCAPSA); *lpParam2 = sizeof(WAVEINCAPSW);
ret = WINMM_MAP_OKMEM; ret = WINMM_MAP_OKMEM;
} else { } else {
@ -833,13 +835,14 @@ static WINMM_MapType MMDRV_WaveIn_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPD
break; break;
case WIDM_GETDEVCAPS: case WIDM_GETDEVCAPS:
{ {
LPWAVEINCAPSA wic32 = (LPWAVEINCAPSA)(*lpParam1); LPWAVEINCAPSW wic32 = (LPWAVEINCAPSW)(*lpParam1);
LPWAVEINCAPS16 wic16 = *(LPWAVEINCAPS16*)((LPSTR)wic32 - sizeof(LPWAVEINCAPS16)); LPWAVEINCAPS16 wic16 = *(LPWAVEINCAPS16*)((LPSTR)wic32 - sizeof(LPWAVEINCAPS16));
wic16->wMid = wic32->wMid; wic16->wMid = wic32->wMid;
wic16->wPid = wic32->wPid; wic16->wPid = wic32->wPid;
wic16->vDriverVersion = wic32->vDriverVersion; wic16->vDriverVersion = wic32->vDriverVersion;
strcpy(wic16->szPname, wic32->szPname); WideCharToMultiByte( CP_ACP, 0, wic32->szPname, -1, wic16->szPname,
sizeof(wic16->szPname), NULL, NULL );
wic16->dwFormats = wic32->dwFormats; wic16->dwFormats = wic32->dwFormats;
wic16->wChannels = wic32->wChannels; wic16->wChannels = wic32->wChannels;
HeapFree(GetProcessHeap(), 0, (LPSTR)wic32 - sizeof(LPWAVEINCAPS16)); HeapFree(GetProcessHeap(), 0, (LPSTR)wic32 - sizeof(LPWAVEINCAPS16));
@ -1010,16 +1013,16 @@ static WINMM_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD
break; break;
case WIDM_GETDEVCAPS: case WIDM_GETDEVCAPS:
{ {
LPWAVEINCAPSA wic32 = (LPWAVEINCAPSA)*lpParam1; LPWAVEINCAPSW wic32 = (LPWAVEINCAPSW)*lpParam1;
LPSTR ptr = HeapAlloc( GetProcessHeap(), 0 ,sizeof(LPWAVEINCAPSA) + sizeof(WAVEINCAPS16)); LPSTR ptr = HeapAlloc( GetProcessHeap(), 0 ,sizeof(LPWAVEINCAPSW) + sizeof(WAVEINCAPS16));
if (ptr) { if (ptr) {
*(LPWAVEINCAPSA*)ptr = wic32; *(LPWAVEINCAPSW*)ptr = wic32;
ret = WINMM_MAP_OKMEM; ret = WINMM_MAP_OKMEM;
} else { } else {
ret = WINMM_MAP_NOMEM; ret = WINMM_MAP_NOMEM;
} }
*lpParam1 = MapLS(ptr) + sizeof(LPWAVEINCAPSA); *lpParam1 = MapLS(ptr) + sizeof(LPWAVEINCAPSW);
*lpParam2 = sizeof(WAVEINCAPS16); *lpParam2 = sizeof(WAVEINCAPS16);
} }
break; break;
@ -1109,13 +1112,14 @@ static WINMM_MapType MMDRV_WaveIn_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPD
case WIDM_GETDEVCAPS: case WIDM_GETDEVCAPS:
{ {
LPWAVEINCAPS16 wic16 = MapSL(*lpParam1); LPWAVEINCAPS16 wic16 = MapSL(*lpParam1);
LPSTR ptr = (LPSTR)wic16 - sizeof(LPWAVEINCAPSA); LPSTR ptr = (LPSTR)wic16 - sizeof(LPWAVEINCAPSW);
LPWAVEINCAPSA wic32 = *(LPWAVEINCAPSA*)ptr; LPWAVEINCAPSW wic32 = *(LPWAVEINCAPSW*)ptr;
wic32->wMid = wic16->wMid; wic32->wMid = wic16->wMid;
wic32->wPid = wic16->wPid; wic32->wPid = wic16->wPid;
wic32->vDriverVersion = wic16->vDriverVersion; wic32->vDriverVersion = wic16->vDriverVersion;
strcpy(wic32->szPname, wic16->szPname); WideCharToMultiByte( CP_ACP, 0, wic32->szPname, -1, wic16->szPname,
sizeof(wic16->szPname), NULL, NULL );
wic32->dwFormats = wic16->dwFormats; wic32->dwFormats = wic16->dwFormats;
wic32->wChannels = wic16->wChannels; wic32->wChannels = wic16->wChannels;
UnMapLS( *lpParam1 ); UnMapLS( *lpParam1 );
@ -1222,14 +1226,14 @@ static WINMM_MapType MMDRV_WaveOut_Map16To32A (UINT wMsg, LPDWORD lpdwUser, LP
case WODM_GETDEVCAPS: case WODM_GETDEVCAPS:
{ {
LPWAVEOUTCAPSA woc32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWAVEOUTCAPS16) + sizeof(WAVEOUTCAPSA)); LPWAVEOUTCAPSW woc32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWAVEOUTCAPS16) + sizeof(WAVEOUTCAPSW));
LPWAVEOUTCAPS16 woc16 = MapSL(*lpParam1); LPWAVEOUTCAPS16 woc16 = MapSL(*lpParam1);
if (woc32) { if (woc32) {
*(LPWAVEOUTCAPS16*)woc32 = woc16; *(LPWAVEOUTCAPS16*)woc32 = woc16;
woc32 = (LPWAVEOUTCAPSA)((LPSTR)woc32 + sizeof(LPWAVEOUTCAPS16)); woc32 = (LPWAVEOUTCAPSW)((LPSTR)woc32 + sizeof(LPWAVEOUTCAPS16));
*lpParam1 = (DWORD)woc32; *lpParam1 = (DWORD)woc32;
*lpParam2 = sizeof(WAVEOUTCAPSA); *lpParam2 = sizeof(WAVEOUTCAPSW);
ret = WINMM_MAP_OKMEM; ret = WINMM_MAP_OKMEM;
} else { } else {
@ -1341,13 +1345,14 @@ static WINMM_MapType MMDRV_WaveOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LP
case WODM_GETDEVCAPS: case WODM_GETDEVCAPS:
{ {
LPWAVEOUTCAPSA woc32 = (LPWAVEOUTCAPSA)(*lpParam1); LPWAVEOUTCAPSW woc32 = (LPWAVEOUTCAPSW)(*lpParam1);
LPWAVEOUTCAPS16 woc16 = *(LPWAVEOUTCAPS16*)((LPSTR)woc32 - sizeof(LPWAVEOUTCAPS16)); LPWAVEOUTCAPS16 woc16 = *(LPWAVEOUTCAPS16*)((LPSTR)woc32 - sizeof(LPWAVEOUTCAPS16));
woc16->wMid = woc32->wMid; woc16->wMid = woc32->wMid;
woc16->wPid = woc32->wPid; woc16->wPid = woc32->wPid;
woc16->vDriverVersion = woc32->vDriverVersion; woc16->vDriverVersion = woc32->vDriverVersion;
strcpy(woc16->szPname, woc32->szPname); WideCharToMultiByte( CP_ACP, 0, woc32->szPname, -1, woc16->szPname,
sizeof(woc16->szPname), NULL, NULL );
woc16->dwFormats = woc32->dwFormats; woc16->dwFormats = woc32->dwFormats;
woc16->wChannels = woc32->wChannels; woc16->wChannels = woc32->wChannels;
woc16->dwSupport = woc32->dwSupport; woc16->dwSupport = woc32->dwSupport;
@ -1416,17 +1421,17 @@ static WINMM_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LP
case WODM_GETDEVCAPS: case WODM_GETDEVCAPS:
{ {
LPWAVEOUTCAPSA woc32 = (LPWAVEOUTCAPSA)*lpParam1; LPWAVEOUTCAPSW woc32 = (LPWAVEOUTCAPSW)*lpParam1;
LPSTR ptr = HeapAlloc( GetProcessHeap(), 0, LPSTR ptr = HeapAlloc( GetProcessHeap(), 0,
sizeof(LPWAVEOUTCAPSA) + sizeof(WAVEOUTCAPS16)); sizeof(LPWAVEOUTCAPSW) + sizeof(WAVEOUTCAPS16));
if (ptr) { if (ptr) {
*(LPWAVEOUTCAPSA*)ptr = woc32; *(LPWAVEOUTCAPSW*)ptr = woc32;
ret = WINMM_MAP_OKMEM; ret = WINMM_MAP_OKMEM;
} else { } else {
ret = WINMM_MAP_NOMEM; ret = WINMM_MAP_NOMEM;
} }
*lpParam1 = MapLS(ptr) + sizeof(LPWAVEOUTCAPSA); *lpParam1 = MapLS(ptr) + sizeof(LPWAVEOUTCAPSW);
*lpParam2 = sizeof(WAVEOUTCAPS16); *lpParam2 = sizeof(WAVEOUTCAPS16);
} }
break; break;
@ -1606,13 +1611,14 @@ static WINMM_MapType MMDRV_WaveOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LP
case WODM_GETDEVCAPS: case WODM_GETDEVCAPS:
{ {
LPWAVEOUTCAPS16 woc16 = MapSL(*lpParam1); LPWAVEOUTCAPS16 woc16 = MapSL(*lpParam1);
LPSTR ptr = (LPSTR)woc16 - sizeof(LPWAVEOUTCAPSA); LPSTR ptr = (LPSTR)woc16 - sizeof(LPWAVEOUTCAPSW);
LPWAVEOUTCAPSA woc32 = *(LPWAVEOUTCAPSA*)ptr; LPWAVEOUTCAPSW woc32 = *(LPWAVEOUTCAPSW*)ptr;
woc32->wMid = woc16->wMid; woc32->wMid = woc16->wMid;
woc32->wPid = woc16->wPid; woc32->wPid = woc16->wPid;
woc32->vDriverVersion = woc16->vDriverVersion; woc32->vDriverVersion = woc16->vDriverVersion;
strcpy(woc32->szPname, woc16->szPname); WideCharToMultiByte( CP_ACP, 0, woc32->szPname, -1, woc16->szPname,
sizeof(woc16->szPname), NULL, NULL );
woc32->dwFormats = woc16->dwFormats; woc32->dwFormats = woc16->dwFormats;
woc32->wChannels = woc16->wChannels; woc32->wChannels = woc16->wChannels;
woc32->dwSupport = woc16->dwSupport; woc32->dwSupport = woc16->dwSupport;

View file

@ -1,2 +0,0 @@
Makefile
midimap.drv.dbg.c

View file

@ -32,6 +32,7 @@
#include "winuser.h" #include "winuser.h"
#include "mmddk.h" #include "mmddk.h"
#include "winreg.h" #include "winreg.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
/* /*
@ -80,7 +81,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm);
typedef struct tagMIDIOUTPORT typedef struct tagMIDIOUTPORT
{ {
char name[MAXPNAMELEN]; WCHAR name[MAXPNAMELEN];
int loaded; int loaded;
HMIDIOUT hMidi; HMIDIOUT hMidi;
unsigned short uDevID; unsigned short uDevID;
@ -105,31 +106,36 @@ static BOOL MIDIMAP_IsBadData(MIDIMAPDATA* mm)
return TRUE; return TRUE;
} }
static BOOL MIDIMAP_FindPort(const char* name, unsigned* dev) static BOOL MIDIMAP_FindPort(const WCHAR* name, unsigned* dev)
{ {
for (*dev = 0; *dev < numMidiOutPorts; (*dev)++) for (*dev = 0; *dev < numMidiOutPorts; (*dev)++)
{ {
TRACE("%s\n", midiOutPorts[*dev].name); TRACE("%s\n", wine_dbgstr_w(midiOutPorts[*dev].name));
if (strcmp(midiOutPorts[*dev].name, name) == 0) if (strcmpW(midiOutPorts[*dev].name, name) == 0)
return TRUE; return TRUE;
} }
/* try the form #nnn */ /* try the form #nnn */
if (*name == '#' && isdigit(name[1])) if (*name == '#' && isdigit(name[1]))
{ {
*dev = atoi(name + 1); const WCHAR* ptr = name + 1;
*dev = 0;
do
{
*dev = *dev * 10 + *ptr - '0';
} while (isdigit(*++ptr));
if (*dev < numMidiOutPorts) if (*dev < numMidiOutPorts)
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA* mom, const char* port) static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA* mom, const WCHAR* port)
{ {
unsigned i, dev = 0; unsigned i, dev = 0;
if (port != NULL && !MIDIMAP_FindPort(port, &dev)) if (port != NULL && !MIDIMAP_FindPort(port, &dev))
{ {
ERR("Registry glitch: couldn't find midi out (%s)\n", port); ERR("Registry glitch: couldn't find midi out (%s)\n", wine_dbgstr_w(port));
dev = 0; dev = 0;
} }
@ -142,11 +148,11 @@ static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA* mom, const char* port)
return TRUE; return TRUE;
} }
static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const char* scheme) static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const WCHAR* scheme)
{ {
HKEY hSchemesKey, hKey, hPortKey; HKEY hSchemesKey, hKey, hPortKey;
unsigned i, idx, dev; unsigned i, idx, dev;
char buffer[256], port[256]; WCHAR buffer[256], port[256];
DWORD type, size, mask; DWORD type, size, mask;
for (i = 0; i < 16; i++) mom->ChannelMap[i] = NULL; for (i = 0; i < 16; i++) mom->ChannelMap[i] = NULL;
@ -157,18 +163,18 @@ static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const char* scheme)
{ {
return FALSE; return FALSE;
} }
if (RegOpenKeyA(hSchemesKey, scheme, &hKey)) if (RegOpenKeyW(hSchemesKey, scheme, &hKey))
{ {
RegCloseKey(hSchemesKey); RegCloseKey(hSchemesKey);
return FALSE; return FALSE;
} }
for (idx = 0; !RegEnumKeyA(hKey, idx, buffer, sizeof(buffer)); idx++) for (idx = 0; !RegEnumKeyW(hKey, idx, buffer, sizeof(buffer)); idx++)
{ {
if (RegOpenKeyA(hKey, buffer, &hPortKey)) continue; if (RegOpenKeyW(hKey, buffer, &hPortKey)) continue;
size = sizeof(port); size = sizeof(port);
if (RegQueryValueExA(hPortKey, NULL, 0, &type, port, &size)) continue; if (RegQueryValueExW(hPortKey, NULL, 0, &type, (void*)port, &size)) continue;
if (!MIDIMAP_FindPort(port, &dev)) continue; if (!MIDIMAP_FindPort(port, &dev)) continue;
@ -206,14 +212,15 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
else else
{ {
DWORD type, size, out; DWORD type, size, out;
char buffer[256]; WCHAR buffer[256];
ret = 2; ret = 2;
size = sizeof(out); size = sizeof(out);
if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out) if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
{ {
static const WCHAR cs[] = {'C','u','r','r','e','n','t','S','c','h','e','m','e',0};
size = sizeof(buffer); size = sizeof(buffer);
if (!RegQueryValueExA(hKey, "CurrentScheme", 0, &type, buffer, &size)) if (!RegQueryValueExW(hKey, cs, 0, &type, (void*)buffer, &size))
{ {
if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer))) if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer)))
ret = MIDIMAP_LoadSettingsDefault(mom, NULL); ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
@ -225,8 +232,9 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
} }
if (ret == 2) if (ret == 2)
{ {
static const WCHAR ci[] = {'C','u','r','r','e','n','t','I','n','s','t','r','u','m','e','n','t',0};
size = sizeof(buffer); size = sizeof(buffer);
if (!RegQueryValueExA(hKey, "CurrentInstrument", 0, &type, buffer, &size) && *buffer) if (!RegQueryValueExW(hKey, ci, 0, &type, (void*)buffer, &size) && *buffer)
{ {
ret = MIDIMAP_LoadSettingsDefault(mom, buffer); ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
} }
@ -404,12 +412,13 @@ static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSA lpMidiCaps, DWORD size) static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD size)
{ {
static const WCHAR name[] = {'W','i','n','e',' ','m','i','d','i',' ','m','a','p','p','e','r',0};
lpMidiCaps->wMid = 0x00FF; lpMidiCaps->wMid = 0x00FF;
lpMidiCaps->wPid = 0x0001; lpMidiCaps->wPid = 0x0001;
lpMidiCaps->vDriverVersion = 0x0100; lpMidiCaps->vDriverVersion = 0x0100;
strcpy(lpMidiCaps->szPname, "Wine midi out mapper"); lstrcpyW(lpMidiCaps->szPname, name);
lpMidiCaps->wTechnology = MOD_MAPPER; lpMidiCaps->wTechnology = MOD_MAPPER;
lpMidiCaps->wVoices = 0; lpMidiCaps->wVoices = 0;
lpMidiCaps->wNotes = 0; lpMidiCaps->wNotes = 0;
@ -465,7 +474,7 @@ DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case MODM_UNPREPARE: return modUnprepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2); case MODM_UNPREPARE: return modUnprepare ((MIDIMAPDATA*)dwUser, (LPMIDIHDR)dwParam1, dwParam2);
case MODM_RESET: return modReset ((MIDIMAPDATA*)dwUser); case MODM_RESET: return modReset ((MIDIMAPDATA*)dwUser);
case MODM_GETDEVCAPS: return modGetDevCaps (wDevID, (MIDIMAPDATA*)dwUser, (LPMIDIOUTCAPSA)dwParam1,dwParam2); case MODM_GETDEVCAPS: return modGetDevCaps (wDevID, (MIDIMAPDATA*)dwUser, (LPMIDIOUTCAPSW)dwParam1,dwParam2);
case MODM_GETNUMDEVS: return 1; case MODM_GETNUMDEVS: return 1;
case MODM_GETVOLUME: return MMSYSERR_NOTSUPPORTED; case MODM_GETVOLUME: return MMSYSERR_NOTSUPPORTED;
case MODM_SETVOLUME: return MMSYSERR_NOTSUPPORTED; case MODM_SETVOLUME: return MMSYSERR_NOTSUPPORTED;
@ -484,7 +493,7 @@ DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
*/ */
static DWORD MIDIMAP_drvOpen(LPSTR str) static DWORD MIDIMAP_drvOpen(LPSTR str)
{ {
MIDIOUTCAPSA moc; MIDIOUTCAPSW moc;
unsigned dev, i; unsigned dev, i;
if (midiOutPorts) if (midiOutPorts)
@ -495,9 +504,9 @@ static DWORD MIDIMAP_drvOpen(LPSTR str)
numMidiOutPorts * sizeof(MIDIOUTPORT)); numMidiOutPorts * sizeof(MIDIOUTPORT));
for (dev = 0; dev < numMidiOutPorts; dev++) for (dev = 0; dev < numMidiOutPorts; dev++)
{ {
if (midiOutGetDevCapsA(dev, &moc, sizeof(moc)) == 0L) if (midiOutGetDevCapsW(dev, &moc, sizeof(moc)) == 0L)
{ {
strcpy(midiOutPorts[dev].name, moc.szPname); strcpyW(midiOutPorts[dev].name, moc.szPname);
midiOutPorts[dev].loaded = 0; midiOutPorts[dev].loaded = 0;
midiOutPorts[dev].hMidi = 0; midiOutPorts[dev].hMidi = 0;
midiOutPorts[dev].uDevID = dev; midiOutPorts[dev].uDevID = dev;

View file

@ -703,7 +703,7 @@ HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO* lpmmioinfo,
{ {
INT len = WideCharToMultiByte( CP_ACP, 0, szFileName, -1, NULL, 0, NULL, NULL ); INT len = WideCharToMultiByte( CP_ACP, 0, szFileName, -1, NULL, 0, NULL, NULL );
szFn = HeapAlloc( GetProcessHeap(), 0, len ); szFn = HeapAlloc( GetProcessHeap(), 0, len );
if (!szFn) return (HMMIO)NULL; if (!szFn) return NULL;
WideCharToMultiByte( CP_ACP, 0, szFileName, -1, szFn, len, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, szFileName, -1, szFn, len, NULL, NULL );
} }

View file

@ -1940,7 +1940,7 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE16 lpHndl, DWORD
lpMMThd->hTask = 0; lpMMThd->hTask = 0;
if ((dwFlags & 1) == 0 && (GetProcessFlags(GetCurrentThreadId()) & 8) == 0) { if ((dwFlags & 1) == 0 && (GetProcessFlags(GetCurrentThreadId()) & 8) == 0) {
lpMMThd->hEvent = CreateEventA(0, 0, 1, 0); lpMMThd->hEvent = CreateEventW(NULL, FALSE, TRUE, NULL);
TRACE("Let's go crazy... trying new MM thread. lpMMThd=%p\n", lpMMThd); TRACE("Let's go crazy... trying new MM thread. lpMMThd=%p\n", lpMMThd);
if (lpMMThd->dwFlags & 2) { if (lpMMThd->dwFlags & 2) {
@ -2712,7 +2712,6 @@ static LRESULT MMIO_Callback16(SEGPTR cb16, LPMMIOINFO lpmmioinfo, UINT uMessage
mmioInfo16.adwInfo[0] = lpmmioinfo->adwInfo[0]; mmioInfo16.adwInfo[0] = lpmmioinfo->adwInfo[0];
mmioInfo16.adwInfo[1] = lpmmioinfo->adwInfo[1]; mmioInfo16.adwInfo[1] = lpmmioinfo->adwInfo[1];
mmioInfo16.adwInfo[2] = lpmmioinfo->adwInfo[2]; mmioInfo16.adwInfo[2] = lpmmioinfo->adwInfo[2];
mmioInfo16.adwInfo[3] = lpmmioinfo->adwInfo[3];
/* map (lParam1, lParam2) into (lp1, lp2) 32=>16 */ /* map (lParam1, lParam2) into (lp1, lp2) 32=>16 */
if ((result = MMIO_Map32To16(uMessage, &lp1, &lp2)) != MMSYSERR_NOERROR) if ((result = MMIO_Map32To16(uMessage, &lp1, &lp2)) != MMSYSERR_NOERROR)
return result; return result;
@ -2733,7 +2732,6 @@ static LRESULT MMIO_Callback16(SEGPTR cb16, LPMMIOINFO lpmmioinfo, UINT uMessage
lpmmioinfo->adwInfo[0] = mmioInfo16.adwInfo[0]; lpmmioinfo->adwInfo[0] = mmioInfo16.adwInfo[0];
lpmmioinfo->adwInfo[1] = mmioInfo16.adwInfo[1]; lpmmioinfo->adwInfo[1] = mmioInfo16.adwInfo[1];
lpmmioinfo->adwInfo[2] = mmioInfo16.adwInfo[2]; lpmmioinfo->adwInfo[2] = mmioInfo16.adwInfo[2];
lpmmioinfo->adwInfo[3] = mmioInfo16.adwInfo[3];
return result; return result;
} }
@ -2777,7 +2775,6 @@ HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16* lpmmioinfo16,
mmioinfo.adwInfo[0] = (DWORD)DosFileHandleToWin32Handle(mmioinfo.adwInfo[0]); mmioinfo.adwInfo[0] = (DWORD)DosFileHandleToWin32Handle(mmioinfo.adwInfo[0]);
mmioinfo.adwInfo[1] = lpmmioinfo16->adwInfo[1]; mmioinfo.adwInfo[1] = lpmmioinfo16->adwInfo[1];
mmioinfo.adwInfo[2] = lpmmioinfo16->adwInfo[2]; mmioinfo.adwInfo[2] = lpmmioinfo16->adwInfo[2];
mmioinfo.adwInfo[3] = lpmmioinfo16->adwInfo[3];
ret = MMIO_Open(szFileName, &mmioinfo, dwOpenFlags, MMIO_PROC_16); ret = MMIO_Open(szFileName, &mmioinfo, dwOpenFlags, MMIO_PROC_16);
MMIO_SetSegmentedBuffer(mmioinfo.hmmio, (SEGPTR)lpmmioinfo16->pchBuffer, FALSE); MMIO_SetSegmentedBuffer(mmioinfo.hmmio, (SEGPTR)lpmmioinfo16->pchBuffer, FALSE);
@ -2856,7 +2853,6 @@ MMRESULT16 WINAPI mmioGetInfo16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uF
lpmmioinfo->adwInfo[0] = mmioinfo.adwInfo[0]; lpmmioinfo->adwInfo[0] = mmioinfo.adwInfo[0];
lpmmioinfo->adwInfo[1] = mmioinfo.adwInfo[1]; lpmmioinfo->adwInfo[1] = mmioinfo.adwInfo[1];
lpmmioinfo->adwInfo[2] = mmioinfo.adwInfo[2]; lpmmioinfo->adwInfo[2] = mmioinfo.adwInfo[2];
lpmmioinfo->adwInfo[3] = mmioinfo.adwInfo[3];
lpmmioinfo->dwReserved1 = 0; lpmmioinfo->dwReserved1 = 0;
lpmmioinfo->dwReserved2 = 0; lpmmioinfo->dwReserved2 = 0;
lpmmioinfo->hmmio = HMMIO_16(mmioinfo.hmmio); lpmmioinfo->hmmio = HMMIO_16(mmioinfo.hmmio);
@ -3065,7 +3061,11 @@ UINT16 WINAPI joyGetNumDevs16(void)
MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize)
{ {
JOYCAPSA jca; JOYCAPSA jca;
MMRESULT ret = joyGetDevCapsA(wID, &jca, sizeof(jca)); MMRESULT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = joyGetDevCapsA(wID, &jca, sizeof(jca));
if (ret != JOYERR_NOERROR) return ret; if (ret != JOYERR_NOERROR) return ret;
lpCaps->wMid = jca.wMid; lpCaps->wMid = jca.wMid;

View file

@ -352,7 +352,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n", TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n",
(LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize);
s.hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); s.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
if (waveOutOpen(&hWave, WAVE_MAPPER, lpWaveFormat, (DWORD)PlaySound_Callback, if (waveOutOpen(&hWave, WAVE_MAPPER, lpWaveFormat, (DWORD)PlaySound_Callback,
(DWORD)&s, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) (DWORD)&s, CALLBACK_FUNCTION) != MMSYSERR_NOERROR)
@ -374,9 +374,9 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
} }
s.dwEventCount = 1L; /* for first buffer */ s.dwEventCount = 1L; /* for first buffer */
index = 0;
do { do {
index = 0;
left = mmckInfo.cksize; left = mmckInfo.cksize;
mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET); mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET);
@ -410,8 +410,8 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
errCleanUp: errCleanUp:
TRACE("Done playing='%s' => %s!\n", debugstr_w(wps->pszSound), bRet ? "ok" : "ko"); TRACE("Done playing='%s' => %s!\n", debugstr_w(wps->pszSound), bRet ? "ok" : "ko");
CloseHandle(s.hEvent); CloseHandle(s.hEvent);
if (waveHdr) HeapFree(GetProcessHeap(), 0, waveHdr); HeapFree(GetProcessHeap(), 0, waveHdr);
if (lpWaveFormat) HeapFree(GetProcessHeap(), 0, lpWaveFormat); HeapFree(GetProcessHeap(), 0, lpWaveFormat);
if (hWave) while (waveOutClose(hWave) == WAVERR_STILLPLAYING) Sleep(100); if (hWave) while (waveOutClose(hWave) == WAVERR_STILLPLAYING) Sleep(100);
if (hmmio) mmioClose(hmmio, 0); if (hmmio) mmioClose(hmmio, 0);

View file

@ -1,2 +0,0 @@
Makefile
msacm.drv.dbg.c

View file

@ -37,6 +37,7 @@
#include "mmddk.h" #include "mmddk.h"
#include "mmreg.h" #include "mmreg.h"
#include "msacm.h" #include "msacm.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wavemap); WINE_DEFAULT_DEBUG_CHANNEL(wavemap);
@ -269,8 +270,8 @@ error:
WARN("ret = WAVERR_BADFORMAT\n"); WARN("ret = WAVERR_BADFORMAT\n");
return WAVERR_BADFORMAT; return WAVERR_BADFORMAT;
} }
WARN("ret = MMSYSERR_ERROR\n"); WARN("ret = 0x%08lx\n", res);
return MMSYSERR_ERROR; return res;
} }
static DWORD wodClose(WAVEMAPDATA* wom) static DWORD wodClose(WAVEMAPDATA* wom)
@ -422,13 +423,15 @@ static DWORD wodGetPosition(WAVEMAPDATA* wom, LPMMTIME lpTime, DWORD dwParam2)
return val; return val;
} }
static DWORD wodGetDevCaps(UINT wDevID, WAVEMAPDATA* wom, LPWAVEOUTCAPSA lpWaveCaps, DWORD dwParam2) static DWORD wodGetDevCaps(UINT wDevID, WAVEMAPDATA* wom, LPWAVEOUTCAPSW lpWaveCaps, DWORD dwParam2)
{ {
static const WCHAR name[] = {'W','i','n','e',' ','w','a','v','e',' ','o','u','t',' ','m','a','p','p','e','r',0};
TRACE("(%04x %p %p %08lx)\n",wDevID, wom, lpWaveCaps, dwParam2); TRACE("(%04x %p %p %08lx)\n",wDevID, wom, lpWaveCaps, dwParam2);
/* if opened low driver, forward message */ /* if opened low driver, forward message */
if (WAVEMAP_IsData(wom)) if (WAVEMAP_IsData(wom))
return waveOutGetDevCapsA((UINT)wom->u.out.hInnerWave, lpWaveCaps, dwParam2); return waveOutGetDevCapsW((UINT)wom->u.out.hInnerWave, lpWaveCaps, dwParam2);
/* else if no drivers, nothing to map so return bad device */ /* else if no drivers, nothing to map so return bad device */
if (waveOutGetNumDevs() == 0) { if (waveOutGetNumDevs() == 0) {
WARN("bad device id\n"); WARN("bad device id\n");
@ -436,11 +439,11 @@ static DWORD wodGetDevCaps(UINT wDevID, WAVEMAPDATA* wom, LPWAVEOUTCAPSA lpWaveC
} }
/* otherwise, return caps of mapper itself */ /* otherwise, return caps of mapper itself */
if (wDevID == (UINT)-1 || wDevID == (UINT16)-1) { if (wDevID == (UINT)-1 || wDevID == (UINT16)-1) {
WAVEOUTCAPSA woc; WAVEOUTCAPSW woc;
woc.wMid = 0x00FF; woc.wMid = 0x00FF;
woc.wPid = 0x0001; woc.wPid = 0x0001;
woc.vDriverVersion = 0x0100; woc.vDriverVersion = 0x0100;
strcpy(woc.szPname, "Wine wave out mapper"); lstrcpyW(woc.szPname, name);
woc.dwFormats = woc.dwFormats =
WAVE_FORMAT_96M08 | WAVE_FORMAT_96S08 | WAVE_FORMAT_96M16 | WAVE_FORMAT_96S16 | WAVE_FORMAT_96M08 | WAVE_FORMAT_96S08 | WAVE_FORMAT_96M16 | WAVE_FORMAT_96S16 |
WAVE_FORMAT_48M08 | WAVE_FORMAT_48S08 | WAVE_FORMAT_48M16 | WAVE_FORMAT_48S16 | WAVE_FORMAT_48M08 | WAVE_FORMAT_48S08 | WAVE_FORMAT_48M16 | WAVE_FORMAT_48S16 |
@ -556,7 +559,7 @@ DWORD WINAPI WAVEMAP_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case WODM_BREAKLOOP: return wodBreakLoop ((WAVEMAPDATA*)dwUser); case WODM_BREAKLOOP: return wodBreakLoop ((WAVEMAPDATA*)dwUser);
case WODM_PREPARE: return wodPrepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); case WODM_PREPARE: return wodPrepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2);
case WODM_UNPREPARE: return wodUnprepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); case WODM_UNPREPARE: return wodUnprepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2);
case WODM_GETDEVCAPS: return wodGetDevCaps (wDevID, (WAVEMAPDATA*)dwUser, (LPWAVEOUTCAPSA)dwParam1,dwParam2); case WODM_GETDEVCAPS: return wodGetDevCaps (wDevID, (WAVEMAPDATA*)dwUser, (LPWAVEOUTCAPSW)dwParam1,dwParam2);
case WODM_GETNUMDEVS: return 1; case WODM_GETNUMDEVS: return 1;
case WODM_GETPITCH: return MMSYSERR_NOTSUPPORTED; case WODM_GETPITCH: return MMSYSERR_NOTSUPPORTED;
case WODM_SETPITCH: return MMSYSERR_NOTSUPPORTED; case WODM_SETPITCH: return MMSYSERR_NOTSUPPORTED;
@ -778,8 +781,8 @@ error:
WARN("ret = WAVERR_BADFORMAT\n"); WARN("ret = WAVERR_BADFORMAT\n");
return WAVERR_BADFORMAT; return WAVERR_BADFORMAT;
} }
WARN("ret = MMSYSERR_ERROR\n"); WARN("ret = 0x%08lx\n", res);
return MMSYSERR_ERROR; return res;
} }
static DWORD widClose(WAVEMAPDATA* wim) static DWORD widClose(WAVEMAPDATA* wim)
@ -916,13 +919,13 @@ static DWORD widGetPosition(WAVEMAPDATA* wim, LPMMTIME lpTime, DWORD dwParam2)
return val; return val;
} }
static DWORD widGetDevCaps(UINT wDevID, WAVEMAPDATA* wim, LPWAVEINCAPSA lpWaveCaps, DWORD dwParam2) static DWORD widGetDevCaps(UINT wDevID, WAVEMAPDATA* wim, LPWAVEINCAPSW lpWaveCaps, DWORD dwParam2)
{ {
TRACE("(%04x, %p %p %08lx)\n", wDevID, wim, lpWaveCaps, dwParam2); TRACE("(%04x, %p %p %08lx)\n", wDevID, wim, lpWaveCaps, dwParam2);
/* if opened low driver, forward message */ /* if opened low driver, forward message */
if (WAVEMAP_IsData(wim)) if (WAVEMAP_IsData(wim))
return waveInGetDevCapsA((UINT)wim->u.in.hInnerWave, lpWaveCaps, dwParam2); return waveInGetDevCapsW((UINT)wim->u.in.hInnerWave, lpWaveCaps, dwParam2);
/* else if no drivers, nothing to map so return bad device */ /* else if no drivers, nothing to map so return bad device */
if (waveInGetNumDevs() == 0) { if (waveInGetNumDevs() == 0) {
WARN("bad device id\n"); WARN("bad device id\n");
@ -930,11 +933,12 @@ static DWORD widGetDevCaps(UINT wDevID, WAVEMAPDATA* wim, LPWAVEINCAPSA lpWaveCa
} }
/* otherwise, return caps of mapper itself */ /* otherwise, return caps of mapper itself */
if (wDevID == (UINT)-1 || wDevID == (UINT16)-1) { if (wDevID == (UINT)-1 || wDevID == (UINT16)-1) {
WAVEINCAPSA wic; WAVEINCAPSW wic;
static const WCHAR init[] = {'W','i','n','e',' ','w','a','v','e',' ','i','n',' ','m','a','p','p','e','r',0};
wic.wMid = 0x00FF; wic.wMid = 0x00FF;
wic.wPid = 0x0001; wic.wPid = 0x0001;
wic.vDriverVersion = 0x0001; wic.vDriverVersion = 0x0001;
strcpy(wic.szPname, "Wine wave in mapper"); strcpyW(wic.szPname, init);
wic.dwFormats = wic.dwFormats =
WAVE_FORMAT_96M08 | WAVE_FORMAT_96S08 | WAVE_FORMAT_96M16 | WAVE_FORMAT_96S16 | WAVE_FORMAT_96M08 | WAVE_FORMAT_96S08 | WAVE_FORMAT_96M16 | WAVE_FORMAT_96S16 |
WAVE_FORMAT_48M08 | WAVE_FORMAT_48S08 | WAVE_FORMAT_48M16 | WAVE_FORMAT_48S16 | WAVE_FORMAT_48M08 | WAVE_FORMAT_48S08 | WAVE_FORMAT_48M16 | WAVE_FORMAT_48S16 |
@ -1023,7 +1027,7 @@ DWORD WINAPI WAVEMAP_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
case WIDM_ADDBUFFER: return widAddBuffer ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); case WIDM_ADDBUFFER: return widAddBuffer ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2);
case WIDM_PREPARE: return widPrepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); case WIDM_PREPARE: return widPrepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2);
case WIDM_UNPREPARE: return widUnprepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); case WIDM_UNPREPARE: return widUnprepare ((WAVEMAPDATA*)dwUser, (LPWAVEHDR)dwParam1, dwParam2);
case WIDM_GETDEVCAPS: return widGetDevCaps (wDevID, (WAVEMAPDATA*)dwUser, (LPWAVEINCAPSA)dwParam1, dwParam2); case WIDM_GETDEVCAPS: return widGetDevCaps (wDevID, (WAVEMAPDATA*)dwUser, (LPWAVEINCAPSW)dwParam1, dwParam2);
case WIDM_GETNUMDEVS: return 1; case WIDM_GETNUMDEVS: return 1;
case WIDM_GETPOS: return widGetPosition ((WAVEMAPDATA*)dwUser, (LPMMTIME)dwParam1, dwParam2); case WIDM_GETPOS: return widGetPosition ((WAVEMAPDATA*)dwUser, (LPMMTIME)dwParam1, dwParam2);
case WIDM_RESET: return widReset ((WAVEMAPDATA*)dwUser); case WIDM_RESET: return widReset ((WAVEMAPDATA*)dwUser);

View file

@ -268,7 +268,7 @@ MMRESULT MIDI_StreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID,
DWORD cMidi, DWORD_PTR dwCallback, DWORD cMidi, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32); DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32);
UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType,
const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32); DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32);
HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo,

View file

@ -97,8 +97,8 @@ static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
/* FIXME crashes in ReactOS /* FIXME crashes in ReactOS
WINMM_IData->cs.DebugInfo->Spare[1] = (DWORD)"WINMM_IData"; WINMM_IData->cs.DebugInfo->Spare[1] = (DWORD)"WINMM_IData";
*/ */
WINMM_IData->psStopEvent = CreateEventA(NULL, TRUE, FALSE, NULL); WINMM_IData->psStopEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
WINMM_IData->psLastEvent = CreateEventA(NULL, TRUE, FALSE, NULL); WINMM_IData->psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
TRACE("Created IData (%p)\n", WINMM_IData); TRACE("Created IData (%p)\n", WINMM_IData);
return TRUE; return TRUE;
} }
@ -295,14 +295,25 @@ UINT WINAPI mixerGetNumDevs(void)
*/ */
UINT WINAPI mixerGetDevCapsA(UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize) UINT WINAPI mixerGetDevCapsA(UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize)
{ {
LPWINE_MLD wmld; MIXERCAPSW micW;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM; if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIXER, TRUE)) == NULL) ret = mixerGetDevCapsW(uDeviceID, &micW, sizeof(micW));
return MMSYSERR_BADDEVICEID;
return MMDRV_Message(wmld, MXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); if (ret == MMSYSERR_NOERROR) {
MIXERCAPSA micA;
micA.wMid = micW.wMid;
micA.wPid = micW.wPid;
micA.vDriverVersion = micW.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, micW.szPname, -1, micA.szPname,
sizeof(micA.szPname), NULL, NULL );
micA.fdwSupport = micW.fdwSupport;
micA.cDestinations = micW.cDestinations;
memcpy(lpCaps, &micA, min(uSize, sizeof(micA)));
}
return ret;
} }
/************************************************************************** /**************************************************************************
@ -310,24 +321,14 @@ UINT WINAPI mixerGetDevCapsA(UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize
*/ */
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize) UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
{ {
MIXERCAPSA micA; LPWINE_MLD wmld;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM; if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = mixerGetDevCapsA(uDeviceID, &micA, sizeof(micA)); if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIXER, TRUE)) == NULL)
if (ret == MMSYSERR_NOERROR) { return MMSYSERR_BADDEVICEID;
MIXERCAPSW micW;
micW.wMid = micA.wMid; return MMDRV_Message(wmld, MXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE);
micW.wPid = micA.wPid;
micW.vDriverVersion = micA.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, micA.szPname, -1, micW.szPname,
sizeof(micW.szPname)/sizeof(WCHAR) );
micW.fdwSupport = micA.fdwSupport;
micW.cDestinations = micA.cDestinations;
memcpy(lpCaps, &micW, min(uSize, sizeof(micW)));
}
return ret;
} }
UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
@ -408,75 +409,76 @@ UINT WINAPI mixerGetID(HMIXEROBJ hmix, LPUINT lpid, DWORD fdwID)
} }
/************************************************************************** /**************************************************************************
* mixerGetControlDetailsA [WINMM.@] * mixerGetControlDetailsW [WINMM.@]
*/ */
UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW,
DWORD fdwDetails) DWORD fdwDetails)
{ {
LPWINE_MIXER lpwm; LPWINE_MIXER lpwm;
UINT uRet = MMSYSERR_NOERROR; UINT uRet = MMSYSERR_NOERROR;
TRACE("(%p, %p, %08lx)\n", hmix, lpmcdA, fdwDetails); TRACE("(%p, %p, %08lx)\n", hmix, lpmcdW, fdwDetails);
if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR) if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR)
return uRet; return uRet;
if (lpmcdA == NULL || lpmcdA->cbStruct != sizeof(*lpmcdA)) if (lpmcdW == NULL || lpmcdW->cbStruct != sizeof(*lpmcdW))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD_PTR)lpmcdA, return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD_PTR)lpmcdW,
fdwDetails, TRUE); fdwDetails, TRUE);
} }
/************************************************************************** /**************************************************************************
* mixerGetControlDetailsW [WINMM.@] * mixerGetControlDetailsA [WINMM.@]
*/ */
UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails) UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA,
DWORD fdwDetails)
{ {
DWORD ret = MMSYSERR_NOTENABLED; DWORD ret = MMSYSERR_NOTENABLED;
TRACE("(%p, %p, %08lx)\n", hmix, lpmcd, fdwDetails); TRACE("(%p, %p, %08lx)\n", hmix, lpmcdA, fdwDetails);
if (lpmcd == NULL || lpmcd->cbStruct != sizeof(*lpmcd)) if (lpmcdA == NULL || lpmcdA->cbStruct != sizeof(*lpmcdA))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) { switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) {
case MIXER_GETCONTROLDETAILSF_VALUE: case MIXER_GETCONTROLDETAILSF_VALUE:
/* can savely use W structure as it is, no string inside */ /* can savely use A structure as it is, no string inside */
ret = mixerGetControlDetailsA(hmix, lpmcd, fdwDetails); ret = mixerGetControlDetailsW(hmix, lpmcdA, fdwDetails);
break; break;
case MIXER_GETCONTROLDETAILSF_LISTTEXT: case MIXER_GETCONTROLDETAILSF_LISTTEXT:
{ {
MIXERCONTROLDETAILS_LISTTEXTW *pDetailsW = (MIXERCONTROLDETAILS_LISTTEXTW *)lpmcd->paDetails; MIXERCONTROLDETAILS_LISTTEXTA *pDetailsA = (MIXERCONTROLDETAILS_LISTTEXTA *)lpmcdA->paDetails;
MIXERCONTROLDETAILS_LISTTEXTA *pDetailsA; MIXERCONTROLDETAILS_LISTTEXTW *pDetailsW;
int size = max(1, lpmcd->cChannels) * sizeof(MIXERCONTROLDETAILS_LISTTEXTA); int size = max(1, lpmcdA->cChannels) * sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
unsigned int i; unsigned int i;
if (lpmcd->u.cMultipleItems != 0) { if (lpmcdA->u.cMultipleItems != 0) {
size *= lpmcd->u.cMultipleItems; size *= lpmcdA->u.cMultipleItems;
} }
pDetailsA = (MIXERCONTROLDETAILS_LISTTEXTA *)HeapAlloc(GetProcessHeap(), 0, size); pDetailsW = (MIXERCONTROLDETAILS_LISTTEXTW *)HeapAlloc(GetProcessHeap(), 0, size);
lpmcd->paDetails = pDetailsA; lpmcdA->paDetails = pDetailsW;
lpmcd->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTA); lpmcdA->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
/* set up lpmcd->paDetails */ /* set up lpmcd->paDetails */
ret = mixerGetControlDetailsA(hmix, lpmcd, fdwDetails); ret = mixerGetControlDetailsW(hmix, lpmcdA, fdwDetails);
/* copy from lpmcd->paDetails back to paDetailsW; */ /* copy from lpmcd->paDetails back to paDetailsW; */
if(ret == MMSYSERR_NOERROR) { if (ret == MMSYSERR_NOERROR) {
for(i=0;i<lpmcd->u.cMultipleItems*lpmcd->cChannels;i++) { for (i = 0; i < lpmcdA->u.cMultipleItems * lpmcdA->cChannels; i++) {
pDetailsW->dwParam1 = pDetailsA->dwParam1; pDetailsA->dwParam1 = pDetailsW->dwParam1;
pDetailsW->dwParam2 = pDetailsA->dwParam2; pDetailsA->dwParam2 = pDetailsW->dwParam2;
MultiByteToWideChar( CP_ACP, 0, pDetailsA->szName, -1, WideCharToMultiByte( CP_ACP, 0, pDetailsW->szName, -1,
pDetailsW->szName, pDetailsA->szName,
sizeof(pDetailsW->szName)/sizeof(WCHAR) ); sizeof(pDetailsA->szName), NULL, NULL );
pDetailsA++; pDetailsA++;
pDetailsW++; pDetailsW++;
} }
pDetailsA -= lpmcd->u.cMultipleItems*lpmcd->cChannels; pDetailsA -= lpmcdA->u.cMultipleItems * lpmcdA->cChannels;
pDetailsW -= lpmcd->u.cMultipleItems*lpmcd->cChannels; pDetailsW -= lpmcdA->u.cMultipleItems * lpmcdA->cChannels;
} }
HeapFree(GetProcessHeap(), 0, pDetailsA); HeapFree(GetProcessHeap(), 0, pDetailsW);
lpmcd->paDetails = pDetailsW; lpmcdA->paDetails = pDetailsA;
lpmcd->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTW); lpmcdA->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTA);
} }
break; break;
default: default:
@ -492,19 +494,59 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd,
UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA, UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA,
DWORD fdwControls) DWORD fdwControls)
{ {
LPWINE_MIXER lpwm; MIXERLINECONTROLSW mlcW;
UINT uRet = MMSYSERR_NOERROR; DWORD ret;
unsigned int i;
TRACE("(%p, %p, %08lx)\n", hmix, lpmlcA, fdwControls); TRACE("(%p, %p, %08lx)\n", hmix, lpmlcA, fdwControls);
if ((uRet = MIXER_GetDev(hmix, fdwControls, &lpwm)) != MMSYSERR_NOERROR) if (lpmlcA == NULL || lpmlcA->cbStruct != sizeof(*lpmlcA) ||
return uRet; lpmlcA->cbmxctrl != sizeof(MIXERCONTROLA))
if (lpmlcA == NULL || lpmlcA->cbStruct != sizeof(*lpmlcA))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD_PTR)lpmlcA, mlcW.cbStruct = sizeof(mlcW);
fdwControls, TRUE); mlcW.dwLineID = lpmlcA->dwLineID;
mlcW.u.dwControlID = lpmlcA->u.dwControlID;
mlcW.u.dwControlType = lpmlcA->u.dwControlType;
mlcW.cControls = lpmlcA->cControls;
mlcW.cbmxctrl = sizeof(MIXERCONTROLW);
mlcW.pamxctrl = HeapAlloc(GetProcessHeap(), 0,
mlcW.cControls * mlcW.cbmxctrl);
ret = mixerGetLineControlsW(hmix, &mlcW, fdwControls);
if (ret == MMSYSERR_NOERROR) {
lpmlcA->dwLineID = mlcW.dwLineID;
lpmlcA->u.dwControlID = mlcW.u.dwControlID;
lpmlcA->u.dwControlType = mlcW.u.dwControlType;
lpmlcA->cControls = mlcW.cControls;
for (i = 0; i < mlcW.cControls; i++) {
lpmlcA->pamxctrl[i].cbStruct = sizeof(MIXERCONTROLA);
lpmlcA->pamxctrl[i].dwControlID = mlcW.pamxctrl[i].dwControlID;
lpmlcA->pamxctrl[i].dwControlType = mlcW.pamxctrl[i].dwControlType;
lpmlcA->pamxctrl[i].fdwControl = mlcW.pamxctrl[i].fdwControl;
lpmlcA->pamxctrl[i].cMultipleItems = mlcW.pamxctrl[i].cMultipleItems;
WideCharToMultiByte( CP_ACP, 0, mlcW.pamxctrl[i].szShortName, -1,
lpmlcA->pamxctrl[i].szShortName,
sizeof(lpmlcA->pamxctrl[i].szShortName), NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, mlcW.pamxctrl[i].szName, -1,
lpmlcA->pamxctrl[i].szName,
sizeof(lpmlcA->pamxctrl[i].szName), NULL, NULL );
/* sizeof(lpmlcA->pamxctrl[i].Bounds) ==
* sizeof(mlcW.pamxctrl[i].Bounds) */
memcpy(&lpmlcA->pamxctrl[i].Bounds, &mlcW.pamxctrl[i].Bounds,
sizeof(mlcW.pamxctrl[i].Bounds));
/* sizeof(lpmlcA->pamxctrl[i].Metrics) ==
* sizeof(mlcW.pamxctrl[i].Metrics) */
memcpy(&lpmlcA->pamxctrl[i].Metrics, &mlcW.pamxctrl[i].Metrics,
sizeof(mlcW.pamxctrl[i].Metrics));
}
}
HeapFree(GetProcessHeap(), 0, mlcW.pamxctrl);
return ret;
} }
/************************************************************************** /**************************************************************************
@ -513,65 +555,25 @@ UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA,
UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW,
DWORD fdwControls) DWORD fdwControls)
{ {
MIXERLINECONTROLSA mlcA; LPWINE_MIXER lpwm;
DWORD ret; UINT uRet = MMSYSERR_NOERROR;
unsigned int i;
TRACE("(%p, %p, %08lx)\n", hmix, lpmlcW, fdwControls); TRACE("(%p, %p, %08lx)\n", hmix, lpmlcW, fdwControls);
if (lpmlcW == NULL || lpmlcW->cbStruct != sizeof(*lpmlcW) || if ((uRet = MIXER_GetDev(hmix, fdwControls, &lpwm)) != MMSYSERR_NOERROR)
lpmlcW->cbmxctrl != sizeof(MIXERCONTROLW)) return uRet;
if (lpmlcW == NULL || lpmlcW->cbStruct != sizeof(*lpmlcW))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
mlcA.cbStruct = sizeof(mlcA); return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD_PTR)lpmlcW,
mlcA.dwLineID = lpmlcW->dwLineID; fdwControls, TRUE);
mlcA.u.dwControlID = lpmlcW->u.dwControlID;
mlcA.u.dwControlType = lpmlcW->u.dwControlType;
mlcA.cControls = lpmlcW->cControls;
mlcA.cbmxctrl = sizeof(MIXERCONTROLA);
mlcA.pamxctrl = HeapAlloc(GetProcessHeap(), 0,
mlcA.cControls * mlcA.cbmxctrl);
ret = mixerGetLineControlsA(hmix, &mlcA, fdwControls);
if (ret == MMSYSERR_NOERROR) {
lpmlcW->dwLineID = mlcA.dwLineID;
lpmlcW->u.dwControlID = mlcA.u.dwControlID;
lpmlcW->u.dwControlType = mlcA.u.dwControlType;
lpmlcW->cControls = mlcA.cControls;
for (i = 0; i < mlcA.cControls; i++) {
lpmlcW->pamxctrl[i].cbStruct = sizeof(MIXERCONTROLW);
lpmlcW->pamxctrl[i].dwControlID = mlcA.pamxctrl[i].dwControlID;
lpmlcW->pamxctrl[i].dwControlType = mlcA.pamxctrl[i].dwControlType;
lpmlcW->pamxctrl[i].fdwControl = mlcA.pamxctrl[i].fdwControl;
lpmlcW->pamxctrl[i].cMultipleItems = mlcA.pamxctrl[i].cMultipleItems;
MultiByteToWideChar( CP_ACP, 0, mlcA.pamxctrl[i].szShortName, -1,
lpmlcW->pamxctrl[i].szShortName,
sizeof(lpmlcW->pamxctrl[i].szShortName)/sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, mlcA.pamxctrl[i].szName, -1,
lpmlcW->pamxctrl[i].szName,
sizeof(lpmlcW->pamxctrl[i].szName)/sizeof(WCHAR) );
/* sizeof(lpmlcW->pamxctrl[i].Bounds) ==
* sizeof(mlcA.pamxctrl[i].Bounds) */
memcpy(&lpmlcW->pamxctrl[i].Bounds, &mlcA.pamxctrl[i].Bounds,
sizeof(mlcA.pamxctrl[i].Bounds));
/* sizeof(lpmlcW->pamxctrl[i].Metrics) ==
* sizeof(mlcA.pamxctrl[i].Metrics) */
memcpy(&lpmlcW->pamxctrl[i].Metrics, &mlcA.pamxctrl[i].Metrics,
sizeof(mlcA.pamxctrl[i].Metrics));
}
}
HeapFree(GetProcessHeap(), 0, mlcA.pamxctrl);
return ret;
} }
/************************************************************************** /**************************************************************************
* mixerGetLineInfoA [WINMM.@] * mixerGetLineInfoW [WINMM.@]
*/ */
UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliW, DWORD fdwInfo) UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
{ {
LPWINE_MIXER lpwm; LPWINE_MIXER lpwm;
UINT uRet = MMSYSERR_NOERROR; UINT uRet = MMSYSERR_NOERROR;
@ -586,68 +588,68 @@ UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliW, DWORD fdwInfo
} }
/************************************************************************** /**************************************************************************
* mixerGetLineInfoW [WINMM.@] * mixerGetLineInfoA [WINMM.@]
*/ */
UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliA,
DWORD fdwInfo) DWORD fdwInfo)
{ {
MIXERLINEA mliA; MIXERLINEW mliW;
UINT ret; UINT ret;
TRACE("(%p, %p, %08lx)\n", hmix, lpmliW, fdwInfo); TRACE("(%p, %p, %08lx)\n", hmix, lpmliA, fdwInfo);
if (lpmliW == NULL || lpmliW->cbStruct != sizeof(*lpmliW)) if (lpmliA == NULL || lpmliA->cbStruct != sizeof(*lpmliA))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
mliA.cbStruct = sizeof(mliA); mliW.cbStruct = sizeof(mliW);
switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) { switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) {
case MIXER_GETLINEINFOF_COMPONENTTYPE: case MIXER_GETLINEINFOF_COMPONENTTYPE:
mliA.dwComponentType = lpmliW->dwComponentType; mliW.dwComponentType = lpmliA->dwComponentType;
break; break;
case MIXER_GETLINEINFOF_DESTINATION: case MIXER_GETLINEINFOF_DESTINATION:
mliA.dwDestination = lpmliW->dwDestination; mliW.dwDestination = lpmliA->dwDestination;
break; break;
case MIXER_GETLINEINFOF_LINEID: case MIXER_GETLINEINFOF_LINEID:
mliA.dwLineID = lpmliW->dwLineID; mliW.dwLineID = lpmliA->dwLineID;
break; break;
case MIXER_GETLINEINFOF_SOURCE: case MIXER_GETLINEINFOF_SOURCE:
mliA.dwDestination = lpmliW->dwDestination; mliW.dwDestination = lpmliA->dwDestination;
mliA.dwSource = lpmliW->dwSource; mliW.dwSource = lpmliA->dwSource;
break; break;
case MIXER_GETLINEINFOF_TARGETTYPE: case MIXER_GETLINEINFOF_TARGETTYPE:
mliA.Target.dwType = lpmliW->Target.dwType; mliW.Target.dwType = lpmliA->Target.dwType;
mliA.Target.wMid = lpmliW->Target.wMid; mliW.Target.wMid = lpmliA->Target.wMid;
mliA.Target.wPid = lpmliW->Target.wPid; mliW.Target.wPid = lpmliA->Target.wPid;
mliA.Target.vDriverVersion = lpmliW->Target.vDriverVersion; mliW.Target.vDriverVersion = lpmliA->Target.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, lpmliW->Target.szPname, -1, mliA.Target.szPname, sizeof(mliA.Target.szPname), NULL, NULL); MultiByteToWideChar( CP_ACP, 0, lpmliA->Target.szPname, -1, mliW.Target.szPname, sizeof(mliW.Target.szPname));
break; break;
default: default:
WARN("Unsupported fdwControls=0x%08lx\n", fdwInfo); WARN("Unsupported fdwControls=0x%08lx\n", fdwInfo);
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
} }
ret = mixerGetLineInfoA(hmix, &mliA, fdwInfo); ret = mixerGetLineInfoW(hmix, &mliW, fdwInfo);
lpmliW->dwDestination = mliA.dwDestination; lpmliA->dwDestination = mliW.dwDestination;
lpmliW->dwSource = mliA.dwSource; lpmliA->dwSource = mliW.dwSource;
lpmliW->dwLineID = mliA.dwLineID; lpmliA->dwLineID = mliW.dwLineID;
lpmliW->fdwLine = mliA.fdwLine; lpmliA->fdwLine = mliW.fdwLine;
lpmliW->dwUser = mliA.dwUser; lpmliA->dwUser = mliW.dwUser;
lpmliW->dwComponentType = mliA.dwComponentType; lpmliA->dwComponentType = mliW.dwComponentType;
lpmliW->cChannels = mliA.cChannels; lpmliA->cChannels = mliW.cChannels;
lpmliW->cConnections = mliA.cConnections; lpmliA->cConnections = mliW.cConnections;
lpmliW->cControls = mliA.cControls; lpmliA->cControls = mliW.cControls;
MultiByteToWideChar( CP_ACP, 0, mliA.szShortName, -1, lpmliW->szShortName, WideCharToMultiByte( CP_ACP, 0, mliW.szShortName, -1, lpmliA->szShortName,
sizeof(lpmliW->szShortName)/sizeof(WCHAR) ); sizeof(lpmliA->szShortName), NULL, NULL);
MultiByteToWideChar( CP_ACP, 0, mliA.szName, -1, lpmliW->szName, WideCharToMultiByte( CP_ACP, 0, mliW.szName, -1, lpmliA->szName,
sizeof(lpmliW->szName)/sizeof(WCHAR) ); sizeof(lpmliA->szName), NULL, NULL );
lpmliW->Target.dwType = mliA.Target.dwType; lpmliA->Target.dwType = mliW.Target.dwType;
lpmliW->Target.dwDeviceID = mliA.Target.dwDeviceID; lpmliA->Target.dwDeviceID = mliW.Target.dwDeviceID;
lpmliW->Target.wMid = mliA.Target.wMid; lpmliA->Target.wMid = mliW.Target.wMid;
lpmliW->Target.wPid = mliA.Target.wPid; lpmliA->Target.wPid = mliW.Target.wPid;
lpmliW->Target.vDriverVersion = mliA.Target.vDriverVersion; lpmliA->Target.vDriverVersion = mliW.Target.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, mliA.Target.szPname, -1, lpmliW->Target.szPname, WideCharToMultiByte( CP_ACP, 0, mliW.Target.szPname, -1, lpmliA->Target.szPname,
sizeof(lpmliW->Target.szPname)/sizeof(WCHAR) ); sizeof(lpmliA->Target.szPname), NULL, NULL );
return ret; return ret;
} }
@ -655,18 +657,18 @@ UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW,
/************************************************************************** /**************************************************************************
* mixerSetControlDetails [WINMM.@] * mixerSetControlDetails [WINMM.@]
*/ */
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd,
DWORD fdwDetails) DWORD fdwDetails)
{ {
LPWINE_MIXER lpwm; LPWINE_MIXER lpwm;
UINT uRet = MMSYSERR_NOERROR; UINT uRet = MMSYSERR_NOERROR;
TRACE("(%p, %p, %08lx)\n", hmix, lpmcdA, fdwDetails); TRACE("(%p, %p, %08lx)\n", hmix, lpmcd, fdwDetails);
if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR) if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR)
return uRet; return uRet;
return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD_PTR)lpmcdA, return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD_PTR)lpmcd,
fdwDetails, TRUE); fdwDetails, TRUE);
} }
@ -698,31 +700,6 @@ UINT WINAPI auxGetNumDevs(void)
* auxGetDevCapsW [WINMM.@] * auxGetDevCapsW [WINMM.@]
*/ */
UINT WINAPI auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize) UINT WINAPI auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize)
{
AUXCAPSA acA;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = auxGetDevCapsA(uDeviceID, &acA, sizeof(acA));
if (ret == MMSYSERR_NOERROR) {
AUXCAPSW acW;
acW.wMid = acA.wMid;
acW.wPid = acA.wPid;
acW.vDriverVersion = acA.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, acA.szPname, -1, acW.szPname,
sizeof(acW.szPname)/sizeof(WCHAR) );
acW.wTechnology = acA.wTechnology;
acW.dwSupport = acA.dwSupport;
memcpy(lpCaps, &acW, min(uSize, sizeof(acW)));
}
return ret;
}
/**************************************************************************
* auxGetDevCapsA [WINMM.@]
*/
UINT WINAPI auxGetDevCapsA(UINT_PTR uDeviceID, LPAUXCAPSA lpCaps, UINT uSize)
{ {
LPWINE_MLD wmld; LPWINE_MLD wmld;
@ -735,6 +712,32 @@ UINT WINAPI auxGetDevCapsA(UINT_PTR uDeviceID, LPAUXCAPSA lpCaps, UINT uSize)
return MMDRV_Message(wmld, AUXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, AUXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE);
} }
/**************************************************************************
* auxGetDevCapsA [WINMM.@]
*/
UINT WINAPI auxGetDevCapsA(UINT_PTR uDeviceID, LPAUXCAPSA lpCaps, UINT uSize)
{
AUXCAPSW acW;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = auxGetDevCapsW(uDeviceID, &acW, sizeof(acW));
if (ret == MMSYSERR_NOERROR) {
AUXCAPSA acA;
acA.wMid = acW.wMid;
acA.wPid = acW.wPid;
acA.vDriverVersion = acW.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, acW.szPname, -1, acA.szPname,
sizeof(acA.szPname), NULL, NULL );
acA.wTechnology = acW.wTechnology;
acA.dwSupport = acW.dwSupport;
memcpy(lpCaps, &acA, min(uSize, sizeof(acA)));
}
return ret;
}
/************************************************************************** /**************************************************************************
* auxGetVolume [WINMM.@] * auxGetVolume [WINMM.@]
*/ */
@ -1003,7 +1006,6 @@ static int MCI_MapMsgWtoA(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
FIXME("Message 0x%04x needs translation\n", msg); FIXME("Message 0x%04x needs translation\n", msg);
return -1; return -1;
} }
return 0;
} }
static DWORD MCI_UnmapMsgWtoA(UINT msg, DWORD_PTR dwParam1, DWORD_PTR dwParam2, static DWORD MCI_UnmapMsgWtoA(UINT msg, DWORD_PTR dwParam1, DWORD_PTR dwParam2,
@ -1253,35 +1255,6 @@ UINT WINAPI midiOutGetNumDevs(void)
*/ */
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps,
UINT uSize) UINT uSize)
{
MIDIOUTCAPSA mocA;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = midiOutGetDevCapsA(uDeviceID, &mocA, sizeof(mocA));
if (ret == MMSYSERR_NOERROR) {
MIDIOUTCAPSW mocW;
mocW.wMid = mocA.wMid;
mocW.wPid = mocA.wPid;
mocW.vDriverVersion = mocA.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, mocA.szPname, -1, mocW.szPname,
sizeof(mocW.szPname)/sizeof(WCHAR) );
mocW.wTechnology = mocA.wTechnology;
mocW.wVoices = mocA.wVoices;
mocW.wNotes = mocA.wNotes;
mocW.wChannelMask = mocA.wChannelMask;
mocW.dwSupport = mocA.dwSupport;
memcpy(lpCaps, &mocW, min(uSize, sizeof(mocW)));
}
return ret;
}
/**************************************************************************
* midiOutGetDevCapsA [WINMM.@]
*/
UINT WINAPI midiOutGetDevCapsA(UINT_PTR uDeviceID, LPMIDIOUTCAPSA lpCaps,
UINT uSize)
{ {
LPWINE_MLD wmld; LPWINE_MLD wmld;
@ -1295,6 +1268,36 @@ UINT WINAPI midiOutGetDevCapsA(UINT_PTR uDeviceID, LPMIDIOUTCAPSA lpCaps,
return MMDRV_Message(wmld, MODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, MODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE);
} }
/**************************************************************************
* midiOutGetDevCapsA [WINMM.@]
*/
UINT WINAPI midiOutGetDevCapsA(UINT_PTR uDeviceID, LPMIDIOUTCAPSA lpCaps,
UINT uSize)
{
MIDIOUTCAPSW mocW;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = midiOutGetDevCapsW(uDeviceID, &mocW, sizeof(mocW));
if (ret == MMSYSERR_NOERROR) {
MIDIOUTCAPSA mocA;
mocA.wMid = mocW.wMid;
mocA.wPid = mocW.wPid;
mocA.vDriverVersion = mocW.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, mocW.szPname, -1, mocA.szPname,
sizeof(mocA.szPname), NULL, NULL );
mocA.wTechnology = mocW.wTechnology;
mocA.wVoices = mocW.wVoices;
mocA.wNotes = mocW.wNotes;
mocA.wChannelMask = mocW.wChannelMask;
mocA.dwSupport = mocW.dwSupport;
memcpy(lpCaps, &mocA, min(uSize, sizeof(mocA)));
}
return ret;
}
/************************************************************************** /**************************************************************************
* MIDI_GetErrorText [internal] * MIDI_GetErrorText [internal]
*/ */
@ -1633,30 +1636,6 @@ UINT WINAPI midiInGetNumDevs(void)
* midiInGetDevCapsW [WINMM.@] * midiInGetDevCapsW [WINMM.@]
*/ */
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize) UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
{
MIDIINCAPSA micA;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = midiInGetDevCapsA(uDeviceID, &micA, sizeof(micA));
if (ret == MMSYSERR_NOERROR) {
MIDIINCAPSW micW;
micW.wMid = micA.wMid;
micW.wPid = micA.wPid;
micW.vDriverVersion = micA.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, micA.szPname, -1, micW.szPname,
sizeof(micW.szPname)/sizeof(WCHAR) );
micW.dwSupport = micA.dwSupport;
memcpy(lpCaps, &micW, min(uSize, sizeof(micW)));
}
return ret;
}
/**************************************************************************
* midiInGetDevCapsA [WINMM.@]
*/
UINT WINAPI midiInGetDevCapsA(UINT_PTR uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize)
{ {
LPWINE_MLD wmld; LPWINE_MLD wmld;
@ -1670,6 +1649,31 @@ UINT WINAPI midiInGetDevCapsA(UINT_PTR uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSi
return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE);
} }
/**************************************************************************
* midiInGetDevCapsA [WINMM.@]
*/
UINT WINAPI midiInGetDevCapsA(UINT_PTR uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize)
{
MIDIINCAPSW micW;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = midiInGetDevCapsW(uDeviceID, &micW, sizeof(micW));
if (ret == MMSYSERR_NOERROR) {
MIDIINCAPSA micA;
micA.wMid = micW.wMid;
micA.wPid = micW.wPid;
micA.vDriverVersion = micW.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, micW.szPname, -1, micA.szPname,
sizeof(micA.szPname), NULL, NULL );
micA.dwSupport = micW.dwSupport;
memcpy(lpCaps, &micA, min(uSize, sizeof(micA)));
}
return ret;
}
/************************************************************************** /**************************************************************************
* midiInGetErrorTextW [WINMM.@] * midiInGetErrorTextW [WINMM.@]
*/ */
@ -2273,7 +2277,7 @@ MMRESULT MIDI_StreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, DWORD cMidi
lpwm->mld.uDeviceID = *lpuDeviceID; lpwm->mld.uDeviceID = *lpuDeviceID;
ret = MMDRV_Open(&lpwm->mld, MODM_OPEN, (DWORD)&lpwm->mod, fdwOpen); ret = MMDRV_Open(&lpwm->mld, MODM_OPEN, (DWORD)&lpwm->mod, fdwOpen);
lpMidiStrm->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); lpMidiStrm->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
lpMidiStrm->wFlags = HIWORD(fdwOpen); lpMidiStrm->wFlags = HIWORD(fdwOpen);
lpMidiStrm->hThread = CreateThread(NULL, 0, MMSYSTEM_MidiStream_Player, lpMidiStrm->hThread = CreateThread(NULL, 0, MMSYSTEM_MidiStream_Player,
@ -2491,7 +2495,7 @@ MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm)
} }
UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType,
const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32) DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32)
{ {
HANDLE handle; HANDLE handle;
@ -2528,7 +2532,7 @@ UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType,
} }
wod.hWave = handle; wod.hWave = handle;
wod.lpFormat = lpFormat; /* should the struct be copied iso pointer? */ wod.lpFormat = (LPWAVEFORMATEX)lpFormat; /* should the struct be copied iso pointer? */
wod.dwCallback = dwCallback; wod.dwCallback = dwCallback;
wod.dwInstance = dwInstance; wod.dwInstance = dwInstance;
wod.dnDevNode = 0L; wod.dnDevNode = 0L;
@ -2582,6 +2586,34 @@ UINT WINAPI waveOutGetNumDevs(void)
*/ */
UINT WINAPI waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps, UINT WINAPI waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps,
UINT uSize) UINT uSize)
{
WAVEOUTCAPSW wocW;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = waveOutGetDevCapsW(uDeviceID, &wocW, sizeof(wocW));
if (ret == MMSYSERR_NOERROR) {
WAVEOUTCAPSA wocA;
wocA.wMid = wocW.wMid;
wocA.wPid = wocW.wPid;
wocA.vDriverVersion = wocW.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, wocW.szPname, -1, wocA.szPname,
sizeof(wocA.szPname), NULL, NULL );
wocA.dwFormats = wocW.dwFormats;
wocA.wChannels = wocW.wChannels;
wocA.dwSupport = wocW.dwSupport;
memcpy(lpCaps, &wocA, min(uSize, sizeof(wocA)));
}
return ret;
}
/**************************************************************************
* waveOutGetDevCapsW [WINMM.@]
*/
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps,
UINT uSize)
{ {
LPWINE_MLD wmld; LPWINE_MLD wmld;
@ -2596,33 +2628,6 @@ UINT WINAPI waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps,
} }
/**************************************************************************
* waveOutGetDevCapsW [WINMM.@]
*/
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps,
UINT uSize)
{
WAVEOUTCAPSA wocA;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = waveOutGetDevCapsA(uDeviceID, &wocA, sizeof(wocA));
if (ret == MMSYSERR_NOERROR) {
WAVEOUTCAPSW wocW;
wocW.wMid = wocA.wMid;
wocW.wPid = wocA.wPid;
wocW.vDriverVersion = wocA.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, wocA.szPname, -1, wocW.szPname,
sizeof(wocW.szPname)/sizeof(WCHAR) );
wocW.dwFormats = wocA.dwFormats;
wocW.wChannels = wocA.wChannels;
wocW.dwSupport = wocA.dwSupport;
memcpy(lpCaps, &wocW, min(uSize, sizeof(wocW)));
}
return ret;
}
/************************************************************************** /**************************************************************************
* WAVE_GetErrorText [internal] * WAVE_GetErrorText [internal]
*/ */
@ -2996,31 +3001,6 @@ UINT WINAPI waveInGetNumDevs(void)
* waveInGetDevCapsW [WINMM.@] * waveInGetDevCapsW [WINMM.@]
*/ */
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize) UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
{
WAVEINCAPSA wicA;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = waveInGetDevCapsA(uDeviceID, &wicA, sizeof(wicA));
if (ret == MMSYSERR_NOERROR) {
WAVEINCAPSW wicW;
wicW.wMid = wicA.wMid;
wicW.wPid = wicA.wPid;
wicW.vDriverVersion = wicA.vDriverVersion;
MultiByteToWideChar( CP_ACP, 0, wicA.szPname, -1, wicW.szPname,
sizeof(wicW.szPname)/sizeof(WCHAR) );
wicW.dwFormats = wicA.dwFormats;
wicW.wChannels = wicA.wChannels;
memcpy(lpCaps, &wicW, min(uSize, sizeof(wicW)));
}
return ret;
}
/**************************************************************************
* waveInGetDevCapsA [WINMM.@]
*/
UINT WINAPI waveInGetDevCapsA(UINT_PTR uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSize)
{ {
LPWINE_MLD wmld; LPWINE_MLD wmld;
@ -3034,6 +3014,32 @@ UINT WINAPI waveInGetDevCapsA(UINT_PTR uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSi
return MMDRV_Message(wmld, WIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, WIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE);
} }
/**************************************************************************
* waveInGetDevCapsA [WINMM.@]
*/
UINT WINAPI waveInGetDevCapsA(UINT_PTR uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSize)
{
WAVEINCAPSW wicW;
UINT ret;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
ret = waveInGetDevCapsW(uDeviceID, &wicW, sizeof(wicW));
if (ret == MMSYSERR_NOERROR) {
WAVEINCAPSA wicA;
wicA.wMid = wicW.wMid;
wicA.wPid = wicW.wPid;
wicA.vDriverVersion = wicW.vDriverVersion;
WideCharToMultiByte( CP_ACP, 0, wicW.szPname, -1, wicA.szPname,
sizeof(wicA.szPname), NULL, NULL );
wicA.dwFormats = wicW.dwFormats;
wicA.wChannels = wicW.wChannels;
memcpy(lpCaps, &wicA, min(uSize, sizeof(wicA)));
}
return ret;
}
/************************************************************************** /**************************************************************************
* waveInGetErrorTextA [WINMM.@] * waveInGetErrorTextA [WINMM.@]
*/ */

View file

@ -188,5 +188,3 @@
@ stdcall waveOutSetVolume(long long) @ stdcall waveOutSetVolume(long long)
@ stdcall waveOutUnprepareHeader(long ptr long) @ stdcall waveOutUnprepareHeader(long ptr long)
@ stdcall waveOutWrite(long ptr long) @ stdcall waveOutWrite(long ptr long)
@ stub winmmf_ThunkData32
@ stub winmmsl_ThunkData32