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.

64 lines
1.9 KiB

  1. //
  2. // Copyright 2001 - Microsoft Corporation
  3. //
  4. // Created By:
  5. // Geoff Pease (GPease) 23-JAN-2001
  6. //
  7. // Maintained By:
  8. // Geoff Pease (GPease) 23-JAN-2001
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. typedef HRESULT (*LPCREATEINST)( IUnknown ** ppunkOut );
  13. typedef HRESULT (*CATIDREGISTER)( ICatRegister *, BOOL );
  14. typedef struct _ClassTable {
  15. LPCREATEINST pfnCreateInstance; // creation function for class
  16. const CLSID * rclsid; // classes in this DLL
  17. LPCTSTR pszName; // Class name for debugging
  18. LPCTSTR pszComModel; // String indicating COM threading model
  19. CATIDREGISTER pfnCatIDRegister; // catagory/component ID support registration
  20. const CLSID * rclsidAppId; // the App ID for this component
  21. LPCTSTR pszSurrogate; // the surrogate for the component - "" or NULL indicates use the COM default.
  22. } CLASSTABLE[], *LPCLASSTABLE;
  23. typedef struct _CategoryIdTable {
  24. const CATID * rcatid; // CATID GUID
  25. LPCTSTR pszName; // CATID name
  26. } CATIDTABLE[], *LPCATIDTABLE;
  27. // CFactory
  28. class
  29. CFactory:
  30. public IClassFactory
  31. {
  32. private:
  33. // IUnknown
  34. LONG m_cRef;
  35. // IClassFactory data
  36. LPCREATEINST m_pfnCreateInstance;
  37. private: // Methods
  38. CFactory( );
  39. ~CFactory();
  40. HRESULT
  41. Init( LPCREATEINST lpfn );
  42. public: // Methods
  43. friend HRESULT CALLBACK
  44. DllGetClassObject( REFCLSID rclsid, REFIID riid, void** ppv );
  45. // IUnknown
  46. STDMETHOD( QueryInterface )( REFIID riid, LPVOID *ppv );
  47. STDMETHOD_( ULONG, AddRef )(void);
  48. STDMETHOD_( ULONG, Release )(void);
  49. // IClassFactory
  50. STDMETHOD( CreateInstance )( IUnknown *punkOuter, REFIID riid, LPVOID *ppv );
  51. STDMETHOD( LockServer )( BOOL fLock );
  52. };
  53. typedef CFactory* LPCFACTORY ;