42 U(uzero).HighPart = 0;
73 "expected STG_E_ACCESSDENIED, got 0x%08x\n",
ret);
82 "expected STG_E_ACCESSDENIED, got 0x%08x\n",
ret);
90 "expected STG_E_ACCESSDENIED, got 0x%08x\n",
ret);
98 "expected STG_E_ACCESSDENIED, got 0x%08x\n",
ret);
106 "expected STG_E_ACCESSDENIED, got 0x%08x\n",
ret);
117 "expected E_INVALIDARG, got 0x%08x\n",
ret);
125 ret = IStream_CopyTo(
stream, clone, uzero, &uret, &uret);
139 ret = IStream_Commit(
stream, STGC_DEFAULT);
149 ret = IStream_LockRegion(
stream, uzero, uzero, 0);
151 "expected E_NOTIMPL or S_OK, got 0x%08x\n",
ret);
156 ret = IStream_UnlockRegion(
stream, uzero, uzero, 0);
159 ret = IStream_UnlockRegion(
stream, uzero, uzero, 0);
162 ret = IStream_UnlockRegion(
stream, uzero, uzero, 0);
170 "expected STG_E_INVALIDPOINTER or E_NOTIMPL, got 0x%08x\n",
ret);
179 ok(clone ==
NULL,
"expected a NULL IStream object, got %p\n",
stream);
182 refcount = IStream_Release(clone);
183 ok(refcount == 0,
"expected 0, got %d\n", refcount);
192 unsigned char buf[16];
198 written = 0xdeadbeaf;
203 ok(written == 2,
"expected 2, got %u\n", written);
208 ok(written == 0xdeadbeaf ||
broken(written == 2) ,
"expected 0xdeadbeaf, got %#x\n", written);
224 ok(
buf[0] == 0x5e &&
buf[1] == 0xa7,
"expected 5ea7, got %02x%02x\n",
buf[0],
buf[1]);
231 ok(
ret ==
S_FALSE,
"expected S_FALSE, got %#x (access %#x, written %u)\n",
ret,
mode, written);
240 ok(
ret ==
S_OK,
"IStream_Read error %#x (access %#x, written %u)\n",
ret,
mode, written);
245 ok(
ret ==
S_FALSE,
"expected S_FALSE, got %#x (access %#x, written %u)\n",
ret,
mode, written);
246 ok(
count == written,
"expected %u, got %u\n", written,
count);
248 ok(
buf[0] == 0x5e &&
buf[1] == 0xa7,
"expected 5ea7, got %02x%02x\n",
buf[0],
buf[1]);
250 memset(&statstg, 0xff,
sizeof(statstg));
256 memset(&statstg, 0xff,
sizeof(statstg));
257 ret = IStream_Stat(
stream, &statstg, STATFLAG_NONAME);
267 hr = IStream_QueryInterface(
stream, &IID_IStream, (
void **)&unk);
269 IUnknown_Release(unk);
272 hr = IStream_QueryInterface(
stream, &IID_ISequentialStream, (
void **)&unk);
276 IUnknown_Release(unk);
280 IUnknown_Release(unk);
289 static const CHAR testA_txt[] =
"\\testA.txt";
291 trace(
"SHCreateStreamOnFileA: testing mode %d, STGM flags %08x\n",
mode, stgm);
308 "SHCreateStreamOnFileA: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) "
309 "or HRESULT_FROM_WIN32(ERROR_BAD_PATHNAME), got 0x%08x\n",
ret);
310 ok(
stream ==
NULL,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p\n",
stream);
321 ok(
stream ==
NULL,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p\n",
stream);
326 ok(
stream ==
NULL,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p\n",
stream);
331 ok(
stream ==
NULL,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p\n",
stream);
338 ok(
stream ==
NULL,
"SHCreateStreamOnFileA: expected a NULL IStream object, got %p\n",
stream);
342 ok(
ret ==
S_OK,
"SHCreateStreamOnFileA: expected S_OK, got 0x%08x\n",
ret);
343 ok(
stream !=
NULL,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL\n");
349 refcount = IStream_Release(
stream);
350 ok(refcount == 0,
"SHCreateStreamOnFileA: expected 0, got %d\n", refcount);
359 ok(
ret ==
S_OK,
"SHCreateStreamOnFileA: expected S_OK, got 0x%08x\n",
ret);
360 ok(
stream !=
NULL,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL\n");
365 refcount = IStream_Release(
stream);
366 ok(refcount == 0,
"SHCreateStreamOnFileA: expected 0, got %d\n", refcount);
371 ok(
ret ==
S_OK,
"SHCreateStreamOnFileA: expected S_OK, got 0x%08x\n",
ret);
372 ok(
stream !=
NULL,
"SHCreateStreamOnFileA: expected a valid IStream object, got NULL\n");
380 refcount = IStream_Release(
stream);
381 ok(refcount == 0,
"SHCreateStreamOnFileA: expected 0, got %d\n", refcount);
384 ok(delret,
"SHCreateStreamOnFileA: could not delete file '%s', got error %d\n",
397 static const CHAR testW_txt[] =
"\\testW.txt";
399 trace(
"SHCreateStreamOnFileW: testing mode %d, STGM flags %08x\n",
mode, stgm);
415 "SHCreateStreamOnFileW: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n",
ret);
416 ok(
stream ==
NULL,
"SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n",
stream);
429 ok(
stream ==
NULL,
"SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n",
stream);
434 ok(
stream ==
NULL,
"SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n",
stream);
439 ok(
stream ==
NULL,
"SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n",
stream);
451 ok(
stream ==
NULL,
"SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n",
stream);
455 ok(
ret ==
S_OK,
"SHCreateStreamOnFileW: expected S_OK, got 0x%08x\n",
ret);
456 ok(
stream !=
NULL,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL\n");
462 refcount = IStream_Release(
stream);
463 ok(refcount == 0,
"SHCreateStreamOnFileW: expected 0, got %d\n", refcount);
472 ok(
ret ==
S_OK,
"SHCreateStreamOnFileW: expected S_OK, got 0x%08x\n",
ret);
473 ok(
stream !=
NULL,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL\n");
478 refcount = IStream_Release(
stream);
479 ok(refcount == 0,
"SHCreateStreamOnFileW: expected 0, got %d\n", refcount);
484 ok(
ret ==
S_OK,
"SHCreateStreamOnFileW: expected S_OK, got 0x%08x\n",
ret);
485 ok(
stream !=
NULL,
"SHCreateStreamOnFileW: expected a valid IStream object, got NULL\n");
493 refcount = IStream_Release(
stream);
494 ok(refcount == 0,
"SHCreateStreamOnFileW: expected 0, got %d\n", refcount);
497 ok(delret,
"SHCreateStreamOnFileW: could not delete the test file, got error %d\n",
511 static const CHAR testEx_txt[] =
"\\testEx.txt";
515 trace(
"SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x\n",
mode, stgm);
531 "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n",
ret);
532 ok(
stream ==
NULL,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n",
stream);
538 win_skip(
"File probably locked by Anti-Virus/Spam software, trying again\n");
544 "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or "
545 "HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got 0x%08x\n",
ret);
547 ok(
stream ==
NULL,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n",
stream);
562 "SHCreateStreamOnFileEx: expected E_INVALIDARG or HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got 0x%08x\n",
ret);
565 skip(
"SHCreateStreamOnFileEx: STGM_TRANSACTED not supported in this configuration.\n");
571 "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or "
572 "HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got 0x%08x\n",
ret);
574 ok(
stream ==
NULL,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n",
stream);
580 skip(
"Not supported\n");
585 ok(
ret ==
S_OK,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n",
ret);
586 ok(
stream !=
NULL,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n");
592 refcount = IStream_Release(
stream);
593 ok(refcount == 0,
"SHCreateStreamOnFileEx: expected 0, got %d\n", refcount);
596 ok(delret,
"SHCreateStreamOnFileEx: could not delete the test file, got error %d\n",
603 win_skip(
"File probably locked by Anti-Virus/Spam software, trying again\n");
607 ok(
ret ==
S_OK,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n",
ret);
608 ok(
stream !=
NULL,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n");
613 refcount = IStream_Release(
stream);
614 ok(refcount == 0,
"SHCreateStreamOnFileEx: expected 0, got %d\n", refcount);
617 ok(delret,
"SHCreateStreamOnFileEx: could not delete the test file, got error %d\n",
624 win_skip(
"File probably locked by Anti-Virus/Spam software, trying again\n");
628 ok(
ret ==
S_OK,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n",
ret);
629 ok(
stream !=
NULL,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n");
634 refcount = IStream_Release(
stream);
635 ok(refcount == 0,
"SHCreateStreamOnFileEx: expected 0, got %d\n", refcount);
644 ok(
ret ==
S_OK,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n",
ret);
645 ok(
stream !=
NULL,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n");
650 refcount = IStream_Release(
stream);
651 ok(refcount == 0,
"SHCreateStreamOnFileEx: expected 0, got %d\n", refcount);
657 ok(
stream ==
NULL,
"SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n",
stream);
661 ok(
ret ==
S_OK,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n",
ret);
662 ok(
stream !=
NULL,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n");
667 refcount = IStream_Release(
stream);
668 ok(refcount == 0,
"SHCreateStreamOnFileEx: expected 0, got %d\n", refcount);
673 ok(
ret ==
S_OK,
"SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n",
ret);
674 ok(
stream !=
NULL,
"SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n");
679 refcount = IStream_Release(
stream);
680 ok(refcount == 0,
"SHCreateStreamOnFileEx: expected 0, got %d\n", refcount);
684 ok(delret,
"SHCreateStreamOnFileEx: could not delete the test file, got error %d\n",
698 static const char srcContents[1];
699 static const WCHAR prefix[] = {
'T',
'S',
'T', 0 };
711 ret = IStream_Write(
src, srcContents,
sizeof(srcContents), &
U(written).LowPart);
727 ok(
read.QuadPart == 1,
"read does not match size: %d != 1\n",
U(
read).LowPart);
728 ok(written.
QuadPart == 1,
"written does not match size: %d != 1\n",
U(written).LowPart);
730 IStream_Release(
dst);
731 IStream_Release(
src);
738 static const BYTE initial[10];
755 hr = IStream_QueryInterface(
stream, &IID_ISequentialStream, (
void **)&unk);
759 IUnknown_Release(unk);
765 hr = IStream_Clone(
stream, &stream2);
769 IStream_Release(stream2);
776 static const DWORD stgm_access[] = {
782 static const DWORD stgm_sharing[] = {
790 static const DWORD stgm_flags[] = {
char * strcpy(char *DstString, const char *SrcString)
#define ERROR_INVALID_PARAMETER
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
HRESULT WINAPI SHCreateStreamOnFileA(LPCSTR lpszPath, DWORD dwMode, IStream **lppStream)
HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode, DWORD dwAttributes, BOOL bCreate, IStream *lpTemplate, IStream **lppStream)
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
static unsigned char buff[32768]
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLsizei GLfloat distance
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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 GLint GLint j
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
#define ERROR_FILE_NOT_FOUND
static IBackgroundCopyFile * test_file
static void test_stream_qi(IStream *stream)
static void test_SHCreateStreamOnFileEx_CopyTo(void)
static void test_stream_read_write(IStream *stream, DWORD mode)
static void test_SHCreateStreamOnFileW(DWORD mode, DWORD stgm)
static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
static void test_IStream_invalid_operations(IStream *stream, DWORD mode)
static void test_SHCreateMemStream(void)
static void test_SHCreateStreamOnFileA(DWORD mode, DWORD stgm)
#define FILE_ATTRIBUTE_TEMPORARY
#define STGM_SHARE_DENY_NONE
#define STGM_SHARE_EXCLUSIVE
#define STGM_DELETEONRELEASE
#define STGM_SHARE_DENY_WRITE
#define STGM_SHARE_DENY_READ
IStream *WINAPI SHCreateMemStream(const BYTE *lpbData, UINT dwDataLen)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define STG_E_INVALIDPOINTER
#define STG_E_LOCKVIOLATION
#define ERROR_PATH_NOT_FOUND
#define ERROR_BAD_PATHNAME
#define ERROR_FILE_EXISTS
#define STG_E_ACCESSDENIED
#define HRESULT_FROM_WIN32(x)