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.

88 lines
1.9 KiB

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