Commit 5e81d9a7 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- finish mmio separation

- no longer storing function pointers in global IData
parent 02af550a
......@@ -44,6 +44,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(mmio);
LRESULT (*pFnMmioCallback16)(SEGPTR,LPMMIOINFO,UINT,LPARAM,LPARAM) /* = NULL */;
/**************************************************************************
* mmioDosIOProc [internal]
*/
......@@ -71,9 +73,7 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
}
/* if filename NULL, assume open file handle in adwInfo[0] */
if (!szFileName) {
lpmmioinfo->adwInfo[0] = DosFileHandleToWin32Handle(lpmmioinfo->adwInfo[0]);
} else {
if (szFileName) {
OFSTRUCT ofs;
lpmmioinfo->adwInfo[0] = (DWORD)OpenFile(szFileName, &ofs, lpmmioinfo->dwFlags & 0xFFFF);
}
......@@ -352,8 +352,8 @@ static LRESULT send_message(struct IOProcList* ioProc, LPMMIOINFO mmioinfo,
switch (ioProc->type) {
case MMIO_PROC_16:
if (WINMM_IData && WINMM_IData->pFnMmioCallback16)
result = WINMM_IData->pFnMmioCallback16((SEGPTR)ioProc->pIOProc,
if (pFnMmioCallback16)
result = pFnMmioCallback16((SEGPTR)ioProc->pIOProc,
mmioinfo, wMsg, lp1, lp2);
break;
case MMIO_PROC_32A:
......@@ -579,9 +579,6 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
wm->info.pchBuffer = NULL;
}
if (wm->ioProc->type == MMIO_PROC_16)
wm->info.dwReserved1 = MapLS(wm->info.pchBuffer);
wm->info.cchBuffer = cchBuffer;
wm->info.pchNext = wm->info.pchBuffer;
wm->info.pchEndRead = wm->info.pchBuffer;
......
......@@ -49,9 +49,7 @@ extern LONG CALLBACK MMSYSTEM_CallTo16_long_l (FARPROC16,LONG);
extern LONG CALLBACK MMSYSTEM_CallTo16_long_lwll (LPMMIOPROC16,LONG,WORD,LONG,LONG);
/* ### stop build ### */
static LRESULT CALLBACK mmioCallback16(SEGPTR cb16,
LPMMIOINFO lpmmioinfo, UINT uMessage,
LPARAM lParam1, LPARAM lParam2);
static LRESULT MMIO_Callback16(SEGPTR, LPMMIOINFO, UINT, LPARAM, LPARAM);
/* ###################################################
* # LIBRARY #
......@@ -85,10 +83,12 @@ BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds,
}
WINMM_IData->hWinMM16Instance = hinstDLL;
WINMM_IData->h16Module32 = hndl;
WINMM_IData->pFnMmioCallback16 = mmioCallback16;
/* hook in our 16 bit function pointers */
pFnMmioCallback16 = MMIO_Callback16;
break;
case DLL_PROCESS_DETACH:
FreeLibrary(WINMM_IData->h16Module32);
pFnMmioCallback16 = NULL;
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
......@@ -2511,12 +2511,11 @@ static LRESULT MMIO_UnMap32To16(DWORD wMsg, LPARAM lParam1, LPARAM lParam2,
}
/******************************************************************
* mmioCallback16
* MMIO_Callback16
*
*
*/
static LRESULT CALLBACK mmioCallback16(SEGPTR cb16,
LPMMIOINFO lpmmioinfo, UINT uMessage,
static LRESULT MMIO_Callback16(SEGPTR cb16, LPMMIOINFO lpmmioinfo, UINT uMessage,
LPARAM lParam1, LPARAM lParam2)
{
LRESULT result;
......@@ -2552,8 +2551,6 @@ static LRESULT CALLBACK mmioCallback16(SEGPTR cb16,
/******************************************************************
* MMIO_ResetSegmentedData
*
*
*
*/
static LRESULT MMIO_SetSegmentedBuffer(HMMIO hmmio, SEGPTR ptr)
{
......@@ -2584,6 +2581,9 @@ HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16* lpmmioinfo16,
mmioinfo.cchBuffer = lpmmioinfo16->cchBuffer;
mmioinfo.pchBuffer = MapSL((DWORD)lpmmioinfo16->pchBuffer);
mmioinfo.adwInfo[0] = lpmmioinfo16->adwInfo[0];
/* if we don't have a file name, it's likely a passed open file descriptor */
if (!szFileName)
mmioinfo.adwInfo[0] = DosFileHandleToWin32Handle(mmioinfo.adwInfo[0]);
mmioinfo.adwInfo[1] = lpmmioinfo16->adwInfo[1];
mmioinfo.adwInfo[2] = lpmmioinfo16->adwInfo[2];
mmioinfo.adwInfo[3] = lpmmioinfo16->adwInfo[3];
......
......@@ -217,7 +217,6 @@ typedef struct tagWINE_MM_IDATA {
/* LPWINE_MIXER lpMixer; */
/* mmio part */
LPWINE_MMIO lpMMIO;
LRESULT (CALLBACK* pFnMmioCallback16)(SEGPTR,LPMMIOINFO,UINT,LPARAM,LPARAM);
/* playsound and sndPlaySound */
WINE_PLAYSOUND* lpPlaySound;
HANDLE psLastEvent;
......@@ -341,6 +340,11 @@ BOOL MMDRV_GetDescription16(const char* fname, char* buf, int buflen);
/* Global variables */
extern LPWINE_MM_IDATA WINMM_IData;
/* pointers to 16 bit functions (if sibling MMSYSTEM.DLL is loaded
* NULL otherwise
*/
extern LRESULT (*pFnMmioCallback16)(SEGPTR,LPMMIOINFO,UINT,LPARAM,LPARAM);
/* HANDLE16 -> HANDLE conversions */
#define HDRVR_32(h16) ((HDRVR)(ULONG_PTR)(h16))
#define HMIDI_32(h16) ((HMIDI)(ULONG_PTR)(h16))
......
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