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.

112 lines
2.5 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. */
  4. #ifndef __SDP_ADJUSTMENT_SAFEARRAY__
  5. #define __SDP_ADJUSTMENT_SAFEARRAY__
  6. #include "sdpcommo.h"
  7. #include "sdpstp.h"
  8. #include "sdpsuit.h"
  9. #include "sdpfld.h"
  10. class _DllDecl SDP_ULONG_SAFEARRAY : public SDP_UITYPE_SAFEARRAY<ULONG, SDP_ULONG, SDP_ULONG_LIST>
  11. {
  12. public:
  13. inline SDP_ULONG_SAFEARRAY(
  14. IN SDP_ULONG_LIST &SdpUlongList
  15. );
  16. };
  17. inline
  18. SDP_ULONG_SAFEARRAY::SDP_ULONG_SAFEARRAY(
  19. IN SDP_ULONG_LIST &SdpUlongList
  20. )
  21. : SDP_UITYPE_SAFEARRAY<ULONG, SDP_ULONG, SDP_ULONG_LIST>(SdpUlongList)
  22. {
  23. m_VarType[0] = VT_UI4;
  24. }
  25. class _DllDecl SDP_ADJUSTMENT_SAFEARRAY :
  26. protected SDP_TIME_PERIOD_SAFEARRAY,
  27. protected SDP_ULONG_SAFEARRAY
  28. {
  29. public:
  30. SDP_ADJUSTMENT_SAFEARRAY(
  31. IN SDP_ADJUSTMENT &SdpAdjustment
  32. );
  33. HRESULT GetSafeArray(
  34. OUT VARIANT *AdjustmentTimesVariant,
  35. OUT VARIANT *IsCompactVariant,
  36. OUT VARIANT *UnitVariant,
  37. OUT VARIANT *CompactValueVariant,
  38. OUT VARIANT *PeriodValueVariant
  39. );
  40. inline HRESULT SetSafeArray(
  41. IN VARIANT &AdjustmentTimesVariant,
  42. IN VARIANT &IsCompactVariant,
  43. IN VARIANT &UnitVariant,
  44. IN VARIANT &CompactValueVariant,
  45. IN VARIANT &PeriodValueArray
  46. );
  47. protected:
  48. VARTYPE m_VarType[5];
  49. virtual BOOL GetElement(
  50. IN ULONG Index,
  51. IN ULONG NumEntries,
  52. IN void **Element,
  53. OUT HRESULT &HResult
  54. );
  55. virtual BOOL SetElement(
  56. IN ULONG Index,
  57. IN ULONG NumEntries,
  58. IN void ***Element,
  59. OUT HRESULT &HResult
  60. );
  61. virtual void RemoveExcessElements(
  62. IN ULONG StartIndex
  63. );
  64. };
  65. inline HRESULT
  66. SDP_ADJUSTMENT_SAFEARRAY::SetSafeArray(
  67. IN VARIANT &AdjustmentTimesVariant,
  68. IN VARIANT &IsCompactVariant,
  69. IN VARIANT &UnitVariant,
  70. IN VARIANT &CompactValueVariant,
  71. IN VARIANT &PeriodValueVariant
  72. )
  73. {
  74. VARIANT *VariantArray[] = {
  75. &IsCompactVariant, &UnitVariant,
  76. &CompactValueVariant, &PeriodValueVariant
  77. };
  78. return SDP_ULONG_SAFEARRAY::SetSafeArrays(
  79. sizeof(VariantArray)/sizeof(VARIANT *),
  80. m_VarType,
  81. VariantArray
  82. );
  83. }
  84. #endif // __SDP_ADJUSTMENT_SAFEARRAY__