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.

60 lines
1.6 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: umiconcf.cxx
  7. //
  8. // Contents: Contains the class factory for creating UMI connection objects.
  9. //
  10. // History: 03-02-00 SivaramR Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #include "winnt.hxx"
  14. //----------------------------------------------------------------------------
  15. // Function: CreateInstance
  16. //
  17. // Synopsis: Creates a connection object.
  18. //
  19. // Arguments:
  20. //
  21. // pUnkOuter Pointer to aggregating IUnknown. UMI connection objects don't
  22. // support aggregation, so this has to be NULL.
  23. // iid Interface requested. Only interface supported is IUmiConnection.
  24. // ppInterface Returns pointer to interface requested
  25. //
  26. // Returns: S_OK on success. Error code otherwise.
  27. //
  28. // Modifies: *ppInterface to return a pointer to the interface requested
  29. //
  30. //----------------------------------------------------------------------------
  31. STDMETHODIMP CUmiConnectionCF::CreateInstance(
  32. IUnknown * pUnkOuter,
  33. REFIID iid,
  34. LPVOID *ppInterface
  35. )
  36. {
  37. HRESULT hr = S_OK;
  38. if(pUnkOuter != NULL)
  39. // Umi connection object cannot be aggregated
  40. RRETURN(CLASS_E_NOAGGREGATION);
  41. if(NULL == ppInterface)
  42. RRETURN(E_FAIL);
  43. *ppInterface = NULL;
  44. hr = CUmiConnection::CreateConnection(iid, ppInterface);
  45. BAIL_ON_FAILURE(hr);
  46. error:
  47. RRETURN(hr);
  48. }