ReactOS 0.4.16-dev-2332-g4cba65d
compobj.c
Go to the documentation of this file.
1/*
2 * COMPOBJ library
3 *
4 * Copyright 1995 Martin von Loewis
5 * Copyright 1998 Justin Bradford
6 * Copyright 1999 Francis Beaudet
7 * Copyright 1999 Sylvain St-Germain
8 * Copyright 2002 Marcus Meissner
9 * Copyright 2004 Mike Hearn
10 * Copyright 2005-2006 Robert Shearman (for CodeWeavers)
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 *
26 * Note
27 * 1. COINIT_MULTITHREADED is 0; it is the lack of COINIT_APARTMENTTHREADED
28 * Therefore do not test against COINIT_MULTITHREADED
29 *
30 * TODO list: (items bunched together depend on each other)
31 *
32 * - Implement the OXID resolver so we don't need magic endpoint names for
33 * clients and servers to meet up
34 *
35 */
36
37#include <stdarg.h>
38#include <stdio.h>
39#include <string.h>
40#include <assert.h>
41
42#define COBJMACROS
43#include "ntstatus.h"
44#define WIN32_NO_STATUS
45#include "windef.h"
46#include "winbase.h"
47#include "winerror.h"
48#include "winreg.h"
49#include "winuser.h"
50#define USE_COM_CONTEXT_DEF
51#include "objbase.h"
52#include "ole2.h"
53#include "ole2ver.h"
54#include "ctxtcall.h"
55#include "dde.h"
56#include "servprov.h"
57
58#ifndef __REACTOS__
59#include "initguid.h"
60#endif
61#include "compobj_private.h"
62#include "moniker.h"
63
64#include "wine/debug.h"
65
67
68/****************************************************************************
69 * This section defines variables internal to the COM module.
70 */
71
73{
79};
80
82{
83 ULONG size;
86 GUID clsid;
87 GUID alias;
89 GUID tlbid;
101};
102
104{
105 ULONG size;
106 DWORD mask;
107 GUID iid;
109 GUID tlbid;
110 GUID base;
113};
114
116{
117 ULONG size;
120};
121
122enum class_reg_data_origin
123{
126};
127
128struct class_reg_data
129{
130 enum class_reg_data_origin origin;
131 union
132 {
133 struct
134 {
135 const WCHAR *module_name;
139 HKEY hkey;
140 } u;
141};
142
144{
145 switch (aspect)
146 {
147 case DVASPECT_CONTENT:
148 return MiscStatusContent;
149 case DVASPECT_THUMBNAIL:
150 return MiscStatusThumbnail;
151 case DVASPECT_ICON:
152 return MiscStatusIcon;
153 case DVASPECT_DOCPRINT:
154 return MiscStatusDocPrint;
155 default:
156 return MiscStatus;
157 };
158}
159
161{
162 ACTCTX_SECTION_KEYED_DATA data;
163
164 data.cbSize = sizeof(data);
165 if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
166 clsid, &data))
167 {
168 struct comclassredirect_data *comclass = (struct comclassredirect_data*)data.lpData;
170 ULONG miscmask = (comclass->flags >> 8) & 0xff;
171
172 if (!(miscmask & misc))
173 {
174 if (!(miscmask & MiscStatus))
175 {
176 *status = 0;
177 return TRUE;
178 }
179 misc = MiscStatus;
180 }
181
182 switch (misc)
183 {
184 case MiscStatus:
185 *status = comclass->miscstatus;
186 break;
187 case MiscStatusIcon:
188 *status = comclass->miscstatusicon;
189 break;
191 *status = comclass->miscstatuscontent;
192 break;
194 *status = comclass->miscstatusthumbnail;
195 break;
197 *status = comclass->miscstatusdocprint;
198 break;
199 default:
200 ;
201 };
202
203 return TRUE;
204 }
205 else
206 return FALSE;
207}
208
209/* wrapper for NtCreateKey that creates the key recursively if necessary */
211{
212 NTSTATUS status = NtCreateKey( (HANDLE *)retkey, access, attr, 0, NULL, 0, NULL );
213
215 {
216 HANDLE subkey;
217 WCHAR *buffer = attr->ObjectName->Buffer;
218 DWORD pos = 0, i = 0, len = attr->ObjectName->Length / sizeof(WCHAR);
220 OBJECT_ATTRIBUTES attr2 = *attr;
221
222 while (i < len && buffer[i] != '\\') i++;
223 if (i == len) return status;
224
225 attr2.ObjectName = &str;
226
227 while (i < len)
228 {
229 str.Buffer = buffer + pos;
230 str.Length = (i - pos) * sizeof(WCHAR);
231 status = NtCreateKey( &subkey, access, &attr2, 0, NULL, 0, NULL );
232 if (attr2.RootDirectory != attr->RootDirectory) NtClose( attr2.RootDirectory );
233 if (status) return status;
234 attr2.RootDirectory = subkey;
235 while (i < len && buffer[i] == '\\') i++;
236 pos = i;
237 while (i < len && buffer[i] != '\\') i++;
238 }
239 str.Buffer = buffer + pos;
240 str.Length = (i - pos) * sizeof(WCHAR);
241 status = NtCreateKey( (PHANDLE)retkey, access, &attr2, 0, NULL, 0, NULL );
242 if (attr2.RootDirectory != attr->RootDirectory) NtClose( attr2.RootDirectory );
243 }
244 return status;
245}
246
248
249#ifndef RTL_CONSTANT_STRING
250#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
251#endif
252
253/* create the special HKEY_CLASSES_ROOT key */
255{
256 HKEY hkey, ret = 0;
258 UNICODE_STRING name = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\Classes");
259
260 attr.Length = sizeof(attr);
261 attr.RootDirectory = 0;
262 attr.ObjectName = &name;
263#ifdef __REACTOS__
264 attr.Attributes = OBJ_CASE_INSENSITIVE;
265#else
266 attr.Attributes = 0;
267#endif
268 attr.SecurityDescriptor = NULL;
269 attr.SecurityQualityOfService = NULL;
270 if (create_key( &hkey, access, &attr )) return 0;
271 TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey );
272
273 if (!(access & KEY_WOW64_64KEY))
274 {
275 if (!(ret = InterlockedCompareExchangePointer( (void **)&classes_root_hkey, hkey, 0 )))
276 ret = hkey;
277 else
278 NtClose( hkey ); /* somebody beat us to it */
279 }
280 else
281 ret = hkey;
282 return ret;
283}
284
285/* map the hkey from special root to normal key if necessary */
287{
288 HKEY ret = hkey;
289 const BOOL is_win64 = sizeof(void*) > sizeof(int);
290 const BOOL force_wow32 = is_win64 && (access & KEY_WOW64_32KEY);
291
292 if (hkey == HKEY_CLASSES_ROOT &&
295 if (force_wow32 && ret && ret == classes_root_hkey)
296 {
297 access &= ~KEY_WOW64_32KEY;
298 if (create_classes_key(classes_root_hkey, L"Wow6432Node", access, &hkey))
299 return 0;
300 ret = hkey;
301 }
302
303 return ret;
304}
305
307{
310
311 if (!(hkey = get_classes_root_hkey( hkey, access ))) return ERROR_INVALID_HANDLE;
312
313 attr.Length = sizeof(attr);
314 attr.RootDirectory = hkey;
315 attr.ObjectName = &nameW;
316#ifdef __REACTOS__
317 attr.Attributes = OBJ_CASE_INSENSITIVE;
318#else
319 attr.Attributes = 0;
320#endif
321 attr.SecurityDescriptor = NULL;
322 attr.SecurityQualityOfService = NULL;
324
325 return RtlNtStatusToDosError( create_key( retkey, access, &attr ) );
326}
327
329{
332
333 if (!(hkey = get_classes_root_hkey( hkey, access ))) return ERROR_INVALID_HANDLE;
334
335 attr.Length = sizeof(attr);
336 attr.RootDirectory = hkey;
337 attr.ObjectName = &nameW;
338#ifdef __REACTOS__
339 attr.Attributes = OBJ_CASE_INSENSITIVE;
340#else
341 attr.Attributes = 0;
342#endif
343 attr.SecurityDescriptor = NULL;
344 attr.SecurityQualityOfService = NULL;
346
347 return RtlNtStatusToDosError( NtOpenKey( (HANDLE *)retkey, access, &attr ) );
348}
349
350/******************************************************************************
351 * Implementation of the manual reset event object. (CLSID_ManualResetEvent)
352 */
353
354typedef struct ManualResetEvent {
360
362{
363 return CONTAINING_RECORD(iface, MREImpl, ISynchronize_iface);
364}
365
367{
369
370 TRACE("%p (%s, %p)\n", This, debugstr_guid(riid), ppv);
371
372 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISynchronize)) {
373 *ppv = &This->ISynchronize_iface;
374 }else if(IsEqualGUID(riid, &IID_ISynchronizeHandle)) {
375 *ppv = &This->ISynchronizeHandle_iface;
376 }else {
377 ERR("Unknown interface %s requested.\n", debugstr_guid(riid));
378 *ppv = NULL;
379 return E_NOINTERFACE;
380 }
381
382 IUnknown_AddRef((IUnknown*)*ppv);
383 return S_OK;
384}
385
387{
390 TRACE("%p, refcount %ld.\n", iface, ref);
391
392 return ref;
393}
394
396{
399 TRACE("%p, refcount %ld.\n", iface, ref);
400
401 if(!ref)
402 {
403 CloseHandle(This->event);
405 }
406
407 return ref;
408}
409
411{
413 DWORD index;
414 TRACE("%p, %#lx, %#lx.\n", iface, dwFlags, dwMilliseconds);
415 return CoWaitForMultipleHandles(dwFlags, dwMilliseconds, 1, &This->event, &index);
416}
417
419{
421 TRACE("%p\n", This);
422 SetEvent(This->event);
423 return S_OK;
424}
425
427{
429 TRACE("%p\n", This);
430 ResetEvent(This->event);
431 return S_OK;
432}
433
434static ISynchronizeVtbl vt_ISynchronize = {
441};
442
444{
445 return CONTAINING_RECORD(iface, MREImpl, ISynchronizeHandle_iface);
446}
447
449{
451 return ISynchronize_QueryInterface(&This->ISynchronize_iface, riid, ppv);
452}
453
455{
457 return ISynchronize_AddRef(&This->ISynchronize_iface);
458}
459
461{
463 return ISynchronize_Release(&This->ISynchronize_iface);
464}
465
467{
469
470 *ph = This->event;
471 return S_OK;
472}
473
474static const ISynchronizeHandleVtbl SynchronizeHandleVtbl = {
479};
480
482{
484 HRESULT hr;
485
486 if (outer)
487 FIXME("Aggregation not implemented.\n");
488
489 This->ref = 1;
490 This->ISynchronize_iface.lpVtbl = &vt_ISynchronize;
491 This->ISynchronizeHandle_iface.lpVtbl = &SynchronizeHandleVtbl;
492 This->event = CreateEventW(NULL, TRUE, FALSE, NULL);
493
494 hr = ISynchronize_QueryInterface(&This->ISynchronize_iface, iid, ppv);
495 ISynchronize_Release(&This->ISynchronize_iface);
496 return hr;
497}
498
499/******************************************************************************
500 * CoBuildVersion [OLE32.@]
501 *
502 * Gets the build version of the DLL.
503 *
504 * PARAMS
505 *
506 * RETURNS
507 * Current build version, hiword is majornumber, loword is minornumber
508 */
510{
511 TRACE("Returning version %d, build %d.\n", rmm, rup);
512 return (rmm<<16)+rup;
513}
514
515/******************************************************************************
516 * CoInitialize [OLE32.@]
517 *
518 * Initializes the COM libraries by calling CoInitializeEx with
519 * COINIT_APARTMENTTHREADED, ie it enters a STA thread.
520 *
521 * PARAMS
522 * lpReserved [I] Pointer to IMalloc interface (obsolete, should be NULL).
523 *
524 * RETURNS
525 * Success: S_OK if not already initialized, S_FALSE otherwise.
526 * Failure: HRESULT code.
527 *
528 * SEE ALSO
529 * CoInitializeEx
530 */
532{
533 /*
534 * Just delegate to the newer method.
535 */
537}
538
539/* open HKCR\\CLSID\\{string form of clsid}\\{keyname} key */
541{
542 WCHAR path[CHARS_IN_GUID + ARRAY_SIZE(L"CLSID\\") - 1];
543 LONG res;
544 HKEY key;
545
546 lstrcpyW(path, L"CLSID\\");
550 return REGDB_E_CLASSNOTREG;
551 else if (res != ERROR_SUCCESS)
552 return REGDB_E_READREGDB;
553
554 if (!keyname)
555 {
556 *subkey = key;
557 return S_OK;
558 }
559
560 res = open_classes_key(key, keyname, access, subkey);
563 return REGDB_E_KEYMISSING;
564 else if (res != ERROR_SUCCESS)
565 return REGDB_E_READREGDB;
566
567 return S_OK;
568}
569
570/***********************************************************************
571 * CoLoadLibrary (OLE32.@)
572 *
573 * Loads a library.
574 *
575 * PARAMS
576 * lpszLibName [I] Path to library.
577 * bAutoFree [I] Whether the library should automatically be freed.
578 *
579 * RETURNS
580 * Success: Handle to loaded library.
581 * Failure: NULL.
582 *
583 * SEE ALSO
584 * CoFreeLibrary, CoFreeAllLibraries, CoFreeUnusedLibraries
585 */
587{
588 TRACE("(%s, %d)\n", debugstr_w(lpszLibName), bAutoFree);
589
590 return LoadLibraryExW(lpszLibName, 0, LOAD_WITH_ALTERED_SEARCH_PATH);
591}
592
593/***********************************************************************
594 * CoFreeLibrary [OLE32.@]
595 *
596 * Unloads a library from memory.
597 *
598 * PARAMS
599 * hLibrary [I] Handle to library to unload.
600 *
601 * RETURNS
602 * Nothing
603 *
604 * SEE ALSO
605 * CoLoadLibrary, CoFreeAllLibraries, CoFreeUnusedLibraries
606 */
608{
610}
611
612
613/***********************************************************************
614 * CoFreeAllLibraries [OLE32.@]
615 *
616 * Function for backwards compatibility only. Does nothing.
617 *
618 * RETURNS
619 * Nothing.
620 *
621 * SEE ALSO
622 * CoLoadLibrary, CoFreeLibrary, CoFreeUnusedLibraries
623 */
625{
626 /* NOP */
627}
628
629/***********************************************************************
630 * CoGetState [OLE32.@]
631 *
632 * Retrieves the thread state object previously stored by CoSetState().
633 *
634 * PARAMS
635 * ppv [I] Address where pointer to object will be stored.
636 *
637 * RETURNS
638 * Success: S_OK.
639 * Failure: E_OUTOFMEMORY.
640 *
641 * NOTES
642 * Crashes on all invalid ppv addresses, including NULL.
643 * If the function returns a non-NULL object then the caller must release its
644 * reference on the object when the object is no longer required.
645 *
646 * SEE ALSO
647 * CoSetState().
648 */
650{
651 struct oletls *info = COM_CurrentInfo();
652 if (!info) return E_OUTOFMEMORY;
653
654 *ppv = NULL;
655
656 if (info->state)
657 {
658 IUnknown_AddRef(info->state);
659 *ppv = info->state;
660 TRACE("apt->state=%p\n", info->state);
661 }
662
663 return S_OK;
664}
665
666/***********************************************************************
667 * CoSetState [OLE32.@]
668 *
669 * Sets the thread state object.
670 *
671 * PARAMS
672 * pv [I] Pointer to state object to be stored.
673 *
674 * NOTES
675 * The system keeps a reference on the object while the object stored.
676 *
677 * RETURNS
678 * Success: S_OK.
679 * Failure: E_OUTOFMEMORY.
680 */
682{
683 struct oletls *info = COM_CurrentInfo();
684 if (!info) return E_OUTOFMEMORY;
685
686 if (pv) IUnknown_AddRef(pv);
687
688 if (info->state)
689 {
690 TRACE("-- release %p now\n", info->state);
691 IUnknown_Release(info->state);
692 }
693
694 info->state = pv;
695
696 return S_OK;
697}
698
699
700/******************************************************************************
701 * CoTreatAsClass [OLE32.@]
702 *
703 * Sets the TreatAs value of a class.
704 *
705 * PARAMS
706 * clsidOld [I] Class to set TreatAs value on.
707 * clsidNew [I] The class the clsidOld should be treated as.
708 *
709 * RETURNS
710 * Success: S_OK.
711 * Failure: HRESULT code.
712 *
713 * SEE ALSO
714 * CoGetTreatAsClass
715 */
717{
718 HKEY hkey = NULL;
719 WCHAR szClsidNew[CHARS_IN_GUID];
720 HRESULT res = S_OK;
721 WCHAR auto_treat_as[CHARS_IN_GUID];
722 LONG auto_treat_as_size = sizeof(auto_treat_as);
723 CLSID id;
724
725 res = COM_OpenKeyForCLSID(clsidOld, NULL, KEY_READ | KEY_WRITE, &hkey);
726 if (FAILED(res))
727 goto done;
728
729 if (IsEqualGUID( clsidOld, clsidNew ))
730 {
731 if (!RegQueryValueW(hkey, L"AutoTreatAs", auto_treat_as, &auto_treat_as_size) &&
732 CLSIDFromString(auto_treat_as, &id) == S_OK)
733 {
734 if (RegSetValueW(hkey, L"TreatAs", REG_SZ, auto_treat_as, sizeof(auto_treat_as)))
735 {
737 goto done;
738 }
739 }
740 else
741 {
742 if (RegDeleteKeyW(hkey, L"TreatAs"))
744 goto done;
745 }
746 }
747 else
748 {
749 if(IsEqualGUID(clsidNew, &CLSID_NULL)){
750 RegDeleteKeyW(hkey, L"TreatAs");
751 }else{
752 if(!StringFromGUID2(clsidNew, szClsidNew, ARRAY_SIZE(szClsidNew))){
753 WARN("StringFromGUID2 failed\n");
754 res = E_FAIL;
755 goto done;
756 }
757
758 if (RegSetValueW(hkey, L"TreatAs", REG_SZ, szClsidNew, sizeof(szClsidNew)) != ERROR_SUCCESS){
759 WARN("RegSetValue failed\n");
761 goto done;
762 }
763 }
764 }
765
766done:
767 if (hkey) RegCloseKey(hkey);
768 return res;
769}
770
771/***********************************************************************
772 * CoIsOle1Class [OLE32.@]
773 *
774 * Determines whether the specified class an OLE v1 class.
775 *
776 * PARAMS
777 * clsid [I] Class to test.
778 *
779 * RETURNS
780 * TRUE if the class is an OLE v1 class, or FALSE otherwise.
781 */
783{
784 FIXME("%s\n", debugstr_guid(clsid));
785 return FALSE;
786}
787
788/***********************************************************************
789 * IsEqualGUID [OLE32.@]
790 *
791 * Compares two Unique Identifiers.
792 *
793 * PARAMS
794 * rguid1 [I] The first GUID to compare.
795 * rguid2 [I] The other GUID to compare.
796 *
797 * RETURNS
798 * TRUE if equal
799 */
800#undef IsEqualGUID
802 REFGUID rguid1,
803 REFGUID rguid2)
804{
805 return !memcmp(rguid1,rguid2,sizeof(GUID));
806}
807
808/***********************************************************************
809 * CoAllowSetForegroundWindow [OLE32.@]
810 *
811 */
813{
814 FIXME("(%p, %p): stub\n", pUnk, pvReserved);
815 return S_OK;
816}
817
818/***********************************************************************
819 * CoGetObject [OLE32.@]
820 *
821 * Gets the object named by converting the name to a moniker and binding to it.
822 *
823 * PARAMS
824 * pszName [I] String representing the object.
825 * pBindOptions [I] Parameters affecting the binding to the named object.
826 * riid [I] Interface to bind to on the object.
827 * ppv [O] On output, the interface riid of the object represented
828 * by pszName.
829 *
830 * RETURNS
831 * Success: S_OK.
832 * Failure: HRESULT code.
833 *
834 * SEE ALSO
835 * MkParseDisplayName.
836 */
837HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions,
838 REFIID riid, void **ppv)
839{
840 IBindCtx *pbc;
841 HRESULT hr;
842
843 *ppv = NULL;
844
845 hr = CreateBindCtx(0, &pbc);
846 if (SUCCEEDED(hr))
847 {
848 if (pBindOptions)
849 hr = IBindCtx_SetBindOptions(pbc, pBindOptions);
850
851 if (SUCCEEDED(hr))
852 {
853 ULONG chEaten;
854 IMoniker *pmk;
855
856 hr = MkParseDisplayName(pbc, pszName, &chEaten, &pmk);
857 if (SUCCEEDED(hr))
858 {
859 hr = IMoniker_BindToObject(pmk, pbc, NULL, riid, ppv);
860 IMoniker_Release(pmk);
861 }
862 }
863
864 IBindCtx_Release(pbc);
865 }
866 return hr;
867}
868
869/* Returns expanded dll path from the registry or activation context. */
871{
872 DWORD ret;
873
874 if (regdata->origin == CLASS_REG_REGISTRY)
875 {
876 DWORD keytype;
878 DWORD dwLength = dstlen * sizeof(WCHAR);
879
880 if( (ret = RegQueryValueExW(regdata->u.hkey, NULL, NULL, &keytype, (BYTE*)src, &dwLength)) == ERROR_SUCCESS ) {
881 if (keytype == REG_EXPAND_SZ) {
883 } else {
884 const WCHAR *quote_start;
885 quote_start = wcschr(src, '\"');
886 if (quote_start) {
887 const WCHAR *quote_end = wcschr(quote_start + 1, '\"');
888 if (quote_end) {
889 memmove(src, quote_start + 1,
890 (quote_end - quote_start - 1) * sizeof(WCHAR));
891 src[quote_end - quote_start - 1] = '\0';
892 }
893 }
895 }
896 }
897 return !ret;
898 }
899 else
900 {
902
903 *dst = 0;
904 ActivateActCtx(regdata->u.actctx.hactctx, &cookie);
905 ret = SearchPathW(NULL, regdata->u.actctx.module_name, L".dll", dstlen, dst, NULL);
907 return *dst != 0;
908 }
909}
910
912{
913 HKEY hkey;
915
916 hres = COM_OpenKeyForCLSID(rclsid, L"InprocHandler32", KEY_READ, &hkey);
917 if (SUCCEEDED(hres))
918 {
919 struct class_reg_data regdata;
921
922 regdata.u.hkey = hkey;
923 regdata.origin = CLASS_REG_REGISTRY;
924
926 {
927 if (!wcsicmp(dllpath, L"ole32.dll"))
928 {
930 return HandlerCF_Create(rclsid, riid, ppv);
931 }
932 }
933 else
934 WARN("not creating object for inproc handler path %s\n", debugstr_w(dllpath));
936 }
937
939}
940
941/***********************************************************************
942 * DllMain (OLE32.@)
943 */
945{
946 TRACE("%p, %#lx, %p.\n", hinstDLL, fdwReason, reserved);
947
948 switch(fdwReason) {
950 hProxyDll = hinstDLL;
951 break;
952
955 if (reserved) break;
957 break;
958 }
959 return TRUE;
960}
961
962/***********************************************************************
963 * DllRegisterServer (OLE32.@)
964 */
966{
968}
969
970/***********************************************************************
971 * DllUnregisterServer (OLE32.@)
972 */
974{
976}
static DWORD const fdwReason
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
LONG NTSTATUS
Definition: precomp.h:26
static const WCHAR nameW[]
Definition: main.c:49
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
@ CLASS_REG_REGISTRY
@ CLASS_REG_ACTCTX
#define CHARS_IN_GUID
HRESULT HandlerCF_Create(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
void release_std_git(void)
Definition: git.c:327
static struct oletls * COM_CurrentInfo(void)
HRESULT WINAPI OLE32_DllRegisterServer(void)
HRESULT WINAPI OLE32_DllUnregisterServer(void)
HMODULE hLibrary
Definition: odbccp32.c:12
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4241
LONG WINAPI RegSetValueW(HKEY hKeyOriginal, LPCWSTR lpSubKey, DWORD dwType, LPCWSTR lpData, DWORD cbData)
Definition: reg.c:5000
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
HINSTANCE hProxyDll
Definition: combase.c:40
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
Definition: combase.c:2803
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
HRESULT WINAPI CoWaitForMultipleHandles(DWORD flags, DWORD timeout, ULONG handle_count, HANDLE *handles, DWORD *index)
Definition: combase.c:2067
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define lstrcpyW
Definition: compat.h:749
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define wcsicmp
Definition: compat.h:15
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
static DWORD DWORD * dwLength
Definition: fusion.c:86
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:520
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:265
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
void clipbrd_destroy(void)
Definition: clipboard.c:2038
static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst, DWORD dstlen)
Definition: compobj.c:870
void WINAPI CoFreeLibrary(HINSTANCE hLibrary)
Definition: compobj.c:607
comclass_miscfields
Definition: compobj.c:73
@ MiscStatusContent
Definition: compobj.c:76
@ MiscStatusThumbnail
Definition: compobj.c:77
@ MiscStatus
Definition: compobj.c:74
@ MiscStatusDocPrint
Definition: compobj.c:78
@ MiscStatusIcon
Definition: compobj.c:75
static HRESULT WINAPI ISynchronize_fnReset(ISynchronize *iface)
Definition: compobj.c:426
@ CLASS_REG_REGISTRY
Definition: compobj.c:125
HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions, REFIID riid, void **ppv)
Definition: compobj.c:837
static ISynchronizeVtbl vt_ISynchronize
Definition: compobj.c:434
static MREImpl * impl_from_ISynchronize(ISynchronize *iface)
Definition: compobj.c:361
HRESULT WINAPI DllRegisterServer(void)
Definition: compobj.c:965
struct ManualResetEvent MREImpl
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID reserved)
Definition: compobj.c:944
static ULONG WINAPI ISynchronize_fnRelease(ISynchronize *iface)
Definition: compobj.c:395
DWORD WINAPI CoBuildVersion(void)
Definition: compobj.c:509
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
Definition: compobj.c:540
BOOL WINAPI CoIsOle1Class(REFCLSID clsid)
Definition: compobj.c:782
static HRESULT WINAPI SynchronizeHandle_QueryInterface(ISynchronizeHandle *iface, REFIID riid, void **ppv)
Definition: compobj.c:448
HRESULT WINAPI CoSetState(IUnknown *pv)
Definition: compobj.c:681
static ULONG WINAPI ISynchronize_fnAddRef(ISynchronize *iface)
Definition: compobj.c:386
#define RTL_CONSTANT_STRING(s)
Definition: compobj.c:250
static HKEY classes_root_hkey
Definition: compobj.c:247
static MREImpl * impl_from_ISynchronizeHandle(ISynchronizeHandle *iface)
Definition: compobj.c:443
HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree)
Definition: compobj.c:586
void WINAPI CoFreeAllLibraries(void)
Definition: compobj.c:624
HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
Definition: compobj.c:716
static HKEY get_classes_root_hkey(HKEY hkey, REGSAM access)
Definition: compobj.c:286
HRESULT WINAPI DllUnregisterServer(void)
Definition: compobj.c:973
BOOL actctx_get_miscstatus(const CLSID *clsid, DWORD aspect, DWORD *status)
Definition: compobj.c:160
static HKEY create_classes_root_hkey(DWORD access)
Definition: compobj.c:254
static NTSTATUS create_key(HKEY *retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr)
Definition: compobj.c:210
static ULONG WINAPI SynchronizeHandle_AddRef(ISynchronizeHandle *iface)
Definition: compobj.c:454
HRESULT WINAPI CoGetState(IUnknown **ppv)
Definition: compobj.c:649
HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: compobj.c:911
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
static HRESULT WINAPI ISynchronize_fnQueryInterface(ISynchronize *iface, REFIID riid, void **ppv)
Definition: compobj.c:366
static const ISynchronizeHandleVtbl SynchronizeHandleVtbl
Definition: compobj.c:474
static ULONG WINAPI SynchronizeHandle_Release(ISynchronizeHandle *iface)
Definition: compobj.c:460
LSTATUS create_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: compobj.c:306
LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: compobj.c:328
HRESULT WINAPI ManualResetEvent_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **ppv)
Definition: compobj.c:481
static enum comclass_miscfields dvaspect_to_miscfields(DWORD aspect)
Definition: compobj.c:143
static HRESULT WINAPI ISynchronize_fnSignal(ISynchronize *iface)
Definition: compobj.c:418
HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, void *pvReserved)
Definition: compobj.c:812
static HRESULT WINAPI ISynchronize_fnWait(ISynchronize *iface, DWORD dwFlags, DWORD dwMilliseconds)
Definition: compobj.c:410
static HRESULT WINAPI SynchronizeHandle_GetHandle(ISynchronizeHandle *iface, HANDLE *ph)
Definition: compobj.c:466
HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
Definition: moniker.c:838
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum GLenum dst
Definition: glext.h:6340
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLenum GLsizei len
Definition: glext.h:6722
GLuint id
Definition: glext.h:5910
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 InterlockedCompareExchangePointer
Definition: interlocked.h:144
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
voidpf uLong int origin
Definition: ioapi.h:144
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
static const BOOL is_win64
Definition: kernelbase.h:49
#define REG_SZ
Definition: layer.c:22
WCHAR dllpath[MAX_PATH]
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static LPCWSTR LPVOID pvReserved
Definition: asmcache.c:749
HRESULT hres
Definition: protocol.c:465
static DWORD dstlen
Definition: directory.c:51
static IUnknown * outer
Definition: compobj.c:82
static BSTR *static LPOLESTR
Definition: varformat.c:44
const CLSID * clsid
Definition: msctf.cpp:50
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: ntapi.c:336
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define KEY_READ
Definition: nt_native.h:1026
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define KEY_WRITE
Definition: nt_native.h:1034
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
Definition: ntapi.c:240
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:279
#define rup
Definition: ole2ver.h:42
#define rmm
Definition: ole2ver.h:41
HRESULT WINAPI CreateBindCtx(DWORD reserved, IBindCtx **bind_context)
Definition: bindctx.c:491
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define CLSID_NULL
Definition: guiddef.h:99
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
const WCHAR * str
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
ISynchronize ISynchronize_iface
Definition: compobj.c:355
HANDLE event
Definition: compobj.c:358
ISynchronizeHandle ISynchronizeHandle_iface
Definition: compobj.c:356
Definition: scsiwmi.h:51
HANDLE RootDirectory
Definition: umtypes.h:186
PUNICODE_STRING ObjectName
Definition: umtypes.h:187
Definition: cookie.c:202
const WCHAR * module_name
union class_reg_data::@323 u
enum class_reg_data_origin origin
struct class_reg_data::@323::@324 actctx
DWORD miscstatuscontent
Definition: combase.c:71
DWORD miscstatusdocprint
Definition: combase.c:74
DWORD miscstatusthumbnail
Definition: combase.c:72
Definition: cookie.c:34
Definition: copy.c:22
Definition: name.c:39
ULONG clsid_offset
Definition: combase.c:93
Definition: send.c:48
Definition: ps.c:97
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
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:650
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:340
#define WINAPI
Definition: msvc.h:6
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:3801
#define E_NOINTERFACE
Definition: winerror.h:3479
#define REGDB_E_READREGDB
Definition: winerror.h:3797
#define REGDB_E_WRITEREGDB
Definition: winerror.h:3798
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772
#define REGDB_E_KEYMISSING
Definition: winerror.h:3799
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1268
ACCESS_MASK REGSAM
Definition: winreg.h:76
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193