Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
4.4 KiB

  1. #ifndef _INSTANT_HXX_
  2. #define _INSTANT_HXX_ 1
  3. typedef HRESULT (STDAPICALLTYPE FNSTGCREATEPROPSTG)( IUnknown* pUnk, REFFMTID fmtid, const CLSID *pclsid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg );
  4. typedef HRESULT (STDAPICALLTYPE FNSTGOPENPROPSTG)( IUnknown* pUnk, REFFMTID fmtid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg );
  5. typedef HRESULT (STDAPICALLTYPE FNSTGCREATEPROPSETSTG)( IStorage *pStorage, DWORD dwReserved, IPropertySetStorage **ppPropSetStg);
  6. typedef HRESULT (STDAPICALLTYPE FNFMTIDTOPROPSTGNAME)( const FMTID *pfmtid, LPOLESTR oszName );
  7. typedef HRESULT (STDAPICALLTYPE FNPROPSTGNAMETOFMTID)( const LPOLESTR oszName, FMTID *pfmtid );
  8. typedef HRESULT (STDAPICALLTYPE FNPROPVARIANTCOPY)( PROPVARIANT * pvarDest, const PROPVARIANT * pvarSrc );
  9. typedef HRESULT (STDAPICALLTYPE FNPROPVARIANTCLEAR)( PROPVARIANT * pvar );
  10. typedef HRESULT (STDAPICALLTYPE FNFREEPROPVARIANTARRAY)( ULONG cVariants, PROPVARIANT * rgvars );
  11. typedef HRESULT (STDAPICALLTYPE FNSTGCREATESTORAGEEX)( IN const WCHAR* pwcsName, IN DWORD grfMode, IN DWORD stgfmt, IN DWORD grfAttrs, IN void * reserved1, IN void * reserved2, IN REFIID riid, OUT void ** ppObjectOpen );
  12. typedef HRESULT (STDAPICALLTYPE FNSTGOPENSTORAGEEX)( IN const WCHAR* pwcsName, IN DWORD grfMode, IN DWORD stgfmt, IN DWORD grfAttrs, IN void * reserved1, IN void * reserved2, IN REFIID riid, OUT void ** ppObjectOpen);
  13. typedef HRESULT (STDAPICALLTYPE FNSTGOPENSTORAGEONHANDLE)( IN HANDLE hStream, IN DWORD grfMode, IN void *reserved1, IN void *reserved2, IN REFIID riid, OUT void **ppObjectOpen );
  14. typedef HRESULT (STDAPICALLTYPE FNSTGCREATESTORAGEONHANDLE)( IN HANDLE hStream, IN DWORD grfMode, IN DWORD stgfmt, IN void *reserved1, IN void *reserved2, IN REFIID riid, OUT void **ppObjectOpen );
  15. typedef ULONG (__stdcall FNSTGPROPERTYLENGTHASVARIANT)( IN SERIALIZEDPROPERTYVALUE const *pprop, IN ULONG cbprop, IN USHORT CodePage, IN BYTE flags);
  16. typedef SERIALIZEDPROPERTYVALUE * (__stdcall FNSTGCONVERTVARIANTTOPROPERTY)( IN PROPVARIANT const *pvar, IN USHORT CodePage, OUT SERIALIZEDPROPERTYVALUE *pprop, IN OUT ULONG *pcb, IN PROPID pid, IN BOOLEAN fVariantVector, OPTIONAL OUT ULONG *pcIndirect);
  17. typedef BOOLEAN (__stdcall FNSTGCONVERTPROPERTYTOVARIANT)( IN SERIALIZEDPROPERTYVALUE const *pprop, IN USHORT CodePage, OUT PROPVARIANT *pvar, IN PMemoryAllocator *pma);
  18. extern HINSTANCE g_hinstDLL;
  19. extern FNSTGCREATEPROPSTG *g_pfnStgCreatePropStg;
  20. extern FNSTGOPENPROPSTG *g_pfnStgOpenPropStg;
  21. extern FNSTGCREATEPROPSETSTG *g_pfnStgCreatePropSetStg;
  22. extern FNFMTIDTOPROPSTGNAME *g_pfnFmtIdToPropStgName;
  23. extern FNPROPSTGNAMETOFMTID *g_pfnPropStgNameToFmtId;
  24. extern FNPROPVARIANTCLEAR *g_pfnPropVariantClear;
  25. extern FNPROPVARIANTCOPY *g_pfnPropVariantCopy;
  26. extern FNFREEPROPVARIANTARRAY *g_pfnFreePropVariantArray;
  27. extern FNSTGCREATESTORAGEEX *g_pfnStgCreateStorageEx;
  28. extern FNSTGOPENSTORAGEEX *g_pfnStgOpenStorageEx;
  29. extern FNSTGOPENSTORAGEONHANDLE *g_pfnStgOpenStorageOnHandle;
  30. extern FNSTGCREATESTORAGEONHANDLE *g_pfnStgCreateStorageOnHandle;
  31. extern FNSTGPROPERTYLENGTHASVARIANT *g_pfnStgPropertyLengthAsVariant;
  32. extern FNSTGCONVERTVARIANTTOPROPERTY *g_pfnStgConvertVariantToProperty;
  33. extern FNSTGCONVERTPROPERTYTOVARIANT *g_pfnStgConvertPropertyToVariant;
  34. extern FNSTGOPENSTORAGEONHANDLE *g_pfnStgOpenStorageOnHandle;
  35. extern EnumImplementation g_enumImplementation;
  36. extern DWORD g_Restrictions;
  37. inline
  38. BOOL UsingQIImplementation()
  39. {
  40. if( PROPIMP_DOCFILE_QI == g_enumImplementation
  41. ||
  42. PROPIMP_STORAGE == g_enumImplementation
  43. ||
  44. PROPIMP_NTFS == g_enumImplementation )
  45. {
  46. return( TRUE );
  47. }
  48. else
  49. {
  50. return( FALSE );
  51. }
  52. }
  53. inline
  54. HRESULT StgToPropSetStg( IStorage *pStg,
  55. IPropertySetStorage **ppPropSetStg )
  56. {
  57. if( PROPIMP_DOCFILE_OLE32 == g_enumImplementation
  58. ||
  59. PROPIMP_DOCFILE_IPROP == g_enumImplementation )
  60. {
  61. return( g_pfnStgCreatePropSetStg( pStg, 0, ppPropSetStg ));
  62. }
  63. else if( UsingQIImplementation() )
  64. return( pStg->QueryInterface( IID_IPropertySetStorage, (void**) ppPropSetStg ));
  65. else
  66. return( E_FAIL );
  67. }
  68. #endif // #ifndef _INSTANT_HXX_