Source code of Windows XP (NT5)
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.

95 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: StgVarB.hxx - Storage Variant Base Class
  7. //
  8. // Contents: C++ Base wrapper for PROPVARIANT.
  9. //
  10. // History: 01-Aug-94 KyleP Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #if !defined(__STGVARB_HXX__)
  14. #define __STGVARB_HXX__
  15. class PSerStream;
  16. class PDeSerStream;
  17. class PMemoryAllocator
  18. {
  19. public:
  20. virtual void *Allocate(ULONG cbSize) = 0;
  21. virtual void Free(void *pv) = 0;
  22. };
  23. #if defined(OFSDBG) || defined(CIDBG)
  24. #define DBGPROP (OFSDBG || DBG || CIDBG)
  25. #else
  26. #define DBGPROP DBG
  27. #endif
  28. #if DBGPROP
  29. #if !defined(_NTDLLBUILD_)
  30. #define ENABLE_DISPLAY_VARIANT
  31. #endif
  32. #endif
  33. #if defined(_NTDLLBUILD_) && defined(_CAIRO_)
  34. #define OLDSUMCATAPI
  35. #endif
  36. #if !defined(_NTDLLBUILD_) || defined(OLDSUMCATAPI)
  37. #define ENABLE_MARSHAL_VARIANT
  38. #endif
  39. //+-------------------------------------------------------------------------
  40. //
  41. // Class: CBaseStorageVariant
  42. //
  43. // Purpose: C++ wrapper for PROPVARIANT
  44. //
  45. // History: 01-Aug-94 KyleP Created
  46. //
  47. // Notes: Only contains a static method to unmarshal from a stream.
  48. //
  49. //--------------------------------------------------------------------------
  50. class CBaseStorageVariant: public /* VC 5 fix - Was "protected" */ tagPROPVARIANT
  51. {
  52. #if defined(OLDSUMCATAPI)
  53. friend void MarshallVariant(PSerStream &stm, PROPVARIANT &var);
  54. #endif
  55. public:
  56. CBaseStorageVariant() {}
  57. CBaseStorageVariant(PROPVARIANT& var): tagPROPVARIANT(var) {}
  58. #ifdef KERNEL
  59. static NTSTATUS UnmarshalledSize( PDeSerStream &stm, ULONG & cb );
  60. #endif
  61. static NTSTATUS Unmarshall(
  62. PDeSerStream &stm,
  63. PROPVARIANT &sv,
  64. PMemoryAllocator &ma);
  65. #ifdef ENABLE_MARSHAL_VARIANT
  66. void Marshall(PSerStream& stm) const;
  67. #endif
  68. #ifdef ENABLE_DISPLAY_VARIANT
  69. VOID DisplayVariant(ULONG ulLevel, USHORT CodePage) const;
  70. #endif
  71. };
  72. #if defined(OLDSUMCATAPI)
  73. extern void MarshallVariant(PSerStream &stm, PROPVARIANT &var);
  74. #endif
  75. #endif // __STGVARB_HXX__