HRESULT WINAPI CoInitializeEx(
  _In_opt_ LPVOID pvReserved,
  _In_     DWORD  dwCoInit
);

HRESULT WINAPI CoInitializeSecurity(
  _In_opt_ PSECURITY_DESCRIPTOR        pSecDesc,
  _In_     LONG                        cAuthSvc,
  _In_opt_ SOLE_AUTHENTICATION_SERVICE *asAuthSvc,
  _In_opt_ PVOID                        pReserved1,
  _In_     DWORD                       dwAuthnLevel,
  _In_     DWORD                       dwImpLevel,
  _In_opt_ PVOID                       pAuthList,
  _In_     DWORD                       dwCapabilities,
  _In_opt_ PVOID                       pReserved3
);

HRESULT WINAPI CoCreateInstance(
  _In_  REFCLSID  rclsid,
  _In_  LPUNKNOWN pUnkOuter,
  _In_  DWORD     dwClsContext,
  _In_  REFIID    riid,
  _Out_ LPVOID    *ppv
);

HRESULT WINAPI CoCreateInstanceEx(
  _In_    REFCLSID     rclsid,
  _In_    IUnknown     *punkOuter,
  _In_    DWORD        dwClsCtx,
  _In_    COSERVERINFO *pServerInfo,
  _In_    DWORD        dwCount,
  _Inout_ MULTI_QI     *pResults
);

HRESULT CoGetClassObject(
  REFCLSID rclsid,
  DWORD    dwClsContext,
  LPVOID   pvReserved,
  REFIID   riid,
  LPVOID   *ppv
);


HRESULT WINAPI CoGetInterceptor(
  _In_  REFIID   iidIntercepted,
  _In_  IUnknown *punkOuter,
  _In_  REFIID   iid,
  _Out_ PVOID     *ppv
);


HRESULT WINAPI CLSIDFromProgID(
  _In_  LPCOLESTR lpszProgID,
  _Out_ LPCLSID   lpclsid
);

PVOID  CoTaskMemFree(
  LPVOID pv
);


LPSAFEARRAY SafeArrayCreate(
  [in] VARTYPE        vt,
  [in] UINT           cDims,
  [in] SAFEARRAYBOUND *rgsabound
);

LPSAFEARRAY SafeArrayCreateVector(
  [in] VARTYPE vt,
  [in] LONG    lLbound,
  [in] ULONG   cElements
);


HRESULT SafeArrayDestroy(
  [in] SAFEARRAY *psa
);


HRESULT SafeArrayDestroyData(
  [in] SAFEARRAY *psa
);

HRESULT SafeArrayGetElement(
  [in]  SAFEARRAY *psa,
  [in]  LONG      *rgIndices,
  [out] VOID      *pv
);

UINT SafeArrayGetElemsize(
  [in] SAFEARRAY *psa
);

HRESULT SafeArrayGetLBound(
  [in]  SAFEARRAY *psa,
  [in]  UINT      nDim,
  [out] LONG      *plLbound
);

HRESULT SafeArrayGetUBound(
  [in]  SAFEARRAY *psa,
  [in]  UINT      nDim,
  [out] LONG      *plUbound
);

UINT SafeArrayGetDim(
  [in] SAFEARRAY *psa
);

HRESULT SafeArrayPutElement(
  [in] SAFEARRAY *psa,
  [in] LONG      *rgIndices,
  [in] VOID      *pv
);

HRESULT SafeArrayGetVartype(
  [in]  SAFEARRAY *psa,
  [out] VARTYPE   *pvt
);

HRESULT SafeArrayCopy(
  [in]  SAFEARRAY   *psa,
  [out] LPSAFEARRAY *ppsaOut
);

HRESULT SafeArrayCopyData(
  [in] SAFEARRAY *psaSource,
  [in] SAFEARRAY *psaTarget
);


PVOID SysAllocString(
  [in, optional] OLECHAR *psz
);

VOID SysFreeString(
  [in, optional] BSTR bstrString
);


HRESULT CreateStreamOnHGlobal(
  [in]  HGLOBAL  hGlobal,
  [in]  BOOL     fDeleteOnRelease,
  [out] LPSTREAM *ppstm
);

HRESULT GetHGlobalFromStream(
  [in]  LPUNKNOWN    pstm,
  [out] HGLOBAL  *phglobal
);

HRESULT CoMarshalInterface(
  [in]           LPUNKNOWN pStm,
  [in]           REFIID    riid,
  [in]           LPUNKNOWN pUnk,
  [in]           DWORD     dwDestContext,
  [in, optional] LPVOID    pvDestContext,
  [in]           DWORD     mshlflags
);

HRESULT CoUnmarshalInterface(
  [in]  PVOID    pStm,
  [in]  REFIID   riid,
  [out] LPVOID   *ppv
);
