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.

42 lines
1.3 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright(C) 1997-1998 Microsoft Corporation all rights reserved.
  4. //
  5. // Module: sdocomponentfactory.cpp
  6. //
  7. // Project: Everest
  8. //
  9. // Description: Component Factory Implementation
  10. //
  11. // Log:
  12. //
  13. // When Who What
  14. // ---- --- ----
  15. // 6/08/98 TLP Initial Version
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #include "stdafx.h"
  19. #include "sdocomponentfactory.h"
  20. //////////////////////////////////////////////////////////////////////////
  21. ComponentPtr CComponentFactory::make(COMPONENTTYPE eComponentType, LONG lComponentId)
  22. {
  23. ComponentMasterPtr* mp = new(nothrow) ComponentMasterPtr((LONG)eComponentType, lComponentId);
  24. if ( NULL != mp )
  25. return ComponentPtr(mp);
  26. else
  27. return ComponentPtr();
  28. }
  29. ///////////////////////////////////////////////////////////////////////////////
  30. ComponentPtr MakeComponent(
  31. COMPONENTTYPE eComponentType,
  32. LONG lComponentId
  33. )
  34. {
  35. /////////////////////////////////////////////////////////////////////////
  36. static CComponentFactory theFactory; // One and only component factory
  37. /////////////////////////////////////////////////////////////////////////
  38. return theFactory.make(eComponentType, lComponentId);
  39. }