ReactOS 0.4.17-dev-806-gffa4164
atl.c
Go to the documentation of this file.
1/*
2 * Copyright 2012 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include <stdarg.h>
20#include <stdio.h>
21
22#define COBJMACROS
23#define CONST_VTABLE
24
25#include <windef.h>
26#include <winbase.h>
27#include <winuser.h>
28#include <exdisp.h>
29
30#include <atlbase.h>
31#include <mshtml.h>
32
33#include <wine/test.h>
34
35static const GUID CLSID_Test =
36 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
37#define CLSID_TEST_STR "178fc163-0000-0000-0000-000000000046"
38
39static const GUID CATID_CatTest1 =
40 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x46}};
41#define CATID_CATTEST1_STR "178fc163-0000-0000-0000-000000000146"
42
43static const GUID CATID_CatTest2 =
44 {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x46}};
45#define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246"
46static const WCHAR progid1W[] = L"Shell.Explorer.2";
47static const WCHAR clsid1W[] = L"{8856f961-340a-11d0-a96b-00c04fd705a2}";
48static const WCHAR url1W[] = L"http://test.winehq.org/tests/winehq_snapshot/";
49static const WCHAR mshtml1W[] = L"mshtml:<html><body>test</body></html>";
50static const WCHAR mshtml2W[] = L"MSHTML:<html><body>test</body></html>";
51static const WCHAR mshtml3W[] = L"<html><body>test</body></html>";
52static const char html_str[] = "<html><body>test</body><html>";
53
55{
56 PSID administrators = NULL;
58 DWORD groups_size;
60 DWORD group_index;
61
62 /* Create a well-known SID for the Administrators group. */
64 DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,
65 &administrators))
66 return FALSE;
67
68 /* Get the group info from the token */
69 groups_size = 0;
70 GetTokenInformation(token, TokenGroups, NULL, 0, &groups_size);
71 groups = HeapAlloc(GetProcessHeap(), 0, groups_size);
72 if (groups == NULL)
73 {
74 FreeSid(administrators);
75 return FALSE;
76 }
77 if (! GetTokenInformation(token, TokenGroups, groups, groups_size, &groups_size))
78 {
80 FreeSid(administrators);
81 return FALSE;
82 }
83
84 /* Now check if the token groups include the Administrators group */
85 for (group_index = 0; group_index < groups->GroupCount; group_index++)
86 {
87 if (EqualSid(groups->Groups[group_index].Sid, administrators))
88 {
90 FreeSid(administrators);
91 return TRUE;
92 }
93 }
94
95 /* If we end up here we didn't find the Administrators group */
97 FreeSid(administrators);
98 return FALSE;
99}
100
102{
103 static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE) = NULL;
106
107 if (!pOpenProcessToken)
108 {
109 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
110 pOpenProcessToken = (void*)GetProcAddress(hadvapi32, "OpenProcessToken");
111 if (!pOpenProcessToken)
112 return FALSE;
113 }
114
115 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
116 {
117 BOOL ret;
119 DWORD size;
120
122 if (ret)
123 {
125 /* UAC is disabled, check for administrators group */
127 else if (type == TokenElevationTypeFull)
128 result = FALSE;
130 result = TRUE;
131 }
133 }
134 return result;
135}
136
137static void test_winmodule(void)
138{
139 _AtlCreateWndData create_data[3];
140 _ATL_WIN_MODULE winmod;
141 void *p;
143
144 winmod.cbSize = 0xdeadbeef;
145 hres = AtlWinModuleInit(&winmod);
146 ok(hres == E_INVALIDARG, "AtlWinModuleInit failed: %08lx\n", hres);
147
148 winmod.cbSize = sizeof(winmod);
149 winmod.m_pCreateWndList = (void*)0xdeadbeef;
150 winmod.m_csWindowCreate.LockCount = 0xdeadbeef;
151 winmod.m_rgWindowClassAtoms.m_aT = (void*)0xdeadbeef;
152 winmod.m_rgWindowClassAtoms.m_nSize = 0xdeadbeef;
153 winmod.m_rgWindowClassAtoms.m_nAllocSize = 0xdeadbeef;
154 hres = AtlWinModuleInit(&winmod);
155 ok(hres == S_OK, "AtlWinModuleInit failed: %08lx\n", hres);
156 ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList);
157 ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %ld\n",
159 ok(winmod.m_rgWindowClassAtoms.m_aT == (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n",
161 ok(winmod.m_rgWindowClassAtoms.m_nSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n",
163 ok(winmod.m_rgWindowClassAtoms.m_nAllocSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n",
165
167
168 AtlWinModuleAddCreateWndData(&winmod, create_data, (void*)0xdead0001);
169 ok(winmod.m_pCreateWndList == create_data, "winmod.m_pCreateWndList != create_data\n");
170 ok(create_data[0].m_pThis == (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data[0].m_pThis);
171 ok(create_data[0].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %lx\n",
172 create_data[0].m_dwThreadID);
173 ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
174
175 AtlWinModuleAddCreateWndData(&winmod, create_data+1, (void*)0xdead0002);
176 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
177 ok(create_data[1].m_pThis == (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data[1].m_pThis);
178 ok(create_data[1].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %lx\n",
179 create_data[1].m_dwThreadID);
180 ok(create_data[1].m_pNext == create_data, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
181
182 AtlWinModuleAddCreateWndData(&winmod, create_data+2, (void*)0xdead0003);
183 ok(winmod.m_pCreateWndList == create_data+2, "winmod.m_pCreateWndList != create_data\n");
184 ok(create_data[2].m_pThis == (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data[2].m_pThis);
185 ok(create_data[2].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %lx\n",
186 create_data[2].m_dwThreadID);
187 ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
188
190 ok(p == (void*)0xdead0003, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
191 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
192 ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
193
194 create_data[1].m_dwThreadID = 0xdeadbeef;
195
197 ok(p == (void*)0xdead0001, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
198 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
199 ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
200 ok(!create_data[1].m_pNext, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
201
203 ok(!p, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
204 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
205}
206
207#define test_key_exists(a,b) _test_key_exists(__LINE__,a,b)
208static void _test_key_exists(unsigned line, HKEY root, const char *key_name)
209{
210 HKEY key;
211 DWORD res;
212
214 ok_(__FILE__,line)(res == ERROR_SUCCESS, "Could not open key %s\n", key_name);
215 if(res == ERROR_SUCCESS)
217}
218
219#define test_key_not_exists(a,b) _test_key_not_exists(__LINE__,a,b)
220static void _test_key_not_exists(unsigned line, HKEY root, const char *key_name)
221{
222 HKEY key;
223 DWORD res;
224
226 ok_(__FILE__,line)(res == ERROR_FILE_NOT_FOUND, "Attempting to open %s returned %lu\n", key_name, res);
227 if(res == ERROR_SUCCESS)
229}
230
231static void test_regcat(void)
232{
233 unsigned char b;
235
236 const struct _ATL_CATMAP_ENTRY catmap[] = {
240 };
241
242 if (is_process_limited())
243 {
244 skip("process is limited\n");
245 return;
246 }
247
249 ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08lx\n", hres);
250
252 test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories\\{" CATID_CATTEST1_STR "}");
253 test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories\\{" CATID_CATTEST2_STR "}");
254
256 ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08lx\n", hres);
257
258 test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories");
259 test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories");
261
262 ok(RegDeleteKeyA(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}") == ERROR_SUCCESS, "Could not delete key\n");
263
265 ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08lx\n", hres);
266
268
269 b = 10;
271 ok(hres == S_OK, "AtlGetPerUserRegistration failed: %08lx\n", hres);
272 ok(!b, "AtlGetPerUserRegistration returned %x\n", b);
273}
274
275static void test_typelib(void)
276{
278 HINSTANCE inst;
279 size_t len;
280 BSTR path;
282
283 inst = LoadLibraryA("scrrun.dll");
284 ok(inst != NULL, "Could not load scrrun.dll\n");
285
286 typelib = NULL;
287 hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
288 ok(hres == S_OK, "AtlLoadTypeLib failed: %08lx\n", hres);
289 FreeLibrary(inst);
290
292 ok(len > ARRAY_SIZE(L"\\scrrun.dll")
293 && lstrcmpiW(path+len-ARRAY_SIZE(L"\\scrrun.dll"), L"\\scrrun.dll"),
294 "unexpected path %s\n", wine_dbgstr_w(path));
296 ok(typelib != NULL, "typelib == NULL\n");
297 ITypeLib_Release(typelib);
298
299 inst = LoadLibraryA("mshtml.dll");
300 ok(inst != NULL, "Could not load mshtml.dll\n");
301
302 typelib = NULL;
303 hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
304 ok(hres == S_OK, "AtlLoadTypeLib failed: %08lx\n", hres);
305 FreeLibrary(inst);
306
308 ok(len > ARRAY_SIZE(L"\\mshtml.tlb")
309 && lstrcmpiW(path+len-ARRAY_SIZE(L"\\mshtml.tlb"), L"\\mshtml.tlb"),
310 "unexpected path %s\n", wine_dbgstr_w(path));
312 ok(typelib != NULL, "typelib == NULL\n");
313 ITypeLib_Release(typelib);
314}
315
317{
319 *ppv = iface;
320 return S_OK;
321 }
322
323 ok(0, "unexpected call\n");
324 return E_NOINTERFACE;
325}
326
328{
329 return 2;
330}
331
333{
334 return 1;
335}
336
338{
339 ok(0, "unexpected call\n");
340 return E_NOTIMPL;
341}
342
345{
346 ok(0, "unexpected call\n");
347 return E_NOTIMPL;
348}
349
350static int advise_cnt;
351
353 DWORD *pdwCookie)
354{
355 ok(pUnkSink == (IUnknown*)0xdead0000, "pUnkSink = %p\n", pUnkSink);
356 *pdwCookie = 0xdeadbeef;
357 advise_cnt++;
358 return S_OK;
359}
360
362{
363 ok(dwCookie == 0xdeadbeef, "dwCookie = %lx\n", dwCookie);
364 advise_cnt--;
365 return S_OK;
366}
367
369 IEnumConnections **ppEnum)
370{
371 ok(0, "unexpected call\n");
372 return E_NOTIMPL;
373}
374
375static const IConnectionPointVtbl ConnectionPointVtbl =
376{
385};
386
388
390 REFIID riid, void **ppv)
391{
393 *ppv = iface;
394 return S_OK;
395 }
396
397 ok(0, "unexpected call\n");
398 return E_NOTIMPL;
399}
400
402{
403 return 2;
404}
405
407{
408 return 1;
409}
410
412 IEnumConnectionPoints **ppEnum)
413{
414 ok(0, "unexpected call\n");
415 return E_NOTIMPL;
416}
417
420{
421 ok(IsEqualGUID(riid, &CLSID_Test), "unexpected riid\n");
422 *ppCP = &ConnectionPoint;
423 return S_OK;
424}
425
426static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = {
432};
433
435
436static void test_cp(void)
437{
438 DWORD cookie = 0;
440
441 hres = AtlAdvise(NULL, (IUnknown*)0xdeed0000, &CLSID_Test, &cookie);
442 ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08lx\n", hres);
443
444 hres = AtlUnadvise(NULL, &CLSID_Test, 0xdeadbeef);
445 ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08lx\n", hres);
446
448 ok(hres == S_OK, "AtlAdvise failed: %08lx\n", hres);
449 ok(cookie == 0xdeadbeef, "cookie = %lx\n", cookie);
450 ok(advise_cnt == 1, "advise_cnt = %d\n", advise_cnt);
451
453 ok(hres == S_OK, "AtlUnadvise failed: %08lx\n", hres);
454 ok(!advise_cnt, "advise_cnt = %d\n", advise_cnt);
455}
456
458
460{
461 ok(0, "unexpected call\n");
462 return E_NOINTERFACE;
463}
464
466{
467 return 2;
468}
469
471{
472 return 1;
473}
474
476{
477 *pClassID = persist_clsid;
478 return S_OK;
479}
480
481static const IPersistVtbl PersistVtbl = {
486};
487
489
491{
492 ok(0, "unexpected call\n");
493 return E_NOINTERFACE;
494}
495
497{
498 return 2;
499}
500
502{
503 return 1;
504}
505
507{
508 ok(0, "unexpected call\n");
509 return E_NOTIMPL;
510}
511
513{
514 ok(dwGuidKind == GUIDKIND_DEFAULT_SOURCE_DISP_IID, "unexpected dwGuidKind %lx\n", dwGuidKind);
515 *pGUID = DIID_DispHTMLBody;
516 return S_OK;
517}
518
519static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl = {
525};
526
529
531{
532 *ppv = NULL;
533
535 *ppv = iface;
536 return S_OK;
537 }
538
541 return E_NOINTERFACE;
543 return S_OK;
544 }
545
547 *ppv = &Persist;
548 return S_OK;
549 }
550
551 ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid));
552 return E_NOINTERFACE;
553}
554
556{
557 return 2;
558}
559
561{
562 return 1;
563}
564
566{
567 ok(0, "unexpected call\n");
568 return E_NOTIMPL;
569}
570
572 ITypeInfo **ppTInfo)
573{
576
577 ok(!iTInfo, "iTInfo = %d\n", iTInfo);
578 ok(!lcid, "lcid = %lx\n", lcid);
579
580 hres = LoadTypeLib(L"mshtml.tlb", &typelib);
581 ok(hres == S_OK, "LoadTypeLib failed: %08lx\n", hres);
582
583 hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IHTMLElement, ppTInfo);
584 ok(hres == S_OK, "GetTypeInfoOfGuid failed: %08lx\n", hres);
585
586 ITypeLib_Release(typelib);
587 return S_OK;
588}
589
590static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames,
591 UINT cNames, LCID lcid, DISPID *rgDispId)
592{
593 ok(0, "unexpected call\n");
594 return E_NOTIMPL;
595}
596
598 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
599 EXCEPINFO *pExcepInfo, UINT *puArgErr)
600{
601 ok(0, "unexpected call\n");
602 return E_NOTIMPL;
603}
604
605static const IDispatchVtbl DispatchVtbl = {
613};
614
616
617static void test_source_iface(void)
618{
619 unsigned short maj_ver, min_ver;
620 IID libid, iid;
622
624
625 maj_ver = min_ver = 0xdead;
626 hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
627 ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08lx\n", hres);
628 ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
629 ok(IsEqualGUID(&iid, &DIID_DispHTMLBody), "iid = %s\n", wine_dbgstr_guid(&iid));
630 ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
631
633 persist_clsid = CLSID_HTMLDocument;
634
635 maj_ver = min_ver = 0xdead;
636 hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
637 ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08lx\n", hres);
638 ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
639 ok(IsEqualGUID(&iid, &DIID_HTMLDocumentEvents), "iid = %s\n", wine_dbgstr_guid(&iid));
640 ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
641
642 persist_clsid = CLSID_HTMLStyle;
643
644 maj_ver = min_ver = 0xdead;
645 hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
646 ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08lx\n", hres);
647 ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
648 ok(IsEqualGUID(&iid, &IID_NULL), "iid = %s\n", wine_dbgstr_guid(&iid));
649 ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
650}
651
652static void test_ax_win(void)
653{
655 HRESULT res;
656 HWND hwnd;
657 HANDLE hfile;
659 WNDPROC wndproc[2] = {NULL, NULL};
660 WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH];
661 WNDCLASSEXW wcex;
662 static HMODULE hinstance = 0;
663 static const WCHAR cls_names[][16] =
664 {
665 L"AtlAxWin100",
666 L"AtlAxWinLic100"
667 };
668
669 ret = AtlAxWinInit();
670 ok(ret, "AtlAxWinInit failed\n");
671
672 hinstance = GetModuleHandleA(NULL);
673
674 for (i = 0; i < 2; i++)
675 {
676 memset(&wcex, 0, sizeof(wcex));
677 wcex.cbSize = sizeof(wcex);
678 ret = GetClassInfoExW(hinstance, cls_names[i], &wcex);
679 ok(ret, "%s has not registered\n", wine_dbgstr_w(cls_names[i]));
680 ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style);
681 wndproc[i] = wcex.lpfnWndProc;
682
683 hwnd = CreateWindowW(cls_names[i], NULL, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
684 ok(hwnd != NULL, "CreateWindow failed!\n");
685 control = (IUnknown *)0xdeadbeef;
687 ok(res == E_FAIL, "Expected E_FAIL, returned %08lx\n", res);
688 ok(!control, "returned %p\n", control);
689 if (control) IUnknown_Release(control);
691
692 hwnd = CreateWindowW(cls_names[i], L"", 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
693 ok(hwnd != NULL, "CreateWindow failed!\n");
694 control = (IUnknown *)0xdeadbeef;
696 ok(res == E_FAIL, "Expected E_FAIL, returned %08lx\n", res);
697 ok(!control, "returned %p\n", control);
698 if (control) IUnknown_Release(control);
700
701 hwnd = CreateWindowW(cls_names[i], L"random", 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
702 todo_wine ok(!hwnd, "returned %p\n", hwnd);
704
705 hwnd = CreateWindowW(cls_names[i], progid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
706 ok(hwnd != NULL, "CreateWindow failed!\n");
707 control = NULL;
709 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
710 ok(control != NULL, "AtlAxGetControl failed!\n");
711 IUnknown_Release(control);
713
714 hwnd = CreateWindowW(cls_names[i], clsid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
715 ok(hwnd != NULL, "CreateWindow failed!\n");
716 control = NULL;
718 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
719 ok(control != NULL, "AtlAxGetControl failed!\n");
720 IUnknown_Release(control);
722
723 hwnd = CreateWindowW(cls_names[i], url1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
724 ok(hwnd != NULL, "CreateWindow failed!\n");
725 control = NULL;
727 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
728 ok(control != NULL, "AtlAxGetControl failed!\n");
729 IUnknown_Release(control);
731
732 /* test html stream with "MSHTML:" prefix */
733 hwnd = CreateWindowW(cls_names[i], mshtml1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
734 ok(hwnd != NULL, "CreateWindow failed!\n");
735 control = NULL;
737 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
738 ok(control != NULL, "AtlAxGetControl failed!\n");
739 IUnknown_Release(control);
741
742 hwnd = CreateWindowW(cls_names[i], mshtml2W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
743 ok(hwnd != NULL, "CreateWindow failed!\n");
744 control = NULL;
746 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
747 ok(control != NULL, "AtlAxGetControl failed!\n");
748 IUnknown_Release(control);
750
751 /* test html stream without "MSHTML:" prefix */
752 hwnd = CreateWindowW(cls_names[i], mshtml3W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
753 todo_wine ok(!hwnd, "returned %p\n", hwnd);
755
757 ok(ret, "GetTempPath failed!\n");
758 lstrcatW(pathW, L"test.html");
759 hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0);
760 ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n");
761 ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL);
762 ok(ret, "WriteFile failed\n");
763 CloseHandle(hfile);
764
765 /* test C:// scheme */
766 hwnd = CreateWindowW(cls_names[i], pathW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
767 ok(hwnd != NULL, "CreateWindow failed!\n");
768 control = NULL;
770 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
771 ok(control != NULL, "AtlAxGetControl failed!\n");
772 IUnknown_Release(control);
774
775 /* test file:// scheme */
776 lstrcpyW(file_uri1W, L"file:///");
777 lstrcatW(file_uri1W, pathW);
778 hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
779 ok(hwnd != NULL, "CreateWindow failed!\n");
780 control = NULL;
782 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
783 ok(control != NULL, "AtlAxGetControl failed!\n");
784 IUnknown_Release(control);
786
787 /* test file:// scheme on non-existent file */
789 ok(ret, "DeleteFile failed (gle=%lu)\n", GetLastError());
790 hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
791 ok(hwnd != NULL, "CreateWindow failed!\n");
792 control = NULL;
794 ok(res == S_OK, "AtlAxGetControl failed with res %08lx\n", res);
795 ok(control != NULL, "AtlAxGetControl failed!\n");
796 IUnknown_Release(control);
798 }
799 todo_wine ok(wndproc[0] != wndproc[1], "expected different proc!\n");
800}
801
803{
804 WNDCLASSA wndclassA;
805
806 wndclassA.style = 0;
807 wndclassA.lpfnWndProc = DefWindowProcA;
808 wndclassA.cbClsExtra = 0;
809 wndclassA.cbWndExtra = 0;
810 wndclassA.hInstance = GetModuleHandleA(NULL);
811 wndclassA.hIcon = NULL;
812 wndclassA.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW);
813 wndclassA.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
814 wndclassA.lpszMenuName = NULL;
815 wndclassA.lpszClassName = "WineAtlTestClass";
816
817 return RegisterClassA(&wndclassA);
818}
819
821{
822 return CreateWindowA("WineAtlTestClass", "Wine ATL Test Window", 0,
825}
826
827static void test_AtlAxAttachControl(void)
828{
829 HWND hwnd;
830 HRESULT hr;
832 LONG val;
833
835 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
836
837 container = (IUnknown *)0xdeadbeef;
839 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
840 ok(container == (IUnknown *)0xdeadbeef,
841 "Expected the output container pointer to be untouched, got %p\n", container);
842
845 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
847
849 container = (IUnknown *)0xdeadbeef;
851 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
852 ok(container == (IUnknown *)0xdeadbeef, "returned %p\n", container);
854
855 hr = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
856 &IID_IOleObject, (void **)&control);
857 ok(hr == S_OK, "Expected CoCreateInstance to return S_OK, got 0x%08lx\n", hr);
858
859 if (FAILED(hr))
860 {
861 skip("Couldn't obtain a test IOleObject instance\n");
862 return;
863 }
864
866 ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08lx\n", hr);
867
868 container = NULL;
870 ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08lx\n", hr);
871 ok(container != NULL, "got %p\n", container);
872 IUnknown_Release(container);
873
875 SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef);
877 ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08lx\n", hr);
879 ok(val == 0xdeadbeef, "returned %08lx\n", val);
881
883 SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef);
884 container = NULL;
886 ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08lx\n", hr);
887 ok(container != NULL, "Expected not NULL!\n");
888 IUnknown_Release(container);
890 ok(val == 0xdeadbeef, "Expected unchanged, returned %08lx\n", val);
892
893 IUnknown_Release(control);
894}
895
896static void test_AtlAxCreateControl(void)
897{
898 HWND hwnd;
900 HRESULT hr;
902 HANDLE hfile;
903 WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH];
904
905 container = NULL;
906 control = (IUnknown *)0xdeadbeef;
908 todo_wine ok(hr == S_FALSE, "got 0x%08lx\n", hr);
909 todo_wine ok(container != NULL, "returned %p\n", container);
910 ok(!control, "returned %p\n", control);
911
912 container = NULL;
913 control = (IUnknown *)0xdeadbeef;
915 ok(hwnd != NULL, "create window failed!\n");
917 ok(hr == S_OK, "got 0x%08lx\n", hr);
918 todo_wine ok(container != NULL, "returned %p!\n", container);
919 ok(!control, "returned %p\n", control);
921
922 container = NULL;
923 control = (IUnknown *)0xdeadbeef;
925 ok(hwnd != NULL, "create window failed!\n");
927 ok(hr == S_OK, "got 0x%08lx\n", hr);
928 todo_wine ok(container != NULL, "returned %p!\n", container);
929 ok(!control, "returned %p\n", control);
931
932 container = (IUnknown *)0xdeadbeef;
933 control = (IUnknown *)0xdeadbeef;
935 ok(hwnd != NULL, "create window failed!\n");
937 ok(hr == CO_E_CLASSSTRING, "got 0x%08lx\n", hr);
938 ok(!container, "returned %p!\n", container);
939 ok(!control, "returned %p\n", control);
941
942 container = NULL;
943 control = NULL;
945 ok(hwnd != NULL, "create window failed!\n");
947 ok(hr == S_OK, "got 0x%08lx\n", hr);
948 ok(container != NULL, "returned %p!\n", container);
949 ok(control != NULL, "returned %p\n", control);
950 IUnknown_Release(container);
951 IUnknown_Release(control);
953
954 container = NULL;
955 control = NULL;
957 ok(hwnd != NULL, "create window failed!\n");
959 ok(hr == S_OK, "got 0x%08lx\n", hr);
960 ok(container != NULL, "returned %p!\n", container);
961 ok(control != NULL, "returned %p\n", control);
962 IUnknown_Release(container);
963 IUnknown_Release(control);
965
966 container = NULL;
967 control = NULL;
969 ok(hwnd != NULL, "create window failed!\n");
971 ok(hr == S_OK, "got 0x%08lx\n", hr);
972 ok(container != NULL, "returned %p!\n", container);
973 ok(control != NULL, "returned %p\n", control);
974 IUnknown_Release(container);
975 IUnknown_Release(control);
977
978 container = NULL;
979 control = NULL;
981 ok(hwnd != NULL, "create window failed!\n");
983 ok(hr == S_OK, "got 0x%08lx\n", hr);
984 ok(container != NULL, "returned %p!\n", container);
985 ok(control != NULL, "returned %p\n", control);
986 IUnknown_Release(container);
987 IUnknown_Release(control);
989
990 container = NULL;
991 control = NULL;
993 ok(hwnd != NULL, "create window failed!\n");
995 ok(hr == S_OK, "got 0x%08lx\n", hr);
996 ok(container != NULL, "returned %p!\n", container);
997 ok(control != NULL, "returned %p\n", control);
998 IUnknown_Release(container);
999 IUnknown_Release(control);
1001
1002 container = (IUnknown *)0xdeadbeef;
1003 control = (IUnknown *)0xdeadbeef;
1005 ok(hwnd != NULL, "create window failed!\n");
1007 ok(hr == CO_E_CLASSSTRING, "got 0x%08lx\n", hr);
1008 ok(!container, "returned %p!\n", container);
1009 ok(!control, "returned %p\n", control);
1011
1013 ok(ret, "GetTempPath failed!\n");
1014 lstrcatW(pathW, L"test.html");
1015 hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0);
1016 ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n");
1017 ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL);
1018 ok(ret, "WriteFile failed\n");
1019 CloseHandle(hfile);
1020
1021 /* test C:// scheme */
1022 container = NULL;
1023 control = NULL;
1025 ok(hwnd != NULL, "create window failed!\n");
1027 ok(hr == S_OK, "got 0x%08lx\n", hr);
1028 ok(container != NULL, "returned %p!\n", container);
1029 ok(control != NULL, "returned %p\n", control);
1030 IUnknown_Release(container);
1031 IUnknown_Release(control);
1033
1034 /* test file:// scheme */
1035 lstrcpyW(file_uri1W, L"file:///");
1036 lstrcatW(file_uri1W, pathW);
1037 container = NULL;
1038 control = NULL;
1040 ok(hwnd != NULL, "create window failed!\n");
1042 ok(hr == S_OK, "got 0x%08lx\n", hr);
1043 ok(container != NULL, "returned %p!\n", container);
1044 ok(control != NULL, "returned %p\n", control);
1045 IUnknown_Release(container);
1046 IUnknown_Release(control);
1048
1049 /* test file:// scheme on non-existent file. */
1051 ok(ret, "DeleteFile failed (gle=%lu)\n", GetLastError());
1052 container = NULL;
1053 control = NULL;
1055 ok(hwnd != NULL, "create window failed!\n");
1057 ok(hr == S_OK, "got 0x%08lx\n", hr);
1058 ok(container != NULL, "returned %p!\n", container);
1059 ok(control != NULL, "returned %p\n", control);
1060 IUnknown_Release(container);
1061 IUnknown_Release(control);
1063}
1064
1066{
1067 _ATL_OBJMAP_ENTRY *null_entry = NULL;
1069 HRESULT hr;
1070 void *ret;
1071
1072 /* Test NULL module */
1074 ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
1075
1076 /* Test NULL m_ppAutoObjMapFirst and m_ppAutoObjMapLast */
1077 module.cbSize = sizeof(module);
1078 module.m_ppAutoObjMapFirst = NULL;
1079 module.m_ppAutoObjMapLast = NULL;
1081 ok(hr == CLASS_E_CLASSNOTAVAILABLE, "Unexpected hr %#lx.\n", hr);
1082
1083 /* Test m_ppAutoObjMapFirst and m_ppAutoObjMapLast both pointing to a NULL entry */
1084 module.cbSize = sizeof(module);
1085 module.m_ppAutoObjMapFirst = &null_entry;
1086 module.m_ppAutoObjMapLast = &null_entry;
1088 ok(hr == CLASS_E_CLASSNOTAVAILABLE, "Unexpected hr %#lx.\n", hr);
1089}
1090
1092{
1093 _ATL_OBJMAP_ENTRY *null_entry = NULL;
1095 HRESULT hr;
1096
1097 /* Test NULL module */
1099 ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
1100
1101 /* Test NULL m_ppAutoObjMapFirst and m_ppAutoObjMapLast */
1102 module.cbSize = sizeof(module);
1103 module.m_ppAutoObjMapFirst = NULL;
1104 module.m_ppAutoObjMapLast = NULL;
1106 todo_wine_if(hr == S_OK)
1107 ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
1108
1109 /* Test m_ppAutoObjMapFirst and m_ppAutoObjMapLast both pointing to a NULL entry */
1110 module.cbSize = sizeof(module);
1111 module.m_ppAutoObjMapFirst = &null_entry;
1112 module.m_ppAutoObjMapLast = &null_entry;
1114 todo_wine_if(hr == S_OK)
1115 ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
1116}
1117
1119{
1120 _ATL_OBJMAP_ENTRY *null_entry = NULL;
1122 HRESULT hr;
1123
1124 /* Test NULL module */
1126 ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
1127
1128 /* Test NULL m_ppAutoObjMapFirst and m_ppAutoObjMapLast */
1129 module.cbSize = sizeof(module);
1130 module.m_ppAutoObjMapFirst = NULL;
1131 module.m_ppAutoObjMapLast = NULL;
1133 ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
1134
1135 /* Test m_ppAutoObjMapFirst and m_ppAutoObjMapLast both pointing to a NULL entry */
1136 module.cbSize = sizeof(module);
1137 module.m_ppAutoObjMapFirst = &null_entry;
1138 module.m_ppAutoObjMapLast = &null_entry;
1140 ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
1141}
1142
1144{
1145 if (!register_class())
1146 return;
1147
1149
1151 test_regcat();
1152 test_typelib();
1153 test_cp();
1155 test_ax_win();
1161
1163}
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define ARRAY_SIZE(A)
Definition: main.h:20
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:674
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:698
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
Definition: security.c:829
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:42
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:70
HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown *unk, GUID *libid, IID *iid, unsigned short *major, unsigned short *minor)
Definition: atl.c:883
HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID clsid, const struct _ATL_CATMAP_ENTRY *catmap, BOOL reg)
Definition: atl.c:747
HRESULT WINAPI AtlGetPerUserRegistration(cpp_bool *pbEnabled)
Definition: atl.c:956
HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib)
Definition: atl.c:337
HRESULT WINAPI AtlAxCreateControlEx(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, IUnknown **container, IUnknown **control, REFIID iidSink, IUnknown *punkSink)
Definition: atl_ax.c:1468
HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container)
Definition: atl_ax.c:1142
HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk)
Definition: atl_ax.c:1385
BOOL WINAPI AtlAxWinInit(void)
Definition: atl_ax.c:86
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
OLECHAR * BSTR
Definition: compat.h:2293
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define lstrcpyW
Definition: compat.h:749
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:1999
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
LCID lcid
Definition: locale.c:5660
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:434
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint res
Definition: glext.h:9613
GLsizei GLuint * groups
Definition: glext.h:11113
GLsizeiptr size
Definition: glext.h:5919
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint GLfloat * val
Definition: glext.h:7180
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
unsigned int UINT
Definition: sysinfo.c:13
HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE *, DWORD, DWORD)
REFIID riid
Definition: atlbase.h:39
HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *)
void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE *, _AtlCreateWndData *, void *)
HRESULT WINAPI AtlComModuleRevokeClassObjects(_ATL_COM_MODULE *)
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define _ATL_CATMAP_ENTRY_END
Definition: atlbase.h:253
void *WINAPI AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE *)
#define _ATL_CATMAP_ENTRY_REQUIRED
Definition: atlbase.h:255
HRESULT WINAPI AtlComModuleGetClassObject(_ATL_COM_MODULE *, REFCLSID, REFIID, void **)
#define _ATL_CATMAP_ENTRY_IMPLEMENTED
Definition: atlbase.h:254
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define b
Definition: ke_i.h:79
#define wine_dbgstr_w
Definition: kernel32.h:34
#define GUID_NULL
Definition: ks.h:106
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define todo_wine_if(is_todo)
Definition: minitest.h:81
#define todo_wine
Definition: minitest.h:80
#define CREATE_NEW
Definition: disk.h:69
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
DWORD min_ver
Definition: apphelp.c:214
static HRESULT WINAPI Persist_GetClassID(IPersist *iface, CLSID *pClassID)
Definition: atl.c:475
static const GUID CLSID_Test
Definition: atl.c:35
static HRESULT WINAPI Persist_QueryInterface(IPersist *iface, REFIID riid, void **ppv)
Definition: atl.c:459
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, DWORD *pdwCookie)
Definition: atl.c:352
#define CATID_CATTEST2_STR
Definition: atl.c:45
static ATOM register_class(void)
Definition: atl.c:802
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, REFIID riid, void **ppv)
Definition: atl.c:316
static const GUID CATID_CatTest1
Definition: atl.c:39
static void test_regcat(void)
Definition: atl.c:231
static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
Definition: atl.c:565
static const char html_str[]
Definition: atl.c:52
static void test_AtlComModuleRegisterClassObjects(void)
Definition: atl.c:1091
static BOOL support_classinfo2
Definition: atl.c:528
static CLSID persist_clsid
Definition: atl.c:457
static void test_AtlAxAttachControl(void)
Definition: atl.c:827
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCP)
Definition: atl.c:418
#define CATID_CATTEST1_STR
Definition: atl.c:41
static ULONG WINAPI Dispatch_Release(IDispatch *iface)
Definition: atl.c:560
static void test_AtlComModuleGetClassObject(void)
Definition: atl.c:1065
static void _test_key_not_exists(unsigned line, HKEY root, const char *key_name)
Definition: atl.c:220
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
Definition: atl.c:337
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, void **ppv)
Definition: atl.c:389
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
Definition: atl.c:411
static void test_AtlComModuleRevokeClassObjects(void)
Definition: atl.c:1118
#define test_key_exists(a, b)
Definition: atl.c:207
static ULONG WINAPI ProvideClassInfo2_AddRef(IProvideClassInfo2 *iface)
Definition: atl.c:496
static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl
Definition: atl.c:519
static ULONG WINAPI Persist_AddRef(IPersist *iface)
Definition: atl.c:465
static BOOL is_token_admin(HANDLE token)
Definition: atl.c:54
static IPersist Persist
Definition: atl.c:488
static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: atl.c:597
static const IConnectionPointVtbl ConnectionPointVtbl
Definition: atl.c:375
static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID)
Definition: atl.c:512
static HRESULT WINAPI ProvideClassInfo2_QueryInterface(IProvideClassInfo2 *iface, REFIID riid, void **ppv)
Definition: atl.c:490
static const WCHAR mshtml2W[]
Definition: atl.c:50
static const IPersistVtbl PersistVtbl
Definition: atl.c:481
static void test_ax_win(void)
Definition: atl.c:652
static void test_winmodule(void)
Definition: atl.c:137
static void test_AtlAxCreateControl(void)
Definition: atl.c:896
static BOOL is_process_limited(void)
Definition: atl.c:101
static HRESULT WINAPI ProvideClassInfo2_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI)
Definition: atl.c:506
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: atl.c:571
static IProvideClassInfo2 ProvideClassInfo2
Definition: atl.c:527
static ULONG WINAPI Persist_Release(IPersist *iface)
Definition: atl.c:470
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
Definition: atl.c:361
static ULONG WINAPI Dispatch_AddRef(IDispatch *iface)
Definition: atl.c:555
static const GUID CATID_CatTest2
Definition: atl.c:43
static int advise_cnt
Definition: atl.c:350
static const WCHAR progid1W[]
Definition: atl.c:46
static const WCHAR url1W[]
Definition: atl.c:48
static const WCHAR mshtml1W[]
Definition: atl.c:49
static const IDispatchVtbl DispatchVtbl
Definition: atl.c:605
static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
Definition: atl.c:426
static const WCHAR mshtml3W[]
Definition: atl.c:51
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
Definition: atl.c:401
static const WCHAR clsid1W[]
Definition: atl.c:47
static IConnectionPoint ConnectionPoint
Definition: atl.c:387
static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
Definition: atl.c:530
static void test_typelib(void)
Definition: atl.c:275
static ULONG WINAPI ProvideClassInfo2_Release(IProvideClassInfo2 *iface)
Definition: atl.c:501
static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: atl.c:590
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, IConnectionPointContainer **ppCPC)
Definition: atl.c:343
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, IEnumConnections **ppEnum)
Definition: atl.c:368
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
Definition: atl.c:327
static HWND create_container_window(void)
Definition: atl.c:820
static void test_cp(void)
Definition: atl.c:436
static void _test_key_exists(unsigned line, HKEY root, const char *key_name)
Definition: atl.c:208
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
Definition: atl.c:406
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
Definition: atl.c:332
#define test_key_not_exists(a, b)
Definition: atl.c:219
static void test_source_iface(void)
Definition: atl.c:617
#define CLSID_TEST_STR
Definition: atl.c:37
HRESULT hres
Definition: protocol.c:465
static const WCHAR pathW[]
Definition: path.c:2368
static void ULONG ULONG * ret_size
Definition: time.c:40
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:398
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:198
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
const GUID IID_IConnectionPointContainer
const GUID IID_IConnectionPoint
const GUID IID_IProvideClassInfo2
const GUID IID_IDispatch
const GUID IID_IOleObject
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
const GUID IID_IPersist
Definition: proxy.cpp:14
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
DWORD LCID
Definition: nls.h:13
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:171
#define memset(x, y, z)
Definition: compat.h:39
void * m_aT
Definition: atlbase.h:185
int m_nSize
Definition: atlbase.h:186
int m_nAllocSize
Definition: atlbase.h:187
Definition: atlbase.h:248
CSimpleArray m_rgWindowClassAtoms
Definition: atlbase.h:203
CComCriticalSection m_csWindowCreate
Definition: atlbase.h:201
_AtlCreateWndData * m_pCreateWndList
Definition: atlbase.h:202
HBRUSH hbrBackground
Definition: winuser.h:3278
HICON hIcon
Definition: winuser.h:3276
HINSTANCE hInstance
Definition: winuser.h:3275
HCURSOR hCursor
Definition: winuser.h:3277
int cbWndExtra
Definition: winuser.h:3274
UINT style
Definition: winuser.h:3271
LPCSTR lpszMenuName
Definition: winuser.h:3279
LPCSTR lpszClassName
Definition: winuser.h:3280
WNDPROC lpfnWndProc
Definition: winuser.h:3272
int cbClsExtra
Definition: winuser.h:3273
WNDPROC lpfnWndProc
Definition: winuser.h:3326
UINT cbSize
Definition: winuser.h:3324
UINT style
Definition: winuser.h:3325
Definition: dialog.c:52
Definition: cookie.c:34
Definition: copy.c:22
Definition: parser.c:49
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:687
#define GWLP_USERDATA
Definition: treelist.c:63
PVOID HANDLE
Definition: typedefs.h:73
char * LPSTR
Definition: typedefs.h:51
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772
#define CO_E_CLASSSTRING
Definition: winerror.h:3919
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeLimited
Definition: winnt_old.h:2719
@ TokenElevationTypeDefault
Definition: winnt_old.h:2717
@ TokenElevationTypeFull
Definition: winnt_old.h:2718
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define IDC_ARROW
Definition: winuser.h:695
#define CS_DBLCLKS
Definition: winuser.h:659
BOOL WINAPI GetClassInfoExW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSEXW)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
#define CW_USEDEFAULT
Definition: winuser.h:225
#define CS_GLOBALCLASS
Definition: winuser.h:660
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
BOOL WINAPI DestroyWindow(_In_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2459
#define COLOR_BTNFACE
Definition: winuser.h:939
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH * Dispatch
Definition: wsk.h:188
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define TOKEN_QUERY
Definition: setypes.h:940
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554
@ TokenGroups
Definition: setypes.h:979
@ TokenElevationType
Definition: setypes.h:995
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652