113 IStream_AddRef(iface);
147 TRACE(
"%p, %p, %ld, %p\n", iface, pv,
cb, read_len);
160 WARN(
"Failed to lock hglobal %p\n",
stream->handle->hglobal);
182 TRACE(
"%p, %p, %ld, %p\n", iface, pv,
cb, written);
201 ERR(
"IStream_SetSize failed with error %#lx\n",
hr);
209 WARN(
"write to invalid hglobal %p\n",
stream->handle->hglobal);
235 case STREAM_SEEK_SET:
238 case STREAM_SEEK_CUR:
240 case STREAM_SEEK_END:
280 stream->handle->hglobal = hglobal;
293 TRACE(
"%p, %p, %ld, %p, %p\n", iface,
dest,
cb.LowPart, read_len, written);
301 while (
cb.QuadPart > 0)
304 ULONG chunk_read, chunk_written;
306 hr = IStream_Read(iface,
buffer, chunk_size, &chunk_read);
314 hr = IStream_Write(
dest,
buffer, chunk_read, &chunk_written);
318 total_written.
QuadPart += chunk_written;
321 if (chunk_read != chunk_size)
324 cb.QuadPart -= chunk_read;
361 memset(pstatstg, 0,
sizeof(STATSTG));
363 pstatstg->pwcsName =
NULL;
364 pstatstg->type = STGTY_STREAM;
365 pstatstg->cbSize.QuadPart =
stream->handle->
size;
376 TRACE(
"%p, %p\n", iface, ppstm);
383 *ppstm = &clone->IStream_iface;
385 clone->handle =
stream->handle;
388 IStream_Seek(*ppstm,
offset, STREAM_SEEK_SET, &
dummy);
448 *phglobal =
object->handle->hglobal;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static HRESULT WINAPI stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *read_len)
HRESULT WINAPI GetHGlobalFromStream(IStream *stream, HGLOBAL *phglobal)
static ULONG WINAPI stream_AddRef(IStream *iface)
static HRESULT WINAPI stream_UnlockRegion(IStream *iface, ULARGE_INTEGER offset, ULARGE_INTEGER len, DWORD lock_type)
static HRESULT WINAPI stream_Write(IStream *iface, const void *pv, ULONG cb, ULONG *written)
static struct hglobal_stream * impl_from_IStream(IStream *iface)
static void handle_release(struct handle_wrapper *handle)
static const IStreamVtbl hglobalstreamvtbl
static ULONG WINAPI stream_Release(IStream *iface)
static HRESULT WINAPI stream_CopyTo(IStream *iface, IStream *dest, ULARGE_INTEGER cb, ULARGE_INTEGER *read_len, ULARGE_INTEGER *written)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
static void handle_addref(struct handle_wrapper *handle)
static HRESULT WINAPI stream_Revert(IStream *iface)
static HRESULT WINAPI stream_Seek(IStream *iface, LARGE_INTEGER move, DWORD origin, ULARGE_INTEGER *pos)
static HRESULT WINAPI stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD flags)
static HRESULT WINAPI stream_QueryInterface(IStream *iface, REFIID riid, void **obj)
static HRESULT WINAPI stream_Clone(IStream *iface, IStream **ppstm)
static HRESULT WINAPI stream_LockRegion(IStream *iface, ULARGE_INTEGER offset, ULARGE_INTEGER len, DWORD lock_type)
static HRESULT WINAPI stream_Commit(IStream *iface, DWORD flags)
static struct handle_wrapper * handle_create(HGLOBAL hglobal, BOOL delete_on_release)
static struct hglobal_stream * hglobalstream_construct(void)
static HRESULT WINAPI stream_SetSize(IStream *iface, ULARGE_INTEGER size)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HGLOBAL NTAPI GlobalReAlloc(HGLOBAL hMem, SIZE_T dwBytes, UINT uFlags)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
static ERESOURCE GlobalLock
#define memcpy(s1, s2, n)
#define IsEqualIID(riid1, riid2)
struct handle_wrapper * handle
#define CONTAINING_RECORD(address, type, field)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
#define STG_E_INVALIDPOINTER
#define STG_E_INVALIDFUNCTION