From 50b5c29e26f3fd3767fc94bc2c43b4f986ce7a40 Mon Sep 17 00:00:00 2001 From: Noomen Hamza Date: Tue, 11 Apr 2000 19:36:13 +0000 Subject: [PATCH] Fixed other bugs within MMIO implementation. Now, it's possible to copy/cut from PhotoPaint and paste to CorelDraw. --- dlls/winmm/mmio.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c index 248868ab2c..40060a49a4 100644 --- a/dlls/winmm/mmio.c +++ b/dlls/winmm/mmio.c @@ -617,18 +617,15 @@ static LRESULT MMIO_Flush(WINE_MMIO* wm, UINT uFlags) /* not quite sure what to do here, but I'll guess */ if (wm->info.dwFlags & MMIO_DIRTY) { - MMIO_SendMessage(wm, MMIOM_SEEK, wm->info.lBufOffset, + MMIO_SendMessage(wm, MMIOM_SEEK, wm->info.lDiskOffset, SEEK_SET, MMIO_PROC_32A); MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)wm->info.pchBuffer, wm->info.pchNext - wm->info.pchBuffer, MMIO_PROC_32A); wm->info.dwFlags &= ~MMIO_DIRTY; } - if (uFlags & MMIO_EMPTYBUF) { - wm->info.pchNext = wm->info.pchBuffer; - wm->info.pchEndRead = wm->info.pchBuffer; - wm->info.pchEndWrite = wm->info.pchBuffer; - } - + if (uFlags & MMIO_EMPTYBUF) + wm->info.pchNext = wm->info.pchBuffer; + return 0; } @@ -995,7 +992,7 @@ LONG WINAPI mmioRead16(HMMIO16 hmmio, HPSTR pch, LONG cch) LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) { LPWINE_MMIO wm; - LONG count; + LONG count,bytesW=0; TRACE("(%04X, %p, %ld);\n", hmmio, pch, cch); @@ -1011,26 +1008,28 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) memcpy(wm->info.pchNext, pch, count); wm->info.pchNext += count; pch += count; - cch -= count; + cch -= count; + bytesW+=count; wm->info.dwFlags |= MMIO_DIRTY; } else if (wm->info.fccIOProc == FOURCC_MEM) { if (wm->info.adwInfo[0]) { /* from where would we get the memory handle? */ - FIXME("memory file expansion not implemented!\n"); + FIXME("memory file expansion not implemented!\n"); + break; } else break; } - - if (wm->info.pchNext == wm->info.pchEndWrite && - MMIO_Flush(wm, MMIO_EMPTYBUF)) break; + + if (wm->info.pchNext == wm->info.pchEndWrite) MMIO_Flush(wm, MMIO_EMPTYBUF); + else break; } } else { - count = MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)pch, cch, MMIO_PROC_32A); + bytesW = MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)pch, cch, MMIO_PROC_32A); wm->info.lBufOffset = wm->info.lDiskOffset; } - TRACE("count=%ld\n", count); - return count; + TRACE("bytes written=%ld\n", bytesW); + return bytesW; } /************************************************************************** -- 2.32.0.93.g670b81a890