2 * Copyright (C) 2008 Google (Roy Shea)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "mstask_private.h"
20 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(mstask
);
24 struct ClassFactoryImpl
26 IClassFactory IClassFactory_iface
;
30 static inline ClassFactoryImpl
*impl_from_IClassFactory(IClassFactory
*iface
)
32 return CONTAINING_RECORD(iface
, ClassFactoryImpl
, IClassFactory_iface
);
35 static HRESULT WINAPI
MSTASK_IClassFactory_QueryInterface(
40 ClassFactoryImpl
*This
= impl_from_IClassFactory(iface
);
42 TRACE("IID: %s\n",debugstr_guid(riid
));
46 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
47 IsEqualGUID(riid
, &IID_IClassFactory
))
49 *ppvObj
= &This
->IClassFactory_iface
;
50 IClassFactory_AddRef(iface
);
54 WARN("Unknown interface: %s\n", debugstr_guid(riid
));
59 static ULONG WINAPI
MSTASK_IClassFactory_AddRef(LPCLASSFACTORY iface
)
62 InterlockedIncrement(&dll_ref
);
66 static ULONG WINAPI
MSTASK_IClassFactory_Release(LPCLASSFACTORY iface
)
69 InterlockedDecrement(&dll_ref
);
73 static HRESULT WINAPI
MSTASK_IClassFactory_CreateInstance(
80 IUnknown
*punk
= NULL
;
83 TRACE("IID: %s\n",debugstr_guid(riid
));
86 return CLASS_E_NOAGGREGATION
;
88 res
= TaskSchedulerConstructor((LPVOID
*) &punk
);
92 res
= ITaskScheduler_QueryInterface(punk
, riid
, ppvObj
);
93 ITaskScheduler_Release(punk
);
97 static HRESULT WINAPI
MSTASK_IClassFactory_LockServer(
104 MSTASK_IClassFactory_AddRef(iface
);
106 MSTASK_IClassFactory_Release(iface
);
110 static const IClassFactoryVtbl IClassFactory_Vtbl
=
112 MSTASK_IClassFactory_QueryInterface
,
113 MSTASK_IClassFactory_AddRef
,
114 MSTASK_IClassFactory_Release
,
115 MSTASK_IClassFactory_CreateInstance
,
116 MSTASK_IClassFactory_LockServer
119 ClassFactoryImpl MSTASK_ClassFactory
= { { &IClassFactory_Vtbl
} };