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. #pragma once
  2. #include <comdef.h>
  3. #include <thash.h>
  4. class CManifestDataObject
  5. {
  6. public:
  7. CManifestDataObject();
  8. ~CManifestDataObject();
  9. STDMETHOD(Set)(
  10. /* in */ LPVOID pvProperty,
  11. /* in */ DWORD cbProperty,
  12. /* in */ DWORD dwType);
  13. STDMETHOD(Get)(
  14. /* out */ LPVOID *ppvProperty,
  15. /* out */ DWORD *pcbProperty,
  16. /* out */ DWORD *pdwType);
  17. STDMETHOD(Assign)(
  18. /* in */ CManifestDataObject& dataObj);
  19. private:
  20. DWORD _dwType;
  21. CString _sData;
  22. IUnknown* _pIUnknownData;
  23. DWORD _dwData;
  24. DWORD _dwSig;
  25. HRESULT _hr;
  26. };
  27. class CManifestData : public IManifestData
  28. {
  29. public:
  30. // IUnknown methods
  31. STDMETHODIMP QueryInterface(REFIID riid, void ** ppv);
  32. STDMETHODIMP_(ULONG) AddRef();
  33. STDMETHODIMP_(ULONG) Release();
  34. STDMETHOD(Set)(
  35. /* in */ LPCWSTR pwzPropertyId,
  36. /* in */ LPVOID pvProperty,
  37. /* in */ DWORD cbProperty,
  38. /* in */ DWORD dwType);
  39. STDMETHOD(Get)(
  40. /* in */ LPCWSTR pwzPropertyId,
  41. /* out */ LPVOID *ppvProperty,
  42. /* out */ DWORD *pcbProperty,
  43. /* out */ DWORD *pdwType);
  44. // indexed Set/Get
  45. STDMETHOD(Set)(
  46. /* in */ DWORD dwPropertyIndex,
  47. /* in */ LPVOID pvProperty,
  48. /* in */ DWORD cbProperty,
  49. /* in */ DWORD dwType);
  50. STDMETHOD(Get)(
  51. /* in */ DWORD dwPropertyIndex,
  52. /* out */ LPVOID *ppvProperty,
  53. /* out */ DWORD *pcbProperty,
  54. /* out */ DWORD *pdwType);
  55. STDMETHOD(GetType)(
  56. /* out */ LPWSTR *ppwzType);
  57. CManifestData();
  58. ~CManifestData();
  59. private:
  60. HRESULT Init();
  61. THashTable<CString, CManifestDataObject> _DataTable;
  62. DWORD _dwSig;
  63. DWORD _cRef;
  64. HRESULT _hr;
  65. friend HRESULT CreateManifestData(LPCWSTR pwzDataType, LPMANIFEST_DATA* ppManifestData);
  66. };