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. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // Steven J. Bailey
  5. // --------------------------------------------------------------------------------
  6. #ifndef __FACTORY_H
  7. #define __FACTORY_H
  8. class CClassFactory; // Forward
  9. // --------------------------------------------------------------------------------
  10. // Object Creation Prototypes
  11. // --------------------------------------------------------------------------------
  12. typedef HRESULT (APIENTRY *PFCREATEINSTANCE)(IUnknown *pUnkOuter, IUnknown **ppUnknown);
  13. #define CreateObjectInstance (*m_pfCreateInstance)
  14. #define SAFECAST(_src, _type) (((_type)(_src)==(_src)?0:0), (_type)(_src))
  15. // --------------------------------------------------------------------------------
  16. // InetComm ClassFactory
  17. // --------------------------------------------------------------------------------
  18. class CClassFactory : public IClassFactory
  19. {
  20. public:
  21. CLSID const *m_pclsid;
  22. DWORD m_dwFlags;
  23. PFCREATEINSTANCE m_pfCreateInstance;
  24. // Construction
  25. CClassFactory(CLSID const *pclsid, DWORD dwFlags, PFCREATEINSTANCE pfCreateInstance);
  26. // IUnknown members
  27. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  28. STDMETHODIMP_(ULONG) AddRef(void);
  29. STDMETHODIMP_(ULONG) Release(void);
  30. // IClassFactory members
  31. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
  32. STDMETHODIMP LockServer(BOOL);
  33. // CClassFactory Members
  34. void SetObjectIndex(ULONG iObjIndex);
  35. };
  36. // --------------------------------------------------------------------------------
  37. // Object Creators
  38. // --------------------------------------------------------------------------------
  39. HRESULT CAthena16Import_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown);
  40. HRESULT CEudoraImport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown);
  41. HRESULT CExchImport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown);
  42. HRESULT CNetscapeImport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown);
  43. HRESULT CCommunicatorImport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown);
  44. #endif // __FACTORY_H