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.

91 lines
2.8 KiB

  1. #ifndef _subitem_h
  2. #define _subitem_h
  3. HRESULT BlobToVariant(BYTE *pData, DWORD cbData, VARIANT *pVar, DWORD *pcbUsed, BOOL fStream = FALSE);
  4. class CEnumItemProperties : public IEnumItemProperties
  5. {
  6. public:
  7. CEnumItemProperties();
  8. HRESULT Initialize(const SUBSCRIPTIONCOOKIE *pCookie, ISubscriptionItem *psi);
  9. HRESULT CopyItem(ITEMPROP *pip, WCHAR *pwszName, VARIANT *pVar);
  10. HRESULT CopyRange(ULONG nStart, ULONG nCount, ITEMPROP *ppip, ULONG *pnCopied);
  11. // IUnknown members
  12. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  13. STDMETHODIMP_(ULONG) AddRef();
  14. STDMETHODIMP_(ULONG) Release();
  15. // IEnumItemProperties
  16. STDMETHODIMP Next(
  17. /* [in] */ ULONG celt,
  18. /* [length_is][size_is][out] */ ITEMPROP *rgelt,
  19. /* [out] */ ULONG *pceltFetched);
  20. STDMETHODIMP Skip(
  21. /* [in] */ ULONG celt);
  22. STDMETHODIMP Reset( void);
  23. STDMETHODIMP Clone(
  24. /* [out] */ IEnumItemProperties **ppenum);
  25. STDMETHODIMP GetCount(
  26. /* [out] */ ULONG *pnCount);
  27. private:
  28. ~CEnumItemProperties();
  29. ULONG m_cRef;
  30. ULONG m_nCurrent;
  31. ULONG m_nCount;
  32. ITEMPROP *m_pItemProps;
  33. };
  34. class CSubscriptionItem : public ISubscriptionItem
  35. {
  36. public:
  37. CSubscriptionItem(const SUBSCRIPTIONCOOKIE *pCookie, HKEY hkey);
  38. HRESULT Read(HKEY hkeyIn, const WCHAR *pwszValueName, BYTE *pData, DWORD dwDataSize);
  39. HRESULT ReadWithAlloc(HKEY hkeyIn, const WCHAR *pwszValueName, BYTE **ppData, DWORD *pdwDataSize);
  40. HRESULT Write(HKEY hkeyIn, const WCHAR *pwszValueName, BYTE *pData, DWORD dwDataSize);
  41. // IUnknown members
  42. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  43. STDMETHODIMP_(ULONG) AddRef();
  44. STDMETHODIMP_(ULONG) Release();
  45. // ISubscriptionItem
  46. STDMETHODIMP GetCookie(SUBSCRIPTIONCOOKIE *pCookie);
  47. STDMETHODIMP GetSubscriptionItemInfo(
  48. /* [out] */ SUBSCRIPTIONITEMINFO *pSubscriptionItemInfo);
  49. STDMETHODIMP SetSubscriptionItemInfo(
  50. /* [in] */ const SUBSCRIPTIONITEMINFO *pSubscriptionItemInfo);
  51. STDMETHODIMP ReadProperties(
  52. ULONG nCount,
  53. /* [size_is][in] */ const LPCWSTR rgwszName[],
  54. /* [size_is][out] */ VARIANT rgValue[]);
  55. STDMETHODIMP WriteProperties(
  56. ULONG nCount,
  57. /* [size_is][in] */ const LPCWSTR rgwszName[],
  58. /* [size_is][in] */ const VARIANT rgValue[]);
  59. STDMETHODIMP EnumProperties(
  60. /* [out] */ IEnumItemProperties **ppEnumItemProperties);
  61. STDMETHODIMP NotifyChanged();
  62. private:
  63. ~CSubscriptionItem();
  64. ULONG m_cRef;
  65. SUBSCRIPTIONCOOKIE m_Cookie;
  66. DWORD m_dwFlags;
  67. };
  68. #endif // _subitem_h