Tony Wasserka : windowscodecs: Support writing to memory streams in IWICStream.
Alexandre Julliard
julliard at winehq.org
Fri Aug 21 09:32:50 CDT 2009
Module: wine
Branch: master
Commit: 0b6df19375c26516846dc1d7a1f82f48498f0fae
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0b6df19375c26516846dc1d7a1f82f48498f0fae
Author: Tony Wasserka <tony.wasserka at freenet.de>
Date: Fri Aug 21 11:08:10 2009 +0200
windowscodecs: Support writing to memory streams in IWICStream.
---
dlls/windowscodecs/stream.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/stream.c b/dlls/windowscodecs/stream.c
index f1af925..8617129 100644
--- a/dlls/windowscodecs/stream.c
+++ b/dlls/windowscodecs/stream.c
@@ -107,8 +107,19 @@ static HRESULT WINAPI StreamOnMemory_Read(IStream *iface,
static HRESULT WINAPI StreamOnMemory_Write(IStream *iface,
void const *pv, ULONG cb, ULONG *pcbWritten)
{
- FIXME("(%p): stub\n", iface);
- return E_NOTIMPL;
+ StreamOnMemory *This = (StreamOnMemory*)iface;
+ TRACE("(%p)\n", This);
+
+ if (!pv) return E_INVALIDARG;
+
+ if (cb > This->dwMemsize - This->dwCurPos) return STG_E_MEDIUMFULL;
+ if (cb) {
+ memcpy(This->pbMemory + This->dwCurPos, pv, cb);
+ This->dwCurPos += cb;
+ }
+ if (pcbWritten) *pcbWritten = cb;
+
+ return S_OK;
}
static HRESULT WINAPI StreamOnMemory_Seek(IStream *iface,
More information about the wine-cvs
mailing list