ReactOS  0.4.13-dev-73-gcfe54aa
ole_server.c
Go to the documentation of this file.
1 /*
2  * OLE client/server test suite
3  *
4  * Copyright 2013 Dmitry Timoshkov
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #define COBJMACROS
22 #define CONST_VTABLE
23 
24 #include <windows.h>
25 #include <exdisp.h>
26 #include <tlhelp32.h>
27 #include <stdio.h>
28 #include <assert.h>
29 #include "wine/test.h"
30 
31 #include <initguid.h>
32 DEFINE_GUID(CLSID_WineTestObject, 0xdeadbeef,0xdead,0xbeef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef);
33 DEFINE_GUID(CLSID_UnknownUnmarshal,0x4c1e39e1,0xe3e3,0x4296,0xaa,0x86,0xec,0x93,0x8d,0x89,0x6e,0x92);
34 
36 {
38 };
39 
40 static const struct
41 {
42  const GUID *guid;
43  const char *name;
44 } guid_name[] =
45 {
46 #define GUID_NAME(guid) \
47  { &IID_##guid, #guid }
56  { &CLSID_IdentityUnmarshal, "CLSID_IdentityUnmarshal" },
57  { &CLSID_UnknownUnmarshal, "CLSID_UnknownUnmarshal" },
58 #undef GUID_NAME
59 };
60 
62 
63 static const char *debugstr_guid(const GUID *guid)
64 {
65  int i;
66 
67  if (!guid) return "(null)";
68 
69  for (i = 0; i < ARRAY_SIZE(guid_name); i++)
70  {
72  return guid_name[i].name;
73  }
74 
75  return wine_dbgstr_guid(guid);
76 }
77 
78 /******************************* OLE server *******************************/
79 typedef struct
80 {
83 } UnknownImpl;
84 
85 static inline UnknownImpl *impl_from_IUnknown(IUnknown *iface)
86 {
87  return CONTAINING_RECORD(iface, UnknownImpl, IUnknown_iface);
88 }
89 
91  REFIID iid, void **ppv)
92 {
94 
95  trace("server: unknown_QueryInterface: %p,%s,%p\n", iface, debugstr_guid(iid), ppv);
96 
97  if (!ppv) return E_INVALIDARG;
98 
99  if (IsEqualIID(&IID_IUnknown, iid))
100  {
101  *ppv = &This->IUnknown_iface;
102  IUnknown_AddRef(&This->IUnknown_iface);
103  return S_OK;
104  }
105 
106  *ppv = NULL;
107  return E_NOINTERFACE;
108 }
109 
111 {
114 
116 
117  trace("server: unknown_AddRef: %p, ref %u\n", iface, ref);
118  return ref;
119 }
120 
122 {
125 
127 
128  trace("server: unknown_Release: %p, ref %u\n", iface, ref);
129  if (ref == 0) HeapFree(GetProcessHeap(), 0, This);
130  return ref;
131 }
132 
133 static const IUnknownVtbl UnknownImpl_Vtbl =
134 {
138 };
139 
140 typedef struct
141 {
142  IClassFactory IClassFactory_iface;
143  LONG ref;
145 
147 {
148  return CONTAINING_RECORD(iface, ClassFactoryImpl, IClassFactory_iface);
149 }
150 
152  REFIID iid, void **ppv)
153 {
155 
156  trace("server: factory_QueryInterface: %p,%s,%p\n", iface, debugstr_guid(iid), ppv);
157 
158  if (!ppv) return E_INVALIDARG;
159 
160  if (IsEqualIID(&IID_IUnknown, iid) ||
162  {
163  IClassFactory_AddRef(&This->IClassFactory_iface);
164  *ppv = &This->IClassFactory_iface;
165  return S_OK;
166  }
167 
168  *ppv = NULL;
169  return E_NOINTERFACE;
170 }
171 
173 {
176 
178 
179  trace("server: factory_AddRef: %p, ref %u\n", iface, ref);
180  return ref;
181 }
182 
184 {
187 
189 
190  trace("server: factory_Release: %p, ref %u\n", iface, ref);
191  return ref;
192 }
193 
195  IUnknown *punkouter, REFIID iid, void **ppv)
196 {
198  HRESULT hr;
199 
200  trace("server: factory_CreateInstance: %p,%s,%p\n", iface, debugstr_guid(iid), ppv);
201 
202  if (punkouter) return CLASS_E_NOAGGREGATION;
203 
204  unknown = HeapAlloc(GetProcessHeap(), 0, sizeof(*unknown));
205  if (!unknown) return E_OUTOFMEMORY;
206 
207  unknown->IUnknown_iface.lpVtbl = &UnknownImpl_Vtbl;
208  unknown->ref = 0;
209  IUnknown_AddRef(&unknown->IUnknown_iface);
210 
211  hr = IUnknown_QueryInterface(&unknown->IUnknown_iface, iid, ppv);
212  IUnknown_Release(&unknown->IUnknown_iface);
213 
214  return hr;
215 }
216 
218 {
220 
221  trace("server: factory_LockServer: %p,%d, ref %u\n", iface, lock, ref);
222  return S_OK;
223 }
224 
225 static const IClassFactoryVtbl ClassFactoryImpl_Vtbl =
226 {
232 };
233 
235 
236 static void ole_server(void)
237 {
238  HRESULT hr;
239  DWORD key;
240 
241  trace("server: starting %u\n", GetCurrentProcessId());
242 
244  if (hr == S_OK)
245  {
246  trace("server: registering class object\n");
247  hr = CoRegisterClassObject(&CLSID_WineTestObject, (IUnknown *)&factory,
248  CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &key);
249  if (hr == S_OK)
250  {
251  HANDLE done_event, init_done_event;
252 
253  done_event = OpenEventA(SYNCHRONIZE, FALSE, "ole_server_done_event");
254  ok(done_event != 0, "server: OpenEvent error %d\n", GetLastError());
255  init_done_event = OpenEventA(EVENT_MODIFY_STATE, FALSE, "ole_server_init_done_event");
256  ok(init_done_event != 0, "server: OpenEvent error %d\n", GetLastError());
257 
258  SetEvent(init_done_event);
259 
260  trace("server: waiting for requests\n");
261  WaitForSingleObject(done_event, INFINITE);
262 
263  /* 1 remainining class ref is supposed to be cleared by CoRevokeClassObject */
264  ok(class_ref == 1, "expected 1 class refs, got %d\n", class_ref);
265  ok(!obj_ref, "expected 0 object refs, got %d\n", obj_ref);
266  ok(!server_locks, "expected 0 server locks, got %d\n", server_locks);
267 
268  CloseHandle(done_event);
269  CloseHandle(init_done_event);
270  if (0)
271  {
272  /* calling CoRevokeClassObject terminates process under Win7 */
273  trace("call CoRevokeClassObject\n");
275  trace("ret CoRevokeClassObject\n");
276  }
277  }
278  trace("server: call CoUninitialize\n");
279  CoUninitialize();
280  trace("server: ret CoUninitialize\n");
281  }
282 
283  trace("server: exiting %u\n", GetCurrentProcessId());
284 }
285 
286 /******************************* OLE client *******************************/
287 static BOOL register_server(const char *server, BOOL inproc_handler)
288 {
289  static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0};
290  DWORD ret;
291  HKEY root;
292  WCHAR buf[39 + 6];
293  char server_path[MAX_PATH];
294 
295  lstrcpyA(server_path, server);
296  lstrcatA(server_path, " ole_server");
297 
298  lstrcpyW(buf, clsidW);
299  StringFromGUID2(&CLSID_WineTestObject, buf + 6, 39);
300 
303  if (ret == ERROR_SUCCESS)
304  {
305  ret = RegSetValueA(root, "LocalServer32", REG_SZ, server_path, strlen(server_path));
306  ok(ret == ERROR_SUCCESS, "RegSetValue error %u\n", ret);
307 
308  if (inproc_handler)
309  {
310  ret = RegSetValueA(root, "InprocHandler32", REG_SZ, "ole32.dll", 9);
311  ok(ret == ERROR_SUCCESS, "RegSetValue error %u\n", ret);
312  }
313 
314  RegCloseKey(root);
315  }
316 
317  return ret == ERROR_SUCCESS;
318 }
319 
320 static void unregister_server(void)
321 {
322  static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0};
323  DWORD ret;
324  HKEY root;
325  WCHAR buf[39 + 6];
326 
327  lstrcpyW(buf, clsidW);
328  StringFromGUID2(&CLSID_WineTestObject, buf + 6, 39);
329 
331  DELETE, NULL, &root, NULL);
332  if (ret == ERROR_SUCCESS)
333  {
334  ret = RegDeleteKeyA(root, "InprocHandler32");
335  ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
336  ret = RegDeleteKeyA(root, "LocalServer32");
337  ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
338  ret = RegDeleteKeyA(root, "");
339  ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
340  RegCloseKey(root);
341  }
342 }
343 
344 static HANDLE start_server(const char *argv0)
345 {
347  STARTUPINFOA si;
349  char cmdline[MAX_PATH * 2];
350  BOOL ret;
351 
352  memset(&si, 0, sizeof(si));
353  si.cb = sizeof(si);
357  si.hStdError = si.hStdOutput;
358 
359  sa.nLength = sizeof(sa);
360  sa.lpSecurityDescriptor = NULL;
361  sa.bInheritHandle = TRUE;
362 
363  sprintf(cmdline, "\"%s\" ole_server -server", argv0);
364  ret = CreateProcessA(argv0, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
365  ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError());
366  if (!ret) return 0;
367 
368  CloseHandle(pi.hThread);
369  return pi.hProcess;
370 }
371 
373 {
374  CLSID clsid = CLSID_WineTestObject;
375  HRESULT hr;
377  IUnknown *unknown;
378  IOleObject *oleobj;
379  IRunnableObject *runobj;
380  DWORD ret;
381  HANDLE mapping, done_event, init_done_event, process;
382  struct winetest_info *info;
383  int argc;
384  char **argv;
385 
386  mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_ole_server");
387  ok(mapping != 0, "CreateFileMapping failed\n");
389 
391 
392  done_event = CreateEventA(NULL, TRUE, FALSE, "ole_server_done_event");
393  ok(done_event != 0, "CreateEvent error %d\n", GetLastError());
394  init_done_event = CreateEventA(NULL, TRUE, FALSE, "ole_server_init_done_event");
395  ok(init_done_event != 0, "CreateEvent error %d\n", GetLastError());
396 
397  if (argc > 2)
398  {
399  if (!lstrcmpiA(argv[2], "-Embedding"))
400  {
401  trace("server: Refusing to be run by ole32\n");
402  return;
403  }
404 
405  if (!lstrcmpiA(argv[2], "-server"))
406  {
407  info->child_failures = 0;
408  ole_server();
409  info->child_failures = winetest_get_failures();
410  return;
411  }
412 
413  trace("server: Unknown parameter: %s\n", argv[2]);
414  return;
415  }
416 
417  if (!register_server(argv[0], FALSE))
418  {
419  win_skip("not enough permissions to create a server CLSID key\n");
420  return;
421  }
422 
423  if (!(process = start_server(argv[0])))
424  {
426  return;
427  }
428  WaitForSingleObject(init_done_event, 5000);
429 
431  ok(hr == S_OK, "OleInitialize error %#x\n", hr);
432 
433  hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void **)&unknown);
434  ok(hr == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %#x\n", hr);
435 
436  if (!register_server(argv[0], TRUE))
437  {
438  win_skip("not enough permissions to create a server CLSID key\n");
440  return;
441  }
442 
443  trace("call CoCreateInstance(&IID_NULL)\n");
444  hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_NULL, (void **)&unknown);
445  trace("ret CoCreateInstance(&IID_NULL)\n");
446  ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
447 
448  /* in-process handler supports IID_IUnknown starting from Vista */
449  trace("call CoCreateInstance(&IID_IUnknown)\n");
450  hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void **)&unknown);
451  trace("ret CoCreateInstance(&IID_IUnknown)\n");
452  ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /* XP,win2000 and earlier */, "CoCreateInstance(IID_IUnknown) error %#x\n", hr);
453  if (hr != S_OK)
454  {
455  win_skip("In-process handler doesn't support IID_IUnknown on this platform\n");
456  goto test_local_server;
457  }
458 
459  trace("call CoCreateInstance(&IID_IOleObject)\n");
460  hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IOleObject, (void **)&oleobj);
461  trace("ret CoCreateInstance(&IID_IOleObject)\n");
462  ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
463 
464  trace("call IUnknown_QueryInterface(&IID_IRunnableObject)\n");
465  hr = IUnknown_QueryInterface(unknown, &IID_IRunnableObject, (void **)&runobj);
466  trace("ret IUnknown_QueryInterface(&IID_IRunnableObject)\n");
467  ok(hr == S_OK, "QueryInterface(&IID_IRunnableObject) error %#x\n", hr);
468 
469  ret = IRunnableObject_IsRunning(runobj);
470  ok(!ret, "expected 0, got %d\n", ret);
471 
472  trace("call OleRun\n");
473  hr = OleRun(unknown);
474  trace("ret OleRun\n");
475 todo_wine
476  ok(hr == S_OK, "OleRun error %#x\n", hr);
477 
478  ret = IRunnableObject_IsRunning(runobj);
479 todo_wine
480  ok(ret == 1, "expected 1, got %d\n", ret);
481 
482  trace("call IRunnableObject_Release\n");
483  ret = IRunnableObject_Release(runobj);
484  trace("ret IRunnableObject_Release\n");
485  ok(ret == 1, "expected ref 1, got %u\n", ret);
486 
487  trace("call IUnknown_QueryInterface(&IID_IOleObject)\n");
488  hr = IUnknown_QueryInterface(unknown, &IID_IOleObject, (void **)&oleobj);
489  trace("ret IUnknown_QueryInterface(&IID_IOleObject)\n");
490  ok(hr == S_OK, "QueryInterface(&IID_IOleObject) error %#x\n", hr);
491 
492  trace("call IOleObject_Release\n");
493  ret = IOleObject_Release(oleobj);
494  trace("ret IOleObject_Release\n");
495  ok(ret == 1, "expected ref 1, got %u\n", ret);
496 
497  trace("call IUnknown_Release\n");
498  ret = IUnknown_Release(unknown);
499  trace("ret IUnknown_Release\n");
500  ok(!ret, "expected ref 0, got %u\n", ret);
501 
503  /* local server supports IID_IUnknown */
504  trace("call CoCreateInstance(&IID_IUnknown)\n");
505  hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IUnknown, (void **)&unknown);
506  trace("ret CoCreateInstance(&IID_IUnknown)\n");
507  ok(hr == S_OK, "CoCreateInstance(IID_IUnknown) error %#x\n", hr);
508 
509  trace("call IUnknown_QueryInterface(&IID_IRunnableObject)\n");
510  hr = IUnknown_QueryInterface(unknown, &IID_IRunnableObject, (void **)&runobj);
511  trace("ret IUnknown_QueryInterface(&IID_IRunnableObject)\n");
512  ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
513 
514  trace("call OleRun\n");
515  hr = OleRun(unknown);
516  trace("ret OleRun\n");
517  ok(hr == S_OK, "OleRun error %#x\n", hr);
518 
519  trace("call IUnknown_QueryInterface(&IID_IOleObject)\n");
520  hr = IUnknown_QueryInterface(unknown, &IID_IOleObject, (void **)&oleobj);
521  trace("ret IUnknown_QueryInterface(&IID_IOleObject)\n");
522  ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
523 
524  trace("call IUnknown_Release\n");
525  ret = IUnknown_Release(unknown);
526  trace("ret IUnknown_Release\n");
527  ok(!ret, "expected ref 0, got %u\n", ret);
528 
529  trace("call CoGetClassObject(&IID_IClassFactory)\n");
530  hr = CoGetClassObject(&clsid, CLSCTX_LOCAL_SERVER, NULL, &IID_IClassFactory, (void **)&factory);
531  trace("ret CoGetClassObject(&IID_IClassFactory)\n");
532  ok(hr == S_OK, "CoGetClassObject error %#x\n", hr);
533 
534  trace("call IClassFactory_CreateInstance(&IID_NULL)\n");
535  hr = IClassFactory_CreateInstance(factory, NULL, &IID_NULL, (void **)&oleobj);
536  trace("ret IClassFactory_CreateInstance(&IID_NULL)\n");
537  ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
538 
539  trace("call IClassFactory_CreateInstance(&IID_IOleObject)\n");
540  hr = IClassFactory_CreateInstance(factory, NULL, &IID_IOleObject, (void **)&oleobj);
541  trace("ret IClassFactory_CreateInstance(&IID_IOleObject)\n");
542  ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
543 
544  trace("call IClassFactory_Release\n");
545  ret = IClassFactory_Release(factory);
546  trace("ret IClassFactory_Release\n");
547  ok(!ret, "expected ref 0, got %u\n", ret);
548 
549  trace("signalling termination\n");
550  SetEvent(done_event);
551  ret = WaitForSingleObject(process, 10000);
552  ok(ret == WAIT_OBJECT_0, "server failed to terminate\n");
553 
554  OleUninitialize();
555 
557 
558  if (info->child_failures)
559  {
560  trace("%d failures in child process\n", info->child_failures);
561  winetest_add_failures(info->child_failures);
562  }
563 }
static HRESULT WINAPI ClassFactoryImpl_QueryInterface(IClassFactory *iface, REFIID iid, void **ppv)
Definition: ole_server.c:151
const CLSID CLSID_IdentityUnmarshal
IUnknown IUnknown_iface
Definition: ole_server.c:81
static int argc
Definition: ServiceArgs.c:12
#define trace(...)
Definition: kmt_test.h:217
LONG winetest_get_failures(void)
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
void winetest_add_failures(LONG new_failures)
#define E_NOINTERFACE
Definition: winerror.h:2364
static rfbScreenInfoPtr server
Definition: vnc.c:74
const GUID * guid
Definition: ole_server.c:42
rwlock_t lock
Definition: tcpcore.h:1163
#define ERROR_SUCCESS
Definition: deptool.c:10
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
#define MapViewOfFile
Definition: compat.h:402
static ULONG WINAPI UnknownImpl_AddRef(IUnknown *iface)
Definition: ole_server.c:110
HRESULT hr
Definition: shlfolder.c:183
static const struct @1615 guid_name[]
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define KEY_READ
Definition: nt_native.h:1023
static void ole_server(void)
Definition: ole_server.c:236
struct _root root
HRESULT WINAPI DECLSPEC_HOTPATCH OleRun(LPUNKNOWN pUnknown)
Definition: ole2.c:1208
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HANDLE process
Definition: process.c:76
const char * wine_dbgstr_guid(const GUID *guid)
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
DWORD dwFlags
Definition: winbase.h:807
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
Definition: reg.c:4990
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define argv
Definition: mplay32.c:18
Definition: send.c:47
static const char * debugstr_guid(const GUID *guid)
Definition: ole_server.c:63
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1094
struct _test_info info[]
Definition: SetCursorPos.c:19
#define sprintf(buf, format,...)
Definition: sprintf.c:55
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
Definition: main.c:440
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
Definition: synch.c:615
GLenum GLint ref
Definition: glext.h:6028
#define ok(value,...)
static LONG obj_ref
Definition: ole_server.c:61
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:583
#define FILE_MAP_READ
Definition: compat.h:427
static HANDLE start_server(const char *argv0)
Definition: ole_server.c:344
#define STD_INPUT_HANDLE
Definition: winbase.h:264
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject(DWORD dwRegister)
Definition: compobj.c:1089
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3012
const GUID IID_IOleObject
#define KEY_WRITE
Definition: nt_native.h:1031
#define STARTF_USESTDHANDLES
Definition: winbase.h:480
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:796
#define GetProcessHeap()
Definition: compat.h:395
static const WCHAR clsidW[]
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static LONG class_ref
Definition: ole_server.c:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const IClassFactoryVtbl ClassFactoryImpl_Vtbl
Definition: ole_server.c:225
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define FILE_MAP_WRITE
Definition: winbase.h:154
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4772
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
DEFINE_GUID(CLSID_WineTestObject, 0xdeadbeef, 0xdead, 0xbeef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef)
HANDLE hStdOutput
Definition: winbase.h:812
static ClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: ole_server.c:146
static HRESULT WINAPI ClassFactoryImpl_LockServer(IClassFactory *iface, BOOL lock)
Definition: ole_server.c:217
Definition: id3.c:18
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int winetest_get_mainargs(char ***pargv)
static void unregister_server(void)
Definition: ole_server.c:320
START_TEST(ole_server)
Definition: ole_server.c:372
static void test_local_server(void)
Definition: marshal.c:3818
static DWORD pi
Definition: protocol.c:150
static LONG server_locks
Definition: ole_server.c:61
int ret
REFCLSID clsid
Definition: msctf.c:84
#define IID_NULL
Definition: guiddef.h:93
#define todo_wine
Definition: test.h:154
#define InterlockedDecrement
Definition: armddk.h:52
HKEY key
Definition: reg.c:42
static char argv0[MAX_PATH]
Definition: shlexec.c:56
#define STD_OUTPUT_HANDLE
Definition: winbase.h:265
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define SYNCHRONIZE
Definition: nt_native.h:61
const GUID IID_IRunnableObject
#define GUID_NAME(guid)
#define broken(x)
Definition: _sntprintf.h:21
static ULONG WINAPI UnknownImpl_Release(IUnknown *iface)
Definition: ole_server.c:121
static BOOL register_server(const char *server, BOOL inproc_handler)
Definition: ole_server.c:287
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1225
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2806
#define S_OK
Definition: intsafe.h:59
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define InterlockedIncrement
Definition: armddk.h:53
static const IUnknownVtbl UnknownImpl_Vtbl
Definition: ole_server.c:133
#define lstrcpyW
Definition: compat.h:406
static ULONG WINAPI ClassFactoryImpl_AddRef(IClassFactory *iface)
Definition: ole_server.c:172
HANDLE hStdInput
Definition: winbase.h:811
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
#define ARRAY_SIZE(a)
Definition: main.h:24
static HRESULT WINAPI UnknownImpl_QueryInterface(IUnknown *iface, REFIID iid, void **ppv)
Definition: ole_server.c:90
static HRESULT WINAPI ClassFactoryImpl_CreateInstance(IClassFactory *iface, IUnknown *punkouter, REFIID iid, void **ppv)
Definition: ole_server.c:194
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1
static ClassFactoryImpl factory
Definition: ole_server.c:234
#define EVENT_MODIFY_STATE
Definition: winbase.h:163
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
const char * name
Definition: ole_server.c:43
static ULONG WINAPI ClassFactoryImpl_Release(IClassFactory *iface)
Definition: ole_server.c:183
#define INFINITE
Definition: serial.h:102
const GUID IID_IClassFactory
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:233
#define memset(x, y, z)
Definition: compat.h:39
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define win_skip
Definition: test.h:141
HANDLE hStdError
Definition: winbase.h:813
#define HeapFree(x, y, z)
Definition: compat.h:394
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
Definition: filemap.c:23
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188
struct ClassFactoryImpl ClassFactoryImpl
#define DELETE
Definition: nt_native.h:57
static UnknownImpl * impl_from_IUnknown(IUnknown *iface)
Definition: ole_server.c:85
Definition: path.c:42
#define PAGE_READWRITE
Definition: nt_native.h:1304
LONG child_failures
Definition: ole_server.c:37
#define REG_SZ
Definition: layer.c:22