CPROVCF.CPP

/*++ 

Copyright (c) 1996 Microsoft Corporation

Module Name:

CProvCF.cpp

Abstract:

ADs Provider Object Class Factory Code

Author:

Environment:

User mode

Revision History :

--*/
#include "adssmp.h"
#pragma hdrstop


//+---------------------------------------------------------------------------
//
// Function: CSampleDSProviderCF::CreateInstance
//
// Synopsis:
//
// Arguments: [pUnkOuter]
// [iid]
// [ppv]
//
// Returns: HRESULT
//
// Modifies:
//
//----------------------------------------------------------------------------
STDMETHODIMP
CSampleDSProviderCF::CreateInstance(IUnknown * pUnkOuter, REFIID iid, LPVOID * ppv)
{
HRESULT hr;
CSampleDSProvider * pProvider;

if (pUnkOuter)
RRETURN(E_FAIL);


hr = CSampleDSProvider::Create(&pProvider);

if (FAILED(hr)) {
RRETURN (hr);
}

if (pProvider)
{
hr = pProvider->QueryInterface(iid, ppv);
pProvider->Release();
}
else
{
*ppv = NULL;
RRETURN(E_OUTOFMEMORY);
}

RRETURN(hr);
}