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.

101 lines
2.4 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. */
  4. #ifndef __SDP_TIME_PERIOD_SAFEARRAY__
  5. #define __SDP_TIME_PERIOD_SAFEARRAY__
  6. #include "sdpcommo.h"
  7. #include "sdpsarr.h"
  8. class _DllDecl SDP_TIME_PERIOD_SAFEARRAY :
  9. protected SDP_SAFEARRAY_WRAP_EX<SDP_TIME_PERIOD, SDP_TIME_PERIOD_LIST>
  10. {
  11. public:
  12. inline SDP_TIME_PERIOD_SAFEARRAY(
  13. IN SDP_TIME_PERIOD_LIST &SdpTimePeriodList
  14. );
  15. HRESULT GetSafeArray(
  16. OUT VARIANT *IsCompactVariant,
  17. OUT VARIANT *UnitVariant,
  18. OUT VARIANT *CompactValueVariant,
  19. OUT VARIANT *PeriodValueVariant
  20. );
  21. inline HRESULT SetSafeArray(
  22. IN VARIANT &IsCompactVariant,
  23. IN VARIANT &UnitVariant,
  24. IN VARIANT &CompactValueVariant,
  25. IN VARIANT &PeriodValueVariant
  26. );
  27. protected:
  28. VARTYPE m_VarType[4];
  29. VARIANT_BOOL m_IsCompact;
  30. CHAR m_Unit;
  31. LONG m_CompactValue;
  32. LONG m_PeriodValue;
  33. virtual BOOL Get(
  34. IN SDP_TIME_PERIOD &ListMember,
  35. IN ULONG NumEntries,
  36. IN void **Element,
  37. OUT HRESULT &HResult
  38. );
  39. virtual BOOL Set(
  40. IN SDP_TIME_PERIOD &ListMember,
  41. IN ULONG NumEntries,
  42. IN void ***Element,
  43. OUT HRESULT &HResult
  44. );
  45. };
  46. inline
  47. SDP_TIME_PERIOD_SAFEARRAY::SDP_TIME_PERIOD_SAFEARRAY(
  48. IN SDP_TIME_PERIOD_LIST &SdpTimePeriodList
  49. )
  50. : SDP_SAFEARRAY_WRAP_EX<SDP_TIME_PERIOD, SDP_TIME_PERIOD_LIST>(SdpTimePeriodList)
  51. {
  52. m_VarType[0] = VT_BOOL;
  53. m_VarType[1] = VT_I1;
  54. m_VarType[2] = VT_I4;
  55. m_VarType[3] = VT_I4;
  56. }
  57. inline HRESULT
  58. SDP_TIME_PERIOD_SAFEARRAY::SetSafeArray(
  59. IN VARIANT &IsCompactVariant,
  60. IN VARIANT &UnitVariant,
  61. IN VARIANT &CompactValueVariant,
  62. IN VARIANT &PeriodValueVariant
  63. )
  64. {
  65. VARIANT *VariantArray[] = {
  66. &IsCompactVariant, &UnitVariant,
  67. &CompactValueVariant, &PeriodValueVariant
  68. };
  69. return SetSafeArrays(
  70. sizeof(VariantArray)/sizeof(VARIANT *),
  71. m_VarType,
  72. VariantArray
  73. );
  74. }
  75. #endif // __SDP_TIME_PERIOD_SAFEARRAY__