winmm: Get rid of the bFrom32 parameter in MMDRV_Alloc and MMDRV_Message.

This commit is contained in:
Eric Pouech 2009-10-22 22:10:32 +02:00 committed by Alexandre Julliard
parent 32c170344a
commit 69c963c3d1
4 changed files with 111 additions and 190 deletions

View File

@ -116,7 +116,7 @@ UINT MMDRV_GetNum(UINT type)
* MMDRV_Message [internal] * MMDRV_Message [internal]
*/ */
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1,
DWORD_PTR dwParam2, BOOL bFrom32) DWORD_PTR dwParam2)
{ {
LPWINE_MM_DRIVER lpDrv; LPWINE_MM_DRIVER lpDrv;
DWORD ret; DWORD ret;
@ -125,9 +125,9 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1,
WINMM_MapType map; WINMM_MapType map;
int devID; int devID;
TRACE("(%s %u %u 0x%08lx 0x%08lx 0x%08lx %c)\n", TRACE("(%s %u %u 0x%08lx 0x%08lx 0x%08lx)\n",
llTypes[mld->type].typestr, mld->uDeviceID, wMsg, llTypes[mld->type].typestr, mld->uDeviceID, wMsg,
mld->dwDriverInstance, dwParam1, dwParam2, bFrom32?'Y':'N'); mld->dwDriverInstance, dwParam1, dwParam2);
if (mld->uDeviceID == (UINT16)-1) { if (mld->uDeviceID == (UINT16)-1) {
if (!llType->bSupportMapper) { if (!llType->bSupportMapper) {
@ -158,41 +158,13 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1,
if (lpDrv->bIs32) { if (lpDrv->bIs32) {
assert(part->u.fnMessage32); assert(part->u.fnMessage32);
if (bFrom32) {
TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx)\n", TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx)\n",
mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2);
ret = part->u.fnMessage32(mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); ret = part->u.fnMessage32(mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2);
TRACE("=> %s\n", WINMM_ErrorToString(ret)); TRACE("=> %s\n", WINMM_ErrorToString(ret));
} else {
map = llType->Map16To32A(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2);
switch (map) {
case WINMM_MAP_NOMEM:
ret = MMSYSERR_NOMEM;
break;
case WINMM_MAP_MSGERROR:
FIXME("NIY: no conversion yet 16->32 (%u)\n", wMsg);
ret = MMSYSERR_ERROR;
break;
case WINMM_MAP_OK:
case WINMM_MAP_OKMEM:
TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx)\n",
mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2);
ret = part->u.fnMessage32(mld->uDeviceID, wMsg, mld->dwDriverInstance,
dwParam1, dwParam2);
TRACE("=> %s\n", WINMM_ErrorToString(ret));
if (map == WINMM_MAP_OKMEM)
llType->UnMap16To32A(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2, ret);
break;
default:
FIXME("NIY\n");
ret = MMSYSERR_NOTSUPPORTED;
break;
}
}
} else { } else {
assert(part->u.fnMessage16 && pFnCallMMDrvFunc16); assert(part->u.fnMessage16 && pFnCallMMDrvFunc16);
if (bFrom32) {
map = llType->Map32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2); map = llType->Map32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2);
switch (map) { switch (map) {
case WINMM_MAP_NOMEM: case WINMM_MAP_NOMEM:
@ -206,9 +178,8 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1,
case WINMM_MAP_OKMEM: case WINMM_MAP_OKMEM:
TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx)\n", TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx)\n",
mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2);
ret = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16, ret = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16, mld->uDeviceID, wMsg,
mld->uDeviceID, wMsg, mld->dwDriverInstance, mld->dwDriverInstance, dwParam1, dwParam2);
dwParam1, dwParam2);
TRACE("=> %s\n", WINMM_ErrorToString(ret)); TRACE("=> %s\n", WINMM_ErrorToString(ret));
if (map == WINMM_MAP_OKMEM) if (map == WINMM_MAP_OKMEM)
llType->UnMap32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2, ret); llType->UnMap32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2, ret);
@ -218,14 +189,6 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1,
ret = MMSYSERR_NOTSUPPORTED; ret = MMSYSERR_NOTSUPPORTED;
break; break;
} }
} else {
TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx)\n",
mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2);
ret = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16,
mld->uDeviceID, wMsg, mld->dwDriverInstance,
dwParam1, dwParam2);
TRACE("=> %s\n", WINMM_ErrorToString(ret));
}
} }
return ret; return ret;
} }
@ -234,12 +197,12 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1,
* MMDRV_Alloc [internal] * MMDRV_Alloc [internal]
*/ */
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags,
DWORD_PTR* dwCallback, DWORD_PTR* dwInstance, BOOL bFrom32) DWORD_PTR* dwCallback, DWORD_PTR* dwInstance)
{ {
LPWINE_MLD mld; LPWINE_MLD mld;
UINT_PTR i; UINT_PTR i;
TRACE("(%d, %04x, %p, %p, %p, %p, %c)\n", TRACE("(%d, %04x, %p, %p, %p, %p)\n",
size, type, hndl, dwFlags, dwCallback, dwInstance, bFrom32?'Y':'N'); size, type, hndl, dwFlags, dwCallback, dwInstance);
mld = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); mld = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if (!mld) return NULL; if (!mld) return NULL;
@ -265,7 +228,6 @@ LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags,
ERR("Shouldn't happen. Bad allocation scheme\n"); ERR("Shouldn't happen. Bad allocation scheme\n");
} }
mld->bFrom32 = bFrom32;
mld->dwFlags = HIWORD(*dwFlags); mld->dwFlags = HIWORD(*dwFlags);
mld->dwCallback = *dwCallback; mld->dwCallback = *dwCallback;
mld->dwClientInstance = *dwInstance; mld->dwClientInstance = *dwInstance;
@ -328,14 +290,14 @@ DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
mld->uDeviceID = (UINT16)-1; mld->uDeviceID = (UINT16)-1;
mld->mmdIndex = llType->lpMlds[-1].mmdIndex; mld->mmdIndex = llType->lpMlds[-1].mmdIndex;
TRACE("Setting mmdIndex to %u\n", mld->mmdIndex); TRACE("Setting mmdIndex to %u\n", mld->mmdIndex);
dwRet = MMDRV_Message(mld, wMsg, dwParam1, dwFlags, TRUE); dwRet = MMDRV_Message(mld, wMsg, dwParam1, dwFlags);
} }
} }
} else { } else {
if (mld->uDeviceID < llType->wMaxId) { if (mld->uDeviceID < llType->wMaxId) {
mld->mmdIndex = llType->lpMlds[mld->uDeviceID].mmdIndex; mld->mmdIndex = llType->lpMlds[mld->uDeviceID].mmdIndex;
TRACE("Setting mmdIndex to %u\n", mld->mmdIndex); TRACE("Setting mmdIndex to %u\n", mld->mmdIndex);
dwRet = MMDRV_Message(mld, wMsg, dwParam1, dwFlags, TRUE); dwRet = MMDRV_Message(mld, wMsg, dwParam1, dwFlags);
} }
} }
if (dwRet == MMSYSERR_NOERROR) if (dwRet == MMSYSERR_NOERROR)
@ -349,7 +311,7 @@ DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg) DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg)
{ {
TRACE("(%p, %04x)\n", mld, wMsg); TRACE("(%p, %04x)\n", mld, wMsg);
return MMDRV_Message(mld, wMsg, 0L, 0L, TRUE); return MMDRV_Message(mld, wMsg, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -457,11 +419,11 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg,
case DRV_QUERYDEVICEINTERFACE: case DRV_QUERYDEVICEINTERFACE:
case DRV_QUERYDEVICEINTERFACESIZE: case DRV_QUERYDEVICEINTERFACESIZE:
return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE); return MMDRV_Message(mld, uMsg, dwParam1, dwParam2);
case DRV_QUERYDSOUNDIFACE: /* Wine-specific: Retrieve DirectSound interface */ case DRV_QUERYDSOUNDIFACE: /* Wine-specific: Retrieve DirectSound interface */
case DRV_QUERYDSOUNDDESC: /* Wine-specific: Retrieve DirectSound driver description*/ case DRV_QUERYDSOUNDDESC: /* Wine-specific: Retrieve DirectSound driver description*/
return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE); return MMDRV_Message(mld, uMsg, dwParam1, dwParam2);
default: default:
WARN("Unknown call %04x\n", uMsg); WARN("Unknown call %04x\n", uMsg);

View File

@ -41,7 +41,7 @@ static void MMDRV_Callback(LPWINE_MLD mld, HDRVR hDev, UINT uMsg, DWORD_PTR dwP
TRACE("CB (*%08lx)(%p %08x %08lx %08lx %08lx\n", TRACE("CB (*%08lx)(%p %08x %08lx %08lx %08lx\n",
mld->dwCallback, hDev, uMsg, mld->dwClientInstance, dwParam1, dwParam2); mld->dwCallback, hDev, uMsg, mld->dwClientInstance, dwParam1, dwParam2);
if (!mld->bFrom32 && (mld->dwFlags & DCB_TYPEMASK) == DCB_FUNCTION) if ((mld->dwFlags & DCB_TYPEMASK) == DCB_FUNCTION)
{ {
WORD args[8]; WORD args[8];
/* 16 bit func, call it */ /* 16 bit func, call it */
@ -243,7 +243,7 @@ static void CALLBACK MMDRV_MidiIn_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dwI
case MIM_LONGDATA: case MIM_LONGDATA:
case MIM_LONGERROR: case MIM_LONGERROR:
/* dwParam1 points to a MidiHdr, work to be done !!! */ /* dwParam1 points to a MidiHdr, work to be done !!! */
if (mld->bFrom32 && !MMDRV_Is32(mld->mmdIndex)) { if (!MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 32 => 16 */ /* initial map is: 32 => 16 */
LPMIDIHDR mh16 = MapSL(dwParam1); LPMIDIHDR mh16 = MapSL(dwParam1);
LPMIDIHDR mh32 = *(LPMIDIHDR*)((LPSTR)mh16 - sizeof(LPMIDIHDR)); LPMIDIHDR mh32 = *(LPMIDIHDR*)((LPSTR)mh16 - sizeof(LPMIDIHDR));
@ -253,19 +253,8 @@ static void CALLBACK MMDRV_MidiIn_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dwI
mh32->dwBytesRecorded = mh16->dwBytesRecorded; mh32->dwBytesRecorded = mh16->dwBytesRecorded;
if (mh32->reserved >= sizeof(MIDIHDR)) if (mh32->reserved >= sizeof(MIDIHDR))
mh32->dwOffset = mh16->dwOffset; mh32->dwOffset = mh16->dwOffset;
} else if (!mld->bFrom32 && MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 16 => 32 */
LPMIDIHDR mh32 = (LPMIDIHDR)(dwParam1);
SEGPTR segmh16 = *(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR));
LPMIDIHDR mh16 = MapSL(segmh16);
dwParam1 = (DWORD)segmh16;
mh16->dwFlags = mh32->dwFlags;
mh16->dwBytesRecorded = mh32->dwBytesRecorded;
if (mh16->reserved >= sizeof(MIDIHDR))
mh16->dwOffset = mh32->dwOffset;
} }
/* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ /* else { 32 => 32, nothing to do, same struct is kept }*/
break; break;
/* case MOM_POSITIONCB: */ /* case MOM_POSITIONCB: */
default: default:
@ -708,7 +697,7 @@ static void CALLBACK MMDRV_MidiOut_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dw
/* dwParam1 & dwParam2 are supposed to be 0, nothing to do */ /* dwParam1 & dwParam2 are supposed to be 0, nothing to do */
break; break;
case MOM_DONE: case MOM_DONE:
if (mld->bFrom32 && !MMDRV_Is32(mld->mmdIndex)) { if (!MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 32 => 16 */ /* initial map is: 32 => 16 */
LPMIDIHDR mh16 = MapSL(dwParam1); LPMIDIHDR mh16 = MapSL(dwParam1);
LPMIDIHDR mh32 = *(LPMIDIHDR*)((LPSTR)mh16 - sizeof(LPMIDIHDR)); LPMIDIHDR mh32 = *(LPMIDIHDR*)((LPSTR)mh16 - sizeof(LPMIDIHDR));
@ -718,18 +707,8 @@ static void CALLBACK MMDRV_MidiOut_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dw
mh32->dwOffset = mh16->dwOffset; mh32->dwOffset = mh16->dwOffset;
if (mh32->reserved >= sizeof(MIDIHDR)) if (mh32->reserved >= sizeof(MIDIHDR))
mh32->dwOffset = mh16->dwOffset; mh32->dwOffset = mh16->dwOffset;
} else if (!mld->bFrom32 && MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 16 => 32 */
LPMIDIHDR mh32 = (LPMIDIHDR)(dwParam1);
SEGPTR segmh16 = *(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR));
LPMIDIHDR mh16 = MapSL(segmh16);
dwParam1 = (DWORD)segmh16;
mh16->dwFlags = mh32->dwFlags;
if (mh16->reserved >= sizeof(MIDIHDR))
mh16->dwOffset = mh32->dwOffset;
} }
/* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ /* else { 32 => 32, nothing to do, same struct is kept }*/
break; break;
/* case MOM_POSITIONCB: */ /* case MOM_POSITIONCB: */
default: default:
@ -1234,7 +1213,7 @@ static void CALLBACK MMDRV_WaveIn_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dwI
/* dwParam1 & dwParam2 are supposed to be 0, nothing to do */ /* dwParam1 & dwParam2 are supposed to be 0, nothing to do */
break; break;
case WIM_DATA: case WIM_DATA:
if (mld->bFrom32 && !MMDRV_Is32(mld->mmdIndex)) { if (!MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 32 => 16 */ /* initial map is: 32 => 16 */
LPWAVEHDR wh16 = MapSL(dwParam1); LPWAVEHDR wh16 = MapSL(dwParam1);
LPWAVEHDR wh32 = *(LPWAVEHDR*)((LPSTR)wh16 - sizeof(LPWAVEHDR)); LPWAVEHDR wh32 = *(LPWAVEHDR*)((LPSTR)wh16 - sizeof(LPWAVEHDR));
@ -1242,17 +1221,8 @@ static void CALLBACK MMDRV_WaveIn_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dwI
dwParam1 = (DWORD)wh32; dwParam1 = (DWORD)wh32;
wh32->dwFlags = wh16->dwFlags; wh32->dwFlags = wh16->dwFlags;
wh32->dwBytesRecorded = wh16->dwBytesRecorded; wh32->dwBytesRecorded = wh16->dwBytesRecorded;
} else if (!mld->bFrom32 && MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 16 => 32 */
LPWAVEHDR wh32 = (LPWAVEHDR)(dwParam1);
SEGPTR segwh16 = *(SEGPTR*)((LPSTR)wh32 - sizeof(LPWAVEHDR));
LPWAVEHDR wh16 = MapSL(segwh16);
dwParam1 = (DWORD)segwh16;
wh16->dwFlags = wh32->dwFlags;
wh16->dwBytesRecorded = wh32->dwBytesRecorded;
} }
/* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ /* else { 32 => 32, nothing to do, same struct is kept }*/
break; break;
default: default:
ERR("Unknown msg %u\n", uMsg); ERR("Unknown msg %u\n", uMsg);
@ -1807,23 +1777,15 @@ static void CALLBACK MMDRV_WaveOut_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dw
/* dwParam1 & dwParam2 are supposed to be 0, nothing to do */ /* dwParam1 & dwParam2 are supposed to be 0, nothing to do */
break; break;
case WOM_DONE: case WOM_DONE:
if (mld->bFrom32 && !MMDRV_Is32(mld->mmdIndex)) { if (!MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 32 => 16 */ /* initial map is: 32 => 16 */
LPWAVEHDR wh16 = MapSL(dwParam1); LPWAVEHDR wh16 = MapSL(dwParam1);
LPWAVEHDR wh32 = *(LPWAVEHDR*)((LPSTR)wh16 - sizeof(LPWAVEHDR)); LPWAVEHDR wh32 = *(LPWAVEHDR*)((LPSTR)wh16 - sizeof(LPWAVEHDR));
dwParam1 = (DWORD)wh32; dwParam1 = (DWORD)wh32;
wh32->dwFlags = wh16->dwFlags; wh32->dwFlags = wh16->dwFlags;
} else if (!mld->bFrom32 && MMDRV_Is32(mld->mmdIndex)) {
/* initial map is: 16 => 32 */
LPWAVEHDR wh32 = (LPWAVEHDR)(dwParam1);
SEGPTR segwh16 = *(SEGPTR*)((LPSTR)wh32 - sizeof(LPWAVEHDR));
LPWAVEHDR wh16 = MapSL(segwh16);
dwParam1 = (DWORD)segwh16;
wh16->dwFlags = wh32->dwFlags;
} }
/* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ /* else { 32 => 32, nothing to do, same struct is kept }*/
break; break;
default: default:
ERR("Unknown msg %u\n", uMsg); ERR("Unknown msg %u\n", uMsg);

View File

@ -97,7 +97,6 @@ typedef struct tagWINE_MLD {
UINT mmdIndex; /* index to low-level driver in MMDrvs table */ UINT mmdIndex; /* index to low-level driver in MMDrvs table */
DWORD_PTR dwDriverInstance; /* this value is driver related, as opposed to DWORD_PTR dwDriverInstance; /* this value is driver related, as opposed to
* opendesc.dwInstance which is client (callback) related */ * opendesc.dwInstance which is client (callback) related */
WORD bFrom32;
WORD dwFlags; WORD dwFlags;
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
DWORD_PTR dwClientInstance; DWORD_PTR dwClientInstance;
@ -183,13 +182,13 @@ BOOL MMDRV_Init(void);
void MMDRV_Exit(void); void MMDRV_Exit(void);
UINT MMDRV_GetNum(UINT); UINT MMDRV_GetNum(UINT);
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags,
DWORD_PTR* dwCallback, DWORD_PTR* dwInstance, BOOL bFrom32); DWORD_PTR* dwCallback, DWORD_PTR* dwInstance);
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld); void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld);
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwParam2); DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwParam2);
DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg); DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg);
LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID); LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID);
LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstTyped); LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstTyped);
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2, BOOL bFrom32); DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
BOOL MMDRV_Is32(unsigned int); BOOL MMDRV_Is32(unsigned int);
void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC,

