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.

69 lines
1.5 KiB

  1. /*
  2. * clsfact.h - IClassFactory implementation.
  3. *
  4. * Taken from URL code by ChrisPi 9-11-95
  5. *
  6. */
  7. #ifndef _CLSFACT_H_
  8. #define _CLSFACT_H_
  9. typedef PIUnknown (*NEWOBJECTPROC)(OBJECTDESTROYEDPROC);
  10. DECLARE_STANDARD_TYPES(NEWOBJECTPROC);
  11. typedef struct classconstructor
  12. {
  13. PCCLSID pcclsid;
  14. NEWOBJECTPROC NewObject;
  15. }
  16. CLASSCONSTRUCTOR;
  17. DECLARE_STANDARD_TYPES(CLASSCONSTRUCTOR);
  18. /* Classes
  19. **********/
  20. // object class factory
  21. class CCLClassFactory : public RefCount,
  22. public IClassFactory
  23. {
  24. private:
  25. NEWOBJECTPROC m_NewObject;
  26. public:
  27. CCLClassFactory(NEWOBJECTPROC NewObject, OBJECTDESTROYEDPROC ObjectDestroyed);
  28. ~CCLClassFactory(void);
  29. // IClassFactory methods
  30. HRESULT STDMETHODCALLTYPE CreateInstance(PIUnknown piunkOuter, REFIID riid, PVOID *ppvObject);
  31. HRESULT STDMETHODCALLTYPE LockServer(BOOL bLock);
  32. // IUnknown methods
  33. ULONG STDMETHODCALLTYPE AddRef(void);
  34. ULONG STDMETHODCALLTYPE Release(void);
  35. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
  36. // friends
  37. #ifdef DEBUG
  38. friend BOOL IsValidPCCCLClassFactory(const CCLClassFactory *pcurlcf);
  39. #endif
  40. };
  41. DECLARE_STANDARD_TYPES(CCLClassFactory);
  42. /* Module Prototypes
  43. ********************/
  44. PIUnknown NewConfLink(OBJECTDESTROYEDPROC ObjectDestroyed);
  45. HRESULT GetClassConstructor(REFCLSID rclsid,
  46. PNEWOBJECTPROC pNewObject);
  47. #endif /* _CLSFACT_H_ */