Source code of Windows XP (NT5)
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.

58 lines
1.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: cconnect.hxx
  7. //
  8. // Contents: Class factory for the LDAP Connection Object.
  9. //
  10. // CLDAPConnectionCF::CreateInstance.
  11. //
  12. // History: 03-12-00 AjayR Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "ldap.hxx"
  16. #pragma hdrstop
  17. //+---------------------------------------------------------------------------
  18. // Function: CLDAPConnectionCF::CreateInstance
  19. //
  20. // Synopsis: Standard CreateInstance implementation.
  21. //
  22. // Arguments: pUnkOuter ---- standard outer IUnknown ptr.
  23. // iid ---- interface requested.
  24. // ppv ---- output ptr for created object.
  25. //
  26. // Returns: HRESULT - S_OK or any failure error code.
  27. //
  28. //----------------------------------------------------------------------------
  29. STDMETHODIMP
  30. CLDAPConnectionCF::CreateInstance(IUnknown * pUnkOuter, REFIID iid, LPVOID * ppv)
  31. {
  32. HRESULT hr;
  33. CLDAPConObject * pConObject;
  34. if (pUnkOuter)
  35. RRETURN(E_FAIL);
  36. hr = CLDAPConObject::CreateConnectionObject(&pConObject);
  37. if (FAILED(hr)) {
  38. RRETURN (hr);
  39. }
  40. if (pConObject) {
  41. hr = pConObject->QueryInterface(iid, ppv);
  42. pConObject->Release();
  43. }
  44. else
  45. {
  46. *ppv = NULL;
  47. RRETURN(E_OUTOFMEMORY);
  48. }
  49. RRETURN(hr);
  50. }