79 TRACE(
"(%p) refcount=%u\n", iface,
ref);
89 TRACE(
"(%p) refcount=%u\n", iface,
ref);
92 This->lock.DebugInfo->Spare[0] = 0;
105 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbRead);
112 This->dwCurPos += uBytesRead;
115 if (pcbRead) *pcbRead = uBytesRead;
126 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbWritten);
138 if (pcbWritten) *pcbWritten =
cb;
156 else if (dwOrigin == STREAM_SEEK_CUR) NewPosition.
QuadPart =
This->dwCurPos + dlibMove.
QuadPart;
157 else if (dwOrigin == STREAM_SEEK_END) NewPosition.
QuadPart =
This->dwMemsize + dlibMove.
QuadPart;
167 This->dwCurPos = NewPosition.
u.LowPart;
169 if(plibNewPosition) plibNewPosition->
QuadPart =
This->dwCurPos;
194 DWORD grfCommitFlags)
196 TRACE(
"(%p, %#x)\n", iface, grfCommitFlags);
203 TRACE(
"(%p)\n", iface);
226 STATSTG *pstatstg,
DWORD grfStatFlag)
229 TRACE(
"(%p, %p, %#x)\n",
This, pstatstg, grfStatFlag);
234 pstatstg->type = STGTY_STREAM;
235 pstatstg->cbSize.QuadPart =
This->dwMemsize;
244 TRACE(
"(%p, %p)\n", iface, ppstm);
314 TRACE(
"(%p) refcount=%u\n", iface,
ref);
324 TRACE(
"(%p) refcount=%u\n", iface,
ref);
327 IWICStream_Release(
This->stream);
339 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbRead);
341 return IWICStream_Read(
This->stream, pv,
cb, pcbRead);
347 ERR(
"(%p, %p, %u, %p)\n", iface, pv,
cb, pcbWritten);
357 return IWICStream_Seek(
This->stream, dlibMove, dwOrigin, plibNewPosition);
375 DWORD grfCommitFlags)
377 TRACE(
"(%p, %#x)\n", iface, grfCommitFlags);
383 TRACE(
"(%p)\n", iface);
404 STATSTG *pstatstg,
DWORD grfStatFlag)
407 TRACE(
"(%p, %p, %#x)\n",
This, pstatstg, grfStatFlag);
409 return IWICStream_Stat(
This->stream, pstatstg, grfStatFlag);
415 TRACE(
"(%p, %p)\n", iface, ppstm);
489 TRACE(
"(%p) refcount=%u\n", iface,
ref);
499 TRACE(
"(%p) refcount=%u\n", iface,
ref);
502 This->lock.DebugInfo->Spare[0] = 0;
504 IStream_Release(
This->stream);
519 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbRead);
525 hr = IStream_Seek(
This->stream, SetPosition, STREAM_SEEK_CUR, &OldPosition);
529 hr = IStream_Seek(
This->stream, SetPosition, STREAM_SEEK_SET,
NULL);
533 if (
This->pos.QuadPart +
cb >
This->max_size.QuadPart)
536 if (
This->pos.QuadPart >
This->max_size.QuadPart)
539 cb =
This->max_size.QuadPart -
This->pos.QuadPart;
541 hr = IStream_Read(
This->stream, pv,
cb, &uBytesRead);
543 IStream_Seek(
This->stream, SetPosition, STREAM_SEEK_SET,
NULL);
546 This->pos.QuadPart += uBytesRead;
549 if (
SUCCEEDED(
hr) && pcbRead) *pcbRead = uBytesRead;
561 ULONG uBytesWritten=0;
562 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbWritten);
568 hr = IStream_Seek(
This->stream, SetPosition, STREAM_SEEK_CUR, &OldPosition);
572 hr = IStream_Seek(
This->stream, SetPosition, STREAM_SEEK_SET,
NULL);
576 if (
This->pos.QuadPart +
cb >
This->max_size.QuadPart)
579 if (
This->pos.QuadPart >
This->max_size.QuadPart)
582 cb =
This->max_size.QuadPart -
This->pos.QuadPart;
584 hr = IStream_Write(
This->stream, pv,
cb, &uBytesWritten);
586 IStream_Seek(
This->stream, SetPosition, STREAM_SEEK_SET,
NULL);
589 This->pos.QuadPart += uBytesWritten;
592 if (
SUCCEEDED(
hr) && pcbWritten) *pcbWritten = uBytesWritten;
607 actual_size =
This->max_size;
608 if (dwOrigin == STREAM_SEEK_SET)
610 else if (dwOrigin == STREAM_SEEK_CUR)
612 else if (dwOrigin == STREAM_SEEK_END)
614 hr = IStream_Stat(
This->stream, &statstg, STATFLAG_NONAME);
617 if (
This->max_size.QuadPart +
This->offset.QuadPart > statstg.cbSize.QuadPart)
618 actual_size.
QuadPart = statstg.cbSize.QuadPart -
This->offset.QuadPart;
630 if(plibNewPosition) plibNewPosition->
QuadPart =
This->pos.QuadPart;
650 pcbRead, pcbWritten);
656 DWORD grfCommitFlags)
658 TRACE(
"(%p, %#x)\n", iface, grfCommitFlags);
665 TRACE(
"(%p)\n", iface);
688 STATSTG *pstatstg,
DWORD grfStatFlag)
692 TRACE(
"(%p, %p, %#x)\n",
This, pstatstg, grfStatFlag);
697 hr = IStream_Stat(
This->stream, pstatstg, grfStatFlag);
700 pstatstg->cbSize.QuadPart -=
This->offset.QuadPart;
701 if (
This->max_size.QuadPart < pstatstg->cbSize.QuadPart)
702 pstatstg->cbSize.QuadPart =
This->max_size.QuadPart;
714 TRACE(
"(%p, %p)\n", iface, ppstm);
768 *
ppv = &
This->IWICStream_iface;
784 TRACE(
"(%p) refcount=%u\n", iface,
ref);
794 TRACE(
"(%p) refcount=%u\n", iface,
ref);
797 if (
This->pStream) IStream_Release(
This->pStream);
807 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbRead);
810 return IStream_Read(
This->pStream, pv,
cb, pcbRead);
817 TRACE(
"(%p, %p, %u, %p)\n",
This, pv,
cb, pcbWritten);
820 return IStream_Write(
This->pStream, pv,
cb, pcbWritten);
828 dwOrigin, plibNewPosition);
831 return IStream_Seek(
This->pStream, dlibMove, dwOrigin, plibNewPosition);
841 return IStream_SetSize(
This->pStream, libNewSize);
851 return IStream_CopyTo(
This->pStream, pstm,
cb, pcbRead, pcbWritten);
855 DWORD grfCommitFlags)
858 TRACE(
"(%p, %#x)\n",
This, grfCommitFlags);
861 return IStream_Commit(
This->pStream, grfCommitFlags);
870 return IStream_Revert(
This->pStream);
881 return IStream_LockRegion(
This->pStream, libOffset,
cb, dwLockType);
892 return IStream_UnlockRegion(
This->pStream, libOffset,
cb, dwLockType);
896 STATSTG *pstatstg,
DWORD grfStatFlag)
899 TRACE(
"(%p, %p, %#x)\n",
This, pstatstg, grfStatFlag);
902 return IStream_Stat(
This->pStream, pstatstg, grfStatFlag);
912 return IStream_Clone(
This->pStream, ppstm);
945 TRACE(
"(%p, %s, %u)\n", iface,
debugstr_w(wzFileName), dwDesiredAccess);
992 TRACE(
"(%p, %p, %u)\n", iface, pbBuffer, cbBufferSize);
1003 pObject->dwMemsize = cbBufferSize;
1006 pObject->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": StreamOnMemory.lock");
1011 IStream_Release(&
pObject->IStream_iface);
1022 if (
size->u.HighPart)
1024 WARN(
"file too large\n");
1076 IStream_Release(&
pObject->IStream_iface);
1105 IStream_AddRef(pIStream);
1109 pObject->max_size = ulMaxSize;
1111 pObject->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": StreamOnStreamRange.lock");
1116 IStream_Release(&
pObject->IStream_iface);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define CreateFileMappingW(a, b, c, d, e, f)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define HeapFree(x, y, z)
#define ERROR_ACCESS_DENIED
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
static HRESULT WINAPI StreamOnMemory_Write(IStream *iface, void const *pv, ULONG cb, ULONG *pcbWritten)
static HRESULT WINAPI IWICStreamImpl_Revert(IWICStream *iface)
static HRESULT WINAPI StreamOnStreamRange_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
static ULONG WINAPI IWICStreamImpl_Release(IWICStream *iface)
static HRESULT WINAPI IWICStreamImpl_InitializeFromIStreamRegion(IWICStream *iface, IStream *pIStream, ULARGE_INTEGER ulOffset, ULARGE_INTEGER ulMaxSize)
static StreamOnMemory * StreamOnMemory_from_IStream(IStream *iface)
static HRESULT WINAPI StreamOnFileHandle_Revert(IStream *iface)
static HRESULT WINAPI StreamOnStreamRange_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static HRESULT WINAPI StreamOnFileHandle_Clone(IStream *iface, IStream **ppstm)
static ULONG WINAPI IWICStreamImpl_AddRef(IWICStream *iface)
static const IStreamVtbl StreamOnStreamRange_Vtbl
static HRESULT WINAPI StreamOnMemory_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI IWICStreamImpl_Seek(IWICStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static HRESULT WINAPI IWICStreamImpl_InitializeFromFilename(IWICStream *iface, LPCWSTR wzFileName, DWORD dwDesiredAccess)
static HRESULT WINAPI StreamOnMemory_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
static const IStreamVtbl StreamOnMemory_Vtbl
static HRESULT WINAPI StreamOnFileHandle_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
static StreamOnFileHandle * StreamOnFileHandle_from_IStream(IStream *iface)
static HRESULT WINAPI StreamOnMemory_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
static HRESULT WINAPI StreamOnMemory_QueryInterface(IStream *iface, REFIID iid, void **ppv)
static HRESULT WINAPI StreamOnFileHandle_Write(IStream *iface, void const *pv, ULONG cb, ULONG *pcbWritten)
static HRESULT WINAPI StreamOnFileHandle_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static StreamOnStreamRange * StreamOnStreamRange_from_IStream(IStream *iface)
static HRESULT WINAPI StreamOnMemory_Clone(IStream *iface, IStream **ppstm)
static HRESULT WINAPI IWICStreamImpl_Stat(IWICStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static HRESULT WINAPI IWICStreamImpl_Write(IWICStream *iface, void const *pv, ULONG cb, ULONG *pcbWritten)
static HRESULT WINAPI StreamOnStreamRange_Write(IStream *iface, void const *pv, ULONG cb, ULONG *pcbWritten)
static ULONG WINAPI StreamOnStreamRange_AddRef(IStream *iface)
static HRESULT WINAPI StreamOnStreamRange_Commit(IStream *iface, DWORD grfCommitFlags)
static HRESULT WINAPI StreamOnMemory_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static HRESULT WINAPI IWICStreamImpl_SetSize(IWICStream *iface, ULARGE_INTEGER libNewSize)
HRESULT stream_initialize_from_filehandle(IWICStream *iface, HANDLE file)
static HRESULT WINAPI StreamOnStreamRange_Revert(IStream *iface)
static HRESULT WINAPI IWICStreamImpl_Commit(IWICStream *iface, DWORD grfCommitFlags)
static ULONG WINAPI StreamOnFileHandle_Release(IStream *iface)
static HRESULT WINAPI StreamOnFileHandle_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
static HRESULT WINAPI StreamOnStreamRange_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI StreamOnStreamRange_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
static HRESULT WINAPI IWICStreamImpl_CopyTo(IWICStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
static HRESULT map_file(HANDLE file, HANDLE *map, void **mem, LARGE_INTEGER *size)
static HRESULT WINAPI StreamOnFileHandle_Commit(IStream *iface, DWORD grfCommitFlags)
static HRESULT WINAPI StreamOnMemory_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
static HRESULT WINAPI StreamOnMemory_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static HRESULT WINAPI IWICStreamImpl_Clone(IWICStream *iface, IStream **ppstm)
static HRESULT WINAPI StreamOnFileHandle_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static HRESULT WINAPI StreamOnStreamRange_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI StreamOnMemory_Revert(IStream *iface)
static HRESULT WINAPI StreamOnFileHandle_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI IWICStreamImpl_Read(IWICStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
static const IStreamVtbl StreamOnFileHandle_Vtbl
static HRESULT WINAPI StreamOnFileHandle_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
HRESULT StreamImpl_Create(IWICStream **stream)
static HRESULT WINAPI StreamOnFileHandle_QueryInterface(IStream *iface, REFIID iid, void **ppv)
static HRESULT WINAPI IWICStreamImpl_QueryInterface(IWICStream *iface, REFIID iid, void **ppv)
static HRESULT WINAPI IWICStreamImpl_InitializeFromIStream(IWICStream *iface, IStream *stream)
static HRESULT WINAPI StreamOnStreamRange_Clone(IStream *iface, IStream **ppstm)
static ULONG WINAPI StreamOnMemory_Release(IStream *iface)
static HRESULT WINAPI IWICStreamImpl_LockRegion(IWICStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI StreamOnStreamRange_QueryInterface(IStream *iface, REFIID iid, void **ppv)
static HRESULT WINAPI StreamOnMemory_Commit(IStream *iface, DWORD grfCommitFlags)
static IWICStreamImpl * impl_from_IWICStream(IWICStream *iface)
static ULONG WINAPI StreamOnStreamRange_Release(IStream *iface)
static HRESULT WINAPI StreamOnMemory_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static ULONG WINAPI StreamOnFileHandle_AddRef(IStream *iface)
static HRESULT WINAPI StreamOnStreamRange_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static const IWICStreamVtbl WICStream_Vtbl
static ULONG WINAPI StreamOnMemory_AddRef(IStream *iface)
static HRESULT WINAPI IWICStreamImpl_UnlockRegion(IWICStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI StreamOnFileHandle_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
static HRESULT WINAPI IWICStreamImpl_InitializeFromMemory(IWICStream *iface, BYTE *pbBuffer, DWORD cbBufferSize)
static HRESULT WINAPI StreamOnStreamRange_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
#define InterlockedCompareExchangePointer
#define memmove(s1, s2, n)
static HMODULE MODULEINFO DWORD cb
#define STGM_SHARE_DENY_WRITE
#define IsEqualIID(riid1, riid2)
IWICStream IWICStream_iface
struct _ULARGE_INTEGER::@4142 u
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
struct _LARGE_INTEGER::@2304 u
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_NOTINITIALIZED
#define HRESULT_FROM_WIN32(x)
#define ERROR_ARITHMETIC_OVERFLOW
#define WINCODEC_ERR_VALUEOUTOFRANGE