ReactOS 0.4.15-dev-7934-g1dc8d80
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 <wine/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"
46
47static const WCHAR emptyW[] = {'\0'};
48static const WCHAR randomW[] = {'r','a','n','d','o','m','\0'};
49static const WCHAR progid1W[] = {'S','h','e','l','l','.','E','x','p','l','o','r','e','r','.','2','\0'};
50static const WCHAR clsid1W[] = {'{','8','8','5','6','f','9','6','1','-','3','4','0','a','-',
51 '1','1','d','0','-','a','9','6','b','-',
52 '0','0','c','0','4','f','d','7','0','5','a','2','}','\0'};
53static const WCHAR url1W[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q',
54 '.','o','r','g','/','t','e','s','t','s','/','w','i','n','e','h','q','_',
55 's','n','a','p','s','h','o','t','/','\0'};
56static const WCHAR mshtml1W[] = {'m','s','h','t','m','l',':','<','h','t','m','l','>','<','b','o','d','y','>',
57 't','e','s','t','<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'};
58static const WCHAR mshtml2W[] = {'M','S','H','T','M','L',':','<','h','t','m','l','>','<','b','o','d','y','>',
59 't','e','s','t','<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'};
60static const WCHAR mshtml3W[] = {'<','h','t','m','l','>','<','b','o','d','y','>', 't','e','s','t',
61 '<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'};
62static const WCHAR fileW[] = {'f','i','l','e',':','/','/','/','\0'};
63static const WCHAR html_fileW[] = {'t','e','s','t','.','h','t','m','l','\0'};
64static const char html_str[] = "<html><body>test</body><html>";
65
67{
68 PSID administrators = NULL;
70 DWORD groups_size;
72 DWORD group_index;
73
74 /* Create a well-known SID for the Administrators group. */
76 DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,
77 &administrators))
78 return FALSE;
79
80 /* Get the group info from the token */
81 groups_size = 0;
82 GetTokenInformation(token, TokenGroups, NULL, 0, &groups_size);
83 groups = HeapAlloc(GetProcessHeap(), 0, groups_size);
84 if (groups == NULL)
85 {
86 FreeSid(administrators);
87 return FALSE;
88 }
89 if (! GetTokenInformation(token, TokenGroups, groups, groups_size, &groups_size))
90 {
92 FreeSid(administrators);
93 return FALSE;
94 }
95
96 /* Now check if the token groups include the Administrators group */
97 for (group_index = 0; group_index < groups->GroupCount; group_index++)
98 {
99 if (EqualSid(groups->Groups[group_index].Sid, administrators))
100 {
102 FreeSid(administrators);
103 return TRUE;
104 }
105 }
106
107 /* If we end up here we didn't find the Administrators group */
109 FreeSid(administrators);
110 return FALSE;
111}
112
114{
115 static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE) = NULL;
118
119 if (!pOpenProcessToken)
120 {
121 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
122 pOpenProcessToken = (void*)GetProcAddress(hadvapi32, "OpenProcessToken");
123 if (!pOpenProcessToken)
124 return FALSE;
125 }
126
127 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
128 {
129 BOOL ret;
131 DWORD size;
132
134 if (ret)
135 {
137 /* UAC is disabled, check for administrators group */
139 else if (type == TokenElevationTypeFull)
140 result = FALSE;
142 result = TRUE;
143 }
145 }
146 return result;
147}
148
149static void test_winmodule(void)
150{
151 _AtlCreateWndData create_data[3];
152 _ATL_WIN_MODULE winmod;
153 void *p;
155
156 winmod.cbSize = 0xdeadbeef;
157 hres = AtlWinModuleInit(&winmod);
158 ok(hres == E_INVALIDARG, "AtlWinModuleInit failed: %08x\n", hres);
159
160 winmod.cbSize = sizeof(winmod);
161 winmod.m_pCreateWndList = (void*)0xdeadbeef;
162 winmod.m_csWindowCreate.LockCount = 0xdeadbeef;
163 winmod.m_rgWindowClassAtoms.m_aT = (void*)0xdeadbeef;
164 winmod.m_rgWindowClassAtoms.m_nSize = 0xdeadbeef;
165 winmod.m_rgWindowClassAtoms.m_nAllocSize = 0xdeadbeef;
166 hres = AtlWinModuleInit(&winmod);
167 ok(hres == S_OK, "AtlWinModuleInit failed: %08x\n", hres);
168 ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList);
169 ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %d\n",
171 ok(winmod.m_rgWindowClassAtoms.m_aT == (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n",
173 ok(winmod.m_rgWindowClassAtoms.m_nSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n",
175 ok(winmod.m_rgWindowClassAtoms.m_nAllocSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n",
177
179
180 AtlWinModuleAddCreateWndData(&winmod, create_data, (void*)0xdead0001);
181 ok(winmod.m_pCreateWndList == create_data, "winmod.m_pCreateWndList != create_data\n");
182 ok(create_data[0].m_pThis == (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data[0].m_pThis);
183 ok(create_data[0].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %x\n",
184 create_data[0].m_dwThreadID);
185 ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
186
187 AtlWinModuleAddCreateWndData(&winmod, create_data+1, (void*)0xdead0002);
188 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
189 ok(create_data[1].m_pThis == (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data[1].m_pThis);
190 ok(create_data[1].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %x\n",
191 create_data[1].m_dwThreadID);
192 ok(create_data[1].m_pNext == create_data, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
193
194 AtlWinModuleAddCreateWndData(&winmod, create_data+2, (void*)0xdead0003);
195 ok(winmod.m_pCreateWndList == create_data+2, "winmod.m_pCreateWndList != create_data\n");
196 ok(create_data[2].m_pThis == (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data[2].m_pThis);
197 ok(create_data[2].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %x\n",
198 create_data[2].m_dwThreadID);
199 ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
200
202 ok(p == (void*)0xdead0003, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
203 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
204 ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
205
206 create_data[1].m_dwThreadID = 0xdeadbeef;
207
209 ok(p == (void*)0xdead0001, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
210 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
211 ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
212 ok(!create_data[1].m_pNext, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
213
215 ok(!p, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
216 ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
217}
218
219#define test_key_exists(a,b) _test_key_exists(__LINE__,a,b)
220static void _test_key_exists(unsigned line, HKEY root, const char *key_name)
221{
222 HKEY key;
223 DWORD res;
224
226 ok_(__FILE__,line)(res == ERROR_SUCCESS, "Could not open key %s\n", key_name);
227 if(res == ERROR_SUCCESS)
229}
230
231#define test_key_not_exists(a,b) _test_key_not_exists(__LINE__,a,b)
232static void _test_key_not_exists(unsigned line, HKEY root, const char *key_name)
233{
234 HKEY key;
235 DWORD res;
236
238 ok_(__FILE__,line)(res == ERROR_FILE_NOT_FOUND, "Attempting to open %s returned %u\n", key_name, res);
239 if(res == ERROR_SUCCESS)
241}
242
243static void test_regcat(void)
244{
245 unsigned char b;
247
248 const struct _ATL_CATMAP_ENTRY catmap[] = {
252 };
253
254 if (is_process_limited())
255 {
256 skip("process is limited\n");
257 return;
258 }
259
261 ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
262
264 test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories\\{" CATID_CATTEST1_STR "}");
265 test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories\\{" CATID_CATTEST2_STR "}");
266
268 ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
269
270 test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories");
271 test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories");
273
274 ok(RegDeleteKeyA(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}") == ERROR_SUCCESS, "Could not delete key\n");
275
277 ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
278
280
281 b = 10;
283 ok(hres == S_OK, "AtlGetPerUserRegistration failed: %08x\n", hres);
284 ok(!b, "AtlGetPerUserRegistration returned %x\n", b);
285}
286
287static void test_typelib(void)
288{
290 HINSTANCE inst;
291 size_t len;
292 BSTR path;
294
295 static const WCHAR scrrun_dll_suffixW[] = {'\\','s','c','r','r','u','n','.','d','l','l',0};
296 static const WCHAR mshtml_tlb_suffixW[] = {'\\','m','s','h','t','m','l','.','t','l','b',0};
297
298 inst = LoadLibraryA("scrrun.dll");
299 ok(inst != NULL, "Could not load scrrun.dll\n");
300
301 typelib = NULL;
302 hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
303 ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres);
304 FreeLibrary(inst);
305
307 ok(len > ARRAY_SIZE(scrrun_dll_suffixW)
308 && lstrcmpiW(path+len-ARRAY_SIZE(scrrun_dll_suffixW), scrrun_dll_suffixW),
309 "unexpected path %s\n", wine_dbgstr_w(path));
311 ok(typelib != NULL, "typelib == NULL\n");
312 ITypeLib_Release(typelib);
313
314 inst = LoadLibraryA("mshtml.dll");
315 ok(inst != NULL, "Could not load mshtml.dll\n");
316
317 typelib = NULL;
318 hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
319 ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres);
320 FreeLibrary(inst);
321
323 ok(len > ARRAY_SIZE(mshtml_tlb_suffixW)
324 && lstrcmpiW(path+len-ARRAY_SIZE(mshtml_tlb_suffixW), mshtml_tlb_suffixW),
325 "unexpected path %s\n", wine_dbgstr_w(path));
327 ok(typelib != NULL, "typelib == NULL\n");
328 ITypeLib_Release(typelib);
329}
330
332{
334 *ppv = iface;
335 return S_OK;
336 }
337
338 ok(0, "unexpected call\n");
339 return E_NOINTERFACE;
340}
341
343{
344 return 2;
345}
346
348{
349 return 1;
350}
351
353{
354 ok(0, "unexpected call\n");
355 return E_NOTIMPL;
356}
357
360{
361 ok(0, "unexpected call\n");
362 return E_NOTIMPL;
363}
364
365static int advise_cnt;
366
368 DWORD *pdwCookie)
369{
370 ok(pUnkSink == (IUnknown*)0xdead0000, "pUnkSink = %p\n", pUnkSink);
371 *pdwCookie = 0xdeadbeef;
372 advise_cnt++;
373 return S_OK;
374}
375
377{
378 ok(dwCookie == 0xdeadbeef, "dwCookie = %x\n", dwCookie);
379 advise_cnt--;
380 return S_OK;
381}
382
384 IEnumConnections **ppEnum)
385{
386 ok(0, "unexpected call\n");
387 return E_NOTIMPL;
388}
389
390static const IConnectionPointVtbl ConnectionPointVtbl =
391{
400};
401
403
405 REFIID riid, void **ppv)
406{
408 *ppv = iface;
409 return S_OK;
410 }
411
412 ok(0, "unexpected call\n");
413 return E_NOTIMPL;
414}
415
417{
418 return 2;
419}
420
422{
423 return 1;
424}
425
427 IEnumConnectionPoints **ppEnum)
428{
429 ok(0, "unexpected call\n");
430 return E_NOTIMPL;
431}
432
435{
436 ok(IsEqualGUID(riid, &CLSID_Test), "unexpected riid\n");
437 *ppCP = &ConnectionPoint;
438 return S_OK;
439}
440
441static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = {
447};
448
450
451static void test_cp(void)
452{
453 DWORD cookie = 0;
455
456 hres = AtlAdvise(NULL, (IUnknown*)0xdeed0000, &CLSID_Test, &cookie);
457 ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres);
458
459 hres = AtlUnadvise(NULL, &CLSID_Test, 0xdeadbeef);
460 ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres);
461
463 ok(hres == S_OK, "AtlAdvise failed: %08x\n", hres);
464 ok(cookie == 0xdeadbeef, "cookie = %x\n", cookie);
465 ok(advise_cnt == 1, "advise_cnt = %d\n", advise_cnt);
466
468 ok(hres == S_OK, "AtlUnadvise failed: %08x\n", hres);
469 ok(!advise_cnt, "advise_cnt = %d\n", advise_cnt);
470}
471
473
475{
476 ok(0, "unexpected call\n");
477 return E_NOINTERFACE;
478}
479
481{
482 return 2;
483}
484
486{
487 return 1;
488}
489
491{
492 *pClassID = persist_clsid;
493 return S_OK;
494}
495
496static const IPersistVtbl PersistVtbl = {
501};
502
504
506{
507 ok(0, "unexpected call\n");
508 return E_NOINTERFACE;
509}
510
512{
513 return 2;
514}
515
517{
518 return 1;
519}
520
522{
523 ok(0, "unexpected call\n");
524 return E_NOTIMPL;
525}
526
528{
529 ok(dwGuidKind == GUIDKIND_DEFAULT_SOURCE_DISP_IID, "unexpected dwGuidKind %x\n", dwGuidKind);
530 *pGUID = DIID_DispHTMLBody;
531 return S_OK;
532}
533
534static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl = {
540};
541
544
546{
547 *ppv = NULL;
548
550 *ppv = iface;
551 return S_OK;
552 }
553
556 return E_NOINTERFACE;
558 return S_OK;
559 }
560
562 *ppv = &Persist;
563 return S_OK;
564 }
565
566 ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid));
567 return E_NOINTERFACE;
568}
569
571{
572 return 2;
573}
574
576{
577 return 1;
578}
579
581{
582 ok(0, "unexpected call\n");
583 return E_NOTIMPL;
584}
585
587 ITypeInfo **ppTInfo)
588{
591
592 static const WCHAR mshtml_tlbW[] = {'m','s','h','t','m','l','.','t','l','b',0};
593
594 ok(!iTInfo, "iTInfo = %d\n", iTInfo);
595 ok(!lcid, "lcid = %x\n", lcid);
596
597 hres = LoadTypeLib(mshtml_tlbW, &typelib);
598 ok(hres == S_OK, "LoadTypeLib failed: %08x\n", hres);
599
600 hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IHTMLElement, ppTInfo);
601 ok(hres == S_OK, "GetTypeInfoOfGuid failed: %08x\n", hres);
602
603 ITypeLib_Release(typelib);
604 return S_OK;
605}
606
608 UINT cNames, LCID lcid, DISPID *rgDispId)
609{
610 ok(0, "unexpected call\n");
611 return E_NOTIMPL;
612}
613
615 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
616 EXCEPINFO *pExcepInfo, UINT *puArgErr)
617{
618 ok(0, "unexpected call\n");
619 return E_NOTIMPL;
620}
621
622static const IDispatchVtbl DispatchVtbl = {
630};
631
633
634static void test_source_iface(void)
635{
636 unsigned short maj_ver, min_ver;
637 IID libid, iid;
639
641
642 maj_ver = min_ver = 0xdead;
643 hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
644 ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres);
645 ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
646 ok(IsEqualGUID(&iid, &DIID_DispHTMLBody), "iid = %s\n", wine_dbgstr_guid(&iid));
647 ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
648
650 persist_clsid = CLSID_HTMLDocument;
651
652 maj_ver = min_ver = 0xdead;
653 hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
654 ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres);
655 ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
656 ok(IsEqualGUID(&iid, &DIID_HTMLDocumentEvents), "iid = %s\n", wine_dbgstr_guid(&iid));
657 ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
658
659 persist_clsid = CLSID_HTMLStyle;
660
661 maj_ver = min_ver = 0xdead;
662 hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
663 ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres);
664 ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
665 ok(IsEqualGUID(&iid, &IID_NULL), "iid = %s\n", wine_dbgstr_guid(&iid));
666 ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
667}
668
669static void test_ax_win(void)
670{
671 DWORD ret, ret_size, i;
672 HRESULT res;
673 HWND hwnd;
674 HANDLE hfile;
675 IUnknown *control;
676 WNDPROC wndproc[2] = {NULL, NULL};
677 WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH];
678 WNDCLASSEXW wcex;
679 static HMODULE hinstance = 0;
680 static const WCHAR cls_names[][16] =
681 {
682 {'A','t','l','A','x','W','i','n','1','0','0',0},
683 {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0}
684 };
685
686 ret = AtlAxWinInit();
687 ok(ret, "AtlAxWinInit failed\n");
688
689 hinstance = GetModuleHandleA(NULL);
690
691 for (i = 0; i < 2; i++)
692 {
693 memset(&wcex, 0, sizeof(wcex));
694 wcex.cbSize = sizeof(wcex);
695 ret = GetClassInfoExW(hinstance, cls_names[i], &wcex);
696 ok(ret, "%s has not registered\n", wine_dbgstr_w(cls_names[i]));
697 ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style);
698 wndproc[i] = wcex.lpfnWndProc;
699
700 hwnd = CreateWindowW(cls_names[i], NULL, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
701 ok(hwnd != NULL, "CreateWindow failed!\n");
702 control = (IUnknown *)0xdeadbeef;
703 res = AtlAxGetControl(hwnd, &control);
704 ok(res == E_FAIL, "Expected E_FAIL, returned %08x\n", res);
705 ok(!control, "returned %p\n", control);
706 if (control) IUnknown_Release(control);
708
709 hwnd = CreateWindowW(cls_names[i], emptyW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
710 ok(hwnd != NULL, "CreateWindow failed!\n");
711 control = (IUnknown *)0xdeadbeef;
712 res = AtlAxGetControl(hwnd, &control);
713 ok(res == E_FAIL, "Expected E_FAIL, returned %08x\n", res);
714 ok(!control, "returned %p\n", control);
715 if (control) IUnknown_Release(control);
717
718 hwnd = CreateWindowW(cls_names[i], randomW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
719 todo_wine ok(!hwnd, "returned %p\n", hwnd);
721
722 hwnd = CreateWindowW(cls_names[i], progid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
723 ok(hwnd != NULL, "CreateWindow failed!\n");
724 control = NULL;
725 res = AtlAxGetControl(hwnd, &control);
726 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
727 ok(control != NULL, "AtlAxGetControl failed!\n");
728 IUnknown_Release(control);
730
731 hwnd = CreateWindowW(cls_names[i], clsid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
732 ok(hwnd != NULL, "CreateWindow failed!\n");
733 control = NULL;
734 res = AtlAxGetControl(hwnd, &control);
735 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
736 ok(control != NULL, "AtlAxGetControl failed!\n");
737 IUnknown_Release(control);
739
740 hwnd = CreateWindowW(cls_names[i], url1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
741 ok(hwnd != NULL, "CreateWindow failed!\n");
742 control = NULL;
743 res = AtlAxGetControl(hwnd, &control);
744 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
745 ok(control != NULL, "AtlAxGetControl failed!\n");
746 IUnknown_Release(control);
748
749 /* test html stream with "MSHTML:" prefix */
750 hwnd = CreateWindowW(cls_names[i], mshtml1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
751 ok(hwnd != NULL, "CreateWindow failed!\n");
752 control = NULL;
753 res = AtlAxGetControl(hwnd, &control);
754 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
755 ok(control != NULL, "AtlAxGetControl failed!\n");
756 IUnknown_Release(control);
758
759 hwnd = CreateWindowW(cls_names[i], mshtml2W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
760 ok(hwnd != NULL, "CreateWindow failed!\n");
761 control = NULL;
762 res = AtlAxGetControl(hwnd, &control);
763 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
764 ok(control != NULL, "AtlAxGetControl failed!\n");
765 IUnknown_Release(control);
767
768 /* test html stream without "MSHTML:" prefix */
769 hwnd = CreateWindowW(cls_names[i], mshtml3W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
770 todo_wine ok(!hwnd, "returned %p\n", hwnd);
772
773 ret = GetTempPathW(MAX_PATH, pathW);
774 ok(ret, "GetTempPath failed!\n");
775 lstrcatW(pathW, html_fileW);
776 hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0);
777 ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n");
778 ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL);
779 ok(ret, "WriteFile failed\n");
780 CloseHandle(hfile);
781
782 /* test C:// scheme */
783 hwnd = CreateWindowW(cls_names[i], pathW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
784 ok(hwnd != NULL, "CreateWindow failed!\n");
785 control = NULL;
786 res = AtlAxGetControl(hwnd, &control);
787 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
788 ok(control != NULL, "AtlAxGetControl failed!\n");
789 IUnknown_Release(control);
791
792 /* test file:// scheme */
793 lstrcpyW(file_uri1W, fileW);
794 lstrcatW(file_uri1W, pathW);
795 hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
796 ok(hwnd != NULL, "CreateWindow failed!\n");
797 control = NULL;
798 res = AtlAxGetControl(hwnd, &control);
799 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
800 ok(control != NULL, "AtlAxGetControl failed!\n");
801 IUnknown_Release(control);
803
804 /* test file:// scheme on non-existent file */
805 ret = DeleteFileW(pathW);
806 ok(ret, "DeleteFile failed!\n");
807 hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
808 ok(hwnd != NULL, "CreateWindow failed!\n");
809 control = NULL;
810 res = AtlAxGetControl(hwnd, &control);
811 ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
812 ok(control != NULL, "AtlAxGetControl failed!\n");
813 IUnknown_Release(control);
815 }
816 todo_wine ok(wndproc[0] != wndproc[1], "expected different proc!\n");
817}
818
820{
821 WNDCLASSA wndclassA;
822
823 wndclassA.style = 0;
824 wndclassA.lpfnWndProc = DefWindowProcA;
825 wndclassA.cbClsExtra = 0;
826 wndclassA.cbWndExtra = 0;
827 wndclassA.hInstance = GetModuleHandleA(NULL);
828 wndclassA.hIcon = NULL;
829 wndclassA.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW);
830 wndclassA.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
831 wndclassA.lpszMenuName = NULL;
832 wndclassA.lpszClassName = "WineAtlTestClass";
833
834 return RegisterClassA(&wndclassA);
835}
836
838{
839 return CreateWindowA("WineAtlTestClass", "Wine ATL Test Window", 0,
842}
843
844static void test_AtlAxAttachControl(void)
845{
846 HWND hwnd;
847 HRESULT hr;
848 IUnknown *control, *container;
849 LONG val;
850
852 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
853
854 container = (IUnknown *)0xdeadbeef;
856 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
857 ok(container == (IUnknown *)0xdeadbeef,
858 "Expected the output container pointer to be untouched, got %p\n", container);
859
862 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
864
866 container = (IUnknown *)0xdeadbeef;
868 ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
869 ok(container == (IUnknown *)0xdeadbeef, "returned %p\n", container);
871
872 hr = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
873 &IID_IOleObject, (void **)&control);
874 ok(hr == S_OK, "Expected CoCreateInstance to return S_OK, got 0x%08x\n", hr);
875
876 if (FAILED(hr))
877 {
878 skip("Couldn't obtain a test IOleObject instance\n");
879 return;
880 }
881
882 hr = AtlAxAttachControl(control, NULL, NULL);
883 ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr);
884
885 container = NULL;
886 hr = AtlAxAttachControl(control, NULL, &container);
887 ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr);
888 ok(container != NULL, "got %p\n", container);
889 IUnknown_Release(container);
890
892 SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef);
893 hr = AtlAxAttachControl(control, hwnd, NULL);
894 ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr);
896 ok(val == 0xdeadbeef, "returned %08x\n", val);
898
900 SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef);
901 container = NULL;
902 hr = AtlAxAttachControl(control, hwnd, &container);
903 ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr);
904 ok(container != NULL, "Expected not NULL!\n");
905 IUnknown_Release(container);
907 ok(val == 0xdeadbeef, "Expected unchanged, returned %08x\n", val);
909
910 IUnknown_Release(control);
911}
912
913static void test_AtlAxCreateControl(void)
914{
915 HWND hwnd;
916 IUnknown *control, *container;
917 HRESULT hr;
918 DWORD ret, ret_size;
919 HANDLE hfile;
920 WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH];
921
922 container = NULL;
923 control = (IUnknown *)0xdeadbeef;
925 todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr);
926 todo_wine ok(container != NULL, "returned %p\n", container);
927 ok(!control, "returned %p\n", control);
928
929 container = NULL;
930 control = (IUnknown *)0xdeadbeef;
932 ok(hwnd != NULL, "create window failed!\n");
934 ok(hr == S_OK, "got 0x%08x\n", hr);
935 todo_wine ok(container != NULL, "returned %p!\n", container);
936 ok(!control, "returned %p\n", control);
938
939 container = NULL;
940 control = (IUnknown *)0xdeadbeef;
942 ok(hwnd != NULL, "create window failed!\n");
944 ok(hr == S_OK, "got 0x%08x\n", hr);
945 todo_wine ok(container != NULL, "returned %p!\n", container);
946 ok(!control, "returned %p\n", control);
948
949 container = (IUnknown *)0xdeadbeef;
950 control = (IUnknown *)0xdeadbeef;
952 ok(hwnd != NULL, "create window failed!\n");
954 ok(hr == CO_E_CLASSSTRING, "got 0x%08x\n", hr);
955 ok(!container, "returned %p!\n", container);
956 ok(!control, "returned %p\n", control);
958
959 container = NULL;
960 control = NULL;
962 ok(hwnd != NULL, "create window failed!\n");
964 ok(hr == S_OK, "got 0x%08x\n", hr);
965 ok(container != NULL, "returned %p!\n", container);
966 ok(control != NULL, "returned %p\n", control);
967 IUnknown_Release(container);
968 IUnknown_Release(control);
970
971 container = NULL;
972 control = NULL;
974 ok(hwnd != NULL, "create window failed!\n");
976 ok(hr == S_OK, "got 0x%08x\n", hr);
977 ok(container != NULL, "returned %p!\n", container);
978 ok(control != NULL, "returned %p\n", control);
979 IUnknown_Release(container);
980 IUnknown_Release(control);
982
983 container = NULL;
984 control = NULL;
986 ok(hwnd != NULL, "create window failed!\n");
988 ok(hr == S_OK, "got 0x%08x\n", hr);
989 ok(container != NULL, "returned %p!\n", container);
990 ok(control != NULL, "returned %p\n", control);
991 IUnknown_Release(container);
992 IUnknown_Release(control);
994
995 container = NULL;
996 control = NULL;
998 ok(hwnd != NULL, "create window failed!\n");
1000 ok(hr == S_OK, "got 0x%08x\n", hr);
1001 ok(container != NULL, "returned %p!\n", container);
1002 ok(control != NULL, "returned %p\n", control);
1003 IUnknown_Release(container);
1004 IUnknown_Release(control);
1006
1007 container = NULL;
1008 control = NULL;
1010 ok(hwnd != NULL, "create window failed!\n");
1012 ok(hr == S_OK, "got 0x%08x\n", hr);
1013 ok(container != NULL, "returned %p!\n", container);
1014 ok(control != NULL, "returned %p\n", control);
1015 IUnknown_Release(container);
1016 IUnknown_Release(control);
1018
1019 container = (IUnknown *)0xdeadbeef;
1020 control = (IUnknown *)0xdeadbeef;
1022 ok(hwnd != NULL, "create window failed!\n");
1024 ok(hr == CO_E_CLASSSTRING, "got 0x%08x\n", hr);
1025 ok(!container, "returned %p!\n", container);
1026 ok(!control, "returned %p\n", control);
1028
1029 ret = GetTempPathW(MAX_PATH, pathW);
1030 ok(ret, "GetTempPath failed!\n");
1031 lstrcatW(pathW, html_fileW);
1032 hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0);
1033 ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n");
1034 ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL);
1035 ok(ret, "WriteFile failed\n");
1036 CloseHandle(hfile);
1037
1038 /* test C:// scheme */
1039 container = NULL;
1040 control = NULL;
1042 ok(hwnd != NULL, "create window failed!\n");
1043 hr = AtlAxCreateControlEx(pathW, hwnd, NULL, &container, &control, &IID_NULL, NULL);
1044 ok(hr == S_OK, "got 0x%08x\n", hr);
1045 ok(container != NULL, "returned %p!\n", container);
1046 ok(control != NULL, "returned %p\n", control);
1047 IUnknown_Release(container);
1048 IUnknown_Release(control);
1050
1051 /* test file:// scheme */
1052 lstrcpyW(file_uri1W, fileW);
1053 lstrcatW(file_uri1W, pathW);
1054 container = NULL;
1055 control = NULL;
1057 ok(hwnd != NULL, "create window failed!\n");
1058 hr = AtlAxCreateControlEx(file_uri1W, hwnd, NULL, &container, &control, &IID_NULL, NULL);
1059 ok(hr == S_OK, "got 0x%08x\n", hr);
1060 ok(container != NULL, "returned %p!\n", container);
1061 ok(control != NULL, "returned %p\n", control);
1062 IUnknown_Release(container);
1063 IUnknown_Release(control);
1065
1066 /* test file:// scheme on non-existent file. */
1067 ret = DeleteFileW(pathW);
1068 ok(ret, "DeleteFile failed!\n");
1069 container = NULL;
1070 control = NULL;
1072 ok(hwnd != NULL, "create window failed!\n");
1073 hr = AtlAxCreateControlEx(file_uri1W, hwnd, NULL, &container, &control, &IID_NULL, NULL);
1074 ok(hr == S_OK, "got 0x%08x\n", hr);
1075 ok(container != NULL, "returned %p!\n", container);
1076 ok(control != NULL, "returned %p\n", control);
1077 IUnknown_Release(container);
1078 IUnknown_Release(control);
1080}
1081
1083{
1084 if (!register_class())
1085 return;
1086
1088
1090 test_regcat();
1091 test_typelib();
1092 test_cp();
1094 test_ax_win();
1097
1099}
static ITypeLib * typelib
Definition: apps.c:108
#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:33
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
#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:45
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:73
HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown *unk, GUID *libid, IID *iid, unsigned short *major, unsigned short *minor)
Definition: atl.c:888
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:961
HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib)
Definition: atl.c:341
HRESULT WINAPI AtlAxCreateControlEx(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, IUnknown **container, IUnknown **control, REFIID iidSink, IUnknown *punkSink)
Definition: atl_ax.c:1483
HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container)
Definition: atl_ax.c:1147
HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk)
Definition: atl_ax.c:1391
BOOL WINAPI AtlAxWinInit(void)
Definition: atl_ax.c:89
#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 LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
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:2080
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:458
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLsizei GLuint * groups
Definition: glext.h:11113
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
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
REFIID riid
Definition: atlbase.h:39
HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *)
void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE *, _AtlCreateWndData *, void *)
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
#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
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define CREATE_NEW
Definition: disk.h:69
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
DWORD min_ver
Definition: apphelp.c:214
static const WCHAR fileW[]
Definition: atl.c:62
static HRESULT WINAPI Persist_GetClassID(IPersist *iface, CLSID *pClassID)
Definition: atl.c:490
static const GUID CLSID_Test
Definition: atl.c:35
static HRESULT WINAPI Persist_QueryInterface(IPersist *iface, REFIID riid, void **ppv)
Definition: atl.c:474
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, DWORD *pdwCookie)
Definition: atl.c:367
#define CATID_CATTEST2_STR
Definition: atl.c:45
static ATOM register_class(void)
Definition: atl.c:819
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, REFIID riid, void **ppv)
Definition: atl.c:331
static const GUID CATID_CatTest1
Definition: atl.c:39
static void test_regcat(void)
Definition: atl.c:243
static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
Definition: atl.c:580
static const char html_str[]
Definition: atl.c:64
static BOOL support_classinfo2
Definition: atl.c:543
static CLSID persist_clsid
Definition: atl.c:472
static void test_AtlAxAttachControl(void)
Definition: atl.c:844
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCP)
Definition: atl.c:433
#define CATID_CATTEST1_STR
Definition: atl.c:41
static ULONG WINAPI Dispatch_Release(IDispatch *iface)
Definition: atl.c:575
static void _test_key_not_exists(unsigned line, HKEY root, const char *key_name)
Definition: atl.c:232
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
Definition: atl.c:352
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, void **ppv)
Definition: atl.c:404
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
Definition: atl.c:426
#define test_key_exists(a, b)
Definition: atl.c:219
static ULONG WINAPI ProvideClassInfo2_AddRef(IProvideClassInfo2 *iface)
Definition: atl.c:511
static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl
Definition: atl.c:534
static ULONG WINAPI Persist_AddRef(IPersist *iface)
Definition: atl.c:480
static BOOL is_token_admin(HANDLE token)
Definition: atl.c:66
static IPersist Persist
Definition: atl.c:503
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:614
static const IConnectionPointVtbl ConnectionPointVtbl
Definition: atl.c:390
static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID)
Definition: atl.c:527
static HRESULT WINAPI ProvideClassInfo2_QueryInterface(IProvideClassInfo2 *iface, REFIID riid, void **ppv)
Definition: atl.c:505
static const WCHAR mshtml2W[]
Definition: atl.c:58
static const IPersistVtbl PersistVtbl
Definition: atl.c:496
static void test_ax_win(void)
Definition: atl.c:669
static void test_winmodule(void)
Definition: atl.c:149
static void test_AtlAxCreateControl(void)
Definition: atl.c:913
static BOOL is_process_limited(void)
Definition: atl.c:113
static HRESULT WINAPI ProvideClassInfo2_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI)
Definition: atl.c:521
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: atl.c:586
static IProvideClassInfo2 ProvideClassInfo2
Definition: atl.c:542
static ULONG WINAPI Persist_Release(IPersist *iface)
Definition: atl.c:485
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
Definition: atl.c:376
static ULONG WINAPI Dispatch_AddRef(IDispatch *iface)
Definition: atl.c:570
static const GUID CATID_CatTest2
Definition: atl.c:43
static const WCHAR emptyW[]
Definition: atl.c:47
static int advise_cnt
Definition: atl.c:365
static const WCHAR progid1W[]
Definition: atl.c:49
static const WCHAR html_fileW[]
Definition: atl.c:63
static const WCHAR url1W[]
Definition: atl.c:53
static const WCHAR mshtml1W[]
Definition: atl.c:56
static const IDispatchVtbl DispatchVtbl
Definition: atl.c:622
static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
Definition: atl.c:441
static const WCHAR mshtml3W[]
Definition: atl.c:60
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
Definition: atl.c:416
static const WCHAR randomW[]
Definition: atl.c:48
static const WCHAR clsid1W[]
Definition: atl.c:50
static IConnectionPoint ConnectionPoint
Definition: atl.c:402
static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
Definition: atl.c:545
static void test_typelib(void)
Definition: atl.c:287
static ULONG WINAPI ProvideClassInfo2_Release(IProvideClassInfo2 *iface)
Definition: atl.c:516
static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: atl.c:607
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, IConnectionPointContainer **ppCPC)
Definition: atl.c:358
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, IEnumConnections **ppEnum)
Definition: atl.c:383
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
Definition: atl.c:342
static HWND create_container_window(void)
Definition: atl.c:837
static void test_cp(void)
Definition: atl.c:451
static void _test_key_exists(unsigned line, HKEY root, const char *key_name)
Definition: atl.c:220
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
Definition: atl.c:421
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
Definition: atl.c:347
#define test_key_not_exists(a, b)
Definition: atl.c:231
static void test_source_iface(void)
Definition: atl.c:634
#define CLSID_TEST_STR
Definition: atl.c:37
HRESULT hres
Definition: protocol.c:465
#define todo_wine
Definition: custom.c:79
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
unsigned int UINT
Definition: ndis.h:50
#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
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
const GUID IID_IConnectionPointContainer
const GUID IID_IConnectionPoint
const GUID IID_IProvideClassInfo2
const GUID IID_IDispatch
const GUID IID_IOleObject
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:197
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
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:3170
HICON hIcon
Definition: winuser.h:3168
HINSTANCE hInstance
Definition: winuser.h:3167
HCURSOR hCursor
Definition: winuser.h:3169
int cbWndExtra
Definition: winuser.h:3166
UINT style
Definition: winuser.h:3163
LPCSTR lpszMenuName
Definition: winuser.h:3171
LPCSTR lpszClassName
Definition: winuser.h:3172
WNDPROC lpfnWndProc
Definition: winuser.h:3164
int cbClsExtra
Definition: winuser.h:3165
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
UINT style
Definition: winuser.h:3217
Definition: cookie.c:34
Definition: copy.c:22
Definition: parser.c:49
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define GWLP_USERDATA
Definition: treelist.c:63
PVOID HANDLE
Definition: typedefs.h:73
uint32_t ULONG
Definition: typedefs.h:59
int ret
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CO_E_CLASSSTRING
Definition: winerror.h:2806
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeLimited
Definition: winnt_old.h:2488
@ TokenElevationTypeDefault
Definition: winnt_old.h:2486
@ TokenElevationTypeFull
Definition: winnt_old.h:2487
#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:4315
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define IDC_ARROW
Definition: winuser.h:687
#define CS_DBLCLKS
Definition: winuser.h:651
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:4316
#define CW_USEDEFAULT
Definition: winuser.h:225
#define CS_GLOBALCLASS
Definition: winuser.h:652
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
BOOL WINAPI DestroyWindow(_In_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2090
#define COLOR_BTNFACE
Definition: winuser.h:928
_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:928
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554
@ TokenGroups
Definition: setypes.h:967
@ TokenElevationType
Definition: setypes.h:983
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180