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.

53 lines
2.3 KiB

  1. //--------------------------------------------------------------------------
  2. // Factory.h
  3. //--------------------------------------------------------------------------
  4. #pragma once
  5. //--------------------------------------------------------------------------
  6. // Forward Decls
  7. //--------------------------------------------------------------------------
  8. class CClassFactory;
  9. //--------------------------------------------------------------------------
  10. // Object Flags
  11. //--------------------------------------------------------------------------
  12. #define OIF_ALLOWAGGREGATION 0x0001
  13. //--------------------------------------------------------------------------
  14. // Object Creation Prototypes
  15. //--------------------------------------------------------------------------
  16. typedef HRESULT (APIENTRY *PFCREATEINSTANCE)(IUnknown *pUnkOuter, IUnknown **ppUnknown);
  17. #define CreateObjectInstance (*m_pfCreateInstance)
  18. //--------------------------------------------------------------------------
  19. // ClassFactory
  20. //--------------------------------------------------------------------------
  21. class CClassFactory : public IClassFactory
  22. {
  23. public:
  24. //----------------------------------------------------------------------
  25. // Construction
  26. //----------------------------------------------------------------------
  27. CClassFactory(CLSID const *pclsid, DWORD dwFlags, PFCREATEINSTANCE pfCreateInstance);
  28. //----------------------------------------------------------------------
  29. // IUnknown members
  30. //----------------------------------------------------------------------
  31. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  32. STDMETHODIMP_(ULONG) AddRef(void);
  33. STDMETHODIMP_(ULONG) Release(void);
  34. //----------------------------------------------------------------------
  35. // IClassFactory members
  36. //----------------------------------------------------------------------
  37. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
  38. STDMETHODIMP LockServer(BOOL);
  39. public:
  40. //----------------------------------------------------------------------
  41. // Data
  42. //----------------------------------------------------------------------
  43. CLSID const *m_pclsid;
  44. DWORD m_dwFlags;
  45. PFCREATEINSTANCE m_pfCreateInstance;
  46. };