33#define DEFINE_EXPECT(func) \
34 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
36#define SET_EXPECT(func) \
37 expect_ ## func = TRUE
39#define CHECK_EXPECT2(func) \
41 ok(expect_ ##func, "unexpected call " #func "\n"); \
42 called_ ## func = TRUE; \
45#define CHECK_EXPECT(func) \
47 CHECK_EXPECT2(func); \
48 expect_ ## func = FALSE; \
51#define CHECK_CALLED(func) \
53 ok(called_ ## func, "expected " #func "\n"); \
54 expect_ ## func = called_ ## func = FALSE; \
57#define CHECK_NOT_CALLED(func) \
59 ok(!called_ ## func, "unexpected " #func "\n"); \
60 expect_ ## func = called_ ## func = FALSE; \
77 ILockBytes_Release(lock_bytes);
86 DWORD link_update_opt;
94 const CLSID non_existent_class = {0xa5f1772f, 0x3772, 0x490f, {0x9e, 0xc6, 0x77, 0x13, 0xe8, 0xb3, 0x4b, 0x5d}};
99 static const WCHAR olestream[] = {1,
'O',
'l',
'e',0};
115 hr = IPersistStorage_InitNew(persist, stg);
123 ok(
header.version == 0x02000001,
"got version %08x\n",
header.version);
125 ok(
header.link_update_opt == 0x0,
"got link update option %08x\n",
header.link_update_opt);
127 ok(
header.moniker_size == 0x0,
"got moniker size %08x\n",
header.moniker_size);
129 IStream_Release(stm);
131 IPersistStorage_Release(persist);
132 IOleObject_Release(ole_obj);
134 IStorage_Release(stg);
143 ok(0,
"unexpected query for IOleObject interface\n");
205 ok(pUnkOuter ==
NULL,
"pUnkOuter != NULL\n");
218 ok(0,
"unexpected call\n");
234 const CLSID test_server_clsid = {0x0f77e570,0x80c3,0x11e2,{0x9e,0x96,0x08,0x00,0x20,0x0c,0x9a,0x66}};
244 win_skip(
"skipping OleCreateDefaultHandler tests\n");
249 CLSCTX_INPROC_SERVER, 0, &class_reg);
256 ok(
hres ==
S_OK,
"QueryInterface(IRunnableObject) failed: %x\n",
hres);
257 IUnknown_Release(unk);
259 hres = IRunnableObject_Run(ro,
NULL);
261 IRunnableObject_Release(ro);
268 CLSCTX_LOCAL_SERVER, 0, &class_reg);
275 ok(
hres ==
S_OK,
"QueryInterface(IID_IOleObject) failed: %x\n",
hres);
278 ok(
hres ==
S_OK,
"QueryInterface(IID_IPersistStorage) failed: %x\n",
hres);
279 IPersistStorage_Release(persist);
280 IOleObject_Release(oleobj);
283 ok(
hres ==
S_OK,
"QueryInterface(IRunnableObject) failed: %x\n",
hres);
284 IUnknown_Release(unk);
288 hres = IRunnableObject_Run(ro,
NULL);
293 IRunnableObject_Release(ro);
const GUID IID_IClassFactory
#define GetProcAddress(x, y)
static const WCHAR version[]
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject(DWORD dwRegister)
HRESULT WINAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL global, BOOL delete_on_release, ILockBytes **ret)
static HGLOBAL create_storage(void)
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
static IUnknown test_class
static ULONG WINAPI test_class_Release(IUnknown *iface)
static HRESULT WINAPI test_class_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static const IClassFactoryVtbl ClassFactoryVtbl
static const IUnknownVtbl test_class_vtbl
#define CHECK_EXPECT(func)
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
#define DEFINE_EXPECT(func)
static ULONG WINAPI test_class_AddRef(IUnknown *iface)
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
#define CHECK_CALLED(func)
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
static void test_olestream(void)
#define CHECK_NOT_CALLED(func)
static void test_default_handler_run(void)
#define STGM_SHARE_EXCLUSIVE
const GUID IID_IRunnableObject
const GUID IID_IPersistStorage
const GUID IID_IOleObject
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
#define REGDB_E_CLASSNOTREG
#define STG_E_FILENOTFOUND