62 *ppvObject = &
This->IStream_iface;
67 IStream_AddRef(iface);
108 if (
This->parentStorage)
110 This->parentStorage = 0;
134 ULONG bytesReadBuffer;
137 TRACE(
"%p, %p, %lu, %p.\n", iface, pv,
cb, pcbRead);
139 if (!
This->parentStorage)
141 WARN(
"storage reverted\n");
150 pcbRead = &bytesReadBuffer;
154 This->currentPosition,
164 This->currentPosition.QuadPart += *pcbRead;
192 TRACE(
"%p, %p, %lu, %p.\n", iface, pv,
cb, pcbWritten);
210 if (!
This->parentStorage)
212 WARN(
"storage reverted\n");
230 TRACE(
"<-- S_OK, written 0\n");
236 This->currentPosition,
244 This->currentPosition.QuadPart += *pcbWritten;
249 TRACE(
"<-- %#lx, written %lu\n",
res, *pcbWritten);
273 TRACE(
"%p, %ld, %ld, %p.\n", iface, dlibMove.
LowPart, dwOrigin, plibNewPosition);
279 if (!
This->parentStorage)
281 WARN(
"storage reverted\n");
290 if (plibNewPosition == 0)
292 plibNewPosition = &newPosition;
301 case STREAM_SEEK_SET:
302 plibNewPosition->
u.HighPart = 0;
303 plibNewPosition->
u.LowPart = 0;
305 case STREAM_SEEK_CUR:
306 *plibNewPosition =
This->currentPosition;
308 case STREAM_SEEK_END:
311 *plibNewPosition = currentEntry.
size;
314 WARN(
"invalid dwOrigin %ld\n", dwOrigin);
323 This->currentPosition = *plibNewPosition;
345 if(!
This->parentStorage)
347 WARN(
"storage reverted\n");
356 WARN(
"invalid value for libNewSize.HighPart %ld\n", libNewSize.
HighPart);
365 WARN(
"access denied\n");
398 TRACE(
"%p, %p, %ld, %p, %p.\n", iface, pstm,
cb.LowPart, pcbRead, pcbWritten);
404 if (!
This->parentStorage)
406 WARN(
"storage reverted\n");
416 while (
cb.QuadPart > 0 )
418 if (
cb.QuadPart >=
sizeof(tmpBuffer) )
419 copySize =
sizeof(tmpBuffer);
421 copySize =
cb.LowPart;
423 IStream_Read(iface, tmpBuffer, copySize, &bytesRead);
425 totalBytesRead.
QuadPart += bytesRead;
427 IStream_Write(pstm, tmpBuffer, bytesRead, &
bytesWritten);
437 WARN(
"medium full\n");
441 if (bytesRead!=copySize)
444 cb.QuadPart -= bytesRead;
463 DWORD grfCommitFlags)
467 if (!
This->parentStorage)
469 WARN(
"storage reverted\n");
498 if (!
This->parentStorage)
500 WARN(
"storage reverted\n");
504 FIXME(
"not implemented!\n");
516 if (!
This->parentStorage)
518 WARN(
"storage reverted\n");
522 FIXME(
"not implemented!\n");
544 TRACE(
"%p, %p, %#lx.\n",
This, pstatstg, grfStatFlag);
550 if (!
This->parentStorage)
552 WARN(
"storage reverted\n");
570 pstatstg->grfMode =
This->grfMode;
574 pstatstg->cbSize =
This->currentPosition;
579 WARN(
"failed to read entry\n");
609 if (!
This->parentStorage)
621 IStream_AddRef(*ppstm);
625 return IStream_Seek(*ppstm, seek_pos, STREAM_SEEK_SET,
NULL);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static struct hglobal_stream * impl_from_IStream(IStream *iface)
#define HeapFree(x, y, z)
void StorageBaseImpl_RemoveStream(StorageBaseImpl *stg, StgStreamImpl *strm)
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage, STATSTG *destination, const DirEntry *source, int statFlags)
void StorageBaseImpl_AddStream(StorageBaseImpl *stg, StgStreamImpl *strm)
GLenum GLsizei GLuint GLint * bytesWritten
#define IsEqualIID(riid1, riid2)
StgStreamImpl * StgStreamImpl_Construct(StorageBaseImpl *parentStorage, DWORD grfMode, DirRef dirEntry)
static HRESULT WINAPI StgStreamImpl_QueryInterface(IStream *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI StgStreamImpl_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
static HRESULT WINAPI StgStreamImpl_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static ULONG WINAPI StgStreamImpl_Release(IStream *iface)
static HRESULT WINAPI StgStreamImpl_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static HRESULT WINAPI StgStreamImpl_Commit(IStream *iface, DWORD grfCommitFlags)
static HRESULT WINAPI StgStreamImpl_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT WINAPI StgStreamImpl_Revert(IStream *iface)
static HRESULT WINAPI StgStreamImpl_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
static HRESULT WINAPI StgStreamImpl_Write(IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
static const IStreamVtbl StgStreamVtbl
static HRESULT WINAPI StgStreamImpl_Clone(IStream *iface, IStream **ppstm)
static HRESULT WINAPI StgStreamImpl_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static ULONG WINAPI StgStreamImpl_AddRef(IStream *iface)
static HRESULT WINAPI StgStreamImpl_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
static HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER newsize)
static HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
#define STGM_ACCESS_MODE(stgm)
static HRESULT StorageBaseImpl_Flush(StorageBaseImpl *This)
static HRESULT StorageBaseImpl_ReadDirEntry(StorageBaseImpl *This, DirRef index, DirEntry *data)
StorageBaseImpl * parentStorage
ULARGE_INTEGER currentPosition
struct _ULARGE_INTEGER::@4458 u
#define STG_E_INVALIDPOINTER
#define STG_E_ACCESSDENIED
#define STG_E_INVALIDFUNCTION
#define STG_E_INSUFFICIENTMEMORY