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.

72 lines
1.4 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995
  5. //
  6. // File: cprovcf.cxx
  7. //
  8. // Contents: Windows NT 3.5 Provider Object Class Factory Code
  9. //
  10. // CWinNTProviderCF::CreateInstance
  11. //
  12. // History: 01-30-95 krishnag Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "winnt.hxx"
  16. #pragma hdrstop
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Function: CWinNTProviderCF::CreateInstance
  20. //
  21. // Synopsis:
  22. //
  23. // Arguments: [pUnkOuter]
  24. // [iid]
  25. // [ppv]
  26. //
  27. // Returns: HRESULT
  28. //
  29. // Modifies:
  30. //
  31. // History: 01-30-95 krishnag Created.
  32. //----------------------------------------------------------------------------
  33. STDMETHODIMP
  34. CWinNTProviderCF::CreateInstance(
  35. IUnknown * pUnkOuter,
  36. REFIID iid,
  37. LPVOID * ppv
  38. )
  39. {
  40. HRESULT hr;
  41. CWinNTProvider * pProvider;
  42. if (pUnkOuter)
  43. RRETURN(E_FAIL);
  44. hr = CWinNTProvider::Create(&pProvider);
  45. if (FAILED(hr)) {
  46. RRETURN (hr);
  47. }
  48. if (pProvider)
  49. {
  50. hr = pProvider->QueryInterface(iid, ppv);
  51. pProvider->Release();
  52. }
  53. else
  54. {
  55. *ppv = NULL;
  56. RRETURN(E_OUTOFMEMORY);
  57. }
  58. RRETURN(hr);
  59. }