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.

71 lines
1.6 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1998
  5. //
  6. // File: bindercf.cxx
  7. //
  8. // Contents: ADSI OLE DB Provider Binder Factory Code
  9. //
  10. // CADsBinderCF::CreateInstance
  11. //
  12. // History: 7-23-98 mgorti Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "oleds.hxx"
  16. #if (!defined(BUILD_FOR_NT40))
  17. #include "atl.h"
  18. #endif
  19. #include "bindercf.hxx"
  20. #if (!defined(BUILD_FOR_NT40))
  21. #include "binder.hxx"
  22. #endif
  23. #pragma hdrstop
  24. //+---------------------------------------------------------------------------
  25. //
  26. // Function: CBinderF::CreateInstance
  27. //
  28. // Synopsis:
  29. //
  30. // Arguments: [pUnkOuter]
  31. // [iid]
  32. // [ppv]
  33. //
  34. // Returns: HRESULT
  35. //
  36. // Modifies:
  37. //
  38. // History: 7-23-98 mgorti Created.
  39. //----------------------------------------------------------------------------
  40. STDMETHODIMP
  41. CADsBinderCF::CreateInstance(IUnknown * pUnkOuter, REFIID iid, LPVOID * ppv)
  42. {
  43. #if (!defined(BUILD_FOR_NT40))
  44. HRESULT hr = S_OK;
  45. // Create Instance code here
  46. CComObject<CBinder> *pBinder = NULL;
  47. hr = CComObject<CBinder>::CreateInstance(&pBinder);
  48. if (FAILED(hr))
  49. return hr;
  50. //To make sure we delete the binder object in case we encounter errors after this point.
  51. pBinder->AddRef();
  52. auto_rel<IBindResource> pBinderDelete(pBinder);
  53. hr = pBinder->QueryInterface(iid, (void**)ppv);
  54. if (FAILED(hr))
  55. return hr;
  56. return hr;
  57. #else
  58. return E_FAIL;
  59. #endif
  60. }