source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/combaseapi.h

Last change on this file was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 14.0 KB
RevLine 
[1166]1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5
6#include <apiset.h>
7#include <apisetcconv.h>
8
9#include <rpc.h>
10#include <rpcndr.h>
11
12#ifndef DECLSPEC_NOTHROW
13#define DECLSPEC_NOTHROW
14#endif
15
16#if (NTDDI_VERSION >= 0x06000000 && !defined (_WIN32_WINNT))
17#define _WIN32_WINNT 0x0600
18#endif
19
20#if (NTDDI_VERSION >= 0x05020000 && !defined (_WIN32_WINNT))
21#define _WIN32_WINNT 0x0502
22#endif
23
24#if (NTDDI_VERSION >= 0x05010000 && !defined (_WIN32_WINNT))
25#define _WIN32_WINNT 0x0501
26#endif
27
28#ifndef _COMBASEAPI_H_
29#define _COMBASEAPI_H_
30
31#include <pshpack8.h>
32
33#ifdef _OLE32_
34#define WINOLEAPI STDAPI
35#define WINOLEAPI_(type) STDAPI_(type)
36#else
37#define WINOLEAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
38#define WINOLEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
39#endif
40
41#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
42#if defined (__cplusplus) && !defined (CINTERFACE)
43
44#ifdef COM_STDMETHOD_CAN_THROW
45#define COM_DECLSPEC_NOTHROW
46#else
47#define COM_DECLSPEC_NOTHROW DECLSPEC_NOTHROW
48#endif
49
50#define __STRUCT__ struct
51#undef interface
52#define interface __STRUCT__
53#define STDMETHOD(method) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE method
54#define STDMETHOD_(type, method) virtual COM_DECLSPEC_NOTHROW type STDMETHODCALLTYPE method
55#define STDMETHODV(method) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODVCALLTYPE method
56#define STDMETHODV_(type, method) virtual COM_DECLSPEC_NOTHROW type STDMETHODVCALLTYPE method
57#define PURE = 0
58#define THIS_
59#define THIS void
60#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
61#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface
62#define DECLARE_INTERFACE_IID(iface, iid) interface DECLSPEC_UUID (iid) DECLSPEC_NOVTABLE iface
63#define DECLARE_INTERFACE_IID_(iface, baseiface, iid) interface DECLSPEC_UUID (iid) DECLSPEC_NOVTABLE iface : public baseiface
64
65#define IFACEMETHOD(method) STDMETHOD (method)
66#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
67#define IFACEMETHODV(method) STDMETHODV (method)
68#define IFACEMETHODV_(type, method) STDMETHODV_(type, method)
69
70#ifndef BEGIN_INTERFACE
71#define BEGIN_INTERFACE
72#define END_INTERFACE
73#endif
74
75interface IUnknown;
76
77extern "C++" {
78 template<typename T> void **IID_PPV_ARGS_Helper (T **pp) {
79 static_cast<IUnknown *> (*pp);
80 return reinterpret_cast<void **> (pp);
81 }
82}
83
84#define IID_PPV_ARGS(ppType) __uuidof (**(ppType)), IID_PPV_ARGS_Helper (ppType)
85#else
86#undef interface
87#define interface struct
88
89#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)
90#define STDMETHOD_(type, method) type (STDMETHODCALLTYPE *method)
91#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)
92#define STDMETHODV_(type, method) type (STDMETHODVCALLTYPE *method)
93
94#define IFACEMETHOD(method) STDMETHOD (method)
95#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
96#define IFACEMETHODV(method) STDMETHODV (method)
97#define IFACEMETHODV_(type, method) /*override*/ STDMETHODV_(type, method)
98
99#ifndef BEGIN_INTERFACE
100#define BEGIN_INTERFACE
101#define END_INTERFACE
102#endif
103
104#define PURE
105#define THIS_ INTERFACE *This,
106#define THIS INTERFACE *This
107#ifdef CONST_VTABLE
108#undef CONST_VTBL
109#define CONST_VTBL const
110#define DECLARE_INTERFACE(iface) typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; typedef const struct iface##Vtbl iface##Vtbl; const struct iface##Vtbl
111#else
112#undef CONST_VTBL
113#define CONST_VTBL
114#define DECLARE_INTERFACE(iface) typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; typedef struct iface##Vtbl iface##Vtbl; struct iface##Vtbl
115#endif
116#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE (iface)
117#define DECLARE_INTERFACE_IID(iface, iid) DECLARE_INTERFACE (iface)
118#define DECLARE_INTERFACE_IID_(iface, baseiface, iid) DECLARE_INTERFACE_ (iface, baseiface)
119#endif
120
121#ifndef FARSTRUCT
122#define FARSTRUCT
123#endif
124
125#ifndef HUGEP
126#define HUGEP
127#endif
128
129#include <stdlib.h>
130
131#define LISet32(li, v) ((li).HighPart = ((LONG) (v)) < 0 ? -1 : 0,(li).LowPart = (v))
132#define ULISet32(li, v) ((li).HighPart = 0,(li).LowPart = (v))
133
134#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)
135#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)
136#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)
137
138typedef enum tagREGCLS {
139 REGCLS_SINGLEUSE = 0,
140 REGCLS_MULTIPLEUSE = 1,
141 REGCLS_MULTI_SEPARATE = 2,
142 REGCLS_SUSPENDED = 4,
143 REGCLS_SURROGATE = 8
144} REGCLS;
145
146typedef interface IRpcStubBuffer IRpcStubBuffer;
147typedef interface IRpcChannelBuffer IRpcChannelBuffer;
148
149typedef enum tagCOINITBASE {
150 COINITBASE_MULTITHREADED = 0x0,
151} COINITBASE;
152
153#include <wtypesbase.h>
154#include <unknwnbase.h>
155#include <objidlbase.h>
156#include <guiddef.h>
157
158#ifndef INITGUID
159#include <cguid.h>
160#endif
161#endif
162
163#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
164#if NTDDI_VERSION >= 0x06020000
165typedef struct tagServerInformation {
166 DWORD dwServerPid;
167 DWORD dwServerTid;
168 UINT64 ui64ServerAddress;
169} ServerInformation,*PServerInformation;
170
171DECLARE_HANDLE (CO_MTA_USAGE_COOKIE);
172#endif
173WINOLEAPI CreateStreamOnHGlobal (HGLOBAL hGlobal, WINBOOL fDeleteOnRelease, LPSTREAM *ppstm);
174WINOLEAPI GetHGlobalFromStream (LPSTREAM pstm, HGLOBAL *phglobal);
175WINOLEAPI_(void) CoUninitialize (void);
176WINOLEAPI CoInitializeEx (LPVOID pvReserved, DWORD dwCoInit);
177WINOLEAPI CoGetCurrentLogicalThreadId (GUID *pguid);
178WINOLEAPI CoGetContextToken (ULONG_PTR *pToken);
179#if NTDDI_VERSION >= 0x06010000
180WINOLEAPI CoGetApartmentType (APTTYPE *pAptType, APTTYPEQUALIFIER *pAptQualifier);
181#endif
182WINOLEAPI CoGetObjectContext (REFIID riid, LPVOID *ppv);
183WINOLEAPI CoRegisterClassObject (REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister);
184WINOLEAPI CoRevokeClassObject (DWORD dwRegister);
185WINOLEAPI CoResumeClassObjects (void);
186WINOLEAPI CoSuspendClassObjects (void);
187#endif
188
189#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
190WINOLEAPI CoGetMalloc (DWORD dwMemContext, LPMALLOC *ppMalloc);
191WINOLEAPI_(DWORD) CoGetCurrentProcess (void);
192WINOLEAPI CoGetCallerTID (LPDWORD lpdwTID);
193WINOLEAPI CoGetDefaultContext (APTTYPE aptType, REFIID riid, void **ppv);
194#if NTDDI_VERSION >= 0x06020000
195WINOLEAPI CoDecodeProxy (DWORD dwClientPid, UINT64 ui64ProxyAddress, PServerInformation pServerInformation);
196WINOLEAPI CoWaitForMultipleObjects (DWORD dwFlags, DWORD dwTimeout, ULONG cHandles, const HANDLE *pHandles, LPDWORD lpdwindex);
197WINOLEAPI CoAllowUnmarshalerCLSID (REFCLSID clsid);
198#endif
199WINOLEAPI CoGetClassObject (REFCLSID rclsid, DWORD dwClsContext, LPVOID pvReserved, REFIID riid, LPVOID *ppv);
200WINOLEAPI_(ULONG) CoAddRefServerProcess (void);
201WINOLEAPI_(ULONG) CoReleaseServerProcess (void);
202WINOLEAPI CoGetPSClsid (REFIID riid, CLSID *pClsid);
203WINOLEAPI CoRegisterPSClsid (REFIID riid, REFCLSID rclsid);
204WINOLEAPI CoRegisterSurrogate (LPSURROGATE pSurrogate);
205WINOLEAPI CoMarshalHresult (LPSTREAM pstm, HRESULT hresult);
206WINOLEAPI CoUnmarshalHresult (LPSTREAM pstm, HRESULT *phresult);
207WINOLEAPI CoLockObjectExternal (LPUNKNOWN pUnk, WINBOOL fLock, WINBOOL fLastUnlockReleases);
208WINOLEAPI CoGetStdMarshalEx (LPUNKNOWN pUnkOuter, DWORD smexflags, LPUNKNOWN *ppUnkInner);
209#endif
210
211#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
212#if NTDDI_VERSION >= 0x06020000
213WINOLEAPI CoIncrementMTAUsage (CO_MTA_USAGE_COOKIE *pCookie);
214WINOLEAPI CoDecrementMTAUsage (CO_MTA_USAGE_COOKIE Cookie);
215#endif
216typedef enum tagSTDMSHLFLAGS {
217 SMEXF_SERVER = 0x01,
218 SMEXF_HANDLER = 0x02
219} STDMSHLFLAGS;
220
221WINOLEAPI CoGetMarshalSizeMax (ULONG *pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
222WINOLEAPI CoMarshalInterface (LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
223WINOLEAPI CoUnmarshalInterface (LPSTREAM pStm, REFIID riid, LPVOID *ppv);
224WINOLEAPI CoReleaseMarshalData (LPSTREAM pStm);
225WINOLEAPI CoDisconnectObject (LPUNKNOWN pUnk, DWORD dwReserved);
226WINOLEAPI CoGetStandardMarshal (REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL *ppMarshal);
227WINOLEAPI CoMarshalInterThreadInterfaceInStream (REFIID riid, LPUNKNOWN pUnk, LPSTREAM *ppStm);
228WINOLEAPI CoGetInterfaceAndReleaseStream (LPSTREAM pStm, REFIID iid, LPVOID *ppv);
229WINOLEAPI CoCreateFreeThreadedMarshaler (LPUNKNOWN punkOuter, LPUNKNOWN *ppunkMarshal);
230WINOLEAPI_(void) CoFreeUnusedLibraries (void);
231WINOLEAPI_(void) CoFreeUnusedLibrariesEx (DWORD dwUnloadDelay, DWORD dwReserved);
232WINOLEAPI CoInitializeSecurity (PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE *asAuthSvc, void *pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void *pAuthList, DWORD dwCapabilities, void *pReserved3);
233WINOLEAPI CoSwitchCallContext (IUnknown *pNewObject, IUnknown **ppOldObject);
234
235#define COM_RIGHTS_EXECUTE 1
236#define COM_RIGHTS_EXECUTE_LOCAL 2
237#define COM_RIGHTS_EXECUTE_REMOTE 4
238#define COM_RIGHTS_ACTIVATE_LOCAL 8
239#define COM_RIGHTS_ACTIVATE_REMOTE 16
240
241WINOLEAPI CoCreateInstanceFromApp (REFCLSID Clsid, IUnknown *punkOuter, DWORD dwClsCtx, PVOID reserved, DWORD dwCount, MULTI_QI *pResults);
242
243#endif
244
245#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
246WINOLEAPI_(WINBOOL) CoIsHandlerConnected (LPUNKNOWN pUnk);
247#if _WIN32_WINNT >= 0x0600
248WINOLEAPI CoDisconnectContext (DWORD dwTimeout);
249#endif
250WINOLEAPI CoGetCallContext (REFIID riid, void **ppInterface);
251WINOLEAPI CoQueryProxyBlanket (IUnknown *pProxy, DWORD *pwAuthnSvc, DWORD *pAuthzSvc, LPOLESTR *pServerPrincName, DWORD *pAuthnLevel, DWORD *pImpLevel, RPC_AUTH_IDENTITY_HANDLE *pAuthInfo, DWORD *pCapabilites);
252WINOLEAPI CoSetProxyBlanket (IUnknown *pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc, OLECHAR *pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel, RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities);
253WINOLEAPI CoCopyProxy (IUnknown *pProxy, IUnknown **ppCopy);
254WINOLEAPI CoQueryClientBlanket (DWORD *pAuthnSvc, DWORD *pAuthzSvc, LPOLESTR *pServerPrincName, DWORD *pAuthnLevel, DWORD *pImpLevel, RPC_AUTHZ_HANDLE *pPrivs, DWORD *pCapabilities);
255WINOLEAPI CoImpersonateClient (void);
256WINOLEAPI CoRevertToSelf (void);
257WINOLEAPI CoQueryAuthenticationServices (DWORD *pcAuthSvc, SOLE_AUTHENTICATION_SERVICE **asAuthSvc);
258WINOLEAPI CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv);
259WINOLEAPI CoCreateInstanceEx (REFCLSID Clsid, IUnknown *punkOuter, DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults);
260#endif
261
262#if WINAPI_FAMILY == WINAPI_FAMILY_APP
263 __forceinline HRESULT CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv) {
264 MULTI_QI OneQI;
265 HRESULT hr;
266
267 OneQI.pItf = NULL;
268#ifdef __cplusplus
269 OneQI.pIID = &riid;
270#else
271 OneQI.pIID = riid;
272#endif
273 hr = CoCreateInstanceFromApp (rclsid, pUnkOuter, dwClsContext, NULL, 1,&OneQI);
274 *ppv = OneQI.pItf;
275 return FAILED (hr) ? hr : OneQI.hr;
276 }
277
278 __forceinline HRESULT CoCreateInstanceEx (REFCLSID Clsid, IUnknown *punkOuter, DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults) {
279 return CoCreateInstanceFromApp (Clsid, punkOuter, dwClsCtx, pServerInfo, dwCount, pResults);
280 }
281#endif
282
283#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
284WINOLEAPI CoGetCancelObject (DWORD dwThreadId, REFIID iid, void **ppUnk);
285WINOLEAPI CoSetCancelObject (IUnknown *pUnk);
286WINOLEAPI CoCancelCall (DWORD dwThreadId, ULONG ulTimeout);
287WINOLEAPI CoTestCancel (void);
288WINOLEAPI CoEnableCallCancellation (LPVOID pReserved);
289WINOLEAPI CoDisableCallCancellation (LPVOID pReserved);
290#endif
291
292#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
293WINOLEAPI StringFromCLSID (REFCLSID rclsid, LPOLESTR *lplpsz);
294WINOLEAPI CLSIDFromString (LPCOLESTR lpsz, LPCLSID pclsid);
295WINOLEAPI StringFromIID (REFIID rclsid, LPOLESTR *lplpsz);
296WINOLEAPI IIDFromString (LPCOLESTR lpsz, LPIID lpiid);
297#endif
298
299#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
300WINOLEAPI ProgIDFromCLSID (REFCLSID clsid, LPOLESTR *lplpszProgID);
301WINOLEAPI CLSIDFromProgID (LPCOLESTR lpszProgID, LPCLSID lpclsid);
302#endif
303
304#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
305WINOLEAPI_(int) StringFromGUID2 (REFGUID rguid, LPOLESTR lpsz, int cchMax);
306WINOLEAPI CoCreateGuid (GUID *pguid);
307
308typedef struct tagPROPVARIANT PROPVARIANT;
309
310WINOLEAPI PropVariantCopy (PROPVARIANT *pvarDest, const PROPVARIANT *pvarSrc);
311WINOLEAPI PropVariantClear (PROPVARIANT *pvar);
312WINOLEAPI FreePropVariantArray (ULONG cVariants, PROPVARIANT *rgvars);
313#endif
314
315#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
316WINOLEAPI CoWaitForMultipleHandles (DWORD dwFlags, DWORD dwTimeout, ULONG cHandles, LPHANDLE pHandles, LPDWORD lpdwindex);
317#endif
318
319#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
320typedef enum tagCOWAIT_FLAGS {
321 COWAIT_DEFAULT = 0,
322 COWAIT_WAITALL = 1,
323 COWAIT_ALERTABLE = 2,
324 COWAIT_INPUTAVAILABLE = 4
325#endif
326#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
327 , COWAIT_DISPATCH_CALLS = 8,
328 COWAIT_DISPATCH_WINDOW_MESSAGES = 0x10
329#endif
330#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
331} COWAIT_FLAGS;
332#endif
333
334#if NTDDI_VERSION >= 0x06020000
335#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
336typedef enum CWMO_FLAGS {
337 CWMO_DEFAULT = 0,
338 CWMO_DISPATCH_CALLS = 1
339#endif
340#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
341 , CWMO_DISPATCH_WINDOW_MESSAGES = 2
342#endif
343#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
344} CWMO_FLAGS;
345#endif
346#endif
347
348#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
349#define CWMO_MAX_HANDLES 56
350#endif
351
352#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
353WINOLEAPI CoGetTreatAsClass (REFCLSID clsidOld, LPCLSID pClsidNew);
354WINOLEAPI CoInvalidateRemoteMachineBindings (LPOLESTR pszMachineName);
355#endif
356
357#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
358typedef HRESULT (STDAPICALLTYPE *LPFNGETCLASSOBJECT) (REFCLSID, REFIID, LPVOID *);
359typedef HRESULT (STDAPICALLTYPE *LPFNCANUNLOADNOW) (void);
360
361STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv);
362STDAPI DllCanUnloadNow (void);
363WINOLEAPI_ (LPVOID) CoTaskMemAlloc (SIZE_T cb);
364WINOLEAPI_ (LPVOID) CoTaskMemRealloc (LPVOID pv, SIZE_T cb);
365WINOLEAPI_ (void) CoTaskMemFree (LPVOID pv);
366
367#ifndef RC_INVOKED
368#include <poppack.h>
369#endif
370
371#endif
372
373#endif
Note: See TracBrowser for help on using the repository browser.