Commit 80a76380 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Fix MMDRV_PhysicalFeatures to handle both 16 and 32 bit pointers

properly.
parent dec10f8a
...@@ -461,7 +461,7 @@ LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, ...@@ -461,7 +461,7 @@ LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType,
* MMDRV_PhysicalFeatures [internal] * MMDRV_PhysicalFeatures [internal]
*/ */
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1,
DWORD dwParam2) DWORD dwParam2, BOOL bFrom32)
{ {
WINE_MM_DRIVER* lpDrv = &MMDrvs[mld->mmdIndex]; WINE_MM_DRIVER* lpDrv = &MMDrvs[mld->mmdIndex];
...@@ -470,10 +470,16 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, ...@@ -470,10 +470,16 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1,
/* all those function calls are undocumented */ /* all those function calls are undocumented */
switch (uMsg) { switch (uMsg) {
case DRV_QUERYDRVENTRY: case DRV_QUERYDRVENTRY:
if (bFrom32)
lstrcpynA((LPSTR)dwParam1, lpDrv->drvname, LOWORD(dwParam2)); lstrcpynA((LPSTR)dwParam1, lpDrv->drvname, LOWORD(dwParam2));
else
lstrcpynA((LPSTR)MapSL(dwParam1), lpDrv->drvname, LOWORD(dwParam2));
break; break;
case DRV_QUERYDEVNODE: case DRV_QUERYDEVNODE:
if (bFrom32)
*(LPDWORD)dwParam1 = 0L; /* should be DevNode */ *(LPDWORD)dwParam1 = 0L; /* should be DevNode */
else
*(DWORD*)MapSL(dwParam1) = 0L;
break; break;
case DRV_QUERYNAME: case DRV_QUERYNAME:
WARN("NIY QueryName\n"); WARN("NIY QueryName\n");
...@@ -489,11 +495,7 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, ...@@ -489,11 +495,7 @@ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1,
return (lpDrv->bIsMapper) ? 2 : 0; return (lpDrv->bIsMapper) ? 2 : 0;
case DRV_QUERYDSOUNDIFACE: /* Wine-specific: Retrieve DirectSound interface */ case DRV_QUERYDSOUNDIFACE: /* Wine-specific: Retrieve DirectSound interface */
return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE);
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);
case DRV_QUERYDSOUNDGUID: /* Wine-specific: Retrieve DirectSound driver GUID */ case DRV_QUERYDSOUNDGUID: /* Wine-specific: Retrieve DirectSound driver GUID */
return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE); return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE);
......
...@@ -1465,7 +1465,7 @@ DWORD WINAPI waveOutMessage16(HWAVEOUT16 hWaveOut, UINT16 uMessage, ...@@ -1465,7 +1465,7 @@ DWORD WINAPI waveOutMessage16(HWAVEOUT16 hWaveOut, UINT16 uMessage,
if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) { if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) {
if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, TRUE)) != NULL) { if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, TRUE)) != NULL) {
return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, FALSE);
} }
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
} }
...@@ -1703,14 +1703,18 @@ DWORD WINAPI waveInMessage16(HWAVEIN16 hWaveIn, UINT16 uMessage, ...@@ -1703,14 +1703,18 @@ DWORD WINAPI waveInMessage16(HWAVEIN16 hWaveIn, UINT16 uMessage,
TRACE("(%04x, %u, %ld, %ld)\n", hWaveIn, uMessage, dwParam1, dwParam2); TRACE("(%04x, %u, %ld, %ld)\n", hWaveIn, uMessage, dwParam1, dwParam2);
if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) {
if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, TRUE)) != NULL) {
return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, FALSE);
}
return MMSYSERR_INVALHANDLE;
}
/* from M$ KB */ /* from M$ KB */
if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER)) if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, FALSE);
return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE);
} }
/* ################################################### /* ###################################################
......
...@@ -247,7 +247,7 @@ DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg); ...@@ -247,7 +247,7 @@ 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, WORD wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32); DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2); UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
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,
MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, LPDRVCALLBACK); MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, LPDRVCALLBACK);
......
...@@ -1292,7 +1292,7 @@ UINT WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, ...@@ -1292,7 +1292,7 @@ UINT WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage,
return 0; return 0;
} }
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) != NULL) { if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) != NULL) {
return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, TRUE);
} }
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
} }
...@@ -2605,7 +2605,7 @@ UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, ...@@ -2605,7 +2605,7 @@ UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) { if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) {
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) != NULL) { if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) != NULL) {
return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, TRUE);
} }
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
} }
...@@ -2860,7 +2860,7 @@ UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, ...@@ -2860,7 +2860,7 @@ UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) { if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) {
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, TRUE)) != NULL) { if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, TRUE)) != NULL) {
return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, TRUE);
} }
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment