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.

72 lines
1.6 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. */
  4. #ifndef __SDP_ATTRIBUTE_SAFEARRAY__
  5. #define __SDP_ATTRIBUTE_SAFEARRAY__
  6. #include "sdpcommo.h"
  7. #include "sdpsarr.h"
  8. class _DllDecl SDP_ATTRIBUTE_SAFEARRAY :
  9. protected SDP_SAFEARRAY_WRAP_EX<SDP_CHAR_STRING_LINE, SDP_ATTRIBUTE_LIST>
  10. {
  11. public:
  12. inline SDP_ATTRIBUTE_SAFEARRAY(
  13. IN SDP_ATTRIBUTE_LIST &SdpAttributeList
  14. );
  15. HRESULT GetSafeArray(
  16. OUT VARIANT *Variant
  17. );
  18. inline HRESULT SetSafeArray(
  19. IN VARIANT &Variant
  20. );
  21. protected:
  22. VARTYPE m_VarType[1];
  23. virtual BOOL Get(
  24. IN SDP_CHAR_STRING_LINE &ListMember,
  25. IN ULONG NumEntries,
  26. IN void **Element,
  27. OUT HRESULT &HResult
  28. );
  29. virtual BOOL Set(
  30. IN SDP_CHAR_STRING_LINE &ListMember,
  31. IN ULONG NumEntries,
  32. IN void ***Element,
  33. OUT HRESULT &HResult
  34. );
  35. };
  36. inline
  37. SDP_ATTRIBUTE_SAFEARRAY::SDP_ATTRIBUTE_SAFEARRAY(
  38. IN SDP_ATTRIBUTE_LIST &SdpAttributeList
  39. )
  40. : SDP_SAFEARRAY_WRAP_EX<SDP_CHAR_STRING_LINE, SDP_ATTRIBUTE_LIST>(SdpAttributeList)
  41. {
  42. m_VarType[0] = VT_BSTR;
  43. }
  44. inline HRESULT
  45. SDP_ATTRIBUTE_SAFEARRAY::SetSafeArray(
  46. IN VARIANT &Variant
  47. )
  48. {
  49. VARIANT *VariantArray = &Variant;
  50. return SDP_SAFEARRAY_WRAP::SetSafeArrays(1, m_VarType, &VariantArray);
  51. }
  52. #endif // __SDP_ATTRIBUTE_SAFEARRAY__