10#ifndef FILE_ATTRIBUTE_VIRTUAL
11#define FILE_ATTRIBUTE_VIRTUAL 0x10000
14DEFINE_GUID(
CLSID_ZipFolderContextMenu, 0xb8cdcb65, 0xb1bf, 0x4b42, 0x94, 0x28, 0x1d, 0xfd, 0xb7, 0xee, 0x92, 0xaf);
19const char test_file_2_contents[] =
"Some generic text in the file in folder_1.\r\nMore text on a new line.";
34 ok(dwWritten ==
Size,
"WriteFile wrote %lu bytes instead of %lu\n", dwWritten,
Size);
42 UINT TickMask = 0xffff;
76 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidl;
82 CComPtr<IShellFolder> spParent;
93#define GetFirstDataObject(spFolder, grfFlags, spData) GetFirstDataObject_(__FILE__, __LINE__, spFolder, grfFlags, spData)
96 CComPtr<IEnumIDList> spEnum;
102 CComHeapPtr<ITEMID_CHILD>
child;
103 ULONG celtFetched = 0;
116 CComPtr<IEnumFORMATETC> pEnumFmt;
126 if (
fmt.cfFormat == cfFormat)
139#define DumpDataObjectFormats(pDataObj) DumpDataObjectFormats_(__FILE__, __LINE__, pDataObj)
140static inline void DumpDataObjectFormats_(
const char*
file,
int line,
IDataObject* pDataObj)
142 CComPtr<IEnumFORMATETC> pEnumFmt;
155 if (
fmt.tymed & TYMED_HGLOBAL)
225 STATSTG statstg = {0};
235 ok_wstr(statstg.pwcsName,
L"test_file_for_zip.txt");
236 ok_hex(statstg.type, STGTY_STREAM);
238 ok_hex(statstg.cbSize.HighPart, 0);
246 ok_hex(statstg.grfLocksSupported, 0);
248 ok_hex(statstg.grfStateBits, 0);
259 char buf[100] = { 0 };
285 NewPosition.
LowPart = statstg.cbSize.LowPart + 1;
315 STATSTG statstg = {0};
325 ok_wstr(statstg.pwcsName,
L"test_file_for_zip.txt");
326 ok_hex(statstg.type, STGTY_STREAM);
328 ok_hex(statstg.cbSize.HighPart, 0);
336 ok_hex(statstg.grfLocksSupported, 0);
338 ok_hex(statstg.grfStateBits, 0);
349 char buf[100] = { 0 };
375 NewPosition.
LowPart = statstg.cbSize.LowPart + 1;
411 CComPtr<IDataObject> spDataObj;
417 trace(
"Pre-Vista zipfldr\n");
426 STGMEDIUM medium = {0};
428 HRESULT hr = spDataObj->GetData(&etc, &medium);
433 ok_hex(medium.tymed, TYMED_HGLOBAL);
442 etc.dwAspect = DVASPECT_CONTENT;
444 etc.tymed = TYMED_ISTREAM;
445 memset(&medium, 0xcc,
sizeof(medium));
446 hr = spDataObj->GetData(&etc, &medium);
448 ok_hex(medium.tymed, TYMED_NULL);
457 etc.dwAspect = DVASPECT_CONTENT;
459 etc.tymed = TYMED_ISTREAM;
460 memset(&medium, 0xcc,
sizeof(medium));
463 hr = spDataObj->GetData(&etc, &medium);
465 ok_hex(medium.tymed, TYMED_ISTREAM);
478 CComPtr<IDataObject> spDataObj;
488 STGMEDIUM medium = {0};
490 HRESULT hr = spDataObj->GetData(&etc, &medium);
495 ok_hex(medium.tymed, TYMED_HGLOBAL);
504 etc.dwAspect = DVASPECT_CONTENT;
506 etc.tymed = TYMED_ISTREAM;
507 memset(&medium, 0xcc,
sizeof(medium));
508 hr = spDataObj->GetData(&etc, &medium);
510 ok_hex(medium.tymed, TYMED_NULL);
519 etc.dwAspect = DVASPECT_CONTENT;
521 etc.tymed = TYMED_ISTREAM;
522 memset(&medium, 0xcc,
sizeof(medium));
523 hr = spDataObj->GetData(&etc, &medium);
525 ok_hex(medium.tymed, TYMED_NULL);
534 etc.dwAspect = DVASPECT_CONTENT;
536 etc.tymed = TYMED_ISTREAM;
537 memset(&medium, 0xcc,
sizeof(medium));
540 hr = spDataObj->GetData(&etc, &medium);
542 ok_hex(medium.tymed, TYMED_ISTREAM);
556 CComPtr<IShellFolder> spFolder;
567 skip(
"Code in zipfldr not implemented yet\n");
#define ok_hr(status, expected)
#define ok_hex_(expression, result)
static CLIPFORMAT cfFileDescriptor
static void test_DataObject_FirstFolder(IShellFolder *pFolder)
const char test_file_1_contents[]
static void test_DataObject_FirstFile(IShellFolder *pFolder)
const char test_file_2_contents[]
static void test_FileContents2(IStream *Stream)
static void test_FileDescriptor(FILEGROUPDESCRIPTORW *Descriptor)
static void test_FileDescriptor_Folder(FILEGROUPDESCRIPTORW *Descriptor)
BOOL extract_resource(WCHAR *Filename, LPCWSTR ResourceName, WCHAR *ParentFolder)
bool InitializeShellFolder_(const char *file, int line, const WCHAR *Filename, CComPtr< IShellFolder > &spFolder)
static CLIPFORMAT cfFileContents
#define FILE_ATTRIBUTE_VIRTUAL
static bool g_bOldZipfldr
static bool GetFirstDataObject_(const char *file, int line, IShellFolder *spFolder, SHCONTF grfFlags, CComPtr< IDataObject > &spData)
static void test_FileContents1(IStream *Stream)
#define GetFirstDataObject(spFolder, grfFlags, spData)
static BOOL write_raw_file(const WCHAR *FileName, const void *Data, DWORD Size)
bool IsFormatAdvertised_(const char *file, int line, IDataObject *pDataObj, CLIPFORMAT cfFormat, TYMED tymed)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define ok_hr_(file, line, status, expected)
#define ok_hex(expression, result)
#define ok_int(expression, result)
#define ok_ptr(expression, result)
EXTERN_C const GUID CLSID_ZipFolderContextMenu
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
#define FAILED_UNEXPECTEDLY(hr)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
DWORD WINAPI GetTickCount(VOID)
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
GLenum GLuint GLenum GLsizei const GLchar * buf
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
HRESULT EnumFormatEtc([in] DWORD dwDirection, [out] IEnumFORMATETC **ppenumFormatEtc)
HRESULT Write([in, size_is(cb)] const void *pv, [in] ULONG cb, [out] ULONG *pcbWritten)
HRESULT Read([out, size_is(cb), length_is(*pcbRead)] void *pv, [in] ULONG cb, [out] ULONG *pcbRead)
HRESULT GetUIObjectOf([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)
HRESULT EnumObjects([in] HWND hwndOwner, [in] SHCONTF grfFlags, [out] IEnumIDList **ppenumIDList)
HRESULT SetSize([in] ULARGE_INTEGER libNewSize)
HRESULT Stat([out] STATSTG *pstatstg, [in] DWORD grfStatFlag)
HRESULT Seek([in] LARGE_INTEGER dlibMove, [in] DWORD dwOrigin, [out] ULARGE_INTEGER *plibNewPosition)
#define trace_(file, line,...)
#define InitializeShellFolder(Filename, pFolder)
#define IsFormatAdvertised(pDataObj, cfFormat, tymed)
#define IDR_ZIP_TEST_FILE
static char workdir[MAX_PATH]
#define FILE_ATTRIBUTE_ARCHIVE
#define FILE_ATTRIBUTE_DIRECTORY
_In_ ULONG _In_ ULONG Offset
#define STGM_SHARE_DENY_WRITE
const GUID IID_IDataObject
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define ok_int_(file, line, expression, result)
static void test_DataObject(void)
static const WCHAR CFSTR_FILECONTENTSW[]
#define CFSTR_SHELLIDLISTA
static const WCHAR CFSTR_FILEDESCRIPTORW[]
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
WCHAR cFileName[MAX_PATH]
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
DWORD WINAPI GetLastError(void)
#define UnlockResource(handle)
#define STG_E_ACCESSDENIED
int WINAPI GetClipboardFormatNameA(_In_ UINT format, _Out_writes_(cchMaxCount) LPSTR lpszFormatName, _In_ int cchMaxCount)
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
UINT WINAPI RegisterClipboardFormatA(_In_ LPCSTR)
#define IID_PPV_ARG(Itype, ppType)