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.

101 lines
1.8 KiB

  1. /*
  2. * factory.hxx
  3. */
  4. #ifndef _FACTORY_
  5. #define _FACTORY_
  6. //
  7. // MyFactory base class.
  8. //
  9. class MyFactory : public IClassFactory
  10. {
  11. protected :
  12. unsigned long Refs;
  13. public:
  14. MyFactory();
  15. ~MyFactory();
  16. // IUnknown
  17. virtual
  18. HRESULT __stdcall QueryInterface(
  19. REFIID iid,
  20. void ** ppv );
  21. virtual
  22. ULONG __stdcall AddRef();
  23. virtual
  24. ULONG __stdcall Release();
  25. // IClassFactory
  26. virtual
  27. HRESULT __stdcall CreateInstance(
  28. IUnknown * pUnkOuter,
  29. REFIID riid,
  30. void ** ppv );
  31. virtual
  32. HRESULT __stdcall LockServer(
  33. BOOL fLock );
  34. };
  35. //
  36. // FactoryLocal class.
  37. //
  38. class FactoryLocal : public MyFactory
  39. {
  40. public:
  41. FactoryLocal() {}
  42. ~FactoryLocal() {}
  43. HRESULT __stdcall CreateInstance(
  44. IUnknown * pUnkOuter,
  45. REFIID riid,
  46. void ** ppv );
  47. };
  48. //
  49. // FactoryRemote class.
  50. //
  51. class FactoryRemote : public MyFactory
  52. {
  53. public:
  54. FactoryRemote() {}
  55. ~FactoryRemote() {}
  56. HRESULT __stdcall CreateInstance(
  57. IUnknown * pUnkOuter,
  58. REFIID riid,
  59. void ** ppv );
  60. };
  61. //
  62. // FactoryAtStorage class.
  63. //
  64. class FactoryAtStorage : public MyFactory
  65. {
  66. public:
  67. FactoryAtStorage() {}
  68. ~FactoryAtStorage() {}
  69. HRESULT __stdcall CreateInstance(
  70. IUnknown * pUnkOuter,
  71. REFIID riid,
  72. void ** ppv );
  73. };
  74. //
  75. // FactoryInproc class.
  76. //
  77. class FactoryInproc : public MyFactory
  78. {
  79. public:
  80. FactoryInproc() {}
  81. ~FactoryInproc() {}
  82. HRESULT __stdcall CreateInstance(
  83. IUnknown * pUnkOuter,
  84. REFIID riid,
  85. void ** ppv );
  86. };
  87. #endif
  88.