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.

123 lines
3.5 KiB

  1. #ifndef _INC_DSKQUOTA_PRSHTEXT_H
  2. #define _INC_DSKQUOTA_PRSHTEXT_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: prshtext.h
  5. Description: DSKQUOTA property sheet extention declaration.
  6. Revision History:
  7. Date Description Programmer
  8. -------- --------------------------------------------------- ----------
  9. 08/15/96 Initial creation. BrianAu
  10. 06/25/98 Disabled snapin code with #ifdef POLICY_MMC_SNAPIN. BrianAu
  11. Switching to ADM-file approach to entering policy
  12. data. Keeping snapin code available in case
  13. we decide to switch back at a later time.
  14. 06/27/98 Added support for mounted volumes. BrianAu
  15. */
  16. ///////////////////////////////////////////////////////////////////////////////
  17. #ifndef _INC_DSKQUOTA_H
  18. # include "dskquota.h"
  19. #endif
  20. #ifndef _INC_DSKQUOTA_POLICY_H
  21. # include "policy.h"
  22. #endif
  23. //
  24. // Base class for all DiskQuotaControl property sheet extensions.
  25. //
  26. class DiskQuotaPropSheetExt : public IShellPropSheetExt
  27. {
  28. private:
  29. LONG m_cRef;
  30. DWORD m_dwDlgTemplateID;
  31. DLGPROC m_lpfnDlgProc;
  32. static UINT CALLBACK
  33. DiskQuotaPropSheetExt::PropSheetPageCallback(
  34. HWND hwnd,
  35. UINT uMsg,
  36. LPPROPSHEETPAGE ppsp);
  37. #ifdef POLICY_MMC_SNAPIN
  38. //
  39. // This base class can't create a disk quota policy object.
  40. // Defer to the policy prop page derived class.
  41. //
  42. virtual HRESULT CreateDiskQuotaPolicyObject(IDiskQuotaPolicy **ppOut)
  43. { return E_NOINTERFACE; }
  44. #endif
  45. //
  46. // Prevent copying.
  47. //
  48. DiskQuotaPropSheetExt(const DiskQuotaPropSheetExt&);
  49. DiskQuotaPropSheetExt& operator = (const DiskQuotaPropSheetExt&);
  50. protected:
  51. CVolumeID m_idVolume;
  52. HPROPSHEETPAGE m_hPage;
  53. PDISKQUOTA_CONTROL m_pQuotaControl;
  54. INT m_cOleInitialized;
  55. //
  56. // Subclasses can act on these notifications if they wish.
  57. // These are called from PropSheetPageCallback().
  58. //
  59. virtual UINT OnPropSheetPageCreate(LPPROPSHEETPAGE ppsp)
  60. { return 1; }
  61. virtual VOID OnPropSheetPageRelease(LPPROPSHEETPAGE ppsp) { }
  62. HRESULT GetQuotaController(IDiskQuotaControl **ppqc);
  63. public:
  64. DiskQuotaPropSheetExt(VOID);
  65. //
  66. // Need to call subclass destructor when Release()
  67. // destroys "this".
  68. //
  69. virtual ~DiskQuotaPropSheetExt(VOID);
  70. HRESULT Initialize(const CVolumeID& idVolume,
  71. DWORD dwDlgTemplateID,
  72. DLGPROC lpfnDlgProc);
  73. //
  74. // IUnknown methods.
  75. //
  76. STDMETHODIMP
  77. QueryInterface(
  78. REFIID,
  79. LPVOID *);
  80. STDMETHODIMP_(ULONG)
  81. AddRef(
  82. VOID);
  83. STDMETHODIMP_(ULONG)
  84. Release(
  85. VOID);
  86. //
  87. // IShellPropSheetInit methods.
  88. //
  89. STDMETHODIMP
  90. AddPages(
  91. LPFNADDPROPSHEETPAGE lpfnAddPage,
  92. LPARAM lParam);
  93. STDMETHODIMP
  94. ReplacePage(
  95. UINT uPageID,
  96. LPFNADDPROPSHEETPAGE lpfnAddPage,
  97. LPARAM lParam)
  98. { return E_NOTIMPL; }
  99. };
  100. #endif // _INC_DSKQUOTA_PRSHTEXT_H