Source code of Windows XP (NT5)
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.

58 lines
1.7 KiB

  1. // PROP.H : The internal property class
  2. #ifndef __PROP_H__
  3. #define __PROP_H__
  4. class CIntProperty
  5. {
  6. public:
  7. CIntProperty();
  8. ~CIntProperty();
  9. // Access functions
  10. STDMETHODIMP SetProp(DWORD dwData) {
  11. m_dwData = dwData;
  12. m_cbSize = sizeof(DWORD);
  13. m_dwType = TYPE_VALUE;
  14. return S_OK; }
  15. STDMETHODIMP SetProp(LPCWSTR lpszwString);
  16. STDMETHODIMP SetProp(LPVOID lpvData, DWORD cbBufSize);
  17. STDMETHODIMP SetPropID(DWORD dwID) { m_dwPropID = dwID;
  18. return S_OK; }
  19. STDMETHODIMP SetPersistState(BOOL fPersist) { m_fPersist = fPersist;
  20. return S_OK; }
  21. STDMETHODIMP SetType(DWORD dwType) { m_dwType = dwType;
  22. return S_OK; }
  23. DWORD GetPropID() { return m_dwPropID; }
  24. DWORD GetSize() { return m_cbSize; }
  25. DWORD GetType() { return m_dwType; }
  26. STDMETHODIMP GetProp(DWORD& dwData) { dwData = m_dwData;
  27. return S_OK; }
  28. STDMETHODIMP GetProp(LPWSTR& lpszwString) { lpszwString = m_lpszwString;
  29. return S_OK; }
  30. STDMETHODIMP GetProp(LPVOID& lpvData) { lpvData = m_lpvData;
  31. return S_OK; }
  32. BOOL GetPersistState() { return m_fPersist; }
  33. private:
  34. DWORD m_dwPropID;
  35. DWORD m_cbSize;
  36. DWORD m_dwType;
  37. union
  38. {
  39. DWORD m_dwData;
  40. LPVOID m_lpvData;
  41. LPWSTR m_lpszwString;
  42. };
  43. BOOL m_fPersist;
  44. static int m_cRefCount;
  45. static LPVOID m_pMemPool;
  46. };
  47. #endif