75 IStream_AddRef(iface);
103 if (
This->failreadcall)
107 else if (
This->failreadsize)
109 *lpRead = ulSize + 8;
112 else if (
This->readreturnlarge)
114 *((
ULONG*)lpMem) = 0xffff01;
119 if (ulSize ==
sizeof(
ULONG))
131 if (!
This->item->cbSize)
137 *((
ULONG *)lpMem) =
This->item->dwSignature;
140 for (
i = 0;
i <
This->item->cbSize;
i++)
154 if (
This->failwritecall)
158 else if (
This->failwritesize)
184 if (
This->failstatcall)
187 pstatstg->cbSize.QuadPart =
This->pos.QuadPart;
233 win_skip(
"Too old shlwapi version\n");
238 ok(pSHWriteDataBlockList != 0,
"No Ordinal 17\n");
240 ok(pSHReadDataBlockList != 0,
"No Ordinal 18\n");
242 ok(pSHFreeDataBlockList != 0,
"No Ordinal 19\n");
244 ok(pSHAddDataBlock != 0,
"No Ordinal 20\n");
246 ok(pSHRemoveDataBlock != 0,
"No Ordinal 21\n");
250 ok(pSHIsEmptyStream != 0,
"No Ordinal 166\n");
252 ok(pIStream_Read != 0,
"No Ordinal 184\n");
254 ok(pIStream_Write != 0,
"No Ordinal 212\n");
256 ok(pIStream_Reset != 0,
"No Ordinal 213\n");
258 ok(pIStream_Size != 0,
"No Ordinal 214\n");
279 obj->pos.QuadPart = 0;
294 if (!pSHWriteDataBlockList || !pSHReadDataBlockList || !pSHFreeDataBlockList || !pSHAddDataBlock ||
305 for (
i = 0;
i <
item->cbSize;
i++)
308 ret = pSHAddDataBlock(&
list, inserted);
316 ok(inserted !=
NULL,
"lost after adding\n");
318 ok(!inserted || inserted->
dwSignature != ~0
U,
"find returned a container\n");
321 if (inserted && (inserted->
cbSize & 0x3))
324 ok(inserted[-1].dwSignature == ~0
U,
"invalid size is not countained\n");
326 "container too small\n");
342 ok(bDataOK ==
TRUE,
"data corrupted on insert\n");
344 ok(!inserted || inserted->
dwSignature ==
item->dwSignature,
"find got wrong item\n");
353 ok(hRet ==
S_OK,
"write failed\n");
358 ok(streamobj.
readcalls == 0,
"called Read() in write\n");
359 ok(streamobj.
seekcalls == 0,
"called Seek() in write\n");
367 ok(streamobj.
writecalls == 1,
"called object after failure\n");
368 ok(streamobj.
readcalls == 0,
"called Read() after failure\n");
369 ok(streamobj.
seekcalls == 0,
"called Seek() after failure\n");
375 "changed size failure return\n");
376 ok(streamobj.
writecalls == 1,
"called object after size failure\n");
377 ok(streamobj.
readcalls == 0,
"called Read() after failure\n");
378 ok(streamobj.
seekcalls == 0,
"called Seek() after failure\n");
385 ret = pSHAddDataBlock(
NULL, inserted);
388 ret = pSHAddDataBlock(&
list, inserted);
392 ok(inserted ==
NULL,
"inserted bad element size\n");
398 ret = pSHAddDataBlock(&
list, inserted);
405 ok(inserted ==
NULL,
"found a nonexistent item\n");
409 BOOL bRet = pSHRemoveDataBlock(&
list,
item->dwSignature);
410 ok(bRet ==
TRUE,
"couldn't find item to delete\n");
416 ok(inserted ==
NULL,
"found an item in empty list\n");
422 ok(hRet ==
S_OK,
"failed create from Read()\n");
428 ok(streamobj.
writecalls == 0,
"called Write() from create\n");
429 ok(streamobj.
seekcalls == 0,
"called Seek() from create\n");
437 ok(inserted !=
NULL,
"lost after adding\n");
439 ok(!inserted || inserted->
dwSignature != ~0
U,
"find returned a container\n");
442 if (inserted && inserted->
cbSize & 0x3)
445 ok(inserted[-1].dwSignature == ~0
U,
"invalid size is not countained\n");
447 "container too small\n");
454 ok(!inserted || inserted->
dwSignature ==
item->dwSignature,
"find got wrong item\n");
464 ok(bDataOK ==
TRUE,
"data corrupted on insert\n");
476 ok(streamobj.
readcalls == 1,
"called object after read failure\n");
477 ok(streamobj.
writecalls == 0,
"called Write() after read failure\n");
478 ok(streamobj.
seekcalls == 0,
"called Seek() after read failure\n");
484 ok(hRet ==
S_OK,
"failed create from Read() with large item\n");
487 ok(streamobj.
writecalls == 0,
"called Write() after read failure\n");
490 pSHFreeDataBlockList(
list);
498 if (!pSHIsEmptyStream)
510 ok(streamobj.
statcalls == 1,
"wrong call count\n");
517 ok(bRet ==
FALSE,
"failed after seek adjusted\n");
521 ok(streamobj.
statcalls == 1,
"wrong call count\n");
528 ok(bRet ==
FALSE,
"should be FALSE after read is OK\n");
529 ok(streamobj.
readcalls == 1,
"wrong call count\n");
531 ok(streamobj.
seekcalls == 1,
"wrong call count\n");
532 ok(streamobj.
statcalls == 1,
"wrong call count\n");
540 ok(bRet ==
TRUE,
"Should be true after read fails\n");
541 ok(streamobj.
readcalls == 1,
"wrong call count\n");
544 ok(streamobj.
statcalls == 1,
"wrong call count\n");
545 ok(streamobj.
pos.
QuadPart == 50001,
"called Seek() after read failed\n");
561 ok(hRet ==
S_OK,
"failed Read()\n");
562 ok(streamobj.
readcalls == 1,
"wrong call count\n");
570 char buff[256] = {0};
579 ok(hRet ==
S_OK,
"failed Write()\n");
592 if (!pIStream_Reset || !pIStream_Size)
604 ok(streamobj.
seekcalls == 1,
"wrong call count\n");
608 ok(hRet ==
S_OK,
"failed Stat()\n");
609 ok(ul.QuadPart == 0,
"213 didn't rewind stream\n");
629 ok(hRet ==
S_OK,
"failed Stat()\n");
630 ok(streamobj.
statcalls == 1,
"wrong call count\n");
634 ok(ul.QuadPart == 5000l,
"Stat gave wrong size\n");
#define InterlockedIncrement
#define InterlockedDecrement
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
static unsigned char buff[32768]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static ULARGE_INTEGER *static BOOL InitFunctionPtrs(void)
static HRESULT WINAPI QueryInterface(IStream *iface, REFIID riid, void **ret_iface)
static HRESULT WINAPI Write(IStream *iface, const void *lpMem, ULONG ulSize, ULONG *lpWritten)
static HRESULT WINAPI Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static BOOL test_SHIsEmptyStream(void)
static void test_IStream_Reset(void)
static DATABLOCK_HEADER *WINAPI * pSHFindDataBlock(DATABLOCK_HEADER *, ULONG)
static const DATABLOCK_HEADER clist_items[]
static void test_CList(void)
static void test_IStream_Size(void)
static ULONG WINAPI AddRef(IStream *iface)
static void InitDummyStream(struct dummystream *obj)
static struct dummystream * impl_from_IStream(IStream *iface)
static void test_IStream_Write(void)
static void test_IStream_Read(void)
static HMODULE SHLWAPI_hshlwapi
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
struct tagDATABLOCKHEADER DATABLOCK_HEADER
const DATABLOCK_HEADER * item
#define CONTAINING_RECORD(address, type, field)
#define STG_E_ACCESSDENIED