#include <winapifamily.h>
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4001) /* nonstandard extension : single line comment */
#endif
#pragma warning(disable:
4001
)
#if !defined( _OLE2_H_ )
#define _OLE2_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <pshpack8.h>
#ifndef WIN32
#define WIN32 100 // 100 == NT version 1.0
#endif
#include <winerror.h>
#include <objbase.h>
#include <oleauto.h>
#include <coml2api.h>
#define E_DRAW VIEW_E_DRAW
#define DATA_E_FORMATETC DV_E_FORMATETC
#define OLEIVERB_PRIMARY (0L)
#define OLEIVERB_SHOW (-1L)
#define OLEIVERB_OPEN (-2L)
#define OLEIVERB_HIDE (-3L)
#define OLEIVERB_UIACTIVATE (-4L)
#define OLEIVERB_INPLACEACTIVATE (-5L)
#define OLEIVERB_DISCARDUNDOSTATE (-6L)
#define EMBDHLP_INPROC_HANDLER 0x0000L
#define EMBDHLP_INPROC_SERVER 0x0001L
#define EMBDHLP_CREATENOW 0x00000000L
#define EMBDHLP_DELAYCREATE 0x00010000L
#define OLECREATE_LEAVERUNNING 0x00000001
#include <oleidl.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if !defined(ISOLATION_AWARE_ENABLED) \
|| !ISOLATION_AWARE_ENABLED \
|| !defined(_OBJBASE_H_) \
|| !defined(CreateDataAdviseHolder)
WINOLEAPI CreateDataAdviseHolder(_Outptr_ LPDATAADVISEHOLDER FAR* ppDAHolder);
#endif
extern
"C"
__declspec
(dllimport)
__stdcall
(
*
);
WINOLEAPI_(DWORD) OleBuildVersion( VOID );
extern
"C"
__declspec
(dllimport)
__stdcall
(
void
);
_Check_return_ WINOLEAPI WriteFmtUserTypeStg (IN LPSTORAGE pstg, IN CLIPFORMAT cf, _In_z_ LPOLESTR lpszUserType);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
);
WINOLEAPI ReadFmtUserTypeStg (IN LPSTORAGE pstg, OUT CLIPFORMAT FAR* pcf, _Outptr_opt_result_z_ LPOLESTR FAR* lplpszUserType);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
*
,
*
);
_Check_return_ WINOLEAPI OleInitialize(IN LPVOID pvReserved);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI_(void) OleUninitialize(void);
extern
"C"
__declspec
(dllimport)
void
__stdcall
(
void
);
WINOLEAPI OleQueryLinkFromData(IN LPDATAOBJECT pSrcDataObject);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI OleQueryCreateFromData(IN LPDATAOBJECT pSrcDataObject);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI OleCreate(IN REFCLSID rclsid, IN REFIID riid, IN DWORD renderopt,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
const
&
,
,
IN LPFORMATETC pFormatEtc, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
_Check_return_
WINOLEAPI OleCreateEx(IN REFCLSID rclsid, IN REFIID riid, IN DWORD dwFlags,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
const
&
,
,
IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
_Check_return_
WINOLEAPI OleCreateFromDataEx(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
_Check_return_
WINOLEAPI OleCreateLinkFromDataEx(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT IN DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateStaticFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID iid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
WINOLEAPI OleCreateLink(IN LPMONIKER pmkLinkSrc, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkEx(IN LPMONIKER pmkLinkSrc, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkToFile(IN LPCOLESTR lpszFileName, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkToFileEx(IN LPCOLESTR lpszFileName, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateFromFile(IN REFCLSID rclsid, IN LPCOLESTR lpszFileName, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
const
&
,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
_Check_return_
WINOLEAPI OleCreateFromFileEx(IN REFCLSID rclsid, IN LPCOLESTR lpszFileName, IN REFIID riid,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
const
&
,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleLoad(IN LPSTORAGE pStg, IN REFIID riid, IN LPOLECLIENTSITE pClientSite,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
,
WINOLEAPI OleSave(_In_ LPPERSISTSTORAGE pPS, _In_ LPSTORAGE pStg, _In_ BOOL fSameAsLoad);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
);
WINOLEAPI OleLoadFromStream( IN LPSTREAM pStm, IN REFIID iidInterface, OUT LPVOID FAR* ppvObj);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
const
&
,
*
);
WINOLEAPI OleSaveToStream( IN LPPERSISTSTREAM pPStm, IN LPSTREAM pStm );
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI OleSetContainedObject(IN LPUNKNOWN pUnknown, IN BOOL fContained);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI OleNoteObjectVisible(IN LPUNKNOWN pUnknown, IN BOOL fVisible);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI RegisterDragDrop(IN HWND hwnd, IN LPDROPTARGET pDropTarget);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI RevokeDragDrop(IN HWND hwnd);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI DoDragDrop(IN LPDATAOBJECT pDataObj, IN LPDROPSOURCE pDropSource,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
IN DWORD dwOKEffects, OUT LPDWORD pdwEffect);
WINOLEAPI OleSetClipboard(IN LPDATAOBJECT pDataObj);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI OleGetClipboard(_Outptr_ LPDATAOBJECT FAR* ppDataObj);
extern
"C"
__declspec
(dllimport)
__stdcall
(
*
);
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
WINOLEAPI OleGetClipboardWithEnterpriseInfo(_Outptr_result_nullonfailure_ IDataObject** dataObject,
extern
"C"
__declspec
(dllimport)
__stdcall
OleGetClipboardWithEnterpriseInfo
(
**
,
_Outptr_result_nullonfailure_ PWSTR* dataEnterpriseId,
_Outptr_result_nullonfailure_ PWSTR* sourceDescription,
_Outptr_result_nullonfailure_ PWSTR* targetDescription,
_Outptr_result_nullonfailure_ PWSTR* dataDescription);
#endif
WINOLEAPI OleFlushClipboard(void);
extern
"C"
__declspec
(dllimport)
__stdcall
(
void
);
WINOLEAPI OleIsCurrentClipboard(IN LPDATAOBJECT pDataObj);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI_(HOLEMENU) OleCreateMenuDescriptor (IN HMENU hmenuCombined,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
IN LPOLEMENUGROUPWIDTHS lpMenuWidths);
WINOLEAPI OleSetMenuDescriptor (IN HOLEMENU holemenu, IN HWND hwndFrame,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
IN HWND hwndActiveObject,
IN LPOLEINPLACEFRAME lpFrame,
IN LPOLEINPLACEACTIVEOBJECT lpActiveObj);
WINOLEAPI OleDestroyMenuDescriptor (IN HOLEMENU holemenu);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI OleTranslateAccelerator (IN LPOLEINPLACEFRAME lpFrame,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
IN LPOLEINPLACEFRAMEINFO lpFrameInfo, IN LPMSG lpmsg);
WINOLEAPI_(HANDLE) OleDuplicateData (IN HANDLE hSrc, IN CLIPFORMAT cfFormat,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
WINOLEAPI OleDraw (IN LPUNKNOWN pUnknown, IN DWORD dwAspect, IN HDC hdcDraw,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
,
_Check_return_ WINOLEAPI OleRun(IN LPUNKNOWN pUnknown);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI_(BOOL) OleIsRunning(IN LPOLEOBJECT pObject);
extern
"C"
__declspec
(dllimport)
__stdcall
(
);
WINOLEAPI OleLockRunning(IN LPUNKNOWN pUnknown, IN BOOL fLock, IN BOOL fLastUnlockCloses);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
);
WINOLEAPI_(void) ReleaseStgMedium(IN LPSTGMEDIUM);
extern
"C"
__declspec
(dllimport)
void
__stdcall
(
);
WINOLEAPI CreateOleAdviseHolder(_Out_ LPOLEADVISEHOLDER FAR* ppOAHolder);
extern
"C"
__declspec
(dllimport)
__stdcall
(
*
);
WINOLEAPI OleCreateDefaultHandler(IN REFCLSID clsid, IN LPUNKNOWN pUnkOuter,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
IN REFIID riid, OUT LPVOID FAR* lplpObj);
WINOLEAPI OleCreateEmbeddingHelper(IN REFCLSID clsid, IN LPUNKNOWN pUnkOuter,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
IN DWORD flags, IN LPCLASSFACTORY pCF,
IN REFIID riid, OUT LPVOID FAR* lplpObj);
WINOLEAPI_(BOOL) IsAccelerator(IN HACCEL hAccel, IN int cAccelEntries, IN LPMSG lpMsg,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
int
,
,
WINOLEAPI_(HGLOBAL) OleGetIconOfFile(_In_ LPOLESTR lpszPath, IN BOOL fUseFileAsLabel);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI_(HGLOBAL) OleGetIconOfClass(IN REFCLSID rclsid, _In_opt_ LPOLESTR lpszLabel,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
IN BOOL fUseTypeAsLabel);
WINOLEAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(IN HICON hIcon, _In_ LPOLESTR lpszLabel,
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
,
_In_ LPOLESTR lpszSourceFile, IN UINT iIconIndex);
_Check_return_ WINOLEAPI OleRegGetUserType (IN REFCLSID clsid, IN DWORD dwFormOfType,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
_Outptr_ LPOLESTR FAR* pszUserType);
WINOLEAPI OleRegGetMiscStatus (IN REFCLSID clsid, IN DWORD dwAspect,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
OUT DWORD FAR* pdwStatus);
WINOLEAPI OleRegEnumFormatEtc(IN REFCLSID clsid, IN DWORD dwDirection,
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
,
_Outptr_ LPENUMFORMATETC FAR* ppenum);
WINOLEAPI OleRegEnumVerbs (IN REFCLSID clsid, _Outptr_ LPENUMOLEVERB FAR* ppenum);
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
*
);
typedef struct _OLESTREAM FAR* LPOLESTREAM;
typedef
struct
_OLESTREAM *
;
typedef
struct
{
DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
(
__stdcall
*
)(
,
void
*,
);
DWORD (CALLBACK* Put)(LPOLESTREAM, const void FAR*, DWORD);
(
__stdcall
*
)(
,
const
void
*,
);
}
;
typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
typedef
struct
{
;
}
;
WINOLEAPI OleConvertOLESTREAMToIStorage
extern
"C"
__declspec
(dllimport)
__stdcall
OleConvertOLESTREAMToIStorage
(IN LPOLESTREAM lpolestream,
IN const DVTARGETDEVICE FAR* ptd);
WINOLEAPI OleConvertIStorageToOLESTREAM
extern
"C"
__declspec
(dllimport)
__stdcall
OUT LPOLESTREAM lpolestream);
WINOLEAPI OleDoAutoConvert(IN LPSTORAGE pStg, OUT LPCLSID pClsidNew);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI OleGetAutoConvert(IN REFCLSID clsidOld, OUT LPCLSID pClsidNew);
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
);
WINOLEAPI OleSetAutoConvert(IN REFCLSID clsidOld, IN REFCLSID clsidNew);
extern
"C"
__declspec
(dllimport)
__stdcall
(
const
&
,
const
&
);
WINOLEAPI SetConvertStg(IN LPSTORAGE pStg, IN BOOL fConvert);
extern
"C"
__declspec
(dllimport)
__stdcall
(
,
);
WINOLEAPI OleConvertIStorageToOLESTREAMEx
extern
"C"
__declspec
(dllimport)
__stdcall
IN CLIPFORMAT cfFormat, // format
IN LONG lHeight, // height
IN DWORD dwSize, // size in bytes
IN LPSTGMEDIUM pmedium, // bits
OUT LPOLESTREAM polestm);
WINOLEAPI OleConvertOLESTREAMToIStorageEx
extern
"C"
__declspec
(dllimport)
__stdcall
OUT CLIPFORMAT FAR* pcfFormat, // format
OUT LONG FAR* plwWidth, // width
OUT LONG FAR* plHeight, // height
OUT DWORD FAR* pdwSize, // size in bytes
OUT LPSTGMEDIUM pmedium); // bits
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#ifndef RC_INVOKED
#include <poppack.h>
#endif // RC_INVOKED
#endif // __OLE2_H__
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif