Fixed bugs in output functions (write).

Rewrote some parts for better DLL separation.
Fixed some prototypes.
Fixed mmioAdvance in write mode.
This commit is contained in:
Eric Pouech 2001-12-04 19:40:28 +00:00 committed by Alexandre Julliard
parent a7e51f19c0
commit d585e7a2a4
2 changed files with 91 additions and 89 deletions

View File

@ -71,7 +71,7 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
lpmmioinfo->adwInfo[0] = (DWORD)OpenFile(szFileName, &ofs, lpmmioinfo->adwInfo[0] = (DWORD)OpenFile(szFileName, &ofs,
lpmmioinfo->dwFlags); lpmmioinfo->dwFlags);
if (lpmmioinfo->adwInfo[0] == -1) if (lpmmioinfo->adwInfo[0] == (DWORD)HFILE_ERROR)
ret = MMIOERR_CANNOTOPEN; ret = MMIOERR_CANNOTOPEN;
} }
break; break;
@ -610,11 +610,12 @@ static BOOL MMIO_Destroy(LPWINE_MMIO wm)
/**************************************************************** /****************************************************************
* MMIO_Flush [INTERNAL] * MMIO_Flush [INTERNAL]
*/ */
static LRESULT MMIO_Flush(WINE_MMIO* wm, UINT uFlags) static MMRESULT MMIO_Flush(WINE_MMIO* wm, UINT uFlags)
{ {
if (wm->info.cchBuffer && (wm->info.fccIOProc != FOURCC_MEM)) { if (wm->info.cchBuffer && (wm->info.fccIOProc != FOURCC_MEM)) {
/* not quite sure what to do here, but I'll guess */ /* not quite sure what to do here, but I'll guess */
if (wm->info.dwFlags & MMIO_DIRTY) { if (wm->info.dwFlags & MMIO_DIRTY) {
/* FIXME: error handling */
MMIO_SendMessage(wm, MMIOM_SEEK, wm->info.lBufOffset, MMIO_SendMessage(wm, MMIOM_SEEK, wm->info.lBufOffset,
SEEK_SET, MMIO_PROC_32A); SEEK_SET, MMIO_PROC_32A);
MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)wm->info.pchBuffer, MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)wm->info.pchBuffer,
@ -625,7 +626,7 @@ static LRESULT MMIO_Flush(WINE_MMIO* wm, UINT uFlags)
} }
wm->info.dwFlags &= ~MMIO_DIRTY; wm->info.dwFlags &= ~MMIO_DIRTY;
return 0; return MMSYSERR_NOERROR;
} }
/*************************************************************************** /***************************************************************************
@ -658,7 +659,7 @@ static LONG MMIO_GrabNextBuffer(LPWINE_MMIO wm, int for_read)
/*************************************************************************** /***************************************************************************
* MMIO_SetBuffer [INTERNAL] * MMIO_SetBuffer [INTERNAL]
*/ */
static UINT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
UINT uFlags, BOOL bFrom32) UINT uFlags, BOOL bFrom32)
{ {
TRACE("(%p %p %ld %u %d)\n", wm, pchBuffer, cchBuffer, uFlags, bFrom32); TRACE("(%p %p %ld %u %d)\n", wm, pchBuffer, cchBuffer, uFlags, bFrom32);
@ -667,14 +668,16 @@ static UINT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
if (cchBuffer > 0xFFFF) if (cchBuffer > 0xFFFF)
WARN("Untested handling of huge mmio buffers (%ld >= 64k)\n", cchBuffer); WARN("Untested handling of huge mmio buffers (%ld >= 64k)\n", cchBuffer);
if (MMIO_Flush(wm, 0) != 0) if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR)
return MMIOERR_CANNOTWRITE; return MMIOERR_CANNOTWRITE;
if ((!cchBuffer || pchBuffer) && (wm->info.dwFlags & MMIO_ALLOCBUF)) { if (wm->hMem && (wm->info.dwFlags & MMIO_ALLOCBUF)) {
GlobalUnlock16(wm->hMem); GlobalUnlock16(wm->hMem);
GlobalFree16(wm->hMem); GlobalFree16(wm->hMem);
wm->hMem = 0;
wm->info.dwFlags &= ~MMIO_ALLOCBUF; wm->info.dwFlags &= ~MMIO_ALLOCBUF;
} }
if (pchBuffer) { if (pchBuffer) {
if (bFrom32) { if (bFrom32) {
wm->info.pchBuffer = pchBuffer; wm->info.pchBuffer = pchBuffer;
@ -684,16 +687,6 @@ static UINT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
wm->buffer16 = (SEGPTR)pchBuffer; wm->buffer16 = (SEGPTR)pchBuffer;
} }
wm->hMem = 0; wm->hMem = 0;
} else if (cchBuffer && (wm->info.dwFlags & MMIO_ALLOCBUF)) {
HGLOBAL16 hNewBuf;
GlobalUnlock16(wm->hMem);
hNewBuf = GlobalReAlloc16(wm->hMem, cchBuffer, 0);
if (!hNewBuf) {
/* FIXME: this assumes the memory block didn't move */
GlobalLock16(wm->hMem);
return MMIOERR_OUTOFMEMORY;
}
wm->hMem = hNewBuf;
} else if (cchBuffer) { } else if (cchBuffer) {
if (!(wm->hMem = GlobalAlloc16(GMEM_MOVEABLE, cchBuffer))) if (!(wm->hMem = GlobalAlloc16(GMEM_MOVEABLE, cchBuffer)))
return MMIOERR_OUTOFMEMORY; return MMIOERR_OUTOFMEMORY;
@ -716,7 +709,7 @@ static UINT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
wm->info.lBufOffset = 0; wm->info.lBufOffset = 0;
wm->bBufferLoaded = FALSE; wm->bBufferLoaded = FALSE;
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
@ -906,7 +899,7 @@ MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT uFlags)
if ((wm = MMIO_Get(NULL, hmmio)) == NULL) if ((wm = MMIO_Get(NULL, hmmio)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
if ((result = MMIO_Flush(wm, 0)) != 0) if ((result = MMIO_Flush(wm, 0)) != MMSYSERR_NOERROR)
return result; return result;
result = MMIO_SendMessage(wm, MMIOM_CLOSE, uFlags, 0, MMIO_PROC_32A); result = MMIO_SendMessage(wm, MMIOM_CLOSE, uFlags, 0, MMIO_PROC_32A);
@ -995,7 +988,7 @@ LONG WINAPI mmioRead16(HMMIO16 hmmio, HPSTR pch, LONG cch)
LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
LONG count,bytesW=0; LONG count;
TRACE("(%04X, %p, %ld);\n", hmmio, pch, cch); TRACE("(%04X, %p, %ld);\n", hmmio, pch, cch);
@ -1003,6 +996,8 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
return -1; return -1;
if (wm->info.cchBuffer) { if (wm->info.cchBuffer) {
LONG bytesW = 0;
count = 0; count = 0;
while (cch) { while (cch) {
if (wm->info.pchNext != wm->info.pchEndWrite) { if (wm->info.pchNext != wm->info.pchEndWrite) {
@ -1014,9 +1009,7 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
cch -= count; cch -= count;
bytesW += count; bytesW += count;
wm->info.dwFlags |= MMIO_DIRTY; wm->info.dwFlags |= MMIO_DIRTY;
} } else {
else
{
if (wm->info.fccIOProc == FOURCC_MEM) { if (wm->info.fccIOProc == FOURCC_MEM) {
if (wm->info.adwInfo[0]) { if (wm->info.adwInfo[0]) {
/* from where would we get the memory handle? */ /* from where would we get the memory handle? */
@ -1033,13 +1026,14 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch)
} }
else break; else break;
} }
count = bytesW;
} else { } else {
bytesW = MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)pch, cch, MMIO_PROC_32A); count = MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)pch, cch, MMIO_PROC_32A);
wm->info.lBufOffset = wm->info.lDiskOffset; wm->info.lBufOffset = wm->info.lDiskOffset;
} }
TRACE("bytes written=%ld\n", bytesW); TRACE("bytes written=%ld\n", count);
return bytesW; return count;
} }
/************************************************************************** /**************************************************************************
@ -1097,7 +1091,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
/* condition to change buffer */ /* condition to change buffer */
if ((wm->info.fccIOProc == FOURCC_MEM) || if ((wm->info.fccIOProc == FOURCC_MEM) ||
MMIO_Flush(wm, 0) || MMIO_Flush(wm, 0) != MMSYSERR_NOERROR ||
/* this also sets the wm->info.lDiskOffset field */ /* this also sets the wm->info.lDiskOffset field */
MMIO_SendMessage(wm, MMIOM_SEEK, MMIO_SendMessage(wm, MMIOM_SEEK,
(offset / wm->info.cchBuffer) * wm->info.cchBuffer, (offset / wm->info.cchBuffer) * wm->info.cchBuffer,
@ -1123,7 +1117,7 @@ LONG WINAPI mmioSeek16(HMMIO16 hmmio, LONG lOffset, INT16 iOrigin)
/************************************************************************** /**************************************************************************
* mmioGetInfo [MMSYSTEM.1215] * mmioGetInfo [MMSYSTEM.1215]
*/ */
UINT16 WINAPI mmioGetInfo16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags) MMRESULT16 WINAPI mmioGetInfo16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1155,13 +1149,13 @@ UINT16 WINAPI mmioGetInfo16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags
lpmmioinfo->dwReserved2 = 0; lpmmioinfo->dwReserved2 = 0;
lpmmioinfo->hmmio = wm->info.hmmio; lpmmioinfo->hmmio = wm->info.hmmio;
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioGetInfo [WINMM.@] * mmioGetInfo [WINMM.@]
*/ */
UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) MMRESULT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1172,13 +1166,13 @@ UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
memcpy(lpmmioinfo, &wm->info, sizeof(MMIOINFO)); memcpy(lpmmioinfo, &wm->info, sizeof(MMIOINFO));
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioSetInfo [MMSYSTEM.1216] * mmioSetInfo [MMSYSTEM.1216]
*/ */
UINT16 WINAPI mmioSetInfo16(HMMIO16 hmmio, const MMIOINFO16* lpmmioinfo, UINT16 uFlags) MMRESULT16 WINAPI mmioSetInfo16(HMMIO16 hmmio, const MMIOINFO16* lpmmioinfo, UINT16 uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1205,13 +1199,13 @@ UINT16 WINAPI mmioSetInfo16(HMMIO16 hmmio, const MMIOINFO16* lpmmioinfo, UINT16
wm->info.pchEndRead = wm->info.pchBuffer + (lpmmioinfo->pchEndRead - lpmmioinfo->pchBuffer); wm->info.pchEndRead = wm->info.pchBuffer + (lpmmioinfo->pchEndRead - lpmmioinfo->pchBuffer);
wm->info.pchEndWrite = wm->info.pchBuffer + (lpmmioinfo->pchEndWrite - lpmmioinfo->pchBuffer); wm->info.pchEndWrite = wm->info.pchBuffer + (lpmmioinfo->pchEndWrite - lpmmioinfo->pchBuffer);
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioSetInfo [WINMM.@] * mmioSetInfo [WINMM.@]
*/ */
UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO* lpmmioinfo, UINT uFlags) MMRESULT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO* lpmmioinfo, UINT uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1232,13 +1226,13 @@ UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO* lpmmioinfo, UINT uFlags)
wm->info.pchNext = lpmmioinfo->pchNext; wm->info.pchNext = lpmmioinfo->pchNext;
wm->info.pchEndRead = lpmmioinfo->pchEndRead; wm->info.pchEndRead = lpmmioinfo->pchEndRead;
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioSetBuffer [WINMM.@] * mmioSetBuffer [WINMM.@]
*/ */
UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT uFlags) MMRESULT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1254,7 +1248,7 @@ UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT uFl
/************************************************************************** /**************************************************************************
* mmioSetBuffer [MMSYSTEM.1217] * mmioSetBuffer [MMSYSTEM.1217]
*/ */
UINT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR segpchBuffer, MMRESULT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR segpchBuffer,
LONG cchBuffer, UINT16 uFlags) LONG cchBuffer, UINT16 uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1271,7 +1265,7 @@ UINT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR segpchBuffer,
/************************************************************************** /**************************************************************************
* mmioFlush [WINMM.@] * mmioFlush [WINMM.@]
*/ */
UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags) MMRESULT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1286,7 +1280,7 @@ UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags)
/************************************************************************** /**************************************************************************
* mmioFlush [MMSYSTEM.1218] * mmioFlush [MMSYSTEM.1218]
*/ */
UINT16 WINAPI mmioFlush16(HMMIO16 hmmio, UINT16 uFlags) MMRESULT16 WINAPI mmioFlush16(HMMIO16 hmmio, UINT16 uFlags)
{ {
return mmioFlush(hmmio, uFlags); return mmioFlush(hmmio, uFlags);
} }
@ -1294,7 +1288,7 @@ UINT16 WINAPI mmioFlush16(HMMIO16 hmmio, UINT16 uFlags)
/************************************************************************** /**************************************************************************
* mmioAdvance [WINMM.@] * mmioAdvance [WINMM.@]
*/ */
UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1309,7 +1303,15 @@ UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
if (uFlags != MMIO_READ && uFlags != MMIO_WRITE) if (uFlags != MMIO_READ && uFlags != MMIO_WRITE)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
if (MMIO_Flush(wm, 0)) if (uFlags == MMIO_WRITE && (lpmmioinfo->dwFlags & MMIO_DIRTY))
{
FIXME("writing data to disk\n");
MMIO_SendMessage(wm, MMIOM_SEEK, lpmmioinfo->lBufOffset, SEEK_SET, MMIO_PROC_32A);
MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)lpmmioinfo->pchBuffer,
lpmmioinfo->pchNext - lpmmioinfo->pchBuffer, MMIO_PROC_32A);
lpmmioinfo->dwFlags &= ~MMIO_DIRTY;
}
if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR)
return MMIOERR_CANNOTWRITE; return MMIOERR_CANNOTWRITE;
MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ); MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ);
@ -1321,13 +1323,13 @@ UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
(wm->info.pchEndWrite - wm->info.pchBuffer); (wm->info.pchEndWrite - wm->info.pchBuffer);
lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; lpmmioinfo->lDiskOffset = wm->info.lDiskOffset;
lpmmioinfo->lBufOffset = wm->info.lBufOffset; lpmmioinfo->lBufOffset = wm->info.lBufOffset;
return 0; return MMSYSERR_NOERROR;
} }
/*********************************************************************** /***********************************************************************
* mmioAdvance [MMSYSTEM.1219] * mmioAdvance [MMSYSTEM.1219]
*/ */
UINT16 WINAPI mmioAdvance16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags) MMRESULT16 WINAPI mmioAdvance16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags)
{ {
LPWINE_MMIO wm; LPWINE_MMIO wm;
@ -1342,7 +1344,7 @@ UINT16 WINAPI mmioAdvance16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags
if (uFlags != MMIO_READ && uFlags != MMIO_WRITE) if (uFlags != MMIO_READ && uFlags != MMIO_WRITE)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
if (MMIO_Flush(wm, 0)) if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR)
return MMIOERR_CANNOTWRITE; return MMIOERR_CANNOTWRITE;
MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ); MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ);
@ -1355,7 +1357,7 @@ UINT16 WINAPI mmioAdvance16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uFlags
lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; lpmmioinfo->lDiskOffset = wm->info.lDiskOffset;
lpmmioinfo->lBufOffset = wm->info.lBufOffset; lpmmioinfo->lBufOffset = wm->info.lBufOffset;
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
@ -1470,7 +1472,7 @@ LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage,
/************************************************************************** /**************************************************************************
* mmioDescend [WINMM.@] * mmioDescend [WINMM.@]
*/ */
UINT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck,
const MMCKINFO* lpckParent, UINT uFlags) const MMCKINFO* lpckParent, UINT uFlags)
{ {
DWORD dwOldPos; DWORD dwOldPos;
@ -1568,13 +1570,13 @@ UINT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck,
TRACE("lpck: ckid=%.4s, cksize=%ld, dwDataOffset=%ld fccType=%08lX (%.4s)!\n", TRACE("lpck: ckid=%.4s, cksize=%ld, dwDataOffset=%ld fccType=%08lX (%.4s)!\n",
(LPSTR)&lpck->ckid, lpck->cksize, lpck->dwDataOffset, (LPSTR)&lpck->ckid, lpck->cksize, lpck->dwDataOffset,
lpck->fccType, srchType?(LPSTR)&lpck->fccType:""); lpck->fccType, srchType?(LPSTR)&lpck->fccType:"");
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioDescend [MMSYSTEM.1223] * mmioDescend [MMSYSTEM.1223]
*/ */
UINT16 WINAPI mmioDescend16(HMMIO16 hmmio, LPMMCKINFO lpck, MMRESULT16 WINAPI mmioDescend16(HMMIO16 hmmio, LPMMCKINFO lpck,
const MMCKINFO* lpckParent, UINT16 uFlags) const MMCKINFO* lpckParent, UINT16 uFlags)
{ {
return mmioDescend(hmmio, lpck, lpckParent, uFlags); return mmioDescend(hmmio, lpck, lpckParent, uFlags);
@ -1583,7 +1585,7 @@ UINT16 WINAPI mmioDescend16(HMMIO16 hmmio, LPMMCKINFO lpck,
/************************************************************************** /**************************************************************************
* mmioAscend [WINMM.@] * mmioAscend [WINMM.@]
*/ */
UINT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags) MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags)
{ {
TRACE("(%04X, %p, %04X);\n", hmmio, lpck, uFlags); TRACE("(%04X, %p, %04X);\n", hmmio, lpck, uFlags);
@ -1611,13 +1613,13 @@ UINT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags)
mmioSeek(hmmio, lpck->dwDataOffset + ((lpck->cksize + 1) & ~1), SEEK_SET); mmioSeek(hmmio, lpck->dwDataOffset + ((lpck->cksize + 1) & ~1), SEEK_SET);
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioAscend [MMSYSTEM.1224] * mmioAscend [MMSYSTEM.1224]
*/ */
UINT16 WINAPI mmioAscend16(HMMIO16 hmmio, MMCKINFO* lpck, UINT16 uFlags) MMRESULT16 WINAPI mmioAscend16(HMMIO16 hmmio, MMCKINFO* lpck, UINT16 uFlags)
{ {
return mmioAscend(hmmio,lpck,uFlags); return mmioAscend(hmmio,lpck,uFlags);
} }
@ -1625,7 +1627,7 @@ UINT16 WINAPI mmioAscend16(HMMIO16 hmmio, MMCKINFO* lpck, UINT16 uFlags)
/************************************************************************** /**************************************************************************
* mmioCreateChunk [WINMM.@] * mmioCreateChunk [WINMM.@]
*/ */
UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO* lpck, UINT uFlags) MMRESULT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO* lpck, UINT uFlags)
{ {
DWORD dwOldPos; DWORD dwOldPos;
LONG size; LONG size;
@ -1658,13 +1660,13 @@ UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO* lpck, UINT uFlags)
return MMIOERR_CANNOTWRITE; return MMIOERR_CANNOTWRITE;
} }
return 0; return MMSYSERR_NOERROR;
} }
/************************************************************************** /**************************************************************************
* mmioCreateChunk [MMSYSTEM.1225] * mmioCreateChunk [MMSYSTEM.1225]
*/ */
UINT16 WINAPI mmioCreateChunk16(HMMIO16 hmmio, MMCKINFO* lpck, UINT16 uFlags) MMRESULT16 WINAPI mmioCreateChunk16(HMMIO16 hmmio, MMCKINFO* lpck, UINT16 uFlags)
{ {
return mmioCreateChunk(hmmio, lpck, uFlags); return mmioCreateChunk(hmmio, lpck, uFlags);
} }
@ -1672,7 +1674,7 @@ UINT16 WINAPI mmioCreateChunk16(HMMIO16 hmmio, MMCKINFO* lpck, UINT16 uFlags)
/************************************************************************** /**************************************************************************
* mmioRename [MMSYSTEM.1226] * mmioRename [MMSYSTEM.1226]
*/ */
UINT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName, MMRESULT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName,
MMIOINFO16* lpmmioinfo, DWORD dwRenameFlags) MMIOINFO16* lpmmioinfo, DWORD dwRenameFlags)
{ {
UINT16 result = MMSYSERR_ERROR; UINT16 result = MMSYSERR_ERROR;
@ -1708,7 +1710,7 @@ UINT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName,
/************************************************************************** /**************************************************************************
* mmioRenameA [WINMM.@] * mmioRenameA [WINMM.@]
*/ */
UINT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName, MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
MMIOINFO* lpmmioinfo, DWORD dwRenameFlags) MMIOINFO* lpmmioinfo, DWORD dwRenameFlags)
{ {
UINT result = MMSYSERR_ERROR; UINT result = MMSYSERR_ERROR;
@ -1741,7 +1743,7 @@ UINT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
/************************************************************************** /**************************************************************************
* mmioRenameW [WINMM.@] * mmioRenameW [WINMM.@]
*/ */
UINT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName, MMRESULT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName,
MMIOINFO* lpmmioinfo, DWORD dwRenameFlags) MMIOINFO* lpmmioinfo, DWORD dwRenameFlags)
{ {
LPSTR szFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szFileName); LPSTR szFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szFileName);

