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.

63 lines
1.2 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation
  3. Module Name:
  4. cfactory.cpp
  5. Abstract:
  6. Header file for CFactory.cpp
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. #ifndef __CFACTORY_H_
  12. #define __CFACTORY_H_
  13. typedef enum tagdDMClassType{
  14. DM_CLASS_TYPE_SNAPIN = 0,
  15. DM_CLASS_TYPE_SNAPIN_EXTENSION,
  16. DM_CLASS_TYPE_SNAPIN_ABOUT,
  17. DM_CLASS_TYPE_UNKNOWN
  18. }DM_CLASS_TYPE, *PDM_CLASS_TYPE;
  19. class CClassFactory : public IClassFactory
  20. {
  21. public:
  22. CClassFactory(DM_CLASS_TYPE ClassType)
  23. : m_Ref(1), m_ClassType(ClassType)
  24. {}
  25. STDMETHOD(QueryInterface) (REFIID riid, LPVOID FAR* ppvObj);
  26. STDMETHOD_(ULONG, AddRef) ();
  27. STDMETHOD_(ULONG, Release) ();
  28. STDMETHOD(CreateInstance)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObj);
  29. STDMETHOD(LockServer)(BOOL fLock);
  30. static HRESULT GetClassObject(REFCLSID rclsid, REFIID riid, void** ppv);
  31. static HRESULT RegisterAll();
  32. static HRESULT UnregisterAll();
  33. static HRESULT CanUnloadNow(void);
  34. static LONG s_Locks;
  35. static LONG s_Objects;
  36. private:
  37. LONG m_Ref;
  38. DM_CLASS_TYPE m_ClassType;
  39. };
  40. #endif // __CFACTORY_H_