2 * Copyright 2012 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include <wine/test.h>
34 static const GUID CLSID_Test
=
35 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
36 #define CLSID_TEST_STR "178fc163-0000-0000-0000-000000000046"
38 static const GUID CATID_CatTest1
=
39 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x46}};
40 #define CATID_CATTEST1_STR "178fc163-0000-0000-0000-000000000146"
42 static const GUID CATID_CatTest2
=
43 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x46}};
44 #define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246"
46 static BOOL
is_process_limited(void)
48 static BOOL (WINAPI
*pOpenProcessToken
)(HANDLE
, DWORD
, PHANDLE
) = NULL
;
51 if (!pOpenProcessToken
)
53 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
54 pOpenProcessToken
= (void*)GetProcAddress(hadvapi32
, "OpenProcessToken");
55 if (!pOpenProcessToken
)
59 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
62 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
65 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
67 return (ret
&& type
== TokenElevationTypeLimited
);
72 static void test_winmodule(void)
74 _AtlCreateWndData create_data
[3];
75 _ATL_WIN_MODULE winmod
;
79 winmod
.cbSize
= 0xdeadbeef;
80 hres
= AtlWinModuleInit(&winmod
);
81 ok(hres
== E_INVALIDARG
, "AtlWinModuleInit failed: %08x\n", hres
);
83 winmod
.cbSize
= sizeof(winmod
);
84 winmod
.m_pCreateWndList
= (void*)0xdeadbeef;
85 winmod
.m_csWindowCreate
.LockCount
= 0xdeadbeef;
86 winmod
.m_rgWindowClassAtoms
.m_aT
= (void*)0xdeadbeef;
87 winmod
.m_rgWindowClassAtoms
.m_nSize
= 0xdeadbeef;
88 winmod
.m_rgWindowClassAtoms
.m_nAllocSize
= 0xdeadbeef;
89 hres
= AtlWinModuleInit(&winmod
);
90 ok(hres
== S_OK
, "AtlWinModuleInit failed: %08x\n", hres
);
91 ok(!winmod
.m_pCreateWndList
, "winmod.m_pCreateWndList = %p\n", winmod
.m_pCreateWndList
);
92 ok(winmod
.m_csWindowCreate
.LockCount
== -1, "winmod.m_csWindowCreate.LockCount = %d\n",
93 winmod
.m_csWindowCreate
.LockCount
);
94 ok(winmod
.m_rgWindowClassAtoms
.m_aT
== (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n",
95 winmod
.m_rgWindowClassAtoms
.m_aT
);
96 ok(winmod
.m_rgWindowClassAtoms
.m_nSize
== 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n",
97 winmod
.m_rgWindowClassAtoms
.m_nSize
);
98 ok(winmod
.m_rgWindowClassAtoms
.m_nAllocSize
== 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n",
99 winmod
.m_rgWindowClassAtoms
.m_nAllocSize
);
101 InitializeCriticalSection(&winmod
.m_csWindowCreate
);
103 AtlWinModuleAddCreateWndData(&winmod
, create_data
, (void*)0xdead0001);
104 ok(winmod
.m_pCreateWndList
== create_data
, "winmod.m_pCreateWndList != create_data\n");
105 ok(create_data
[0].m_pThis
== (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data
[0].m_pThis
);
106 ok(create_data
[0].m_dwThreadID
== GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %x\n",
107 create_data
[0].m_dwThreadID
);
108 ok(!create_data
[0].m_pNext
, "unexpected create_data[0].m_pNext %p\n", create_data
[0].m_pNext
);
110 AtlWinModuleAddCreateWndData(&winmod
, create_data
+1, (void*)0xdead0002);
111 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
112 ok(create_data
[1].m_pThis
== (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data
[1].m_pThis
);
113 ok(create_data
[1].m_dwThreadID
== GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %x\n",
114 create_data
[1].m_dwThreadID
);
115 ok(create_data
[1].m_pNext
== create_data
, "unexpected create_data[1].m_pNext %p\n", create_data
[1].m_pNext
);
117 AtlWinModuleAddCreateWndData(&winmod
, create_data
+2, (void*)0xdead0003);
118 ok(winmod
.m_pCreateWndList
== create_data
+2, "winmod.m_pCreateWndList != create_data\n");
119 ok(create_data
[2].m_pThis
== (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data
[2].m_pThis
);
120 ok(create_data
[2].m_dwThreadID
== GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %x\n",
121 create_data
[2].m_dwThreadID
);
122 ok(create_data
[2].m_pNext
== create_data
+1, "unexpected create_data[2].m_pNext %p\n", create_data
[2].m_pNext
);
124 p
= AtlWinModuleExtractCreateWndData(&winmod
);
125 ok(p
== (void*)0xdead0003, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p
);
126 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
127 ok(create_data
[2].m_pNext
== create_data
+1, "unexpected create_data[2].m_pNext %p\n", create_data
[2].m_pNext
);
129 create_data
[1].m_dwThreadID
= 0xdeadbeef;
131 p
= AtlWinModuleExtractCreateWndData(&winmod
);
132 ok(p
== (void*)0xdead0001, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p
);
133 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
134 ok(!create_data
[0].m_pNext
, "unexpected create_data[0].m_pNext %p\n", create_data
[0].m_pNext
);
135 ok(!create_data
[1].m_pNext
, "unexpected create_data[1].m_pNext %p\n", create_data
[1].m_pNext
);
137 p
= AtlWinModuleExtractCreateWndData(&winmod
);
138 ok(!p
, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p
);
139 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
142 #define test_key_exists(a,b) _test_key_exists(__LINE__,a,b)
143 static void _test_key_exists(unsigned line
, HKEY root
, const char *key_name
)
148 res
= RegOpenKeyA(root
, key_name
, &key
);
149 ok_(__FILE__
,line
)(res
== ERROR_SUCCESS
, "Could not open key %s\n", key_name
);
150 if(res
== ERROR_SUCCESS
)
154 #define test_key_not_exists(a,b) _test_key_not_exists(__LINE__,a,b)
155 static void _test_key_not_exists(unsigned line
, HKEY root
, const char *key_name
)
160 res
= RegOpenKeyA(root
, key_name
, &key
);
161 ok_(__FILE__
,line
)(res
== ERROR_FILE_NOT_FOUND
, "Attempting to open %s returned %u\n", key_name
, res
);
162 if(res
== ERROR_SUCCESS
)
166 static void test_regcat(void)
171 const struct _ATL_CATMAP_ENTRY catmap
[] = {
172 {_ATL_CATMAP_ENTRY_IMPLEMENTED
, &CATID_CatTest1
},
173 {_ATL_CATMAP_ENTRY_REQUIRED
, &CATID_CatTest2
},
174 {_ATL_CATMAP_ENTRY_END
}
177 if (is_process_limited())
179 skip("process is limited\n");
183 hres
= AtlRegisterClassCategoriesHelper(&CLSID_Test
, catmap
, TRUE
);
184 ok(hres
== S_OK
, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres
);
186 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}");
187 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Implemented Categories\\{" CATID_CATTEST1_STR
"}");
188 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Required Categories\\{" CATID_CATTEST2_STR
"}");
190 hres
= AtlRegisterClassCategoriesHelper(&CLSID_Test
, catmap
, FALSE
);
191 ok(hres
== S_OK
, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres
);
193 test_key_not_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Implemented Categories");
194 test_key_not_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Required Categories");
195 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}");
197 ok(RegDeleteKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}") == ERROR_SUCCESS
, "Could not delete key\n");
199 hres
= AtlRegisterClassCategoriesHelper(&CLSID_Test
, NULL
, TRUE
);
200 ok(hres
== S_OK
, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres
);
202 test_key_not_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}");
205 hres
= AtlGetPerUserRegistration(&b
);
206 ok(hres
== S_OK
, "AtlGetPerUserRegistration failed: %08x\n", hres
);
207 ok(!b
, "AtlGetPerUserRegistration returned %x\n", b
);
210 static void test_typelib(void)
218 static const WCHAR scrrun_dll_suffixW
[] = {'\\','s','c','r','r','u','n','.','d','l','l',0};
219 static const WCHAR mshtml_tlb_suffixW
[] = {'\\','m','s','h','t','m','l','.','t','l','b',0};
221 inst
= LoadLibraryA("scrrun.dll");
222 ok(inst
!= NULL
, "Could not load scrrun.dll\n");
225 hres
= AtlLoadTypeLib(inst
, NULL
, &path
, &typelib
);
226 ok(hres
== S_OK
, "AtlLoadTypeLib failed: %08x\n", hres
);
229 len
= SysStringLen(path
);
230 ok(len
> sizeof(scrrun_dll_suffixW
)/sizeof(WCHAR
)
231 && lstrcmpiW(path
+len
-sizeof(scrrun_dll_suffixW
)/sizeof(WCHAR
), scrrun_dll_suffixW
),
232 "unexpected path %s\n", wine_dbgstr_w(path
));
234 ok(typelib
!= NULL
, "typelib == NULL\n");
235 ITypeLib_Release(typelib
);
237 inst
= LoadLibraryA("mshtml.dll");
238 ok(inst
!= NULL
, "Could not load mshtml.dll\n");
241 hres
= AtlLoadTypeLib(inst
, NULL
, &path
, &typelib
);
242 ok(hres
== S_OK
, "AtlLoadTypeLib failed: %08x\n", hres
);
245 len
= SysStringLen(path
);
246 ok(len
> sizeof(mshtml_tlb_suffixW
)/sizeof(WCHAR
)
247 && lstrcmpiW(path
+len
-sizeof(mshtml_tlb_suffixW
)/sizeof(WCHAR
), mshtml_tlb_suffixW
),
248 "unexpected path %s\n", wine_dbgstr_w(path
));
250 ok(typelib
!= NULL
, "typelib == NULL\n");
251 ITypeLib_Release(typelib
);
254 static HRESULT WINAPI
ConnectionPoint_QueryInterface(IConnectionPoint
*iface
, REFIID riid
, void **ppv
)
256 if(IsEqualGUID(&IID_IConnectionPoint
, riid
)) {
261 ok(0, "unexpected call\n");
262 return E_NOINTERFACE
;
265 static ULONG WINAPI
ConnectionPoint_AddRef(IConnectionPoint
*iface
)
270 static ULONG WINAPI
ConnectionPoint_Release(IConnectionPoint
*iface
)
275 static HRESULT WINAPI
ConnectionPoint_GetConnectionInterface(IConnectionPoint
*iface
, IID
*pIID
)
277 ok(0, "unexpected call\n");
281 static HRESULT WINAPI
ConnectionPoint_GetConnectionPointContainer(IConnectionPoint
*iface
,
282 IConnectionPointContainer
**ppCPC
)
284 ok(0, "unexpected call\n");
288 static int advise_cnt
;
290 static HRESULT WINAPI
ConnectionPoint_Advise(IConnectionPoint
*iface
, IUnknown
*pUnkSink
,
293 ok(pUnkSink
== (IUnknown
*)0xdead0000, "pUnkSink = %p\n", pUnkSink
);
294 *pdwCookie
= 0xdeadbeef;
299 static HRESULT WINAPI
ConnectionPoint_Unadvise(IConnectionPoint
*iface
, DWORD dwCookie
)
301 ok(dwCookie
== 0xdeadbeef, "dwCookie = %x\n", dwCookie
);
306 static HRESULT WINAPI
ConnectionPoint_EnumConnections(IConnectionPoint
*iface
,
307 IEnumConnections
**ppEnum
)
309 ok(0, "unexpected call\n");
313 static const IConnectionPointVtbl ConnectionPointVtbl
=
315 ConnectionPoint_QueryInterface
,
316 ConnectionPoint_AddRef
,
317 ConnectionPoint_Release
,
318 ConnectionPoint_GetConnectionInterface
,
319 ConnectionPoint_GetConnectionPointContainer
,
320 ConnectionPoint_Advise
,
321 ConnectionPoint_Unadvise
,
322 ConnectionPoint_EnumConnections
325 static IConnectionPoint ConnectionPoint
= { &ConnectionPointVtbl
};
327 static HRESULT WINAPI
ConnectionPointContainer_QueryInterface(IConnectionPointContainer
*iface
,
328 REFIID riid
, void **ppv
)
330 if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
335 ok(0, "unexpected call\n");
339 static ULONG WINAPI
ConnectionPointContainer_AddRef(IConnectionPointContainer
*iface
)
344 static ULONG WINAPI
ConnectionPointContainer_Release(IConnectionPointContainer
*iface
)
349 static HRESULT WINAPI
ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer
*iface
,
350 IEnumConnectionPoints
**ppEnum
)
352 ok(0, "unexpected call\n");
356 static HRESULT WINAPI
ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer
*iface
,
357 REFIID riid
, IConnectionPoint
**ppCP
)
359 ok(IsEqualGUID(riid
, &CLSID_Test
), "unexpected riid\n");
360 *ppCP
= &ConnectionPoint
;
364 static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
= {
365 ConnectionPointContainer_QueryInterface
,
366 ConnectionPointContainer_AddRef
,
367 ConnectionPointContainer_Release
,
368 ConnectionPointContainer_EnumConnectionPoints
,
369 ConnectionPointContainer_FindConnectionPoint
372 static IConnectionPointContainer ConnectionPointContainer
= { &ConnectionPointContainerVtbl
};
374 static void test_cp(void)
379 hres
= AtlAdvise(NULL
, (IUnknown
*)0xdeed0000, &CLSID_Test
, &cookie
);
380 ok(hres
== E_INVALIDARG
, "expect E_INVALIDARG, returned %08x\n", hres
);
382 hres
= AtlUnadvise(NULL
, &CLSID_Test
, 0xdeadbeef);
383 ok(hres
== E_INVALIDARG
, "expect E_INVALIDARG, returned %08x\n", hres
);
385 hres
= AtlAdvise((IUnknown
*)&ConnectionPointContainer
, (IUnknown
*)0xdead0000, &CLSID_Test
, &cookie
);
386 ok(hres
== S_OK
, "AtlAdvise failed: %08x\n", hres
);
387 ok(cookie
== 0xdeadbeef, "cookie = %x\n", cookie
);
388 ok(advise_cnt
== 1, "advise_cnt = %d\n", advise_cnt
);
390 hres
= AtlUnadvise((IUnknown
*)&ConnectionPointContainer
, &CLSID_Test
, 0xdeadbeef);
391 ok(hres
== S_OK
, "AtlUnadvise failed: %08x\n", hres
);
392 ok(!advise_cnt
, "advise_cnt = %d\n", advise_cnt
);
395 static CLSID persist_clsid
;
397 static HRESULT WINAPI
Persist_QueryInterface(IPersist
*iface
, REFIID riid
, void **ppv
)
399 ok(0, "unexpected call\n");
400 return E_NOINTERFACE
;
403 static ULONG WINAPI
Persist_AddRef(IPersist
*iface
)
408 static ULONG WINAPI
Persist_Release(IPersist
*iface
)
413 static HRESULT WINAPI
Persist_GetClassID(IPersist
*iface
, CLSID
*pClassID
)
415 *pClassID
= persist_clsid
;
419 static const IPersistVtbl PersistVtbl
= {
420 Persist_QueryInterface
,
426 static IPersist Persist
= { &PersistVtbl
};
428 static HRESULT WINAPI
ProvideClassInfo2_QueryInterface(IProvideClassInfo2
*iface
, REFIID riid
, void **ppv
)
430 ok(0, "unexpected call\n");
431 return E_NOINTERFACE
;
434 static ULONG WINAPI
ProvideClassInfo2_AddRef(IProvideClassInfo2
*iface
)
439 static ULONG WINAPI
ProvideClassInfo2_Release(IProvideClassInfo2
*iface
)
444 static HRESULT WINAPI
ProvideClassInfo2_GetClassInfo(IProvideClassInfo2
*iface
, ITypeInfo
**ppTI
)
446 ok(0, "unexpected call\n");
450 static HRESULT WINAPI
ProvideClassInfo2_GetGUID(IProvideClassInfo2
*iface
, DWORD dwGuidKind
, GUID
*pGUID
)
452 ok(dwGuidKind
== GUIDKIND_DEFAULT_SOURCE_DISP_IID
, "unexpected dwGuidKind %x\n", dwGuidKind
);
453 *pGUID
= DIID_DispHTMLBody
;
457 static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl
= {
458 ProvideClassInfo2_QueryInterface
,
459 ProvideClassInfo2_AddRef
,
460 ProvideClassInfo2_Release
,
461 ProvideClassInfo2_GetClassInfo
,
462 ProvideClassInfo2_GetGUID
465 static IProvideClassInfo2 ProvideClassInfo2
= { &ProvideClassInfo2Vtbl
};
466 static BOOL support_classinfo2
;
468 static HRESULT WINAPI
Dispatch_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
472 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IDispatch
, riid
)) {
477 if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
478 if(!support_classinfo2
)
479 return E_NOINTERFACE
;
480 *ppv
= &ProvideClassInfo2
;
484 if(IsEqualGUID(&IID_IPersist
, riid
)) {
489 ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid
));
490 return E_NOINTERFACE
;
493 static ULONG WINAPI
Dispatch_AddRef(IDispatch
*iface
)
498 static ULONG WINAPI
Dispatch_Release(IDispatch
*iface
)
503 static HRESULT WINAPI
Dispatch_GetTypeInfoCount(IDispatch
*iface
, UINT
*pctinfo
)
505 ok(0, "unexpected call\n");
509 static HRESULT WINAPI
Dispatch_GetTypeInfo(IDispatch
*iface
, UINT iTInfo
, LCID lcid
,
515 static const WCHAR mshtml_tlbW
[] = {'m','s','h','t','m','l','.','t','l','b',0};
517 ok(!iTInfo
, "iTInfo = %d\n", iTInfo
);
518 ok(!lcid
, "lcid = %x\n", lcid
);
520 hres
= LoadTypeLib(mshtml_tlbW
, &typelib
);
521 ok(hres
== S_OK
, "LoadTypeLib failed: %08x\n", hres
);
523 hres
= ITypeLib_GetTypeInfoOfGuid(typelib
, &IID_IHTMLElement
, ppTInfo
);
524 ok(hres
== S_OK
, "GetTypeInfoOfGuid failed: %08x\n", hres
);
526 ITypeLib_Release(typelib
);
530 static HRESULT WINAPI
Dispatch_GetIDsOfNames(IDispatch
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
531 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
533 ok(0, "unexpected call\n");
537 static HRESULT WINAPI
Dispatch_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
538 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
539 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
541 ok(0, "unexpected call\n");
545 static const IDispatchVtbl DispatchVtbl
= {
546 Dispatch_QueryInterface
,
549 Dispatch_GetTypeInfoCount
,
550 Dispatch_GetTypeInfo
,
551 Dispatch_GetIDsOfNames
,
555 static IDispatch Dispatch
= { &DispatchVtbl
};
557 static void test_source_iface(void)
559 unsigned short maj_ver
, min_ver
;
563 support_classinfo2
= TRUE
;
565 maj_ver
= min_ver
= 0xdead;
566 hres
= AtlGetObjectSourceInterface((IUnknown
*)&Dispatch
, &libid
, &iid
, &maj_ver
, &min_ver
);
567 ok(hres
== S_OK
, "AtlGetObjectSourceInterface failed: %08x\n", hres
);
568 ok(IsEqualGUID(&libid
, &LIBID_MSHTML
), "libid = %s\n", wine_dbgstr_guid(&libid
));
569 ok(IsEqualGUID(&iid
, &DIID_DispHTMLBody
), "iid = %s\n", wine_dbgstr_guid(&iid
));
570 ok(maj_ver
== 4 && min_ver
== 0, "ver = %d.%d\n", maj_ver
, min_ver
);
572 support_classinfo2
= FALSE
;
573 persist_clsid
= CLSID_HTMLDocument
;
575 maj_ver
= min_ver
= 0xdead;
576 hres
= AtlGetObjectSourceInterface((IUnknown
*)&Dispatch
, &libid
, &iid
, &maj_ver
, &min_ver
);
577 ok(hres
== S_OK
, "AtlGetObjectSourceInterface failed: %08x\n", hres
);
578 ok(IsEqualGUID(&libid
, &LIBID_MSHTML
), "libid = %s\n", wine_dbgstr_guid(&libid
));
579 ok(IsEqualGUID(&iid
, &DIID_HTMLDocumentEvents
), "iid = %s\n", wine_dbgstr_guid(&iid
));
580 ok(maj_ver
== 4 && min_ver
== 0, "ver = %d.%d\n", maj_ver
, min_ver
);
582 persist_clsid
= CLSID_HTMLStyle
;
584 maj_ver
= min_ver
= 0xdead;
585 hres
= AtlGetObjectSourceInterface((IUnknown
*)&Dispatch
, &libid
, &iid
, &maj_ver
, &min_ver
);
586 ok(hres
== S_OK
, "AtlGetObjectSourceInterface failed: %08x\n", hres
);
587 ok(IsEqualGUID(&libid
, &LIBID_MSHTML
), "libid = %s\n", wine_dbgstr_guid(&libid
));
588 ok(IsEqualGUID(&iid
, &IID_NULL
), "iid = %s\n", wine_dbgstr_guid(&iid
));
589 ok(maj_ver
== 4 && min_ver
== 0, "ver = %d.%d\n", maj_ver
, min_ver
);
592 static void test_ax_win(void)
596 static const WCHAR AtlAxWin100
[] = {'A','t','l','A','x','W','i','n','1','0','0',0};
597 static const WCHAR AtlAxWinLic100
[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0};
598 static HMODULE hinstance
= 0;
600 ret
= AtlAxWinInit();
601 ok(ret
, "AtlAxWinInit failed\n");
603 hinstance
= GetModuleHandleA(NULL
);
605 memset(&wcex
, 0, sizeof(wcex
));
606 wcex
.cbSize
= sizeof(wcex
);
607 ret
= GetClassInfoExW(hinstance
, AtlAxWin100
, &wcex
);
608 ok(ret
, "AtlAxWin100 has not registered\n");
609 ok(wcex
.style
== (CS_GLOBALCLASS
| CS_DBLCLKS
), "wcex.style %08x\n", wcex
.style
);
611 memset(&wcex
, 0, sizeof(wcex
));
612 wcex
.cbSize
= sizeof(wcex
);
613 ret
= GetClassInfoExW(hinstance
, AtlAxWinLic100
, &wcex
);
614 ok(ret
, "AtlAxWinLic100 has not registered\n");
615 ok(wcex
.style
== (CS_GLOBALCLASS
| CS_DBLCLKS
), "wcex.style %08x\n", wcex
.style
);