Commit 46b68f09 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Made mmioSetBuffer callable from 16 and 32 bit code.

parent e674ede0
......@@ -156,7 +156,7 @@ type win16
1214 pascal mmioSeek(word long word) mmioSeek16
1215 pascal mmioGetInfo(word ptr word) mmioGetInfo16
1216 pascal MMIOSETINFO(word ptr word) mmioSetInfo16
1217 pascal MMIOSETBUFFER(word ptr long word) mmioSetBuffer
1217 pascal MMIOSETBUFFER(word ptr long word) mmioSetBuffer16
1218 pascal mmioFlush(word word) mmioFlush16
1219 pascal mmioAdvance(word ptr word) mmioAdvance16
1220 pascal mmioStringToFOURCC(str word) mmioStringToFOURCC16
......
......@@ -1624,7 +1624,9 @@ MMRESULT16 WINAPI mmioSetInfo16(HMMIO16,const MMIOINFO16*,UINT16);
MMRESULT32 WINAPI mmioSetInfo32(HMMIO32,const MMIOINFO32*,UINT32);
#define mmioSetInfo WINELIB_NAME(mmioSetInfo)
UINT16 WINAPI mmioSetBuffer(HMMIO16,LPSTR,LONG,UINT16);
UINT16 WINAPI mmioSetBuffer16(HMMIO16,LPSTR,LONG,UINT16);
UINT32 WINAPI mmioSetBuffer32(HMMIO32,LPSTR,LONG,UINT32);
#define mmioSetBuffer WINELIB_NAME(mmioSetInfo)
UINT16 WINAPI mmioFlush16(HMMIO16,UINT16);
UINT32 WINAPI mmioFlush32(HMMIO32,UINT32);
......
......@@ -286,14 +286,14 @@ static HMMIO16 MMIO_Open(LPSTR szFileName, MMIOINFO16 * lpmmioinfo,
}
if (dwOpenFlags & MMIO_ALLOCBUF) {
if ((result = mmioSetBuffer(hmmio, NULL, MMIO_DEFAULTBUFFER, 0))) {
if ((result = mmioSetBuffer16(hmmio, NULL, MMIO_DEFAULTBUFFER, 0))) {
if (lpmmioinfo)
lpmmioinfo->wErrorRet = result;
return 0;
}
} else
if (lpmminfo->fccIOProc == FOURCC_MEM) {
if ((result = mmioSetBuffer(hmmio, lpmmioinfo->pchBuffer, lpmmioinfo->cchBuffer, 0))) {
if ((result = mmioSetBuffer16(hmmio, lpmmioinfo->pchBuffer, lpmmioinfo->cchBuffer, 0))) {
if (lpmmioinfo)
lpmmioinfo->wErrorRet = result;
return 0;
......@@ -368,7 +368,7 @@ MMRESULT32 WINAPI mmioClose32(HMMIO32 hmmio, UINT32 uFlags)
result = mmioSendMessage(hmmio,MMIOM_CLOSE,(LPARAM)uFlags,(LPARAM)0);
mmioSetBuffer(hmmio, NULL, 0, 0);
mmioSetBuffer16(hmmio, NULL, 0, 0);
GlobalUnlock16(hmmio);
GlobalFree16(hmmio);
......@@ -388,7 +388,7 @@ MMRESULT16 WINAPI mmioClose16(HMMIO16 hmmio, UINT16 uFlags)
/**************************************************************************
* mmioRead [WINM.124]
* mmioRead [WINMM.124]
*/
LONG WINAPI mmioRead32(HMMIO32 hmmio, HPSTR pch, LONG cch)
{
......@@ -627,10 +627,10 @@ UINT32 WINAPI mmioSetInfo32(HMMIO32 hmmio, const MMIOINFO32 * lpmmioinfo, UINT32
}
/**************************************************************************
* mmioSetBuffer [MMSYSTEM.1217]
* mmioSetBuffer [WINMM.129]
*/
UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer,
LONG cchBuffer, UINT16 uFlags)
UINT32 WINAPI mmioSetBuffer32(HMMIO32 hmmio, LPSTR pchBuffer,
LONG cchBuffer, UINT32 uFlags)
{
LPMMIOINFO16 lpmminfo;
......@@ -649,8 +649,7 @@ UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer,
}
if (pchBuffer) {
lpmminfo->pchBuffer = pchBuffer;
} else
if (lpmminfo->dwFlags&MMIO_ALLOCBUF) {
} else if (lpmminfo->dwFlags&MMIO_ALLOCBUF) {
HGLOBAL16 hNewBuf;
GlobalUnlock16(lpmminfo->dwReserved1);
hNewBuf = GlobalReAlloc16(lpmminfo->dwReserved1, cchBuffer, 0);
......@@ -662,8 +661,7 @@ UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer,
}
lpmminfo->dwReserved1 = hNewBuf;
lpmminfo->pchBuffer = GlobalLock16(hNewBuf);
} else
if (cchBuffer) {
} else if (cchBuffer) {
HGLOBAL16 hNewBuf = GlobalAlloc16(GMEM_MOVEABLE, cchBuffer);
if (!hNewBuf) {
GlobalUnlock16(hmmio);
......@@ -685,6 +683,15 @@ UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer,
}
/**************************************************************************
* mmioSetBuffer [MMSYSTEM.1217]
*/
UINT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR pchBuffer,
LONG cchBuffer, UINT16 uFlags)
{
return mmioSetBuffer32(hmmio, pchBuffer, cchBuffer, uFlags);
}
/**************************************************************************
* mmioFlush [WINMM.117]
*/
UINT32 WINAPI mmioFlush32(HMMIO32 hmmio, UINT32 uFlags)
......
......@@ -128,8 +128,8 @@ type win32
125 stub mmioRenameA
126 stub mmioRenameW
127 stdcall mmioSeek(long long long) mmioSeek32
128 stub mmioSendMessage
129 stub mmioSetBuffer
128 stdcall mmioSendMessage(long long long long) mmioSendMessage
129 stdcall mmioSetBuffer(long ptr long long) mmioSetBuffer32
130 stdcall mmioSetInfo(long ptr long) mmioSetInfo32
131 stdcall mmioStringToFOURCCA(str long) mmioStringToFOURCC32A
132 stdcall mmioStringToFOURCCW(wstr long) mmioStringToFOURCC32W
......
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