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.

70 lines
1.7 KiB

  1. /**********************************************************************/
  2. /** Microsoft Passport **/
  3. /** Copyright(c) Microsoft Corporation, 1999 - 2001 **/
  4. /**********************************************************************/
  5. /*
  6. PassportFactory.cpp
  7. FILE HISTORY:
  8. */
  9. // PassportFactory.cpp : Implementation of CPassportFactory
  10. #include "stdafx.h"
  11. #include "PassportFactory.h"
  12. using namespace ATL;
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CPassportFactory
  15. //===========================================================================
  16. //
  17. // InterfaceSupportsErrorInfo
  18. //
  19. STDMETHODIMP CPassportFactory::InterfaceSupportsErrorInfo(REFIID riid)
  20. {
  21. static const IID* arr[] =
  22. {
  23. &IID_IPassportFactory,
  24. };
  25. for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
  26. {
  27. if (InlineIsEqualGUID(*arr[i],riid))
  28. return S_OK;
  29. }
  30. return S_FALSE;
  31. }
  32. //===========================================================================
  33. //
  34. // CreatePassportManager
  35. //
  36. STDMETHODIMP CPassportFactory::CreatePassportManager(
  37. IDispatch** ppDispPassportManager
  38. )
  39. {
  40. HRESULT hr;
  41. if(ppDispPassportManager == NULL)
  42. {
  43. hr = E_INVALIDARG;
  44. goto Cleanup;
  45. }
  46. CComObject<CManager>* pObj = NULL;
  47. * ppDispPassportManager = NULL;
  48. hr = ATL::CComObject<CManager>::CreateInstance(&pObj); // this has 0 ref count on it, don't need release here
  49. if (hr == S_OK && pObj)
  50. {
  51. hr = pObj->QueryInterface(__uuidof(IDispatch), (void**)ppDispPassportManager);
  52. }
  53. Cleanup:
  54. return hr;
  55. }