winedbg: Don't dereference possibly NULL thread pointer.
[wine/zf.git] / dlls / ole32 / compobj_private.h
blob3c0e338127cd7e549aeadd14e0be11e2d5ae1fa1
1 /*
2 * Copyright 1995 Martin von Loewis
3 * Copyright 1998 Justin Bradford
4 * Copyright 1999 Francis Beaudet
5 * Copyright 1999 Sylvain St-Germain
6 * Copyright 2002 Marcus Meissner
7 * Copyright 2003 Ove Kåven, TransGaming Technologies
8 * Copyright 2004 Mike Hearn, Rob Shearman, CodeWeavers Inc
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #ifndef __WINE_OLE_COMPOBJ_H
26 #define __WINE_OLE_COMPOBJ_H
28 /* All private prototype functions used by OLE will be added to this header file */
30 #include <stdarg.h>
32 #include "wine/list.h"
33 #include "wine/heap.h"
35 #include "windef.h"
36 #include "winbase.h"
37 #include "wtypes.h"
38 #include "dcom.h"
39 #include "winreg.h"
40 #include "winternl.h"
42 DEFINE_OLEGUID( CLSID_DfMarshal, 0x0000030b, 0, 0 );
44 /* this is what is stored in TEB->ReservedForOle */
45 struct oletls
47 struct apartment *apt;
48 IErrorInfo *errorinfo; /* see errorinfo.c */
49 DWORD thread_seqid; /* returned with CoGetCurrentProcess */
50 DWORD flags; /* tlsdata_flags (+0Ch on x86) */
51 void *unknown0;
52 DWORD inits; /* number of times CoInitializeEx called */
53 DWORD ole_inits; /* number of times OleInitialize called */
54 GUID causality_id; /* unique identifier for each COM call */
55 LONG pending_call_count_client; /* number of client calls pending */
56 LONG pending_call_count_server; /* number of server calls pending */
57 DWORD unknown;
58 IObjContext *context_token; /* (+38h on x86) */
59 IUnknown *call_state; /* current call context (+3Ch on x86) */
60 DWORD unknown2[46];
61 IUnknown *cancel_object; /* cancel object set by CoSetCancelObject (+F8h on x86) */
62 IUnknown *state; /* see CoSetState */
63 struct list spies; /* Spies installed with CoRegisterInitializeSpy */
64 DWORD spies_lock;
65 DWORD cancelcount;
68 /* Global Interface Table Functions */
69 extern void release_std_git(void) DECLSPEC_HIDDEN;
70 extern HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv) DECLSPEC_HIDDEN;
72 HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *key) DECLSPEC_HIDDEN;
73 HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv) DECLSPEC_HIDDEN;
74 HRESULT FTMarshalCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN;
76 /* Drag and drop */
77 void OLEDD_UnInitialize(void) DECLSPEC_HIDDEN;
79 extern HRESULT WINAPI InternalTlsAllocData(struct oletls **tlsdata);
81 /* will create if necessary */
82 static inline struct oletls *COM_CurrentInfo(void)
84 struct oletls *oletls;
86 if (!NtCurrentTeb()->ReservedForOle)
87 InternalTlsAllocData(&oletls);
89 return NtCurrentTeb()->ReservedForOle;
92 static inline struct apartment * COM_CurrentApt(void)
94 return COM_CurrentInfo()->apt;
97 #define CHARS_IN_GUID 39 /* including NULL */
99 /* from dlldata.c */
100 extern HINSTANCE hProxyDll DECLSPEC_HIDDEN;
101 extern HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN;
102 extern HRESULT WINAPI OLE32_DllRegisterServer(void) DECLSPEC_HIDDEN;
103 extern HRESULT WINAPI OLE32_DllUnregisterServer(void) DECLSPEC_HIDDEN;
105 extern HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN;
106 extern HRESULT HandlerCF_Create(REFCLSID rclsid, REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN;
108 extern HRESULT WINAPI GlobalOptions_CreateInstance(IClassFactory *iface, IUnknown *pUnk,
109 REFIID riid, void **ppv) DECLSPEC_HIDDEN;
110 extern IClassFactory GlobalOptionsCF DECLSPEC_HIDDEN;
111 extern HRESULT WINAPI GlobalInterfaceTable_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid,
112 void **obj) DECLSPEC_HIDDEN;
113 extern IClassFactory GlobalInterfaceTableCF DECLSPEC_HIDDEN;
114 extern HRESULT WINAPI ManualResetEvent_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid,
115 void **obj) DECLSPEC_HIDDEN;
116 extern IClassFactory ManualResetEventCF DECLSPEC_HIDDEN;
117 extern HRESULT WINAPI Ole32DllGetClassObject(REFCLSID clsid, REFIID riid, void **obj) DECLSPEC_HIDDEN;
119 /* Exported non-interface Data Advise Holder functions */
120 HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate) DECLSPEC_HIDDEN;
121 void DataAdviseHolder_OnDisconnect(IDataAdviseHolder *iface) DECLSPEC_HIDDEN;
123 extern UINT ownerlink_clipboard_format DECLSPEC_HIDDEN;
124 extern UINT filename_clipboard_format DECLSPEC_HIDDEN;
125 extern UINT filenameW_clipboard_format DECLSPEC_HIDDEN;
126 extern UINT dataobject_clipboard_format DECLSPEC_HIDDEN;
127 extern UINT embedded_object_clipboard_format DECLSPEC_HIDDEN;
128 extern UINT embed_source_clipboard_format DECLSPEC_HIDDEN;
129 extern UINT custom_link_source_clipboard_format DECLSPEC_HIDDEN;
130 extern UINT link_source_clipboard_format DECLSPEC_HIDDEN;
131 extern UINT object_descriptor_clipboard_format DECLSPEC_HIDDEN;
132 extern UINT link_source_descriptor_clipboard_format DECLSPEC_HIDDEN;
133 extern UINT ole_private_data_clipboard_format DECLSPEC_HIDDEN;
135 extern LSTATUS create_classes_key(HKEY, const WCHAR *, REGSAM, HKEY *) DECLSPEC_HIDDEN;
136 extern LSTATUS open_classes_key(HKEY, const WCHAR *, REGSAM, HKEY *) DECLSPEC_HIDDEN;
138 extern BOOL actctx_get_miscstatus(const CLSID*, DWORD, DWORD*) DECLSPEC_HIDDEN;
140 extern const char *debugstr_formatetc(const FORMATETC *formatetc) DECLSPEC_HIDDEN;
142 static inline HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src)
144 *dst = *src;
145 if (src->ptd)
147 dst->ptd = CoTaskMemAlloc( src->ptd->tdSize );
148 if (!dst->ptd) return E_OUTOFMEMORY;
149 memcpy( dst->ptd, src->ptd, src->ptd->tdSize );
151 return S_OK;
154 extern HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data,
155 BOOL copy, IEnumSTATDATA **ppenum) DECLSPEC_HIDDEN;
157 #endif /* __WINE_OLE_COMPOBJ_H */