22 #define NONAMELESSUNION 33 DEFINE_GUID(FMTID_Test,0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12);
34 DEFINE_GUID(FMTID_NotExisting, 0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x13);
35 DEFINE_GUID(CLSID_ClassMoniker, 0x0000031a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
37 #define DEFINE_EXPECT(func) \ 38 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE 40 #define SET_EXPECT(func) \ 41 expect_ ## func = TRUE 43 #define CHECK_EXPECT2(func) \ 45 ok(expect_ ##func, "unexpected call " #func "\n"); \ 46 called_ ## func = TRUE; \ 49 #define CHECK_EXPECT(func) \ 51 CHECK_EXPECT2(func); \ 52 expect_ ## func = FALSE; \ 55 #define CHECK_CALLED(func) \ 57 ok(called_ ## func, "expected " #func "\n"); \ 58 expect_ ## func = called_ ## func = FALSE; \ 76 ULONG,
const PROPSPEC*, PROPVARIANT*);
89 pSHCreateQueryCancelAutoPlayMoniker = (
void*)
GetProcAddress(
hmod,
"SHCreateQueryCancelAutoPlayMoniker");
96 ok(0,
"unexpected call\n");
102 ok(0,
"unexpected call\n");
113 const PROPSPEC *rgpspec, PROPVARIANT *rgpropvar)
118 ok(rgpspec !=
NULL,
"rgpspec = NULL\n");
119 ok(rgpropvar !=
NULL,
"rgpropvar = NULL\n");
121 ok(rgpspec[0].ulKind == PRSPEC_PROPID,
"rgpspec[0].ulKind = %d\n", rgpspec[0].ulKind);
122 ok(rgpspec[0].propid ==
PID_CODEPAGE,
"rgpspec[0].propid = %d\n", rgpspec[0].propid);
124 rgpropvar[0].vt =
VT_I2;
125 rgpropvar[0].iVal = 1234;
129 ok(cpspec == 10,
"cpspec = %u\n", cpspec);
130 ok(rgpspec == (
void*)0xdeadbeef,
"rgpspec = %p\n", rgpspec);
131 ok(rgpropvar !=
NULL,
"rgpropvar = NULL\n");
133 ok(rgpropvar[0].
vt==0 ||
broken(rgpropvar[0].
vt==
VT_BSTR),
"rgpropvar[0].vt = %d\n", rgpropvar[0].
vt);
136 rgpropvar[0].bstrVal = (
void*)0xdeadbeef;
138 rgpropvar[1].pszVal = (
void*)0xdeadbeef;
140 rgpropvar[2].pcVal = (
void*)0xdeadbeef;
142 rgpropvar[3].pvarVal = (
void*)0xdeadbeef;
149 const PROPSPEC *rgpspec,
const PROPVARIANT *rgpropvar,
154 ok(cpspec == 20,
"cpspec = %d\n", cpspec);
155 ok(rgpspec == (
void*)0xdeadbeef,
"rgpspec = %p\n", rgpspec);
156 ok(rgpropvar == (
void*)0xdeadbeef,
"rgpropvar = %p\n", rgpspec);
162 const PROPSPEC *rgpspec)
164 ok(0,
"unexpected call\n");
171 ok(0,
"unexpected call\n");
178 ok(0,
"unexpected call\n");
185 ok(0,
"unexpected call\n");
191 ok(0,
"unexpected call\n");
197 ok(0,
"unexpected call\n");
203 ok(0,
"unexpected call\n");
210 ok(0,
"unexpected call\n");
216 ok(0,
"unexpected call\n");
224 memset(statpsstg, 0,
sizeof(STATPROPSETSTG));
225 memcpy(&statpsstg->fmtid, &FMTID_Test,
sizeof(
FMTID));
226 statpsstg->grfFlags = PROPSETFLAG_ANSI;
253 ok(0,
"unexpected call\n");
259 ok(0,
"unexpected call\n");
265 ok(0,
"unexpected call\n");
275 "Incorrect rfmtid value\n");
276 ok(pclsid ==
NULL,
"pclsid != NULL\n");
277 ok(grfFlags == PROPSETFLAG_ANSI,
"grfFlags = %x\n", grfFlags);
278 ok(grfMode ==
STGM_READ,
"grfMode = %x\n", grfMode);
290 ok(grfMode ==
STGM_READ,
"grfMode = %x\n", grfMode);
303 ok(
IsEqualGUID(rfmtid, &FMTID_Test),
"wrong rfmtid value\n");
308 IEnumSTATPROPSETSTG **ppenum)
310 ok(0,
"unexpected call\n");
330 PROPVARIANT
read[10];
333 if(!pSHPropStgCreate || !pSHPropStgReadMultiple || !pSHPropStgWriteMultiple) {
334 win_skip(
"SHPropStg* functions are missing\n");
340 pSHPropStgCreate(
NULL, &FMTID_Test,
NULL, PROPSETFLAG_DEFAULT,
425 read[0].bstrVal = (
void*)0xdeadbeef;
429 hres = pSHPropStgReadMultiple(property_storage, 0, 10, (
void*)0xdeadbeef,
read);
437 hres = pSHPropStgReadMultiple(property_storage, 1251, 10, (
void*)0xdeadbeef,
read);
455 IClassActivator_AddRef(iface);
518 ok(0,
"unexpected call\n");
524 ok(0,
"unexpected call\n");
530 ok(0,
"unexpected call\n");
536 ok(0,
"unexpected call\n");
542 ok(0,
"unexpected call\n");
553 ok(pbc !=
NULL,
"got %p\n", pbc);
554 ok(moniker_to_left ==
NULL,
"got %p\n", moniker_to_left);
572 ok(0,
"unexpected call\n");
578 DWORD dwReduceHowFar,
582 ok(0,
"unexpected call\n");
588 BOOL fOnlyIfNotGeneric,
591 ok(0,
"unexpected call\n");
597 ok(0,
"unexpected call\n");
603 ok(0,
"unexpected call\n");
609 ok(0,
"unexpected call\n");
618 ok(0,
"unexpected call\n");
627 ok(0,
"unexpected call\n");
633 ok(0,
"unexpected call\n");
639 ok(0,
"unexpected call\n");
645 ok(0,
"unexpected call\n");
654 ok(0,
"unexpected call\n");
665 ok(0,
"unexpected call\n");
671 ok(0,
"unexpected call\n");
713 if (!pSHCreateQueryCancelAutoPlayMoniker)
715 win_skip(
"SHCreateQueryCancelAutoPlayMoniker is not available, skipping tests.\n");
719 hr = pSHCreateQueryCancelAutoPlayMoniker(
NULL);
722 hr = pSHCreateQueryCancelAutoPlayMoniker(&mon);
726 hr = IMoniker_IsSystemMoniker(mon, &sys);
728 ok(sys == MKSYS_CLASSMONIKER,
"got %d\n", sys);
731 hr = IMoniker_GetClassID(mon, &
clsid);
740 hr = IMoniker_BindToObject(mon, ctxt, &
test_moniker, &IID_IQueryCancelAutoPlay, (
void**)&unk);
742 IBindCtx_Release(ctxt);
747 IMoniker_Release(mon);
750 #define WM_EXPECTED_VALUE WM_APP 751 #define DROPTEST_FILENAME "c:\\wintest.bin" 769 HDROP hDrop = (HDROP)
wparam;
775 ok(
num == 1,
"expected 1, got %u\n",
num);
777 ok(
num == 1,
"expected 1, got %u\n",
num);
783 ok(
pt.x == 10,
"expected 10, got %d\n",
pt.x);
784 ok(
pt.y == 20,
"expected 20, got %d\n",
pt.y);
800 memset(&cls, 0,
sizeof(cls));
813 ok(
r,
"got %d\n",
r);
821 ok(
r,
"got %d\n",
r);
828 ok(0,
"unexpected return value, got %d\n",
r);
860 pDrop->
fNC = non_client_flag;
869 ok(
r,
"got %d\n",
r);
872 ok(
r,
"got %d\n",
r);
875 ok(
r,
"got %d\n",
r);
883 #undef WM_EXPECTED_VALUE 884 #undef DROPTEST_FILENAME 888 static const WCHAR session_format[] = {
889 'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
890 'W',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
891 'E',
'x',
'p',
'l',
'o',
'r',
'e',
'r',
'\\',
'S',
'e',
's',
's',
'i',
'o',
'n',
'I',
'n',
'f',
'o',
'\\',
'%',
'u',0};
898 if (!pSHCreateSessionKey)
900 win_skip(
"SHCreateSessionKey is not implemented\n");
907 hkey = (
HKEY)0xdeadbeef;
908 hr = pSHCreateSessionKey(0, &hkey);
910 ok(hkey ==
NULL,
"got %p\n", hkey);
917 ok(hkey != hkey2,
"got %p, %p\n", hkey, hkey2);
926 wsprintfW(sessionW, session_format, session);
928 ok(!
ret,
"key not found\n");
940 ok(
hr ==
S_OK,
"Failed to create IDropTargetHelper, %#x\n",
hr);
942 hr = IDropTargetHelper_QueryInterface(
target, &IID_IDragSourceHelper, (
void **)&dragsource);
944 IDragSourceHelper_Release(dragsource);
946 IDropTargetHelper_Release(
target);
956 ok(
hr ==
S_OK,
"CoInitialize failed (0x%08x)\n",
hr);
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static HKEY *static void init(void)
static DWORD WINAPI drop_window_therad(void *arg)
#define WM_EXPECTED_VALUE
static HRESULT WINAPI PropertyStorage_Enum(IPropertyStorage *This, IEnumSTATPROPSTG **ppenum)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
static ULONG WINAPI test_activator_AddRef(IClassActivator *iface)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
static HRESULT WINAPI PropertyStorage_DeleteMultiple(IPropertyStorage *This, ULONG cpspec, const PROPSPEC *rgpspec)
static HRESULT WINAPI test_moniker_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI PropertyStorage_SetClass(IPropertyStorage *This, REFCLSID clsid)
static HRESULT WINAPI test_moniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
static const IMonikerVtbl test_moniker_vtbl
static ULONG WINAPI PropertySetStorage_Release(IPropertySetStorage *This)
static ULONG WINAPI PropertySetStorage_AddRef(IPropertySetStorage *This)
ACPI_SIZE strlen(const char *String)
static HRESULT(WINAPI *pSHPropStgCreate)(IPropertySetStorage *
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
static HRESULT WINAPI PropertyStorage_Commit(IPropertyStorage *This, DWORD grfCommitFlags)
#define HKEY_CURRENT_USER
static ULONG WINAPI test_moniker_Release(IMoniker *iface)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
DEFINE_GUID(FMTID_Test, 0x12345678, 0x1234, 0x1234, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12)
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
static HRESULT WINAPI PropertySetStorage_QueryInterface(IPropertySetStorage *This, REFIID riid, void **ppvObject)
const char * wine_dbgstr_guid(const GUID *guid)
static HRESULT WINAPI test_moniker_IsDirty(IMoniker *iface)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
DWORD WINAPI GetLastError(VOID)
static HRESULT WINAPI PropertySetStorage_Delete(IPropertySetStorage *This, REFFMTID rfmtid)
static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
static const CLSID IPropertyStorage UINT *static const PROPSPEC PROPVARIANT *static UINT const PROPSPEC PROPVARIANT PROPID
static HRESULT WINAPI test_moniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
BOOL WINAPI DestroyWindow(_In_ HWND)
static HRESULT WINAPI test_moniker_Inverse(IMoniker *iface, IMoniker **ppmk)
static HRESULT WINAPI test_moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
static void test_DragQueryFile(BOOL non_client_flag)
static const CLSID IPropertyStorage UINT *static UINT
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
static HRESULT WINAPI test_activator_GetClassObject(IClassActivator *iface, REFCLSID clsid, DWORD context, LCID locale, REFIID riid, void **ppv)
LONG WINAPI RegCloseKey(HKEY hKey)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static UINT WPARAM LPARAM lparam
static HRESULT WINAPI test_moniker_RelativePathTo(IMoniker *iface, IMoniker *pmOther, IMoniker **ppmkRelPath)
static HRESULT WINAPI test_moniker_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
static HRESULT WINAPI PropertySetStorage_Open(IPropertySetStorage *This, REFFMTID rfmtid, DWORD grfMode, IPropertyStorage **ppprstg)
static HRESULT WINAPI test_moniker_IsSystemMoniker(IMoniker *iface, DWORD *pwdMksys)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
static HRESULT WINAPI PropertyStorage_QueryInterface(IPropertyStorage *This, REFIID riid, void **ppvObject)
static IPropertyStorage PropertyStorage
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
static const CLSID IPropertyStorage UINT *static ULONG
static HRESULT WINAPI PropertySetStorage_Create(IPropertySetStorage *This, REFFMTID rfmtid, const CLSID *pclsid, DWORD grfFlags, DWORD grfMode, IPropertyStorage **ppprstg)
static HRESULT WINAPI test_moniker_GetClassID(IMoniker *iface, CLSID *pClassID)
static IPropertySetStorage PropertySetStorage
static HRESULT WINAPI PropertyStorage_ReadMultiple(IPropertyStorage *This, ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgpropvar)
static ULONG WINAPI test_activator_Release(IClassActivator *iface)
static HRESULT WINAPI PropertyStorage_Revert(IPropertyStorage *This)
static HRESULT WINAPI PropertyStorage_Stat(IPropertyStorage *This, STATPROPSETSTG *statpsstg)
#define CHECK_EXPECT(func)
BOOL WINAPI ProcessIdToSessionId(IN DWORD dwProcessId, OUT PDWORD pSessionId)
UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength)
static HRESULT WINAPI PropertyStorage_DeletePropertyNames(IPropertyStorage *This, ULONG cpropid, const PROPID *rgpropid)
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
static IPropertyStorageVtbl PropertyStorageVtbl
static HRESULT WINAPI PropertyStorage_WritePropertyNames(IPropertyStorage *This, ULONG cpropid, const PROPID *rgpropid, const LPOLESTR *rglpwstrName)
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
static HRESULT WINAPI PropertyStorage_WriteMultiple(IPropertyStorage *This, ULONG cpspec, const PROPSPEC *rgpspec, const PROPVARIANT *rgpropvar, PROPID propidNameFirst)
const GUID IID_IPersistStream
static HRESULT WINAPI test_moniker_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pItemTime)
static HRESULT WINAPI test_moniker_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
#define STG_E_FILENOTFOUND
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
#define memcpy(s1, s2, n)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
REFIID LPVOID * ppvObject
#define DEFINE_EXPECT(func)
static HRESULT WINAPI test_moniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *moniker_to_left, REFIID riid, void **ppv)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void test_SHCreateQueryCancelAutoPlayMoniker(void)
static ULONG WINAPI PropertyStorage_Release(IPropertyStorage *This)
static void test_dragdrophelper(void)
static HRESULT WINAPI test_moniker_Hash(IMoniker *iface, DWORD *pdwHash)
static PEXPLICIT_ACCESSW *static HMODULE hmod
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
static ULONG WINAPI PropertyStorage_AddRef(IPropertyStorage *This)
static HRESULT WINAPI test_moniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
static HRESULT WINAPI test_moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
static void test_SHPropStg_functions(void)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static HRESULT WINAPI PropertyStorage_ReadPropertyNames(IPropertyStorage *This, ULONG cpropid, const PROPID *rgpropid, LPOLESTR *rglpwstrName)
static HRESULT WINAPI test_moniker_Load(IMoniker *iface, IStream *pStm)
static HRESULT WINAPI test_moniker_CommonPrefixWith(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
static HRESULT WINAPI PropertyStorage_SetTimes(IPropertyStorage *This, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime)
#define MultiByteToWideChar
static IMoniker test_moniker
static IClassActivator test_activator
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DragFinish(HDROP h)
int strcmp(const char *String1, const char *String2)
#define DROPTEST_FILENAME
#define GetProcAddress(x, y)
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
static IPropertySetStorageVtbl PropertySetStorageVtbl
static HRESULT WINAPI test_moniker_IsRunning(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
#define WS_EX_ACCEPTFILES
struct _DROPFILES DROPFILES
static HRESULT WINAPI test_moniker_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
static ULONG WINAPI test_moniker_AddRef(IMoniker *iface)
BOOL Delete(LPCTSTR ServiceName)
static HRESULT WINAPI PropertySetStorage_Enum(IPropertySetStorage *This, IEnumSTATPROPSETSTG **ppenum)
static void test_SHCreateSessionKey(void)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define IsEqualIID(riid1, riid2)
static const IClassActivatorVtbl test_activator_vtbl
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
DWORD WINAPI GetCurrentProcessId(VOID)
static UINT WPARAM wparam
static HRESULT WINAPI test_moniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
#define CHECK_CALLED(func)
static HRESULT WINAPI test_activator_QI(IClassActivator *iface, REFIID riid, void **ppv)