View File

@ -312,7 +312,7 @@ UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIXER, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIXER, TRUE)) == NULL)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
return MMDRV_Message(wmld, MXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, MXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
} }
static void CALLBACK MIXER_WCallback(HMIXEROBJ hmx, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam, DWORD_PTR param2) static void CALLBACK MIXER_WCallback(HMIXEROBJ hmx, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam, DWORD_PTR param2)
@ -364,7 +364,7 @@ UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
} }
wmld = MMDRV_Alloc(sizeof(WINE_MIXER), MMDRV_MIXER, &hMix, &fdwOpen, wmld = MMDRV_Alloc(sizeof(WINE_MIXER), MMDRV_MIXER, &hMix, &fdwOpen,
&dwCallback, &dwInstance, TRUE); &dwCallback, &dwInstance);
wmld->uDeviceID = uDeviceID; wmld->uDeviceID = uDeviceID;
mod.hmx = hMix; mod.hmx = hMix;
@ -435,7 +435,7 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD_PTR)lpmcdW, return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD_PTR)lpmcdW,
fdwDetails, TRUE); fdwDetails);
} }
/************************************************************************** /**************************************************************************
@ -583,7 +583,7 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW,
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD_PTR)lpmlcW, return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD_PTR)lpmlcW,
fdwControls, TRUE); fdwControls);
} }
/************************************************************************** /**************************************************************************
@ -600,7 +600,7 @@ UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo
return uRet; return uRet;
return MMDRV_Message(&lpwm->mld, MXDM_GETLINEINFO, (DWORD_PTR)lpmliW, return MMDRV_Message(&lpwm->mld, MXDM_GETLINEINFO, (DWORD_PTR)lpmliW,
fdwInfo, TRUE); fdwInfo);
} }
/************************************************************************** /**************************************************************************
@ -687,7 +687,7 @@ UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd,
return uRet; return uRet;
return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD_PTR)lpmcd, return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD_PTR)lpmcd,
fdwDetails, TRUE); fdwDetails);
} }
/************************************************************************** /**************************************************************************
@ -703,7 +703,7 @@ DWORD WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR
if ((wmld = MMDRV_Get(hmix, MMDRV_MIXER, FALSE)) == NULL) if ((wmld = MMDRV_Get(hmix, MMDRV_MIXER, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, uMsg, dwParam1, dwParam2, TRUE); return MMDRV_Message(wmld, uMsg, dwParam1, dwParam2);
} }
/************************************************************************** /**************************************************************************
@ -727,7 +727,7 @@ UINT WINAPI auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize)
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, AUXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, AUXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
} }
/************************************************************************** /**************************************************************************
@ -767,7 +767,7 @@ UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD* lpdwVolume)
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, AUXDM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L, TRUE); return MMDRV_Message(wmld, AUXDM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L);
} }
/************************************************************************** /**************************************************************************
@ -781,7 +781,7 @@ UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume)
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, AUXDM_SETVOLUME, dwVolume, 0L, TRUE); return MMDRV_Message(wmld, AUXDM_SETVOLUME, dwVolume, 0L);
} }
/************************************************************************** /**************************************************************************
@ -794,7 +794,7 @@ UINT WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD_PTR dw1, DWORD_PT
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, uMessage, dw1, dw2, TRUE); return MMDRV_Message(wmld, uMessage, dw1, dw2);
} }
/************************************************************************** /**************************************************************************
@ -820,7 +820,7 @@ UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps,
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, MODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
} }
/************************************************************************** /**************************************************************************
@ -905,7 +905,7 @@ UINT WINAPI midiOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize)
*/ */
static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, DWORD_PTR* lpdwCallback, static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, DWORD_PTR* lpdwCallback,
DWORD_PTR* lpdwInstance, LPDWORD lpdwFlags, DWORD_PTR* lpdwInstance, LPDWORD lpdwFlags,
DWORD cIDs, MIDIOPENSTRMID* lpIDs, BOOL bFrom32) DWORD cIDs, MIDIOPENSTRMID* lpIDs)
{ {
HANDLE hMidiOut; HANDLE hMidiOut;
LPWINE_MIDI lpwm; LPWINE_MIDI lpwm;
@ -914,7 +914,7 @@ static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, DWORD_PTR* lpdwCallback,
size = sizeof(WINE_MIDI) + (cIDs ? (cIDs-1) : 0) * sizeof(MIDIOPENSTRMID); size = sizeof(WINE_MIDI) + (cIDs ? (cIDs-1) : 0) * sizeof(MIDIOPENSTRMID);
lpwm = (LPWINE_MIDI)MMDRV_Alloc(size, MMDRV_MIDIOUT, &hMidiOut, lpdwFlags, lpwm = (LPWINE_MIDI)MMDRV_Alloc(size, MMDRV_MIDIOUT, &hMidiOut, lpdwFlags,
lpdwCallback, lpdwInstance, bFrom32); lpdwCallback, lpdwInstance);
if (lphMidiOut != NULL) if (lphMidiOut != NULL)
*lphMidiOut = hMidiOut; *lphMidiOut = hMidiOut;
@ -946,8 +946,7 @@ UINT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID,
if (lphMidiOut != NULL) *lphMidiOut = 0; if (lphMidiOut != NULL) *lphMidiOut = 0;
lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &dwFlags, lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &dwFlags, 0, NULL);
0, NULL, TRUE);
if (lpwm == NULL) if (lpwm == NULL)
return MMSYSERR_NOMEM; return MMSYSERR_NOMEM;
@ -1002,7 +1001,7 @@ UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_PREPARE, (DWORD_PTR)lpMidiOutHdr, uSize, TRUE); return MMDRV_Message(wmld, MODM_PREPARE, (DWORD_PTR)lpMidiOutHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1025,7 +1024,7 @@ UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD_PTR)lpMidiOutHdr, uSize, TRUE); return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD_PTR)lpMidiOutHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1040,7 +1039,7 @@ UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_DATA, dwMsg, 0L, TRUE); return MMDRV_Message(wmld, MODM_DATA, dwMsg, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1056,7 +1055,7 @@ UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut,
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD_PTR)lpMidiOutHdr, uSize, TRUE); return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD_PTR)lpMidiOutHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1071,7 +1070,7 @@ UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_RESET, 0L, 0L, TRUE); return MMDRV_Message(wmld, MODM_RESET, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1086,7 +1085,7 @@ UINT WINAPI midiOutGetVolume(HMIDIOUT hMidiOut, DWORD* lpdwVolume)
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L, TRUE); return MMDRV_Message(wmld, MODM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1101,7 +1100,7 @@ UINT WINAPI midiOutSetVolume(HMIDIOUT hMidiOut, DWORD dwVolume)
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL) if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MODM_SETVOLUME, dwVolume, 0L, TRUE); return MMDRV_Message(wmld, MODM_SETVOLUME, dwVolume, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1170,7 +1169,7 @@ UINT WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage,
FIXME("can't handle OPEN or CLOSE message!\n"); FIXME("can't handle OPEN or CLOSE message!\n");
return MMSYSERR_NOTSUPPORTED; return MMSYSERR_NOTSUPPORTED;
} }
return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
} }
/************************************************************************** /**************************************************************************
@ -1195,7 +1194,7 @@ UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSi
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIIN, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIIN, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1239,7 +1238,7 @@ UINT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID,
if (lphMidiIn != NULL) *lphMidiIn = 0; if (lphMidiIn != NULL) *lphMidiIn = 0;
lpwm = (LPWINE_MIDI)MMDRV_Alloc(sizeof(WINE_MIDI), MMDRV_MIDIIN, &hMidiIn, lpwm = (LPWINE_MIDI)MMDRV_Alloc(sizeof(WINE_MIDI), MMDRV_MIDIIN, &hMidiIn,
&dwFlags, &dwCallback, &dwInstance, TRUE); &dwFlags, &dwCallback, &dwInstance);
if (lpwm == NULL) if (lpwm == NULL)
return MMSYSERR_NOMEM; return MMSYSERR_NOMEM;
@ -1295,7 +1294,7 @@ UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD_PTR)lpMidiInHdr, uSize, TRUE); return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD_PTR)lpMidiInHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1318,7 +1317,7 @@ UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD_PTR)lpMidiInHdr, uSize, TRUE); return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD_PTR)lpMidiInHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1334,7 +1333,7 @@ UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn,
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD_PTR)lpMidiInHdr, uSize, TRUE); return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD_PTR)lpMidiInHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -1349,7 +1348,7 @@ UINT WINAPI midiInStart(HMIDIIN hMidiIn)
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_START, 0L, 0L, TRUE); return MMDRV_Message(wmld, MIDM_START, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1364,7 +1363,7 @@ UINT WINAPI midiInStop(HMIDIIN hMidiIn)
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_STOP, 0L, 0L, TRUE); return MMDRV_Message(wmld, MIDM_STOP, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1379,7 +1378,7 @@ UINT WINAPI midiInReset(HMIDIIN hMidiIn)
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, MIDM_RESET, 0L, 0L, TRUE); return MMDRV_Message(wmld, MIDM_RESET, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -1420,7 +1419,7 @@ UINT WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage,
FIXME("can't handle OPEN or CLOSE message!\n"); FIXME("can't handle OPEN or CLOSE message!\n");
return MMSYSERR_NOTSUPPORTED; return MMSYSERR_NOTSUPPORTED;
} }
return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
} }
/************************************************************************** /**************************************************************************
@ -1809,7 +1808,7 @@ MMRESULT WINAPI midiStreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID,
mosm.dwStreamID = (DWORD)lpMidiStrm; mosm.dwStreamID = (DWORD)lpMidiStrm;
/* FIXME: the correct value is not allocated yet for MAPPER */ /* FIXME: the correct value is not allocated yet for MAPPER */
mosm.wDeviceID = *lpuDeviceID; mosm.wDeviceID = *lpuDeviceID;
lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &fdwOpen, 1, &mosm, TRUE); lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &fdwOpen, 1, &mosm);
lpMidiStrm->hDevice = hMidiOut; lpMidiStrm->hDevice = hMidiOut;
if (lphMidiStrm) if (lphMidiStrm)
*lphMidiStrm = (HMIDISTRM)hMidiOut; *lphMidiStrm = (HMIDISTRM)hMidiOut;
@ -2056,7 +2055,7 @@ static UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType,
lpFormat->nAvgBytesPerSec, lpFormat->nBlockAlign, lpFormat->wBitsPerSample); lpFormat->nAvgBytesPerSec, lpFormat->nBlockAlign, lpFormat->wBitsPerSample);
if ((wmld = MMDRV_Alloc(sizeof(WINE_WAVE), uType, &handle, if ((wmld = MMDRV_Alloc(sizeof(WINE_WAVE), uType, &handle,
&dwFlags, &dwCallback, &dwInstance, TRUE)) == NULL) { &dwFlags, &dwCallback, &dwInstance)) == NULL) {
WARN("no memory\n"); WARN("no memory\n");
return MMSYSERR_NOMEM; return MMSYSERR_NOMEM;
} }
@ -2154,8 +2153,7 @@ UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps,
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEOUT, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEOUT, TRUE)) == NULL)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
return MMDRV_Message(wmld, WODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, WODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
} }
/************************************************************************** /**************************************************************************
@ -2256,7 +2254,7 @@ UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
if ((result = MMDRV_Message(wmld, WODM_PREPARE, (DWORD_PTR)lpWaveOutHdr, if ((result = MMDRV_Message(wmld, WODM_PREPARE, (DWORD_PTR)lpWaveOutHdr,
uSize, TRUE)) != MMSYSERR_NOTSUPPORTED) uSize)) != MMSYSERR_NOTSUPPORTED)
return result; return result;
if (lpWaveOutHdr->dwFlags & WHDR_INQUEUE) if (lpWaveOutHdr->dwFlags & WHDR_INQUEUE)
@ -2290,7 +2288,7 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
if ((result = MMDRV_Message(wmld, WODM_UNPREPARE, (DWORD_PTR)lpWaveOutHdr, if ((result = MMDRV_Message(wmld, WODM_UNPREPARE, (DWORD_PTR)lpWaveOutHdr,
uSize, TRUE)) != MMSYSERR_NOTSUPPORTED) uSize)) != MMSYSERR_NOTSUPPORTED)
return result; return result;
if (lpWaveOutHdr->dwFlags & WHDR_INQUEUE) if (lpWaveOutHdr->dwFlags & WHDR_INQUEUE)
@ -2315,7 +2313,7 @@ UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr,
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_WRITE, (DWORD_PTR)lpWaveOutHdr, uSize, TRUE); return MMDRV_Message(wmld, WODM_WRITE, (DWORD_PTR)lpWaveOutHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -2329,7 +2327,7 @@ UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_BREAKLOOP, 0L, 0L, TRUE); return MMDRV_Message(wmld, WODM_BREAKLOOP, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2343,7 +2341,7 @@ UINT WINAPI waveOutPause(HWAVEOUT hWaveOut)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_PAUSE, 0L, 0L, TRUE); return MMDRV_Message(wmld, WODM_PAUSE, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2357,7 +2355,7 @@ UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_RESET, 0L, 0L, TRUE); return MMDRV_Message(wmld, WODM_RESET, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2371,7 +2369,7 @@ UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_RESTART, 0L, 0L, TRUE); return MMDRV_Message(wmld, WODM_RESTART, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2387,7 +2385,7 @@ UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, LPMMTIME lpTime,
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_GETPOS, (DWORD_PTR)lpTime, uSize, TRUE); return MMDRV_Message(wmld, WODM_GETPOS, (DWORD_PTR)lpTime, uSize);
} }
/************************************************************************** /**************************************************************************
@ -2401,7 +2399,7 @@ UINT WINAPI waveOutGetPitch(HWAVEOUT hWaveOut, LPDWORD lpdw)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_GETPITCH, (DWORD_PTR)lpdw, 0L, TRUE); return MMDRV_Message(wmld, WODM_GETPITCH, (DWORD_PTR)lpdw, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2415,7 +2413,7 @@ UINT WINAPI waveOutSetPitch(HWAVEOUT hWaveOut, DWORD dw)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_SETPITCH, dw, 0L, TRUE); return MMDRV_Message(wmld, WODM_SETPITCH, dw, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2429,7 +2427,7 @@ UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT hWaveOut, LPDWORD lpdw)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_GETPLAYBACKRATE, (DWORD_PTR)lpdw, 0L, TRUE); return MMDRV_Message(wmld, WODM_GETPLAYBACKRATE, (DWORD_PTR)lpdw, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2443,7 +2441,7 @@ UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT hWaveOut, DWORD dw)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_SETPLAYBACKRATE, dw, 0L, TRUE); return MMDRV_Message(wmld, WODM_SETPLAYBACKRATE, dw, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2463,7 +2461,7 @@ UINT WINAPI waveOutGetVolume(HWAVEOUT hWaveOut, LPDWORD lpdw)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_GETVOLUME, (DWORD_PTR)lpdw, 0L, TRUE); return MMDRV_Message(wmld, WODM_GETVOLUME, (DWORD_PTR)lpdw, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2478,7 +2476,7 @@ UINT WINAPI waveOutSetVolume(HWAVEOUT hWaveOut, DWORD dw)
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_SETVOLUME, dw, 0L, TRUE); return MMDRV_Message(wmld, WODM_SETVOLUME, dw, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2523,7 +2521,7 @@ UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
} }
/************************************************************************** /**************************************************************************
@ -2548,7 +2546,7 @@ UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSi
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEIN, TRUE)) == NULL) if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEIN, TRUE)) == NULL)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
return MMDRV_Message(wmld, WIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize, TRUE); return MMDRV_Message(wmld, WIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
} }
/************************************************************************** /**************************************************************************
@ -2601,7 +2599,7 @@ UINT WINAPI waveInClose(HWAVEIN hWaveIn)
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
dwRet = MMDRV_Message(wmld, WIDM_CLOSE, 0L, 0L, TRUE); dwRet = MMDRV_Message(wmld, WIDM_CLOSE, 0L, 0L);
if (dwRet != WAVERR_STILLPLAYING) if (dwRet != WAVERR_STILLPLAYING)
MMDRV_Free(hWaveIn, wmld); MMDRV_Free(hWaveIn, wmld);
return dwRet; return dwRet;
@ -2625,7 +2623,7 @@ UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr,
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
if ((result = MMDRV_Message(wmld, WIDM_PREPARE, (DWORD_PTR)lpWaveInHdr, if ((result = MMDRV_Message(wmld, WIDM_PREPARE, (DWORD_PTR)lpWaveInHdr,
uSize, TRUE)) != MMSYSERR_NOTSUPPORTED) uSize)) != MMSYSERR_NOTSUPPORTED)
return result; return result;
if (lpWaveInHdr->dwFlags & WHDR_INQUEUE) if (lpWaveInHdr->dwFlags & WHDR_INQUEUE)
@ -2659,7 +2657,7 @@ UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr,
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
if ((result = MMDRV_Message(wmld, WIDM_UNPREPARE, (DWORD_PTR)lpWaveInHdr, if ((result = MMDRV_Message(wmld, WIDM_UNPREPARE, (DWORD_PTR)lpWaveInHdr,
uSize, TRUE)) != MMSYSERR_NOTSUPPORTED) uSize)) != MMSYSERR_NOTSUPPORTED)
return result; return result;
if (lpWaveInHdr->dwFlags & WHDR_INQUEUE) if (lpWaveInHdr->dwFlags & WHDR_INQUEUE)
@ -2685,7 +2683,7 @@ UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn,
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WIDM_ADDBUFFER, (DWORD_PTR)lpWaveInHdr, uSize, TRUE); return MMDRV_Message(wmld, WIDM_ADDBUFFER, (DWORD_PTR)lpWaveInHdr, uSize);
} }
/************************************************************************** /**************************************************************************
@ -2700,7 +2698,7 @@ UINT WINAPI waveInReset(HWAVEIN hWaveIn)
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WIDM_RESET, 0L, 0L, TRUE); return MMDRV_Message(wmld, WIDM_RESET, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2715,7 +2713,7 @@ UINT WINAPI waveInStart(HWAVEIN hWaveIn)
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WIDM_START, 0L, 0L, TRUE); return MMDRV_Message(wmld, WIDM_START, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2730,7 +2728,7 @@ UINT WINAPI waveInStop(HWAVEIN hWaveIn)
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld,WIDM_STOP, 0L, 0L, TRUE); return MMDRV_Message(wmld,WIDM_STOP, 0L, 0L);
} }
/************************************************************************** /**************************************************************************
@ -2746,7 +2744,7 @@ UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, LPMMTIME lpTime,
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WIDM_GETPOS, (DWORD_PTR)lpTime, uSize, TRUE); return MMDRV_Message(wmld, WIDM_GETPOS, (DWORD_PTR)lpTime, uSize);
} }
/************************************************************************** /**************************************************************************
@ -2789,7 +2787,7 @@ UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
} }
struct mm_starter struct mm_starter