ReactOS 0.4.16-dev-2320-ge1853c6
roapi.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Alistair Leslie-Hughes
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#define COBJMACROS
19#include <stdarg.h>
20
21#include "windef.h"
22#include "winbase.h"
23#include "winerror.h"
24#include "winstring.h"
25
26#include "initguid.h"
27#include "roapi.h"
28
29#include "wine/test.h"
30
31#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
32static void _expect_ref(IUnknown* obj, ULONG ref, int line)
33{
34 ULONG rc;
35 IUnknown_AddRef(obj);
36 rc = IUnknown_Release(obj);
37 ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
38}
39
40static void flush_events(void)
41{
42 int diff = 200;
43 DWORD time;
44 MSG msg;
45
46 time = GetTickCount() + diff;
47 while (diff > 0)
48 {
50 break;
51 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
53 diff = time - GetTickCount();
54 }
55}
56
57static void load_resource(const WCHAR *filename)
58{
59 DWORD written;
61 HRSRC res;
62 void *ptr;
63
65 ok(file != INVALID_HANDLE_VALUE, "failed to create %s, error %lu\n", debugstr_w(filename), GetLastError());
66
67 res = FindResourceW(NULL, filename, L"TESTDLL");
68 ok(res != 0, "couldn't find resource\n");
71 ok(written == SizeofResource(GetModuleHandleW(NULL), res), "couldn't write resource\n");
73}
74
75static void test_ActivationFactories(void)
76{
77 HRESULT hr;
80 IInspectable *inspect = NULL;
81 ULONG ref;
82
83 hr = WindowsCreateString(L"Windows.Data.Xml.Dom.XmlDocument",
84 ARRAY_SIZE(L"Windows.Data.Xml.Dom.XmlDocument") - 1, &str);
85 ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
86
87 hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str2);
88 ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
89
91 ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
92
93 hr = RoGetActivationFactory(str2, &IID_IActivationFactory, (void **)&factory);
94 ok(hr == REGDB_E_CLASSNOTREG, "Unexpected hr %#lx.\n", hr);
95
96 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
97 todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
98 if(factory)
99 IActivationFactory_Release(factory);
100
101 hr = RoActivateInstance(str2, &inspect);
102 ok(hr == REGDB_E_CLASSNOTREG, "Unexpected hr %#lx.\n", hr);
103
104 hr = RoActivateInstance(str, &inspect);
105 todo_wine ok(hr == S_OK, "UNexpected hr %#lx.\n", hr);
106 if(inspect)
107 IInspectable_Release(inspect);
108
111
112 hr = WindowsCreateString(L"Wine.Test.Missing", ARRAY_SIZE(L"Wine.Test.Missing") - 1, &str);
113 ok(hr == S_OK, "WindowsCreateString returned %#lx.\n", hr);
114 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
115 ok(hr == REGDB_E_CLASSNOTREG, "RoGetActivationFactory returned %#lx.\n", hr);
116 ok(factory == NULL, "got factory %p.\n", factory);
118 hr = WindowsCreateString(L"Wine.Test.Class", ARRAY_SIZE(L"Wine.Test.Class") - 1, &str);
119 ok(hr == S_OK, "WindowsCreateString returned %#lx.\n", hr);
120 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
122 ok(hr == E_NOTIMPL || broken(hr == REGDB_E_CLASSNOTREG) /* <= w1064v1809 */,
123 "RoGetActivationFactory returned %#lx.\n", hr);
125 ok(factory == NULL, "got factory %p.\n", factory);
126 if (factory) IActivationFactory_Release(factory);
128 hr = WindowsCreateString(L"Wine.Test.Trusted", ARRAY_SIZE(L"Wine.Test.Trusted") - 1, &str);
129 ok(hr == S_OK, "WindowsCreateString returned %#lx.\n", hr);
130 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
131 ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /* <= w1064v1809 */,
132 "RoGetActivationFactory returned %#lx.\n", hr);
133 if (hr == REGDB_E_CLASSNOTREG)
134 ok(!factory, "got factory %p.\n", factory);
135 else
136 ok(!!factory, "got factory %p.\n", factory);
137 if (!factory) ref = 0;
138 else ref = IActivationFactory_Release(factory);
139 ok(ref == 0, "Release returned %lu\n", ref);
141
143}
144
145static APTTYPE check_thread_apttype;
148
150{
151 check_thread_apttype = 0xdeadbeef;
152 check_thread_aptqualifier = 0xdeadbeef;
154 return 0;
155}
156
157#define check_thread_apartment(a) check_thread_apartment_(__LINE__, FALSE, a)
158#define check_thread_apartment_broken(a) check_thread_apartment_(__LINE__, TRUE, a)
159static void check_thread_apartment_(unsigned int line, BOOL broken_fail, HRESULT expected_hr_thread)
160{
162
163 check_thread_hr = 0xdeadbeef;
167 ok_(__FILE__, line)(check_thread_hr == expected_hr_thread
168 || broken(broken_fail && expected_hr_thread == S_OK && check_thread_hr == CO_E_NOTINITIALIZED),
169 "got %#lx, expected %#lx.\n", check_thread_hr, expected_hr_thread);
171 {
172 ok_(__FILE__, line)(check_thread_apttype == APTTYPE_MTA, "got %d.\n", check_thread_apttype);
174 }
175}
176
178
180{
181 HRESULT hr;
182
184 ok(hr == S_OK, "got %#lx.\n", hr);
186
189 return 0;
190}
191
193{
195 HSTRING str;
196 HRESULT hr;
197
199 ok(hr == S_OK, "got %#lx.\n", hr);
200
201 hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str);
202 ok(hr == S_OK, "got %#lx.\n", hr);
203 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
204 ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr);
206
209
210 /* No CoUninitialize(), testing cleanup on thread exit. */
211 return 0;
212}
213
214static void test_implicit_mta(void)
215{
216 static const struct
217 {
218 BOOL ro_init;
219 BOOL mta;
220 }
221 tests[] =
222 {
223 { FALSE, FALSE },
224 { FALSE, TRUE },
225 { TRUE, FALSE },
226 { TRUE, TRUE },
227 };
228 APTTYPEQUALIFIER aptqualifier;
230 APTTYPE apttype;
231 unsigned int i;
233 HSTRING str;
234 HRESULT hr;
235
236 hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str);
237 ok(hr == S_OK, "got %#lx.\n", hr);
238 /* RoGetActivationFactory doesn't implicitly initialize COM. */
239 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
240 ok(hr == CO_E_NOTINITIALIZED, "got %#lx.\n", hr);
241
243
244 /* RoGetActivationFactory initializes implicit MTA. */
245 for (i = 0; i < ARRAY_SIZE(tests); ++i)
246 {
247 winetest_push_context("test %u", i);
248 if (tests[i].ro_init)
250 else
252 ok(hr == S_OK, "got %#lx.\n", hr);
254 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
255 ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr);
256 check_thread_apartment_broken(S_OK); /* Broken on Win8. */
257 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
258 ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr);
259 check_thread_apartment_broken(S_OK); /* Broken on Win8. */
260 if (tests[i].ro_init)
262 else
266 }
267
270
271 /* RoGetActivationFactory references implicit MTA in a current thread
272 * even if implicit MTA was already initialized: check with STA init
273 * after RoGetActivationFactory(). */
275 ok(!!thread, "failed.\n");
278
279 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
280 ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr);
282
283 hr = CoGetApartmentType(&apttype, &aptqualifier);
284 ok(hr == S_OK, "got %#lx.\n", hr);
285 ok(apttype == APTTYPE_MTA, "got %d.\n", apttype);
286 ok(aptqualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got %d.\n", aptqualifier);
287
289 ok(hr == S_OK, "got %#lx.\n", hr);
290
291 hr = CoGetApartmentType(&apttype, &aptqualifier);
292 ok(hr == S_OK, "got %#lx.\n", hr);
293 ok(apttype == APTTYPE_MAINSTA, "got %d.\n", apttype);
294 ok(aptqualifier == APTTYPEQUALIFIER_NONE, "got %d.\n", aptqualifier);
295
299 check_thread_apartment_broken(S_OK); /* Broken on Win8. */
302
303 /* RoGetActivationFactory references implicit MTA in a current thread
304 * even if implicit MTA was already initialized: check with STA init
305 * before RoGetActivationFactory(). */
307 ok(!!thread, "failed.\n");
310
312 ok(hr == S_OK, "got %#lx.\n", hr);
313
314 hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
315 ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr);
317
321 check_thread_apartment_broken(S_OK); /* Broken on Win8. */
324
325 /* Test implicit MTA apartment thread exit. */
327 ok(!!thread, "failed.\n");
329 check_thread_apartment_broken(S_OK); /* Broken on Win8. */
334
338}
339
340struct unk_impl
341{
343 LONG ref;
344};
345
346static inline struct unk_impl *impl_from_IUnknown(IUnknown *iface)
347{
348 return CONTAINING_RECORD(iface, struct unk_impl, IUnknown_iface);
349}
350
352{
354 {
355 *ppv = iface;
356 IUnknown_AddRef(iface);
357 return S_OK;
358 }
359
360 return E_NOINTERFACE;
361}
362
364{
366 || IsEqualGUID(riid, &IID_INoMarshal))
367 {
368 *ppv = iface;
369 IUnknown_AddRef(iface);
370 return S_OK;
371 }
372
373 return E_NOINTERFACE;
374}
375
377{
378 struct unk_impl *impl = impl_from_IUnknown(iface);
379 return InterlockedIncrement(&impl->ref);
380}
381
383{
384 struct unk_impl *impl = impl_from_IUnknown(iface);
385 return InterlockedDecrement(&impl->ref);
386}
387
388static const IUnknownVtbl unk_vtbl =
389{
393};
394
395static const IUnknownVtbl unk_no_marshal_vtbl =
396{
400};
401
403{
409};
410
412{
415 HRESULT hr;
416
417 winetest_push_context("%d %d %d", param->option, param->from_type, param->to_type);
418
419 RoInitialize(param->to_type);
420
421 unknown = NULL;
422 hr = IAgileReference_Resolve(param->agile_reference, &IID_IUnknown, (void **)&unknown);
423 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
424 ok(!!unknown, "Expected pointer not NULL.\n");
425 if (param->from_type == RO_INIT_MULTITHREADED && param->to_type == RO_INIT_MULTITHREADED)
426 {
427 ok(unknown == param->unk_obj, "Expected the same object.\n");
429 EXPECT_REF(param->unk_obj, param->option == AGILEREFERENCE_DEFAULT ? 5 : 6);
430 }
431 else
432 {
433 ok(unknown != param->unk_obj, "Expected a different object pointer.\n");
435 EXPECT_REF(param->unk_obj, param->option == AGILEREFERENCE_DEFAULT ? 4 : 5);
437 }
438 IUnknown_Release(unknown);
439
442 return 0;
443}
444
446{
448 struct unk_impl unk_no_marshal_obj = {{&unk_no_marshal_vtbl}, 1};
449 struct unk_impl unk_obj = {{&unk_vtbl}, 1};
452 RO_INIT_TYPE from_type, to_type;
453 IUnknown *unknown, *unknown2;
454 IAgileObject *agile_object;
456 HRESULT hr;
457 DWORD ret;
458
460 {
461 for (from_type = RO_INIT_SINGLETHREADED; from_type <= RO_INIT_MULTITHREADED; from_type++)
462 {
463 winetest_push_context("%d %d", option, from_type);
464
466 ok(hr == CO_E_NOTINITIALIZED, "Got unexpected hr %#lx.\n", hr);
467
468 RoInitialize(from_type);
469
471 EXPECT_REF(&unk_obj, 1);
472
473 /* Invalid option */
475 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
476
477 /* Non-existent interface for the object */
478 hr = RoGetAgileReference(option, &IID_IActivationFactory, &unk_obj.IUnknown_iface, &agile_reference);
479 ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
480
481 /* Objects that implements INoMarshal */
483 ok(hr == CO_E_NOT_SUPPORTED, "Got unexpected hr %#lx.\n", hr);
484
485 /* Create agile reference object */
487 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
488 ok(!!agile_reference, "Got unexpected agile_reference.\n");
490 EXPECT_REF(&unk_obj, 2);
491
492 /* Check the created agile reference object has IAgileObject */
493 hr = IAgileReference_QueryInterface(agile_reference, &IID_IAgileObject, (void **)&agile_object);
494 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
495 IAgileObject_Release(agile_object);
496
497 /* Resolve once */
498 unknown = NULL;
499 hr = IAgileReference_Resolve(agile_reference, &IID_IUnknown, (void **)&unknown);
500 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
501 ok(!!unknown, "Expected pointer not NULL.\n");
502 ok(unknown == &unk_obj.IUnknown_iface, "Expected the same object.\n");
504 EXPECT_REF(&unk_obj, 3);
505
506 /* Resolve twice */
507 unknown2 = NULL;
508 hr = IAgileReference_Resolve(agile_reference, &IID_IUnknown, (void **)&unknown2);
509 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
510 ok(!!unknown2, "Expected pointer not NULL.\n");
511 ok(unknown2 == &unk_obj.IUnknown_iface, "Expected the same object.\n");
513 EXPECT_REF(&unk_obj, 4);
514
515 /* Resolve in another apartment */
516 for (to_type = RO_INIT_SINGLETHREADED; to_type <= RO_INIT_MULTITHREADED; to_type++)
517 {
518 param.option = option;
519 param.from_type = from_type;
520 param.to_type = to_type;
521 param.agile_reference = agile_reference;
522 param.unk_obj = &unk_obj.IUnknown_iface;
524 flush_events();
526 ok(!ret, "WaitForSingleObject failed, error %ld.\n", GetLastError());
527 }
528
529 IUnknown_Release(unknown2);
530 IUnknown_Release(unknown);
531 IAgileReference_Release(agile_reference);
532 EXPECT_REF(&unk_obj, 1);
533
536 }
537 }
538}
539
541{
542 BOOL ret;
543
544 load_resource(L"wine.combase.test.dll");
545
549
550 SetLastError(0xdeadbeef);
551 ret = DeleteFileW(L"wine.combase.test.dll");
553 ok(ret, "Failed to delete file, error %lu\n", GetLastError());
554}
#define CO_E_NOTINITIALIZED
static struct apartment * mta
Definition: apartment.c:50
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define msg(x)
Definition: auth_time.c:54
#define ARRAY_SIZE(A)
Definition: main.h:20
static HANDLE thread
Definition: service.c:33
const GUID IID_IUnknown
AgileReferenceOptions
Definition: combaseapi.h:48
@ AGILEREFERENCE_DEFAULT
Definition: combaseapi.h:49
@ AGILEREFERENCE_DELAYEDMARSHAL
Definition: combaseapi.h:50
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI CoGetApartmentType(APTTYPE *type, APTTYPEQUALIFIER *qualifier)
Definition: combase.c:2928
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
Definition: combase.c:2803
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI RoActivateInstance(HSTRING classid, IInspectable **instance)
Definition: roapi.c:219
HRESULT WINAPI DECLSPEC_HOTPATCH RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_factory)
Definition: roapi.c:146
HRESULT WINAPI RoInitialize(RO_INIT_TYPE type)
Definition: roapi.c:123
HRESULT WINAPI RoGetAgileReference(enum AgileReferenceOptions option, REFIID riid, IUnknown *obj, IAgileReference **agile_reference)
Definition: roapi.c:360
void WINAPI RoUninitialize(void)
Definition: roapi.c:138
HRESULT WINAPI WindowsCreateString(LPCWSTR ptr, UINT32 len, HSTRING *out)
Definition: string.c:87
HRESULT WINAPI WindowsDeleteString(HSTRING str)
Definition: string.c:143
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define CloseHandle
Definition: compat.h:739
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
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 GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLfloat param
Definition: glext.h:5796
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
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const char * filename
Definition: ioapi.h:137
#define debugstr_w
Definition: kernel32.h:32
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
#define todo_wine_if(is_todo)
Definition: minitest.h:81
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
#define todo_wine
Definition: minitest.h:80
__u16 time
Definition: mkdosfs.c:8
#define CREATE_ALWAYS
Definition: disk.h:72
static PVOID ptr
Definition: dispmode.c:27
static struct test_info tests[]
static DWORD CALLBACK test_RoGetAgileReference_thread_proc(void *arg)
Definition: roapi.c:411
static DWORD WINAPI mta_init_implicit_thread(void *dummy)
Definition: roapi.c:192
static void load_resource(const WCHAR *filename)
Definition: roapi.c:57
static HRESULT check_thread_hr
Definition: roapi.c:147
static void test_implicit_mta(void)
Definition: roapi.c:214
#define check_thread_apartment_broken(a)
Definition: roapi.c:158
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
Definition: roapi.c:32
static DWORD WINAPI mta_init_thread(void *dummy)
Definition: roapi.c:179
static HRESULT WINAPI unk_no_marshal_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: roapi.c:363
static ULONG WINAPI unk_Release(IUnknown *iface)
Definition: roapi.c:382
static struct unk_impl * impl_from_IUnknown(IUnknown *iface)
Definition: roapi.c:346
static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: roapi.c:351
static HANDLE mta_init_thread_init_done_event
Definition: roapi.c:177
static const IUnknownVtbl unk_no_marshal_vtbl
Definition: roapi.c:395
static void flush_events(void)
Definition: roapi.c:40
static ULONG WINAPI unk_AddRef(IUnknown *iface)
Definition: roapi.c:376
static void test_RoGetAgileReference(void)
Definition: roapi.c:445
static APTTYPEQUALIFIER check_thread_aptqualifier
Definition: roapi.c:146
static void check_thread_apartment_(unsigned int line, BOOL broken_fail, HRESULT expected_hr_thread)
Definition: roapi.c:159
#define EXPECT_REF(obj, ref)
Definition: roapi.c:31
static const IUnknownVtbl unk_vtbl
Definition: roapi.c:388
#define check_thread_apartment(a)
Definition: roapi.c:157
static HANDLE mta_init_thread_done_event
Definition: roapi.c:177
static void test_ActivationFactories(void)
Definition: roapi.c:75
static DWORD WINAPI check_apartment_thread(void *dummy)
Definition: roapi.c:149
static APTTYPE check_thread_apttype
Definition: roapi.c:145
#define GENERIC_WRITE
Definition: nt_native.h:90
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:279
@ COINIT_MULTITHREADED
Definition: objbase.h:280
enum APTTYPE_MTA
@ APTTYPEQUALIFIER_IMPLICIT_MTA
@ APTTYPEQUALIFIER_NONE
enum _APTTYPEQUALIFIER APTTYPEQUALIFIER
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
RO_INIT_TYPE
Definition: roapi.h:25
@ RO_INIT_SINGLETHREADED
Definition: roapi.h:26
@ RO_INIT_MULTITHREADED
Definition: roapi.h:27
const WCHAR * str
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
Definition: parser.h:35
HRESULT hr
Definition: shlfolder.c:183
Definition: main.c:439
Definition: fci.c:127
Definition: parser.c:49
Definition: getopt.h:109
Definition: send.c:48
enum AgileReferenceOptions option
Definition: roapi.c:404
IAgileReference * agile_reference
Definition: roapi.c:407
Definition: api.c:544
IUnknown IUnknown_iface
Definition: api.c:545
LONG ref
Definition: api.c:546
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:3801
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CO_E_NOT_SUPPORTED
Definition: winerror.h:3510
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define QS_ALLINPUT
Definition: winuser.h:914
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180