View File

@ -1357,9 +1357,9 @@ HMMIO WINAPI mmioOpenA(LPSTR,MMIOINFO*,DWORD);
HMMIO WINAPI mmioOpenW(LPWSTR,MMIOINFO*,DWORD); HMMIO WINAPI mmioOpenW(LPWSTR,MMIOINFO*,DWORD);
#define mmioOpen WINELIB_NAME_AW(mmioOpen) #define mmioOpen WINELIB_NAME_AW(mmioOpen)
UINT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName, MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
MMIOINFO * lpmmioinfo, DWORD dwRenameFlags); MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
UINT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName, MMRESULT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName,
MMIOINFO * lpmmioinfo, DWORD dwRenameFlags); MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
#define mmioRename WINELIB_NAME_AW(mmioRename) #define mmioRename WINELIB_NAME_AW(mmioRename)
@ -1369,13 +1369,13 @@ LONG WINAPI mmioWrite(HMMIO,HPCSTR,LONG);
LONG WINAPI mmioSeek(HMMIO,LONG,INT); LONG WINAPI mmioSeek(HMMIO,LONG,INT);
MMRESULT WINAPI mmioGetInfo(HMMIO,MMIOINFO*,UINT); MMRESULT WINAPI mmioGetInfo(HMMIO,MMIOINFO*,UINT);
MMRESULT WINAPI mmioSetInfo(HMMIO,const MMIOINFO*,UINT); MMRESULT WINAPI mmioSetInfo(HMMIO,const MMIOINFO*,UINT);
UINT WINAPI mmioSetBuffer(HMMIO,LPSTR,LONG,UINT); MMRESULT WINAPI mmioSetBuffer(HMMIO,LPSTR,LONG,UINT);
UINT WINAPI mmioFlush(HMMIO,UINT); MMRESULT WINAPI mmioFlush(HMMIO,UINT);
UINT WINAPI mmioAdvance(HMMIO,MMIOINFO*,UINT); MMRESULT WINAPI mmioAdvance(HMMIO,MMIOINFO*,UINT);
LONG WINAPI mmioSendMessage(HMMIO,UINT,LPARAM,LPARAM); LRESULT WINAPI mmioSendMessage(HMMIO,UINT,LPARAM,LPARAM);
UINT WINAPI mmioDescend(HMMIO,MMCKINFO*,const MMCKINFO*,UINT); MMRESULT WINAPI mmioDescend(HMMIO,MMCKINFO*,const MMCKINFO*,UINT);
UINT WINAPI mmioAscend(HMMIO,MMCKINFO*,UINT); MMRESULT WINAPI mmioAscend(HMMIO,MMCKINFO*,UINT);
UINT WINAPI mmioCreateChunk(HMMIO,MMCKINFO*,UINT); MMRESULT WINAPI mmioCreateChunk(HMMIO,MMCKINFO*,UINT);
typedef UINT CALLBACK (*YIELDPROC)(MCIDEVICEID,DWORD); typedef UINT CALLBACK (*YIELDPROC)(MCIDEVICEID,DWORD);