29 pidl->mkid.cb = (
USHORT)cbItem;
44 const BYTE data[] = {0x11, 0x22, 0x33};
50 ok(pidlSrc !=
NULL,
"pidlSrc was NULL.\n");
53 skip(
"pidlSrc was NULL.\n");
58 ok(pstm !=
NULL,
"pstm was NULL.\n");
61 skip(
"pstm was NULL.\n");
71 ok(pidlDst !=
NULL,
"pidlDst was NULL\n");
93 ok(pidlSrc !=
NULL,
"CoTaskMemAlloc failed\n");
96 skip(
"pidlSrc was NULL\n");
103 ok(pstm !=
NULL,
"pstm was NULL\n");
106 skip(
"pstm was NULL\n");
116 ok(pidlDst !=
NULL,
"pidlDst was NULL\n");
133 UINT cbTotal = 4 + 5 + 2;
140 ok(pidlSrc !=
NULL,
"CoTaskMemAlloc failed\n");
143 skip(
"pidlSrc was NULL\n");
151 *
p++ = 0xAA; *
p++ = 0xBB;
154 *
p++ = 0x01; *
p++ = 0x02; *
p++ = 0x03;
157 ok(pstm !=
NULL,
"pstm was NULL\n");
160 skip(
"pstm was NULL\n");
170 ok(pidlDst !=
NULL,
"pidlDst was NULL\n");
189 ok(pstm !=
NULL,
"pstm was NULL\n");
192 skip(
"pstm was NULL\n");
198 ok(pidl ==
NULL,
"pidl was not NULL\n");
211 ok(pstm !=
NULL,
"pstm was NULL.\n");
214 skip(
"pstm was NULL.\n");
218 pstm->
Write(&cbSize,
sizeof(cbSize), &cbWritten);
223 ok(pidl ==
NULL,
"pidl was not NULL\n");
236 ok(pstm !=
NULL,
"pstm was NULL.\n");
239 skip(
"pstm was NULL.\n");
243 pstm->
Write(&cbSize,
sizeof(cbSize), &cbWritten);
248 ok(pidl ==
NULL,
"pidl was not NULL\n");
262 ok(pstm !=
NULL,
"pstm was NULL.\n");
265 skip(
"pstm was NULL.\n");
269 pstm->
Write(&cbSize,
sizeof(cbSize), &cbWritten);
275 ok(pidl ==
NULL,
"pidl was not NULL\n");
290 ok(pidlSrc !=
NULL,
"pidlSrc was NULL\n");
293 skip(
"pidlSrc was NULL\n");
297 ok(pstm !=
NULL,
"pstm was NULL.\n");
300 skip(
"pstm was NULL.\n");
324 ok(pstm !=
NULL,
"pstm was NULL.\n");
327 skip(
"pstm was NULL.\n");
333 ok(pidl ==
NULL,
"pidl was not NULL\n");
343 skip(
"shlwapi not found\n");
351 skip(
"IStream_ReadPidl or IStream_WritePidl not found\n");
359 skip(
"shell32 not found\n");
367 skip(
"ILGetSize not found\n");
#define ok_hr(status, expected)
static void RewindStream(IStream *pstm)
UINT(WINAPI * FN_ILGetSize)(LPCITEMIDLIST)
static FN_IStream_WritePidl g_fnIStream_WritePidl
static void Test_RoundTrip_MultiItemPidl(void)
static FN_IStream_ReadPidl g_fnIStream_ReadPidl
HRESULT(WINAPI * FN_IStream_WritePidl)(IStream *, LPCITEMIDLIST)
static void Test_RoundTrip_EmptyPidl(void)
static FN_ILGetSize g_fnILGetSize
static void Test_Write_StreamPosition(void)
static void Test_Read_EmptyStream(void)
static LPITEMIDLIST MakeSimplePidl(const BYTE *data, UINT dataLen)
HRESULT(WINAPI * FN_IStream_ReadPidl)(IStream *, _Out_ LPITEMIDLIST *)
static void Test_RoundTrip_SimplePidl(void)
static void Test_Read_TruncatedData(void)
static void Test_Read_OutputNullOnFailure(void)
static void Test_Read_MissingTerminator(void)
static void Test_Read_TooSmallCbSize(void)
#define ok_eq_longlong(value, expected)
#define ok_int(expression, result)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
#define GetProcAddress(x, y)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
HRESULT Write([in, size_is(cb)] const void *pv, [in] ULONG cb, [out] ULONG *pcbWritten)
HRESULT Seek([in] LARGE_INTEGER dlibMove, [in] DWORD dwOrigin, [out] ULARGE_INTEGER *plibNewPosition)
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
#define memcpy(s1, s2, n)
static unsigned char rawData[2356]
IStream *WINAPI SHCreateMemStream(const BYTE *lpbData, UINT dwDataLen)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
#define MAKEINTRESOURCEA(i)