// // Copyright (c) Microsoft Corporation. All rights reserved. // // // Use of this source code is subject to the terms of the Microsoft end-user // license agreement (EULA) under which you licensed this SOFTWARE PRODUCT. // If you did not accept the terms of the EULA, you are not authorized to use // this source code. For a copy of the EULA, please see the LICENSE.RTF on your // install media. // cpp_quote("//") cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.") cpp_quote("//") cpp_quote("//") cpp_quote("// Use of this source code is subject to the terms of the Microsoft end-user") cpp_quote("// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.") cpp_quote("// If you did not accept the terms of the EULA, you are not authorized to use") cpp_quote("// this source code. For a copy of the EULA, please see the LICENSE.RTF on your") cpp_quote("// install media.") cpp_quote("//") cpp_quote("#if ( _MSC_VER >= 800 )") cpp_quote("#if _MSC_VER >= 1200") cpp_quote("#pragma warning(push)") cpp_quote("#endif") cpp_quote("#pragma warning(disable:4201) /* Nameless struct/union */") cpp_quote("#pragma warning(disable:4237) /* obsolete member named 'bool' */") cpp_quote("#endif") cpp_quote("#if ( _MSC_VER >= 1020 )") cpp_quote("#pragma once") cpp_quote("#endif") #ifndef DO_NO_IMPORTS import "objidl.idl"; import "oaidl.idl"; #endif /**************************************************************************** * Property Storage Interfaces ****************************************************************************/ typedef struct tagVersionedStream { GUID guidVersion; IStream *pStream; } VERSIONEDSTREAM, *LPVERSIONEDSTREAM; cpp_quote("") cpp_quote("// Flags for IPropertySetStorage::Create") cpp_quote("// (This flag is only supported on StgCreatePropStg & StgOpenPropStg") cpp_quote("// (This flag causes a version-1 property set to be created") const DWORD PROPSETFLAG_CASE_SENSITIVE = 8; cpp_quote("") cpp_quote("// Flags for the reservied PID_BEHAVIOR property") const DWORD PROPSET_BEHAVIOR_CASE_SENSITIVE = 1; cpp_quote("#ifdef MIDL_PASS") cpp_quote("// This is the PROPVARIANT definition for marshaling.") typedef struct tag_inner_PROPVARIANT PROPVARIANT; cpp_quote("#else") cpp_quote("// This is the standard C layout of the PROPVARIANT.") cpp_quote("typedef struct tagPROPVARIANT PROPVARIANT;") cpp_quote("#endif") cpp_quote("#ifndef __objidl_h__") #define TYPEDEF_CA(type, name) \ typedef struct tag##name\ {\ ULONG cElems;\ [size_is( cElems )]\ type * pElems;\ } name TYPEDEF_CA(CHAR, CAC); // // The new PROPVARIANT. Apr 16 1998 // The goal was to add all the OleAut union arms that the OleAut VARIANT // supports without breaking wire compatibility with the old PROPVARIANT. // Adding IDispatch* and safe ARRAYs required the creation of propidl.idl // since the use of OAIDL types in PROPVARIANT means it can no longer reside // in objidl.idl. // Adding DECIMAL is the tricky part. OleAut VARIANTs have an extra outer // union for DECIMAL. (Go look at the VARIANT definition in oaidl). Adding // an outer union in the IDL description would break wire compatibility with // the old PROPVARIANT. The solution has two parts: // 1) If the union contained DECIMAL data (don't worry how it got there, eg. // someone cast a pointer) how do we get it across the wire successfully? // The types of the padding were changed so they matche the first part of a // DECIMAL. Add a case for VT_DECIMAL to marshal the second half. // 2) Provide an outer union, with devVal field name for the C/C++ programmer. // Rename the old PROPVARIANT as tag_inner_PROPVARIANT and added some // cpp_quote's that glue an outer union, named tagPROPVARIANT, around it. // There are also some cpp_quote games played with the typedef LPPROPVARIANT // and PROPVARIANT types. cpp_quote("#ifdef MIDL_PASS") cpp_quote("// This is the PROPVARIANT padding layout for marshaling.") typedef BYTE PROPVAR_PAD1; typedef BYTE PROPVAR_PAD2; typedef ULONG PROPVAR_PAD3; cpp_quote("#else") cpp_quote("// This is the standard C layout of the structure.") cpp_quote("typedef WORD PROPVAR_PAD1;") cpp_quote("typedef WORD PROPVAR_PAD2;") cpp_quote("typedef WORD PROPVAR_PAD3;") cpp_quote("#define tag_inner_PROPVARIANT") cpp_quote("#endif") cpp_quote("#ifndef MIDL_PASS") cpp_quote("struct tagPROPVARIANT {") cpp_quote(" union {") cpp_quote("#endif") struct tag_inner_PROPVARIANT { VARTYPE vt; PROPVAR_PAD1 wReserved1; PROPVAR_PAD2 wReserved2; PROPVAR_PAD3 wReserved3; [switch_is((unsigned short) vt)] union { // // Basic Types. // [case (VT_EMPTY, VT_NULL)] ; [case (VT_I1)] CHAR cVal; // New [case (VT_UI1)] UCHAR bVal; [case (VT_I2)] SHORT iVal; [case (VT_UI2)] USHORT uiVal; [case (VT_I4)] LONG lVal; [case (VT_UI4)] ULONG ulVal; [case (VT_INT)] INT intVal; // New [case (VT_UINT)] UINT uintVal; // New [case (VT_DECIMAL, VT_I8)] LARGE_INTEGER hVal; // Decimal [case (VT_UI8)] ULARGE_INTEGER uhVal; [case (VT_R4)] FLOAT fltVal; [case (VT_R8)] DOUBLE dblVal; [case (VT_BOOL)] VARIANT_BOOL boolVal; [case (VT_ILLEGAL)] _VARIANT_BOOL bool; // obsolete [case (VT_ERROR)] SCODE scode; [case (VT_CY)] CY cyVal; [case (VT_DATE)] DATE date; [case (VT_FILETIME)] FILETIME filetime; [case (VT_CLSID)] CLSID * puuid; [case (VT_CF)] CLIPDATA * pclipdata; [case (VT_BSTR)] BSTR bstrVal; [case (VT_BSTR_BLOB)] BSTRBLOB bstrblobVal; // System use only [case (VT_BLOB, VT_BLOB_OBJECT)] BLOB blob; [case (VT_LPSTR)] LPSTR pszVal; [case (VT_LPWSTR)] LPWSTR pwszVal; [case (VT_UNKNOWN)] IUnknown * punkVal; // New [case (VT_DISPATCH)] IDispatch * pdispVal; // New [case (VT_STREAM, VT_STREAMED_OBJECT)] IStream* pStream; [case (VT_STORAGE, VT_STORED_OBJECT)] IStorage* pStorage; [case (VT_VERSIONED_STREAM)] LPVERSIONEDSTREAM pVersionedStream; // // Arrays of types (only the old VARIANT types) // [case (VT_ARRAY|VT_I1, VT_ARRAY|VT_UI1, VT_ARRAY|VT_I2, VT_ARRAY|VT_UI2, VT_ARRAY|VT_I4, VT_ARRAY|VT_UI4, VT_ARRAY|VT_INT, VT_ARRAY|VT_UINT, VT_ARRAY|VT_R4, VT_ARRAY|VT_R8, VT_ARRAY|VT_CY, VT_ARRAY|VT_DATE, VT_ARRAY|VT_BSTR, VT_ARRAY|VT_BOOL, VT_ARRAY|VT_DECIMAL, VT_ARRAY|VT_DISPATCH, VT_ARRAY|VT_UNKNOWN, VT_ARRAY|VT_ERROR, VT_ARRAY|VT_VARIANT)] LPSAFEARRAY parray; // New // // Vectors of types // [case (VT_VECTOR|VT_I1)] CAC cac; // new [case (VT_VECTOR|VT_UI1)] CAUB caub; [case (VT_VECTOR|VT_I2)] CAI cai; [case (VT_VECTOR|VT_UI2)] CAUI caui; [case (VT_VECTOR|VT_I4)] CAL cal; [case (VT_VECTOR|VT_UI4)] CAUL caul; [case (VT_VECTOR|VT_I8)] CAH cah; [case (VT_VECTOR|VT_UI8)] CAUH cauh; [case (VT_VECTOR|VT_R4)] CAFLT caflt; [case (VT_VECTOR|VT_R8)] CADBL cadbl; [case (VT_VECTOR|VT_BOOL)] CABOOL cabool; [case (VT_VECTOR|VT_ERROR)] CASCODE cascode; [case (VT_VECTOR|VT_CY)] CACY cacy; [case (VT_VECTOR|VT_DATE)] CADATE cadate; [case (VT_VECTOR|VT_FILETIME)] CAFILETIME cafiletime; [case (VT_VECTOR|VT_CLSID)] CACLSID cauuid; [case (VT_VECTOR|VT_CF)] CACLIPDATA caclipdata; [case (VT_VECTOR|VT_BSTR)] CABSTR cabstr; [case (VT_VECTOR|VT_BSTR_BLOB)]CABSTRBLOB cabstrblob; // System use only [case (VT_VECTOR|VT_LPSTR)] CALPSTR calpstr; [case (VT_VECTOR|VT_LPWSTR)] CALPWSTR calpwstr; [case (VT_VECTOR|VT_VARIANT)] CAPROPVARIANT capropvar; // // ByRefs of types. // [case (VT_BYREF|VT_I1)] CHAR* pcVal; // New [case (VT_BYREF|VT_UI1)] UCHAR* pbVal; // New [case (VT_BYREF|VT_I2)] SHORT* piVal; // New [case (VT_BYREF|VT_UI2)] USHORT* puiVal; // New [case (VT_BYREF|VT_I4)] LONG* plVal; // New [case (VT_BYREF|VT_UI4)] ULONG* pulVal; // New [case (VT_BYREF|VT_INT)] INT* pintVal; // New [case (VT_BYREF|VT_UINT)] UINT* puintVal; // New [case (VT_BYREF|VT_R4)] FLOAT* pfltVal; // New [case (VT_BYREF|VT_R8)] DOUBLE* pdblVal; // New [case (VT_BYREF|VT_BOOL)] VARIANT_BOOL* pboolVal; // New [case (VT_BYREF|VT_DECIMAL)] DECIMAL* pdecVal; // New [case (VT_BYREF|VT_ERROR)] SCODE* pscode; // New [case (VT_BYREF|VT_CY)] CY* pcyVal; // New [case (VT_BYREF|VT_DATE)] DATE* pdate; // New [case (VT_BYREF|VT_BSTR)] BSTR* pbstrVal; // New [case (VT_BYREF|VT_UNKNOWN)] IUnknown ** ppunkVal; // New [case (VT_BYREF|VT_DISPATCH)] IDispatch ** ppdispVal; // New [case (VT_BYREF|VT_ARRAY)] LPSAFEARRAY* pparray; // New [case (VT_BYREF|VT_VARIANT)] PROPVARIANT* pvarVal; // New }; }; cpp_quote("#ifndef MIDL_PASS") cpp_quote(" DECIMAL decVal;") cpp_quote(" };") cpp_quote("};") cpp_quote("#endif") cpp_quote("#ifdef MIDL_PASS") cpp_quote("// This is the LPPROPVARIANT definition for marshaling.") typedef struct tag_inner_PROPVARIANT * LPPROPVARIANT; cpp_quote("#else") cpp_quote("// This is the standard C layout of the PROPVARIANT.") cpp_quote("typedef struct tagPROPVARIANT * LPPROPVARIANT;") cpp_quote("#endif") cpp_quote("#endif") cpp_quote("// Reserved global Property IDs") cpp_quote("// Range which is read-only to downlevel implementations") const PROPID PID_MIN_READONLY = 0x80000000; const PROPID PID_MAX_READONLY = 0xbfffffff; cpp_quote("// Property IDs for the DiscardableInformation Property Set") cpp_quote("") cpp_quote("#define PIDDI_THUMBNAIL 0x00000002L // VT_BLOB") cpp_quote("") cpp_quote("// Property IDs for the SummaryInformation Property Set") cpp_quote("") cpp_quote("#define PIDSI_TITLE 0x00000002L // VT_LPSTR") cpp_quote("#define PIDSI_SUBJECT 0x00000003L // VT_LPSTR") cpp_quote("#define PIDSI_AUTHOR 0x00000004L // VT_LPSTR") cpp_quote("#define PIDSI_KEYWORDS 0x00000005L // VT_LPSTR") cpp_quote("#define PIDSI_COMMENTS 0x00000006L // VT_LPSTR") cpp_quote("#define PIDSI_TEMPLATE 0x00000007L // VT_LPSTR") cpp_quote("#define PIDSI_LASTAUTHOR 0x00000008L // VT_LPSTR") cpp_quote("#define PIDSI_REVNUMBER 0x00000009L // VT_LPSTR") cpp_quote("#define PIDSI_EDITTIME 0x0000000aL // VT_FILETIME (UTC)") cpp_quote("#define PIDSI_LASTPRINTED 0x0000000bL // VT_FILETIME (UTC)") cpp_quote("#define PIDSI_CREATE_DTM 0x0000000cL // VT_FILETIME (UTC)") cpp_quote("#define PIDSI_LASTSAVE_DTM 0x0000000dL // VT_FILETIME (UTC)") cpp_quote("#define PIDSI_PAGECOUNT 0x0000000eL // VT_I4") cpp_quote("#define PIDSI_WORDCOUNT 0x0000000fL // VT_I4") cpp_quote("#define PIDSI_CHARCOUNT 0x00000010L // VT_I4") cpp_quote("#define PIDSI_THUMBNAIL 0x00000011L // VT_CF") cpp_quote("#define PIDSI_APPNAME 0x00000012L // VT_LPSTR") cpp_quote("#define PIDSI_DOC_SECURITY 0x00000013L // VT_I4") cpp_quote("") cpp_quote("// Property IDs for the DocSummaryInformation Property Set") cpp_quote("") cpp_quote("#define PIDDSI_CATEGORY 0x00000002 // VT_LPSTR") cpp_quote("#define PIDDSI_PRESFORMAT 0x00000003 // VT_LPSTR") cpp_quote("#define PIDDSI_BYTECOUNT 0x00000004 // VT_I4") cpp_quote("#define PIDDSI_LINECOUNT 0x00000005 // VT_I4") cpp_quote("#define PIDDSI_PARCOUNT 0x00000006 // VT_I4") cpp_quote("#define PIDDSI_SLIDECOUNT 0x00000007 // VT_I4") cpp_quote("#define PIDDSI_NOTECOUNT 0x00000008 // VT_I4") cpp_quote("#define PIDDSI_HIDDENCOUNT 0x00000009 // VT_I4") cpp_quote("#define PIDDSI_MMCLIPCOUNT 0x0000000A // VT_I4") cpp_quote("#define PIDDSI_SCALE 0x0000000B // VT_BOOL") cpp_quote("#define PIDDSI_HEADINGPAIR 0x0000000C // VT_VARIANT | VT_VECTOR") cpp_quote("#define PIDDSI_DOCPARTS 0x0000000D // VT_LPSTR | VT_VECTOR") cpp_quote("#define PIDDSI_MANAGER 0x0000000E // VT_LPSTR") cpp_quote("#define PIDDSI_COMPANY 0x0000000F // VT_LPSTR") cpp_quote("#define PIDDSI_LINKSDIRTY 0x00000010 // VT_BOOL") cpp_quote("") cpp_quote("") cpp_quote("// FMTID_MediaFileSummaryInfo - Property IDs") cpp_quote("") cpp_quote("#define PIDMSI_EDITOR 0x00000002L // VT_LPWSTR") cpp_quote("#define PIDMSI_SUPPLIER 0x00000003L // VT_LPWSTR") cpp_quote("#define PIDMSI_SOURCE 0x00000004L // VT_LPWSTR") cpp_quote("#define PIDMSI_SEQUENCE_NO 0x00000005L // VT_LPWSTR") cpp_quote("#define PIDMSI_PROJECT 0x00000006L // VT_LPWSTR") cpp_quote("#define PIDMSI_STATUS 0x00000007L // VT_UI4") cpp_quote("#define PIDMSI_OWNER 0x00000008L // VT_LPWSTR") cpp_quote("#define PIDMSI_RATING 0x00000009L // VT_LPWSTR") cpp_quote("#define PIDMSI_PRODUCTION 0x0000000AL // VT_FILETIME (UTC)") cpp_quote("#define PIDMSI_COPYRIGHT 0x0000000BL // VT_LPWSTR") cpp_quote("") cpp_quote("// PIDMSI_STATUS value definitions") enum PIDMSI_STATUS_VALUE { PIDMSI_STATUS_NORMAL = 0, PIDMSI_STATUS_NEW, PIDMSI_STATUS_PRELIM, PIDMSI_STATUS_DRAFT, PIDMSI_STATUS_INPROGRESS, PIDMSI_STATUS_EDIT, PIDMSI_STATUS_REVIEW, PIDMSI_STATUS_PROOF, PIDMSI_STATUS_FINAL, PIDMSI_STATUS_OTHER = 0x7FFF } ; cpp_quote("#ifndef __objidl_h__") cpp_quote("// Macros for parsing the OS Version of the Property Set Header") cpp_quote("#define PROPSETHDR_OSVER_KIND(dwOSVer) HIWORD( (dwOSVer) )") cpp_quote("#define PROPSETHDR_OSVER_MAJOR(dwOSVer) LOBYTE(LOWORD( (dwOSVer) ))") cpp_quote("#define PROPSETHDR_OSVER_MINOR(dwOSVer) HIBYTE(LOWORD( (dwOSVer) ))") cpp_quote("#define PROPSETHDR_OSVERSION_UNKNOWN 0xFFFFFFFF") cpp_quote("#endif") typedef [unique] IPropertyStorage * LPPROPERTYSTORAGE; cpp_quote("WINOLEAPI PropVariantCopy ( PROPVARIANT * pvarDest, const PROPVARIANT * pvarSrc );") cpp_quote("WINOLEAPI PropVariantClear ( PROPVARIANT * pvar );") cpp_quote("WINOLEAPI FreePropVariantArray ( ULONG cVariants, PROPVARIANT * rgvars );") cpp_quote("") cpp_quote("#ifndef _PROPVARIANTINIT_DEFINED_") cpp_quote("#define _PROPVARIANTINIT_DEFINED_") cpp_quote("# ifdef __cplusplus") cpp_quote("inline void PropVariantInit ( PROPVARIANT * pvar )") cpp_quote("{") cpp_quote(" memset ( pvar, 0, sizeof(PROPVARIANT) );") cpp_quote("}") cpp_quote("# else") cpp_quote("# define PropVariantInit(pvar) memset ( (pvar), 0, sizeof(PROPVARIANT) )") cpp_quote("# endif") cpp_quote("#endif") cpp_quote("") cpp_quote("") cpp_quote("#ifndef _STGCREATEPROPSTG_DEFINED_") cpp_quote("WINOLEAPI StgCreatePropStg( IUnknown* pUnk, REFFMTID fmtid, const CLSID *pclsid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg );") cpp_quote("WINOLEAPI StgOpenPropStg( IUnknown* pUnk, REFFMTID fmtid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg );") cpp_quote("WINOLEAPI StgCreatePropSetStg( IStorage *pStorage, DWORD dwReserved, IPropertySetStorage **ppPropSetStg);") cpp_quote("") cpp_quote("#define CCH_MAX_PROPSTG_NAME 31") cpp_quote("WINOLEAPI FmtIdToPropStgName( const FMTID *pfmtid, LPOLESTR oszName );" ) cpp_quote("WINOLEAPI PropStgNameToFmtId( const LPOLESTR oszName, FMTID *pfmtid );" ) cpp_quote("#endif") cpp_quote("#if _MSC_VER >= 1200") cpp_quote("#pragma warning(pop)") cpp_quote("#else") cpp_quote("#pragma warning(default:4201) /* Nameless struct/union */") cpp_quote("#pragma warning(default:4237) /* keywords bool, true, false, etc.. */") cpp_quote("#endif")