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
22 #define WIN32_NO_STATUS
24 #define COM_NO_WINDOWS_H
37 #include <wine/atlbase.h>
40 #include <wine/test.h>
42 static const GUID CLSID_Test
=
43 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
44 #define CLSID_TEST_STR "178fc163-0000-0000-0000-000000000046"
46 static const GUID CATID_CatTest1
=
47 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x46}};
48 #define CATID_CATTEST1_STR "178fc163-0000-0000-0000-000000000146"
50 static const GUID CATID_CatTest2
=
51 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x46}};
52 #define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246"
54 static const char *debugstr_guid(REFIID riid
)
61 sprintf(buf
, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
62 riid
->Data1
, riid
->Data2
, riid
->Data3
, riid
->Data4
[0],
63 riid
->Data4
[1], riid
->Data4
[2], riid
->Data4
[3], riid
->Data4
[4],
64 riid
->Data4
[5], riid
->Data4
[6], riid
->Data4
[7]);
69 static void test_winmodule(void)
71 _AtlCreateWndData create_data
[3];
72 _ATL_WIN_MODULE winmod
;
76 winmod
.cbSize
= 0xdeadbeef;
77 hres
= AtlWinModuleInit(&winmod
);
78 ok(hres
== E_INVALIDARG
, "AtlWinModuleInit failed: %08x\n", hres
);
80 winmod
.cbSize
= sizeof(winmod
);
81 winmod
.m_pCreateWndList
= (void*)0xdeadbeef;
82 winmod
.m_csWindowCreate
.LockCount
= 0xdeadbeef;
83 winmod
.m_rgWindowClassAtoms
.m_aT
= (void*)0xdeadbeef;
84 winmod
.m_rgWindowClassAtoms
.m_nSize
= 0xdeadbeef;
85 winmod
.m_rgWindowClassAtoms
.m_nAllocSize
= 0xdeadbeef;
86 hres
= AtlWinModuleInit(&winmod
);
87 ok(hres
== S_OK
, "AtlWinModuleInit failed: %08x\n", hres
);
88 ok(!winmod
.m_pCreateWndList
, "winmod.m_pCreateWndList = %p\n", winmod
.m_pCreateWndList
);
89 ok(winmod
.m_csWindowCreate
.LockCount
== -1, "winmod.m_csWindowCreate.LockCount = %d\n",
90 winmod
.m_csWindowCreate
.LockCount
);
91 ok(winmod
.m_rgWindowClassAtoms
.m_aT
== (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n",
92 winmod
.m_rgWindowClassAtoms
.m_aT
);
93 ok(winmod
.m_rgWindowClassAtoms
.m_nSize
== 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n",
94 winmod
.m_rgWindowClassAtoms
.m_nSize
);
95 ok(winmod
.m_rgWindowClassAtoms
.m_nAllocSize
== 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n",
96 winmod
.m_rgWindowClassAtoms
.m_nAllocSize
);
98 InitializeCriticalSection(&winmod
.m_csWindowCreate
);
100 AtlWinModuleAddCreateWndData(&winmod
, create_data
, (void*)0xdead0001);
101 ok(winmod
.m_pCreateWndList
== create_data
, "winmod.m_pCreateWndList != create_data\n");
102 ok(create_data
[0].m_pThis
== (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data
[0].m_pThis
);
103 ok(create_data
[0].m_dwThreadID
== GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %x\n",
104 create_data
[0].m_dwThreadID
);
105 ok(!create_data
[0].m_pNext
, "unexpected create_data[0].m_pNext %p\n", create_data
[0].m_pNext
);
107 AtlWinModuleAddCreateWndData(&winmod
, create_data
+1, (void*)0xdead0002);
108 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
109 ok(create_data
[1].m_pThis
== (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data
[1].m_pThis
);
110 ok(create_data
[1].m_dwThreadID
== GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %x\n",
111 create_data
[1].m_dwThreadID
);
112 ok(create_data
[1].m_pNext
== create_data
, "unexpected create_data[1].m_pNext %p\n", create_data
[1].m_pNext
);
114 AtlWinModuleAddCreateWndData(&winmod
, create_data
+2, (void*)0xdead0003);
115 ok(winmod
.m_pCreateWndList
== create_data
+2, "winmod.m_pCreateWndList != create_data\n");
116 ok(create_data
[2].m_pThis
== (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data
[2].m_pThis
);
117 ok(create_data
[2].m_dwThreadID
== GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %x\n",
118 create_data
[2].m_dwThreadID
);
119 ok(create_data
[2].m_pNext
== create_data
+1, "unexpected create_data[2].m_pNext %p\n", create_data
[2].m_pNext
);
121 p
= AtlWinModuleExtractCreateWndData(&winmod
);
122 ok(p
== (void*)0xdead0003, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p
);
123 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
124 ok(create_data
[2].m_pNext
== create_data
+1, "unexpected create_data[2].m_pNext %p\n", create_data
[2].m_pNext
);
126 create_data
[1].m_dwThreadID
= 0xdeadbeef;
128 p
= AtlWinModuleExtractCreateWndData(&winmod
);
129 ok(p
== (void*)0xdead0001, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p
);
130 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
131 ok(!create_data
[0].m_pNext
, "unexpected create_data[0].m_pNext %p\n", create_data
[0].m_pNext
);
132 ok(!create_data
[1].m_pNext
, "unexpected create_data[1].m_pNext %p\n", create_data
[1].m_pNext
);
134 p
= AtlWinModuleExtractCreateWndData(&winmod
);
135 ok(!p
, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p
);
136 ok(winmod
.m_pCreateWndList
== create_data
+1, "winmod.m_pCreateWndList != create_data\n");
139 #define test_key_exists(a,b) _test_key_exists(__LINE__,a,b)
140 static void _test_key_exists(unsigned line
, HKEY root
, const char *key_name
)
145 res
= RegOpenKeyA(root
, key_name
, &key
);
146 ok_(__FILE__
,line
)(res
== ERROR_SUCCESS
, "Could not open key %s\n", key_name
);
147 if(res
== ERROR_SUCCESS
)
151 #define test_key_not_exists(a,b) _test_key_not_exists(__LINE__,a,b)
152 static void _test_key_not_exists(unsigned line
, HKEY root
, const char *key_name
)
157 res
= RegOpenKeyA(root
, key_name
, &key
);
158 ok_(__FILE__
,line
)(res
== ERROR_FILE_NOT_FOUND
, "Attempting to open %s returned %u\n", key_name
, res
);
159 if(res
== ERROR_SUCCESS
)
163 static void test_regcat(void)
168 const struct _ATL_CATMAP_ENTRY catmap
[] = {
169 {_ATL_CATMAP_ENTRY_IMPLEMENTED
, &CATID_CatTest1
},
170 {_ATL_CATMAP_ENTRY_REQUIRED
, &CATID_CatTest2
},
171 {_ATL_CATMAP_ENTRY_END
}
174 hres
= AtlRegisterClassCategoriesHelper(&CLSID_Test
, catmap
, TRUE
);
175 ok(hres
== S_OK
, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres
);
177 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}");
178 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Implemented Categories\\{" CATID_CATTEST1_STR
"}");
179 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Required Categories\\{" CATID_CATTEST2_STR
"}");
181 hres
= AtlRegisterClassCategoriesHelper(&CLSID_Test
, catmap
, FALSE
);
182 ok(hres
== S_OK
, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres
);
184 test_key_not_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Implemented Categories");
185 test_key_not_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}\\Required Categories");
186 test_key_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}");
188 ok(RegDeleteKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}") == ERROR_SUCCESS
, "Could not delete key\n");
190 hres
= AtlRegisterClassCategoriesHelper(&CLSID_Test
, NULL
, TRUE
);
191 ok(hres
== S_OK
, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres
);
193 test_key_not_exists(HKEY_CLASSES_ROOT
, "CLSID\\{" CLSID_TEST_STR
"}");
196 hres
= AtlGetPerUserRegistration(&b
);
197 ok(hres
== S_OK
, "AtlGetPerUserRegistration failed: %08x\n", hres
);
198 ok(!b
, "AtlGetPerUserRegistration returned %x\n", b
);
201 static void test_typelib(void)
209 static const WCHAR scrrun_dll_suffixW
[] = {'\\','s','c','r','r','u','n','.','d','l','l',0};
210 static const WCHAR mshtml_tlb_suffixW
[] = {'\\','m','s','h','t','m','l','.','t','l','b',0};
212 inst
= LoadLibraryA("scrrun.dll");
213 ok(inst
!= NULL
, "Could not load scrrun.dll\n");
216 hres
= AtlLoadTypeLib(inst
, NULL
, &path
, &typelib
);
217 ok(hres
== S_OK
, "AtlLoadTypeLib failed: %08x\n", hres
);
220 len
= SysStringLen(path
);
221 ok(len
> sizeof(scrrun_dll_suffixW
)/sizeof(WCHAR
)
222 && lstrcmpiW(path
+len
-sizeof(scrrun_dll_suffixW
)/sizeof(WCHAR
), scrrun_dll_suffixW
),
223 "unexpected path %s\n", wine_dbgstr_w(path
));
225 ok(typelib
!= NULL
, "typelib == NULL\n");
226 ITypeLib_Release(typelib
);
228 inst
= LoadLibraryA("mshtml.dll");
229 ok(inst
!= NULL
, "Could not load mshtml.dll\n");
232 hres
= AtlLoadTypeLib(inst
, NULL
, &path
, &typelib
);
233 ok(hres
== S_OK
, "AtlLoadTypeLib failed: %08x\n", hres
);
236 len
= SysStringLen(path
);
237 ok(len
> sizeof(mshtml_tlb_suffixW
)/sizeof(WCHAR
)
238 && lstrcmpiW(path
+len
-sizeof(mshtml_tlb_suffixW
)/sizeof(WCHAR
), mshtml_tlb_suffixW
),
239 "unexpected path %s\n", wine_dbgstr_w(path
));
241 ok(typelib
!= NULL
, "typelib == NULL\n");
242 ITypeLib_Release(typelib
);
245 static HRESULT WINAPI
ConnectionPoint_QueryInterface(IConnectionPoint
*iface
, REFIID riid
, void **ppv
)
247 if(IsEqualGUID(&IID_IConnectionPoint
, riid
)) {
252 ok(0, "unexpected call\n");
253 return E_NOINTERFACE
;
256 static ULONG WINAPI
ConnectionPoint_AddRef(IConnectionPoint
*iface
)
261 static ULONG WINAPI
ConnectionPoint_Release(IConnectionPoint
*iface
)
266 static HRESULT WINAPI
ConnectionPoint_GetConnectionInterface(IConnectionPoint
*iface
, IID
*pIID
)
268 ok(0, "unexpected call\n");
272 static HRESULT WINAPI
ConnectionPoint_GetConnectionPointContainer(IConnectionPoint
*iface
,
273 IConnectionPointContainer
**ppCPC
)
275 ok(0, "unexpected call\n");
279 static int advise_cnt
;
281 static HRESULT WINAPI
ConnectionPoint_Advise(IConnectionPoint
*iface
, IUnknown
*pUnkSink
,
284 ok(pUnkSink
== (IUnknown
*)0xdead0000, "pUnkSink = %p\n", pUnkSink
);
285 *pdwCookie
= 0xdeadbeef;
290 static HRESULT WINAPI
ConnectionPoint_Unadvise(IConnectionPoint
*iface
, DWORD dwCookie
)
292 ok(dwCookie
== 0xdeadbeef, "dwCookie = %x\n", dwCookie
);
297 static HRESULT WINAPI
ConnectionPoint_EnumConnections(IConnectionPoint
*iface
,
298 IEnumConnections
**ppEnum
)
300 ok(0, "unexpected call\n");
304 static const IConnectionPointVtbl ConnectionPointVtbl
=
306 ConnectionPoint_QueryInterface
,
307 ConnectionPoint_AddRef
,
308 ConnectionPoint_Release
,
309 ConnectionPoint_GetConnectionInterface
,
310 ConnectionPoint_GetConnectionPointContainer
,
311 ConnectionPoint_Advise
,
312 ConnectionPoint_Unadvise
,
313 ConnectionPoint_EnumConnections
316 static IConnectionPoint ConnectionPoint
= { &ConnectionPointVtbl
};
318 static HRESULT WINAPI
ConnectionPointContainer_QueryInterface(IConnectionPointContainer
*iface
,
319 REFIID riid
, void **ppv
)
321 if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
326 ok(0, "unexpected call\n");
330 static ULONG WINAPI
ConnectionPointContainer_AddRef(IConnectionPointContainer
*iface
)
335 static ULONG WINAPI
ConnectionPointContainer_Release(IConnectionPointContainer
*iface
)
340 static HRESULT WINAPI
ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer
*iface
,
341 IEnumConnectionPoints
**ppEnum
)
343 ok(0, "unexpected call\n");
347 static HRESULT WINAPI
ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer
*iface
,
348 REFIID riid
, IConnectionPoint
**ppCP
)
350 ok(IsEqualGUID(riid
, &CLSID_Test
), "unexpected riid\n");
351 *ppCP
= &ConnectionPoint
;
355 static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
= {
356 ConnectionPointContainer_QueryInterface
,
357 ConnectionPointContainer_AddRef
,
358 ConnectionPointContainer_Release
,
359 ConnectionPointContainer_EnumConnectionPoints
,
360 ConnectionPointContainer_FindConnectionPoint
363 static IConnectionPointContainer ConnectionPointContainer
= { &ConnectionPointContainerVtbl
};
365 static void test_cp(void)
370 hres
= AtlAdvise(NULL
, (IUnknown
*)0xdeed0000, &CLSID_Test
, &cookie
);
371 ok(hres
== E_INVALIDARG
, "expect E_INVALIDARG, returned %08x\n", hres
);
373 hres
= AtlUnadvise(NULL
, &CLSID_Test
, 0xdeadbeef);
374 ok(hres
== E_INVALIDARG
, "expect E_INVALIDARG, returned %08x\n", hres
);
376 hres
= AtlAdvise((IUnknown
*)&ConnectionPointContainer
, (IUnknown
*)0xdead0000, &CLSID_Test
, &cookie
);
377 ok(hres
== S_OK
, "AtlAdvise failed: %08x\n", hres
);
378 ok(cookie
== 0xdeadbeef, "cookie = %x\n", cookie
);
379 ok(advise_cnt
== 1, "advise_cnt = %d\n", advise_cnt
);
381 hres
= AtlUnadvise((IUnknown
*)&ConnectionPointContainer
, &CLSID_Test
, 0xdeadbeef);
382 ok(hres
== S_OK
, "AtlUnadvise failed: %08x\n", hres
);
383 ok(!advise_cnt
, "advise_cnt = %d\n", advise_cnt
);
386 static CLSID persist_clsid
;
388 static HRESULT WINAPI
Persist_QueryInterface(IPersist
*iface
, REFIID riid
, void **ppv
)
390 ok(0, "unexpected call\n");
391 return E_NOINTERFACE
;
394 static ULONG WINAPI
Persist_AddRef(IPersist
*iface
)
399 static ULONG WINAPI
Persist_Release(IPersist
*iface
)
404 static HRESULT WINAPI
Persist_GetClassID(IPersist
*iface
, CLSID
*pClassID
)
406 *pClassID
= persist_clsid
;
410 static const IPersistVtbl PersistVtbl
= {
411 Persist_QueryInterface
,
417 static IPersist Persist
= { &PersistVtbl
};
419 static HRESULT WINAPI
ProvideClassInfo2_QueryInterface(IProvideClassInfo2
*iface
, REFIID riid
, void **ppv
)
421 ok(0, "unexpected call\n");
422 return E_NOINTERFACE
;
425 static ULONG WINAPI
ProvideClassInfo2_AddRef(IProvideClassInfo2
*iface
)
430 static ULONG WINAPI
ProvideClassInfo2_Release(IProvideClassInfo2
*iface
)
435 static HRESULT WINAPI
ProvideClassInfo2_GetClassInfo(IProvideClassInfo2
*iface
, ITypeInfo
**ppTI
)
437 ok(0, "unexpected call\n");
441 static HRESULT WINAPI
ProvideClassInfo2_GetGUID(IProvideClassInfo2
*iface
, DWORD dwGuidKind
, GUID
*pGUID
)
443 ok(dwGuidKind
== GUIDKIND_DEFAULT_SOURCE_DISP_IID
, "unexpected dwGuidKind %x\n", dwGuidKind
);
444 *pGUID
= DIID_DispHTMLBody
;
448 static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl
= {
449 ProvideClassInfo2_QueryInterface
,
450 ProvideClassInfo2_AddRef
,
451 ProvideClassInfo2_Release
,
452 ProvideClassInfo2_GetClassInfo
,
453 ProvideClassInfo2_GetGUID
456 static IProvideClassInfo2 ProvideClassInfo2
= { &ProvideClassInfo2Vtbl
};
457 static BOOL support_classinfo2
;
459 static HRESULT WINAPI
Dispatch_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
463 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IDispatch
, riid
)) {
468 if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
469 if(!support_classinfo2
)
470 return E_NOINTERFACE
;
471 *ppv
= &ProvideClassInfo2
;
475 if(IsEqualGUID(&IID_IPersist
, riid
)) {
480 ok(0, "unexpected riid: %s\n", debugstr_guid(riid
));
481 return E_NOINTERFACE
;
484 static ULONG WINAPI
Dispatch_AddRef(IDispatch
*iface
)
489 static ULONG WINAPI
Dispatch_Release(IDispatch
*iface
)
494 static HRESULT WINAPI
Dispatch_GetTypeInfoCount(IDispatch
*iface
, UINT
*pctinfo
)
496 ok(0, "unexpected call\n");
500 static HRESULT WINAPI
Dispatch_GetTypeInfo(IDispatch
*iface
, UINT iTInfo
, LCID lcid
,
506 static const WCHAR mshtml_tlbW
[] = {'m','s','h','t','m','l','.','t','l','b',0};
508 ok(!iTInfo
, "iTInfo = %d\n", iTInfo
);
509 ok(!lcid
, "lcid = %x\n", lcid
);
511 hres
= LoadTypeLib(mshtml_tlbW
, &typelib
);
512 ok(hres
== S_OK
, "LoadTypeLib failed: %08x\n", hres
);
514 hres
= ITypeLib_GetTypeInfoOfGuid(typelib
, &IID_IHTMLElement
, ppTInfo
);
515 ok(hres
== S_OK
, "GetTypeInfoOfGuid failed: %08x\n", hres
);
517 ITypeLib_Release(typelib
);
521 static HRESULT WINAPI
Dispatch_GetIDsOfNames(IDispatch
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
522 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
524 ok(0, "unexpected call\n");
528 static HRESULT WINAPI
Dispatch_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
529 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
530 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
532 ok(0, "unexpected call\n");
536 static const IDispatchVtbl DispatchVtbl
= {
537 Dispatch_QueryInterface
,
540 Dispatch_GetTypeInfoCount
,
541 Dispatch_GetTypeInfo
,
542 Dispatch_GetIDsOfNames
,
546 static IDispatch Dispatch
= { &DispatchVtbl
};
548 static void test_source_iface(void)
550 unsigned short maj_ver
, min_ver
;
554 support_classinfo2
= TRUE
;
556 maj_ver
= min_ver
= 0xdead;
557 hres
= AtlGetObjectSourceInterface((IUnknown
*)&Dispatch
, &libid
, &iid
, &maj_ver
, &min_ver
);
558 ok(hres
== S_OK
, "AtlGetObjectSourceInterface failed: %08x\n", hres
);
559 ok(IsEqualGUID(&libid
, &LIBID_MSHTML
), "libid = %s\n", debugstr_guid(&libid
));
560 ok(IsEqualGUID(&iid
, &DIID_DispHTMLBody
), "iid = %s\n", debugstr_guid(&iid
));
561 ok(maj_ver
== 4 && min_ver
== 0, "ver = %d.%d\n", maj_ver
, min_ver
);
563 support_classinfo2
= FALSE
;
564 persist_clsid
= CLSID_HTMLDocument
;
566 maj_ver
= min_ver
= 0xdead;
567 hres
= AtlGetObjectSourceInterface((IUnknown
*)&Dispatch
, &libid
, &iid
, &maj_ver
, &min_ver
);
568 ok(hres
== S_OK
, "AtlGetObjectSourceInterface failed: %08x\n", hres
);
569 ok(IsEqualGUID(&libid
, &LIBID_MSHTML
), "libid = %s\n", debugstr_guid(&libid
));
570 ok(IsEqualGUID(&iid
, &DIID_HTMLDocumentEvents
), "iid = %s\n", debugstr_guid(&iid
));
571 ok(maj_ver
== 4 && min_ver
== 0, "ver = %d.%d\n", maj_ver
, min_ver
);
573 persist_clsid
= CLSID_HTMLStyle
;
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", debugstr_guid(&libid
));
579 ok(IsEqualGUID(&iid
, &IID_NULL
), "iid = %s\n", debugstr_guid(&iid
));
580 ok(maj_ver
== 4 && min_ver
== 0, "ver = %d.%d\n", maj_ver
, min_ver
);
583 static void test_ax_win(void)
587 static const WCHAR AtlAxWin100
[] = {'A','t','l','A','x','W','i','n','1','0','0',0};
588 static const WCHAR AtlAxWinLic100
[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0};
589 static HMODULE hinstance
= 0;
591 ret
= AtlAxWinInit();
592 ok(ret
, "AtlAxWinInit failed\n");
594 hinstance
= GetModuleHandleA(NULL
);
596 memset(&wcex
, 0, sizeof(wcex
));
597 wcex
.cbSize
= sizeof(wcex
);
598 ret
= GetClassInfoExW(hinstance
, AtlAxWin100
, &wcex
);
599 ok(ret
, "AtlAxWin100 has not registered\n");
600 ok(wcex
.style
== (CS_GLOBALCLASS
| CS_DBLCLKS
), "wcex.style %08x\n", wcex
.style
);
602 memset(&wcex
, 0, sizeof(wcex
));
603 wcex
.cbSize
= sizeof(wcex
);
604 ret
= GetClassInfoExW(hinstance
, AtlAxWinLic100
, &wcex
);
605 ok(ret
, "AtlAxWinLic100 has not registered\n");
606 ok(wcex
.style
== (CS_GLOBALCLASS
| CS_DBLCLKS
), "wcex.style %08x\n", wcex
.style
);