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 */
32 #include "wine/list.h"
33 #include "wine/heap.h"
42 DEFINE_OLEGUID( CLSID_DfMarshal
, 0x0000030b, 0, 0 );
44 /* this is what is stored in TEB->ReservedForOle */
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) */
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 */
58 IObjContext
*context_token
; /* (+38h on x86) */
59 IUnknown
*call_state
; /* current call context (+3Ch on x86) */
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 */
66 CO_MTA_USAGE_COOKIE implicit_mta_cookie
; /* mta referenced by roapi from sta thread */
69 /* Global Interface Table Functions */
70 extern void release_std_git(void);
71 extern HRESULT
StdGlobalInterfaceTable_GetFactory(LPVOID
*ppv
);
73 HRESULT
COM_OpenKeyForCLSID(REFCLSID clsid
, LPCWSTR keyname
, REGSAM access
, HKEY
*key
);
74 HRESULT
MARSHAL_GetStandardMarshalCF(LPVOID
*ppv
);
75 HRESULT
FTMarshalCF_Create(REFIID riid
, LPVOID
*ppv
);
78 void OLEDD_UnInitialize(void);
80 extern HRESULT WINAPI
InternalTlsAllocData(struct oletls
**tlsdata
);
82 /* will create if necessary */
83 static inline struct oletls
*COM_CurrentInfo(void)
85 struct oletls
*oletls
;
87 if (!NtCurrentTeb()->ReservedForOle
)
88 InternalTlsAllocData(&oletls
);
90 return NtCurrentTeb()->ReservedForOle
;
93 static inline struct apartment
* COM_CurrentApt(void)
95 return COM_CurrentInfo()->apt
;
98 #define CHARS_IN_GUID 39 /* including NULL */
101 extern HINSTANCE hProxyDll
;
102 extern HRESULT WINAPI
OLE32_DllGetClassObject(REFCLSID rclsid
, REFIID iid
,LPVOID
*ppv
);
103 extern HRESULT WINAPI
OLE32_DllRegisterServer(void);
104 extern HRESULT WINAPI
OLE32_DllUnregisterServer(void);
106 extern HRESULT
Handler_DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
);
107 extern HRESULT
HandlerCF_Create(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
);
109 extern HRESULT WINAPI
GlobalOptions_CreateInstance(IClassFactory
*iface
, IUnknown
*pUnk
,
110 REFIID riid
, void **ppv
);
111 extern IClassFactory GlobalOptionsCF
;
112 extern HRESULT WINAPI
GlobalInterfaceTable_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
,
114 extern IClassFactory GlobalInterfaceTableCF
;
115 extern HRESULT WINAPI
ManualResetEvent_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
,
117 extern IClassFactory ManualResetEventCF
;
118 extern HRESULT WINAPI
Ole32DllGetClassObject(REFCLSID clsid
, REFIID riid
, void **obj
);
120 /* Exported non-interface Data Advise Holder functions */
121 HRESULT
DataAdviseHolder_OnConnect(IDataAdviseHolder
*iface
, IDataObject
*pDelegate
);
122 void DataAdviseHolder_OnDisconnect(IDataAdviseHolder
*iface
);
124 extern UINT ownerlink_clipboard_format
;
125 extern UINT filename_clipboard_format
;
126 extern UINT filenameW_clipboard_format
;
127 extern UINT dataobject_clipboard_format
;
128 extern UINT embedded_object_clipboard_format
;
129 extern UINT embed_source_clipboard_format
;
130 extern UINT custom_link_source_clipboard_format
;
131 extern UINT link_source_clipboard_format
;
132 extern UINT object_descriptor_clipboard_format
;
133 extern UINT link_source_descriptor_clipboard_format
;
134 extern UINT ole_private_data_clipboard_format
;
136 void clipbrd_destroy(void);
138 extern LSTATUS
create_classes_key(HKEY
, const WCHAR
*, REGSAM
, HKEY
*);
139 extern LSTATUS
open_classes_key(HKEY
, const WCHAR
*, REGSAM
, HKEY
*);
141 extern BOOL
actctx_get_miscstatus(const CLSID
*, DWORD
, DWORD
*);
143 extern const char *debugstr_formatetc(const FORMATETC
*formatetc
);
145 static inline HRESULT
copy_formatetc(FORMATETC
*dst
, const FORMATETC
*src
)
150 dst
->ptd
= CoTaskMemAlloc( src
->ptd
->tdSize
);
151 if (!dst
->ptd
) return E_OUTOFMEMORY
;
152 memcpy( dst
->ptd
, src
->ptd
, src
->ptd
->tdSize
);
157 extern HRESULT
EnumSTATDATA_Construct(IUnknown
*holder
, ULONG index
, DWORD array_len
, STATDATA
*data
,
158 BOOL copy
, IEnumSTATDATA
**ppenum
);
160 #endif /* __WINE_OLE_COMPOBJ_H */