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.

92 lines
2.4 KiB

  1. #ifndef _INC_DSKQUOTA_FACTORY_H
  2. #define _INC_DSKQUOTA_FACTORY_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: factory.h
  5. Description: Contains declaration for the class factory object.
  6. Revision History:
  7. Date Description Programmer
  8. -------- --------------------------------------------------- ----------
  9. 05/22/96 Initial creation. BrianAu
  10. 08/15/96 Added shell extension support. BrianAu
  11. 02/04/98 Added creation of IComponent. BrianAu
  12. */
  13. ///////////////////////////////////////////////////////////////////////////////
  14. class DiskQuotaUIClassFactory : public IClassFactory
  15. {
  16. public:
  17. DiskQuotaUIClassFactory(void)
  18. : m_cRef(0) { }
  19. //
  20. // IUnknown methods
  21. //
  22. STDMETHODIMP
  23. QueryInterface(
  24. REFIID,
  25. LPVOID *);
  26. STDMETHODIMP_(ULONG)
  27. AddRef(
  28. VOID);
  29. STDMETHODIMP_(ULONG)
  30. Release(
  31. VOID);
  32. //
  33. // IClassFactory methods
  34. //
  35. STDMETHODIMP
  36. CreateInstance(
  37. LPUNKNOWN pUnkOuter,
  38. REFIID riid,
  39. LPVOID *ppvOut);
  40. STDMETHODIMP
  41. LockServer(
  42. BOOL fLock);
  43. private:
  44. LONG m_cRef;
  45. //
  46. // Prevent copying.
  47. //
  48. DiskQuotaUIClassFactory(const DiskQuotaUIClassFactory& rhs);
  49. DiskQuotaUIClassFactory& operator = (const DiskQuotaUIClassFactory& rhs);
  50. };
  51. //
  52. // Since dskquoui.dll can offer up two somewhat-related objects (a shell extension
  53. // and an MMC snapin extension), we create this intermediary class in case someone
  54. // calls IClassFactory::CreateInstance asking for IUnknown (MMC does this). When
  55. // this happens, we don't know what object the client wants. The caller then can
  56. // query this proxy object for a specific interface and the proxy generates the
  57. // appropriate object.
  58. //
  59. class InstanceProxy : public IUnknown
  60. {
  61. public:
  62. InstanceProxy(void)
  63. : m_cRef(0) { }
  64. ~InstanceProxy(void) { }
  65. //
  66. // IUnknown methods
  67. //
  68. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  69. STDMETHODIMP_(ULONG) AddRef(VOID);
  70. STDMETHODIMP_(ULONG) Release(VOID);
  71. private:
  72. LONG m_cRef;
  73. };
  74. #endif // _INC_DSKQUOTA_FACTORY_H