Commit ec7d7b72 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

- Convert HDRVR to a void*.

- Fix declaration of DriverCallback().
parent 6a775981
......@@ -271,7 +271,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
pad->obj.dwType = WINE_ACMOBJ_DRIVER;
pad->obj.pACMDriverID = padid;
if (!(pad->hDrvr = padid->hInstModule))
if (!(pad->hDrvr = (HDRVR)padid->hInstModule))
{
ACMDRVOPENDESCW adod;
int len;
......
......@@ -46,6 +46,9 @@ LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2);
void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID lpv, LPDWORD lParam1, LPDWORD lParam2);
LRESULT MSVIDEO_SendMessage(HIC hic, UINT msg, DWORD lParam1, DWORD lParam2, BOOL bFrom32);
#define HDRVR_16(h32) (LOWORD(h32))
/***********************************************************************
* VideoForWindowsVersion [MSVFW32.2]
* VideoForWindowsVersion [MSVIDEO.2]
......@@ -268,7 +271,7 @@ HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHa
MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32);
seg_icopen = MapLS( &icopen );
whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
whic->hdrv = (HDRVR)MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
UnMapLS( seg_icopen );
if (whic->hdrv == 0) {
WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic);
......@@ -976,7 +979,7 @@ LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL b
if (bDrv32) {
ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);
} else {
ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,whic->hdrv,hic,msg,lParam1,lParam2);
ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,HDRVR_16(whic->hdrv),hic,msg,lParam1,lParam2);
}
} else {
ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
......
......@@ -458,7 +458,7 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara
TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName));
the_end:
if (lpDrv) TRACE("=> %08lx\n", (DWORD)lpDrv);
return (DWORD)lpDrv;
return (HDRVR)lpDrv;
}
/**************************************************************************
......@@ -638,4 +638,3 @@ LRESULT WINAPI DriverProc16(DWORD dwDevID, HDRVR16 hDrv, WORD wMsg,
return DrvDefDriverProc16(dwDevID, hDrv, wMsg, dwParam1, dwParam2);
}
......@@ -70,7 +70,8 @@ static BOOL JOY_LoadDriver(DWORD dwJoyID)
if (JOY_Sticks[dwJoyID].hDriver)
return TRUE;
return JOY_Sticks[dwJoyID].hDriver = OpenDriverA("joystick.drv", 0, dwJoyID);
JOY_Sticks[dwJoyID].hDriver = OpenDriverA("joystick.drv", 0, dwJoyID);
return (JOY_Sticks[dwJoyID].hDriver != 0);
}
/**************************************************************************
......
......@@ -198,7 +198,7 @@ static void MMDRV_Callback(LPWINE_MLD mld, HDRVR hDev, UINT uMsg, DWORD dwParam1
if (!mld->bFrom32 && (mld->dwFlags & DCB_TYPEMASK) == DCB_FUNCTION) {
/* 16 bit func, call it */
TRACE("Function (16 bit) !\n");
MMDRV_CallTo16_word_wwlll((FARPROC16)mld->dwCallback, hDev, uMsg,
MMDRV_CallTo16_word_wwlll((FARPROC16)mld->dwCallback, HDRVR_16(hDev), uMsg,
mld->dwClientInstance, dwParam1, dwParam2);
} else {
DriverCallback(mld->dwCallback, mld->dwFlags, hDev, uMsg,
......
......@@ -755,11 +755,11 @@ BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev,
break;
case DCB_WINDOW:
TRACE("Window(%04lX) handle=%04X!\n", dwCallBack, hDev);
PostMessageA((HWND)dwCallBack, wMsg, hDev, dwParam1);
PostMessageA((HWND)dwCallBack, wMsg, (WPARAM)hDev, dwParam1);
break;
case DCB_TASK: /* aka DCB_THREAD */
TRACE("Task(%04lx) !\n", dwCallBack);
PostThreadMessageA(dwCallBack, wMsg, hDev, dwParam1);
PostThreadMessageA(dwCallBack, wMsg, (WPARAM)hDev, dwParam1);
break;
case DCB_FUNCTION:
TRACE("Function (32 bit) !\n");
......@@ -804,7 +804,7 @@ BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HDRVR16 hDev,
WORD wMsg, DWORD dwUser, DWORD dwParam1,
DWORD dwParam2)
{
return DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
return DriverCallback(dwCallBack, uFlags, HDRVR_32(hDev), wMsg, dwUser, dwParam1, dwParam2);
}
/**************************************************************************
......@@ -3158,8 +3158,9 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI
lpMidiHdr->dwFlags |= MHDR_DONE;
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
(HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
}
lpMidiStrm->lpMidiHdr = 0;
SetEvent(lpMidiStrm->hEvent);
......@@ -3231,8 +3232,9 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI
lpMidiHdr->dwFlags |= MHDR_DONE;
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
(HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
break;
}
......@@ -3352,8 +3354,9 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt)
break;
}
if (me->dwEvent & MEVT_F_CALLBACK) {
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
MM_MOM_POSITIONCB, lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L);
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
(HDRVR)lpMidiStrm->hDevice, MM_MOM_POSITIONCB,
lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L);
}
lpMidiHdr->dwOffset += sizeof(MIDIEVENT) - sizeof(me->dwParms);
if (me->dwEvent & MEVT_F_LONG)
......@@ -3364,8 +3367,9 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt)
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiStrm->lpMidiHdr = (LPMIDIHDR)lpMidiHdr->lpNext;
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice,
MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
(HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
lpData = 0;
}
}
......
......@@ -94,8 +94,8 @@ static void CALLBACK wodCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance,
ERR("Unknown msg %u\n", uMsg);
}
DriverCallback(wom->dwCallback, HIWORD(wom->dwFlags), wom->hOuterWave, uMsg,
wom->dwClientInstance, dwParam1, dwParam2);
DriverCallback(wom->dwCallback, HIWORD(wom->dwFlags), (HDRVR)wom->hOuterWave,
uMsg, wom->dwClientInstance, dwParam1, dwParam2);
}
static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
......@@ -502,8 +502,8 @@ static void CALLBACK widCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance,
ERR("Unknown msg %u\n", uMsg);
}
DriverCallback(wim->dwCallback, HIWORD(wim->dwFlags), wim->hOuterWave, uMsg,
wim->dwClientInstance, dwParam1, dwParam2);
DriverCallback(wim->dwCallback, HIWORD(wim->dwFlags), (HDRVR)wim->hOuterWave,
uMsg, wim->dwClientInstance, dwParam1, dwParam2);
}
static DWORD widOpenHelper(WAVEMAPDATA* wim, UINT idx,
......
......@@ -228,6 +228,7 @@ LPWINE_MM_IDATA TIME_MMTimeStart(void);
void TIME_MMTimeStop(void);
/* HANDLE16 -> HANDLE conversions */
#define HDRVR_32(h16) ((HDRVR)(ULONG_PTR)(h16))
#define HMIDI_32(h16) ((HMIDI)(ULONG_PTR)(h16))
#define HMIDIIN_32(h16) ((HMIDIIN)(ULONG_PTR)(h16))
#define HMIDIOUT_32(h16) ((HMIDIOUT)(ULONG_PTR)(h16))
......@@ -239,6 +240,7 @@ void TIME_MMTimeStop(void);
#define HWAVEOUT_32(h16) ((HWAVEOUT)(ULONG_PTR)(h16))
/* HANDLE -> HANDLE16 conversions */
#define HDRVR_16(h32) (LOWORD(h32))
#define HMIDI_16(h32) (LOWORD(h32))
#define HMIDIIN_16(h32) (LOWORD(h32))
#define HMIDIOUT_16(h32) (LOWORD(h32))
......
......@@ -217,7 +217,7 @@ static DWORD OSS_OpenDevice(unsigned wDevID, int* pfd, unsigned req_access,
int val;
int fd = -1;
if (wDevID >= MAX_WAVEDRV) return MMSYSERR_BADDEVICEID;;
if (wDevID >= MAX_WAVEDRV) return MMSYSERR_BADDEVICEID;
ossdev = &OSS_Devices[wDevID];
if (ossdev->full_duplex && (req_access == O_RDONLY || req_access == O_WRONLY))
......@@ -702,8 +702,9 @@ static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD
case WOM_CLOSE:
case WOM_DONE:
if (wwo->wFlags != DCB_NULL &&
!DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, wwo->waveDesc.hWave,
wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) {
!DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags,
(HDRVR)wwo->waveDesc.hWave, wMsg,
wwo->waveDesc.dwInstance, dwParam1, dwParam2)) {
WARN("can't notify client !\n");
return MMSYSERR_ERROR;
}
......@@ -2079,8 +2080,9 @@ static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD
case WIM_CLOSE:
case WIM_DATA:
if (wwi->wFlags != DCB_NULL &&
!DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, wwi->waveDesc.hWave,
wMsg, wwi->waveDesc.dwInstance, dwParam1, dwParam2)) {
!DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags,
(HDRVR)wwi->waveDesc.hWave, wMsg,
wwi->waveDesc.dwInstance, dwParam1, dwParam2)) {
WARN("can't notify client !\n");
return MMSYSERR_ERROR;
}
......
......@@ -515,10 +515,9 @@ BOOL16 WINAPI mmThreadIsCurrent16(HANDLE16 hndl);
BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev,
WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev,
UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
#include "poppack.h"
#endif /* __MMDDK_H */
......@@ -30,7 +30,7 @@ extern "C" {
typedef LPSTR HPSTR; /* a huge version of LPSTR */
typedef LPCSTR HPCSTR; /* a huge version of LPCSTR */
DECLARE_OLD_HANDLE(HDRVR);
DECLARE_HANDLE(HDRVR);
DECLARE_HANDLE(HWAVE);
DECLARE_HANDLE(HWAVEIN);
DECLARE_HANDLE(HWAVEOUT);
......
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