2009-01-31 15:32:09 +00:00
|
|
|
/*
|
|
|
|
* Class factory interface for Queue Manager (BITS)
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Google (Roy Shea)
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "qmgr.h"
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
2013-06-16 11:10:20 +00:00
|
|
|
BITS_IClassFactory_AddRef(IClassFactory *iface)
|
2009-01-31 15:32:09 +00:00
|
|
|
{
|
2013-06-16 11:10:20 +00:00
|
|
|
return 2; /* non-heap based object */
|
2009-01-31 15:32:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2013-06-16 11:10:20 +00:00
|
|
|
BITS_IClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppvObj)
|
2009-01-31 15:32:09 +00:00
|
|
|
{
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory))
|
|
|
|
{
|
2013-06-16 11:10:20 +00:00
|
|
|
*ppvObj = &BITS_ClassFactory.IClassFactory_iface;
|
2009-01-31 15:32:09 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ppvObj = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
2013-06-16 11:10:20 +00:00
|
|
|
BITS_IClassFactory_Release(IClassFactory *iface)
|
2009-01-31 15:32:09 +00:00
|
|
|
{
|
2013-06-16 11:10:20 +00:00
|
|
|
return 1; /* non-heap based object */
|
2009-01-31 15:32:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2013-06-16 11:10:20 +00:00
|
|
|
BITS_IClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid,
|
|
|
|
void **ppvObj)
|
2009-01-31 15:32:09 +00:00
|
|
|
{
|
|
|
|
HRESULT res;
|
|
|
|
IUnknown *punk = NULL;
|
|
|
|
|
|
|
|
TRACE("IID: %s\n", debugstr_guid(riid));
|
|
|
|
|
|
|
|
if (pUnkOuter)
|
|
|
|
return CLASS_E_NOAGGREGATION;
|
|
|
|
|
|
|
|
res = BackgroundCopyManagerConstructor(pUnkOuter, (LPVOID*) &punk);
|
|
|
|
if (FAILED(res))
|
|
|
|
return res;
|
|
|
|
|
|
|
|
res = IUnknown_QueryInterface(punk, riid, ppvObj);
|
|
|
|
IUnknown_Release(punk);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2013-06-16 11:10:20 +00:00
|
|
|
BITS_IClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
|
2009-01-31 15:32:09 +00:00
|
|
|
{
|
|
|
|
FIXME("Not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IClassFactoryVtbl BITS_IClassFactory_Vtbl =
|
|
|
|
{
|
|
|
|
BITS_IClassFactory_QueryInterface,
|
|
|
|
BITS_IClassFactory_AddRef,
|
|
|
|
BITS_IClassFactory_Release,
|
|
|
|
BITS_IClassFactory_CreateInstance,
|
|
|
|
BITS_IClassFactory_LockServer
|
|
|
|
};
|
|
|
|
|
|
|
|
ClassFactoryImpl BITS_ClassFactory =
|
|
|
|
{
|
2013-06-16 11:10:20 +00:00
|
|
|
{ &BITS_IClassFactory_Vtbl }
|
2009-01-31 15:32:09 +00:00
|
|
|
};
|