File Index Symbol Index

//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: combaseapi.h
//
// Contents: Base Component Object Model defintions.
//
//----------------------------------------------------------------------------
#include <apiset.h>
#include <apisetcconv.h>
//TODO version number should be bumped when _APISET_TARGET_VERSION_WIN10_RS2 becomes available
#include <rpc.h>
#include <rpcndr.h>
#if (NTDDI_VERSION >= NTDDI_VISTA && !defined(_WIN32_WINNT))
#define _WIN32_WINNT 0x0600 #endif
#if (NTDDI_VERSION >= NTDDI_WS03 && !defined(_WIN32_WINNT))
#define _WIN32_WINNT 0x0502 #endif
#if (NTDDI_VERSION >= NTDDI_WINXP && !defined(_WIN32_WINNT))
#define _WIN32_WINNT 0x0501 #endif
#if (NTDDI_VERSION >= NTDDI_WIN2K && !defined(_WIN32_WINNT))
#define _WIN32_WINNT 0x0500 #endif
#if !defined(_COMBASEAPI_H_)
#define _COMBASEAPI_H_
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#include <pshpack8.h>
//TODO change _OLE32_ to _COMBASEAPI_
#ifdef _OLE32_
#define WINOLEAPI STDAPI
#define WINOLEAPI_(type) STDAPI_(type)
#else
#ifdef _68K_
#ifndef REQUIRESAPPLEPASCAL
#define WINOLEAPI EXTERN_C DECLSPEC_IMPORT HRESULT PASCAL
#define WINOLEAPI_(type) EXTERN_C DECLSPEC_IMPORT type PASCAL
#else
#define WINOLEAPI EXTERN_C DECLSPEC_IMPORT PASCAL HRESULT
#define WINOLEAPI_(type) EXTERN_C DECLSPEC_IMPORT PASCAL type
#endif
#else
#define WINOLEAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#define WINOLEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE #endif
#endif
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
/****** Interface Declaration ***********************************************/
/* * These are macros for declaring interfaces. They exist so that * a single definition of the interface is simulataneously a proper * declaration of the interface structures (C++ abstract classes) * for both C and C++. * * DECLARE_INTERFACE(iface) is used to declare an interface that does * not derive from a base interface. * DECLARE_INTERFACE_(iface, baseiface) is used to declare an interface * that does derive from a base interface. * * By default if the source file has a .c extension the C version of * the interface declaratations will be expanded; if it has a .cpp * extension the C++ version will be expanded. if you want to force * the C version expansion even though the source file has a .cpp * extension, then define the macro "CINTERFACE". * eg. cl -DCINTERFACE file.cpp * * Example Interface declaration: * * #undef INTERFACE * #define INTERFACE IClassFactory * * DECLARE_INTERFACE_(IClassFactory, IUnknown) * { * // *** IUnknown methods *** * STDMETHOD(QueryInterface) (THIS_ * REFIID riid, * LPVOID FAR* ppvObj) PURE; * STDMETHOD_(ULONG,AddRef) (THIS) PURE; * STDMETHOD_(ULONG,Release) (THIS) PURE; * * // *** IClassFactory methods *** * STDMETHOD(CreateInstance) (THIS_ * LPUNKNOWN pUnkOuter, * REFIID riid, * LPVOID FAR* ppvObject) PURE; * }; * * Example C++ expansion: * * struct FAR IClassFactory : public IUnknown * { * virtual HRESULT STDMETHODCALLTYPE QueryInterface( * IID FAR& riid, * LPVOID FAR* ppvObj) = 0; * virtual HRESULT STDMETHODCALLTYPE AddRef(void) = 0; * virtual HRESULT STDMETHODCALLTYPE Release(void) = 0; * virtual HRESULT STDMETHODCALLTYPE CreateInstance( * LPUNKNOWN pUnkOuter, * IID FAR& riid, * LPVOID FAR* ppvObject) = 0; * }; * * NOTE: Our documentation says '#define interface class' but we use * 'struct' instead of 'class' to keep a lot of 'public:' lines * out of the interfaces. The 'FAR' forces the 'this' pointers to * be far, which is what we need. * * Example C expansion: * * typedef struct IClassFactory * { * const struct IClassFactoryVtbl FAR* lpVtbl; * } IClassFactory; * * typedef struct IClassFactoryVtbl IClassFactoryVtbl; * * struct IClassFactoryVtbl * { * HRESULT (STDMETHODCALLTYPE * QueryInterface) ( * IClassFactory FAR* This, * IID FAR* riid, * LPVOID FAR* ppvObj) ; * HRESULT (STDMETHODCALLTYPE * AddRef) (IClassFactory FAR* This) ; * HRESULT (STDMETHODCALLTYPE * Release) (IClassFactory FAR* This) ; * HRESULT (STDMETHODCALLTYPE * CreateInstance) ( * IClassFactory FAR* This, * LPUNKNOWN pUnkOuter, * IID FAR* riid, * LPVOID FAR* ppvObject); * HRESULT (STDMETHODCALLTYPE * LockServer) ( * IClassFactory FAR* This, * BOOL fLock); * }; */
#if defined(__cplusplus) && !defined(CINTERFACE)
//#define interface struct FAR
#ifdef COM_STDMETHOD_CAN_THROW
#define COM_DECLSPEC_NOTHROW
#else
#define COM_DECLSPEC_NOTHROW DECLSPEC_NOTHROW #endif
#define __STRUCT__ struct
#define interface __STRUCT__
#define STDMETHOD(method) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE method
#define STDMETHOD_(type,method) virtual COM_DECLSPEC_NOTHROW type STDMETHODCALLTYPE method
#define STDMETHODV(method) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODVCALLTYPE method
#define STDMETHODV_(type,method) virtual COM_DECLSPEC_NOTHROW type STDMETHODVCALLTYPE method
#define PURE = 0
#define THIS_
#define THIS void
#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface
#define DECLARE_INTERFACE_IID(iface, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface
#define DECLARE_INTERFACE_IID_(iface, baseiface, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface : public baseiface
#define IFACEMETHOD(method) __override STDMETHOD(method)
#define IFACEMETHOD_(type,method) __override STDMETHOD_(type,method)
#define IFACEMETHODV(method) __override STDMETHODV(method)
#define IFACEMETHODV_(type,method) __override STDMETHODV_(type,method)
#if !defined(BEGIN_INTERFACE)
#if defined(_MPPC_) && ((defined(_MSC_VER) || defined(__SC__) || defined(__MWERKS__)) && !defined(NO_NULL_VTABLE_ENTRY))
#define BEGIN_INTERFACE virtual void a() {}
#define END_INTERFACE #else
#define BEGIN_INTERFACE
#define END_INTERFACE #endif #endif
#ifndef SORTPP_PASS
// This forward declaration has been left where this type was previously defined, to preserve ordering.
extern
"C++"
{ }
#endif // !SORTPP_PASS
#define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType)
#else
#define interface struct
#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE * method)
#define STDMETHOD_(type,method) type (STDMETHODCALLTYPE * method)
#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE * method)
#define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE * method)
#define IFACEMETHOD(method) __override STDMETHOD(method)
#define IFACEMETHOD_(type,method) __override STDMETHOD_(type,method)
#define IFACEMETHODV(method) __override STDMETHODV(method)
#define IFACEMETHODV_(type,method) __override STDMETHODV_(type,method)
#if !defined(BEGIN_INTERFACE)
#if defined(_MPPC_)
#define BEGIN_INTERFACE void *b;
#define END_INTERFACE
#else
#define BEGIN_INTERFACE
#define END_INTERFACE
#endif
#endif
#define PURE
#define THIS_ INTERFACE FAR* This,
#define THIS INTERFACE FAR* This
#ifdef CONST_VTABLE
#undef CONST_VTBL
#define CONST_VTBL const
#define DECLARE_INTERFACE(iface) typedef interface iface { \
const struct iface##Vtbl FAR* lpVtbl; \
} iface; \
typedef const struct iface##Vtbl iface##Vtbl; \
const struct iface##Vtbl
#else
#undef CONST_VTBL
#define CONST_VTBL
#define DECLARE_INTERFACE(iface) typedef interface iface { \
struct iface##Vtbl FAR* lpVtbl; \
} iface; \
typedef struct iface##Vtbl iface##Vtbl; \
struct iface##Vtbl
#endif
#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE(iface)
#define DECLARE_INTERFACE_IID(iface, iid) DECLARE_INTERFACE(iface)
#define DECLARE_INTERFACE_IID_(iface, baseiface, iid) DECLARE_INTERFACE_(iface, baseiface) #endif
/****** Additional basic types **********************************************/
#ifndef FARSTRUCT
#ifdef __cplusplus
#define FARSTRUCT FAR
#else
#define FARSTRUCT #endif // __cplusplus #endif // FARSTRUCT
#ifndef HUGEP
#if defined(_WIN32) || defined(_MPPC_)
#define HUGEP
#else
#define HUGEP __huge #endif // WIN32 #endif // HUGEP
#include <stdlib.h>
#define LISet32(li, v) ((li).HighPart = ((LONG) (v)) < 0 ? -1 : 0, (li).LowPart = (v))
#define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER)
// With DCOM, CLSCTX_REMOTE_SERVER should be included
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
#define CLSCTX_ALL (CLSCTX_INPROC_SERVER| \
CLSCTX_INPROC_HANDLER| \
CLSCTX_LOCAL_SERVER| \
CLSCTX_REMOTE_SERVER)
#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER)
#else
#define CLSCTX_ALL (CLSCTX_INPROC_SERVER| \
CLSCTX_INPROC_HANDLER| \
CLSCTX_LOCAL_SERVER )
#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER) #endif
// class registration flags; passed to CoRegisterClassObject
typedef
enum
tagREGCLS
{
REGCLS_SINGLEUSE
=
0
,
// class object only generates one instance
REGCLS_MULTIPLEUSE
=
1
,
// same class object genereates multiple inst.
// and local automatically goes into inproc tbl.
REGCLS_MULTI_SEPARATE
=
2
,
// multiple use, but separate control over each
// context.
REGCLS_SUSPENDED
=
4
,
// register is as suspended, will be activated
// when app calls CoResumeClassObjects
REGCLS_SURROGATE
=
8
,
// must be used when a surrogate process
// is registering a class object that will be
// loaded in the surrogate
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
REGCLS_AGILE
=
0x10
,
// Class object aggregates the free-threaded marshaler
// and will be made visible to all inproc apartments.
// Can be used together with other flags - for example,
// REGCLS_AGILE | REGCLS_MULTIPLEUSE to register a
// class object that can be used multiple times from
// different apartments. Without other flags, behavior
// will retain REGCLS_SINGLEUSE semantics in that only
// one instance can be generated.
#endif
}
REGCLS
;
/* here is where we pull in the MIDL generated headers for the interfaces */
// COM initialization flags; passed to CoInitialize.
typedef
enum
tagCOINITBASE
{
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
// These constants are only valid on Windows NT 4.0
COINITBASE_MULTITHREADED
=
0x0
,
// OLE calls objects on any thread.
#endif // DCOM
}
COINITBASE
;
#include <wtypesbase.h> #include <unknwnbase.h>
#if defined(__cplusplus) && !defined(CINTERFACE)
// IID_PPV_ARGS(ppType)
// ppType is the variable of type IType that will be filled
//
// RESULTS in: IID_IType, ppvType
// will create a compiler error if wrong level of indirection is used.
//
extern
"C++"
{ { #pragma prefast(suppress:
6269
,
"Tool issue with unused static_cast"
)
static_cast
<
IUnknown
*>(*
pp
);
// make sure everyone derives from IUnknown
return
reinterpret_cast
<
void
**>(
pp
); } }
#endif // defined(__cplusplus) && !defined(CINTERFACE)
#include <objidlbase.h>
#include <guiddef.h>
#ifndef INITGUID
// TODO change to cguidbase.h
#include <cguid.h> #endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
/****** STD Object API Prototypes *****************************************/
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetMalloc
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CreateStreamOnHGlobal
(
HGLOBAL
hGlobal
, );
GetHGlobalFromStream
( );
/* init/uninit */
CoUninitialize
(
void
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetCurrentProcess
(
void
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoInitializeEx
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetCallerTID
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoGetCurrentLogicalThreadId
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif // DCOM
#if (_WIN32_WINNT >= 0x0501)
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoGetContextToken
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetDefaultContext
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
// definition for Win7 new APIs
#if (NTDDI_VERSION >= NTDDI_WIN7)
CoGetApartmentType
( );
#endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
// definition for Win8 new APIs
#if (NTDDI_VERSION >= NTDDI_WIN8)
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
typedef
struct
tagServerInformation
{
DWORD
dwServerPid
;
DWORD
dwServerTid
;
UINT64
ui64ServerAddress
; }
ServerInformation
, *
PServerInformation
;
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoDecodeProxy
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
( );
CoDecrementMTAUsage
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoAllowUnmarshalerCLSID
( );
// Predefine _EXE_INITIALIZE_MTA to have the runtime initialize an MTA for your process
// prior to initializing globals (i.e. dynamic initializers)
// _EXE_INITIALIZE_MTA et al. are too long for rc
#if !defined RC_INVOKED
#if defined _M_IX86
#define _CRT_INTERNAL_COMBASE_SYMBOL_PREFIX "_"
#elif defined _M_X64 || defined _M_ARM || defined _M_ARM64
#define _CRT_INTERNAL_COMBASE_SYMBOL_PREFIX "" #endif
#if defined _EXE_INITIALIZE_MTA && !defined _M_CEE
#pragma comment(lib, "exe_initialize_mta")
#pragma comment(linker, "/include:" _CRT_INTERNAL_COMBASE_SYMBOL_PREFIX "__PLEASE_LINK_WITH_exe_initialize_mta.lib") #endif #endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoGetObjectContext
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
/* register/revoke/get class objects */
CoGetClassObject
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoRegisterClassObject
( );
CoRevokeClassObject
( );
CoResumeClassObjects
(
void
);
CoSuspendClassObjects
(
void
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoAddRefServerProcess
(
void
);
CoReleaseServerProcess
(
void
);
CoGetPSClsid
( );
CoRegisterPSClsid
( );
// Registering surrogate processes
CoRegisterSurrogate
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
/* marshaling interface pointers */
CoGetMarshalSizeMax
( );
CoMarshalInterface
( );
CoUnmarshalInterface
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoMarshalHresult
( );
CoUnmarshalHresult
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoReleaseMarshalData
( );
CoDisconnectObject
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoLockObjectExternal
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoGetStandardMarshal
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetStdMarshalEx
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
/* flags for CoGetStdMarshalEx */
typedef
enum
tagSTDMSHLFLAGS
{
SMEXF_SERVER
=
0x01
,
// server side aggregated std marshaler
SMEXF_HANDLER
=
0x02
// client side (handler) agg std marshaler
}
STDMSHLFLAGS
;
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoIsHandlerConnected
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
// Apartment model inter-thread interface passing helpers
CoMarshalInterThreadInterfaceInStream
( );
CoGetInterfaceAndReleaseStream
( );
CoCreateFreeThreadedMarshaler
( );
CoFreeUnusedLibraries
(
void
);
#if (_WIN32_WINNT >= 0x0501)
CoFreeUnusedLibrariesEx
( );
#endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#if (_WIN32_WINNT >= 0x0600)
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoDisconnectContext
(
DWORD
dwTimeout
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
/* Call Security. */
CoInitializeSecurity
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetCallContext
( );
CoQueryProxyBlanket
( );
CoSetProxyBlanket
( );
CoCopyProxy
( );
CoQueryClientBlanket
( );
CoImpersonateClient
(
void
);
CoRevertToSelf
(
void
);
CoQueryAuthenticationServices
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoSwitchCallContext
( );
#define COM_RIGHTS_EXECUTE 1
#define COM_RIGHTS_EXECUTE_LOCAL 2
#define COM_RIGHTS_EXECUTE_REMOTE 4
#define COM_RIGHTS_ACTIVATE_LOCAL 8
#define COM_RIGHTS_ACTIVATE_REMOTE 16
#define COM_RIGHTS_RESERVED1 32
#define COM_RIGHTS_RESERVED2 64
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif // DCOM
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
/* helper for creating instances */
CoCreateInstance
( );
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
CoCreateInstanceEx
( );
#endif // DCOM
CoRegisterActivationFilter
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#if (_WIN32_WINNT >= 0x0602)
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
CoCreateInstanceFromApp
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
#pragma region Not Desktop or OneCore Family
#if WINAPI_PARTITION_APP && !(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
__inline _Check_return_ HRESULT CoCreateInstance(
_In_ REFCLSID rclsid,
_In_opt_ LPUNKNOWN pUnkOuter,
_In_ DWORD dwClsContext,
_In_ REFIID riid,
_COM_Outptr_ _At_(*ppv, _Post_readable_size_(_Inexpressible_(varies))) LPVOID FAR* ppv)
{
MULTI_QI OneQI;
HRESULT hr;
OneQI.pItf = NULL;
#ifdef __cplusplus
OneQI.pIID = &riid;
#else
OneQI.pIID = riid;
#endif
hr = CoCreateInstanceFromApp( rclsid, pUnkOuter, dwClsContext, NULL, 1, &OneQI );
#ifdef _PREFAST_
if (SUCCEEDED(hr) && SUCCEEDED(OneQI.hr))
_Analysis_assume_(OneQI.pItf != NULL);
else
_Analysis_assume_(OneQI.pItf == NULL);
#endif
*ppv = OneQI.pItf;
return FAILED(hr) ? hr : OneQI.hr;
}
__inline _Check_return_ HRESULT CoCreateInstanceEx(
_In_ REFCLSID Clsid,
_In_opt_ IUnknown * punkOuter,
_In_ DWORD dwClsCtx,
_In_opt_ COSERVERINFO * pServerInfo,
_In_ DWORD dwCount,
_Inout_updates_(dwCount) MULTI_QI *pResults )
{
return CoCreateInstanceFromApp(Clsid, punkOuter, dwClsCtx, pServerInfo, dwCount, pResults);
}
#endif // WINAPI_PARTITION_APP && !(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
/* Call related APIs */
// DCOM
#if (_WIN32_WINNT >= 0x0500) || defined(_WIN32_DCOM)
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetCancelObject
( );
CoSetCancelObject
( );
CoCancelCall
( );
CoTestCancel
(
void
);
CoEnableCallCancellation
( );
CoDisableCallCancellation
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
/* other helpers */
StringFromCLSID
( );
CLSIDFromString
( );
StringFromIID
( );
IIDFromString
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
ProgIDFromCLSID
( );
CLSIDFromProgID
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
StringFromGUID2
( );
CoCreateGuid
( );
/* Prop variant support */
typedef
struct
tagPROPVARIANT
PROPVARIANT
;
_Check_return_
PropVariantCopy
( );
PropVariantClear
( );
FreePropVariantArray
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif // DCOM
// DCOM
#if (_WIN32_WINNT >= 0x0400) || defined(_WIN32_DCOM)
/* Synchronization API */
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoWaitForMultipleHandles
( );
/* Flags for Synchronization API and Classes */
typedef
enum
tagCOWAIT_FLAGS
{
COWAIT_DEFAULT
=
0
,
COWAIT_WAITALL
=
1
,
COWAIT_ALERTABLE
=
2
,
COWAIT_INPUTAVAILABLE
=
4
,
COWAIT_DISPATCH_CALLS
=
8
,
COWAIT_DISPATCH_WINDOW_MESSAGES
=
0x10
, }
COWAIT_FLAGS
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
enum
CWMO_FLAGS
{
CWMO_DEFAULT
=
0
,
CWMO_DISPATCH_CALLS
=
1
,
CWMO_DISPATCH_WINDOW_MESSAGES
=
2
, }
CWMO_FLAGS
;
CoWaitForMultipleObjects
( );
#endif // (NTDDI_VERSION >= NTDDI_WIN8)
#define CWMO_MAX_HANDLES 56
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif // DCOM
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoGetTreatAsClass
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
/* for flushing OLESCM remote binding handles */
#if (_WIN32_WINNT >= 0x0501)
#pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoInvalidateRemoteMachineBindings
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
enum
AgileReferenceOptions
{
AGILEREFERENCE_DEFAULT
=
0
,
AGILEREFERENCE_DELAYEDMARSHAL
=
1
, };
RoGetAgileReference
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#endif
#pragma region Application or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
/* the server dlls must define their DllGetClassObject and DllCanUnloadNow * to match these; the typedefs are located here to ensure all are changed at * the same time. */
_Check_return_
__control_entrypoint(DllExport)
/****** Default Memory Allocation ******************************************/
CoTaskMemAlloc
( );
CoTaskMemRealloc
( );
CoTaskMemFree
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma endregion #pragma region Desktop or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
CoFileTimeNow
( );
CLSIDFromProgIDEx
( );
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifndef RC_INVOKED #include <poppack.h> #endif // RC_INVOKED
#endif // __COMBASEAPI_H__