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 static HRESULT WINAPI
MSTASK_IClassFactory_QueryInterface(
29 ClassFactoryImpl
*This
= (ClassFactoryImpl
*)iface
;
31 TRACE("IID: %s\n",debugstr_guid(riid
));
35 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
36 IsEqualGUID(riid
, &IID_IClassFactory
))
38 *ppvObj
= &This
->lpVtbl
;
39 IClassFactory_AddRef(iface
);
43 WARN("Unknown interface: %s\n", debugstr_guid(riid
));
48 static ULONG WINAPI
MSTASK_IClassFactory_AddRef(LPCLASSFACTORY iface
)
51 InterlockedIncrement(&dll_ref
);
55 static ULONG WINAPI
MSTASK_IClassFactory_Release(LPCLASSFACTORY iface
)
58 InterlockedDecrement(&dll_ref
);
62 static HRESULT WINAPI
MSTASK_IClassFactory_CreateInstance(
69 IUnknown
*punk
= NULL
;
72 TRACE("IID: %s\n",debugstr_guid(riid
));
75 return CLASS_E_NOAGGREGATION
;
77 res
= TaskSchedulerConstructor((LPVOID
*) &punk
);
81 res
= ITaskScheduler_QueryInterface(punk
, riid
, ppvObj
);
82 ITaskScheduler_Release(punk
);
86 static HRESULT WINAPI
MSTASK_IClassFactory_LockServer(
93 MSTASK_IClassFactory_AddRef(iface
);
95 MSTASK_IClassFactory_Release(iface
);
99 static const IClassFactoryVtbl IClassFactory_Vtbl
=
101 MSTASK_IClassFactory_QueryInterface
,
102 MSTASK_IClassFactory_AddRef
,
103 MSTASK_IClassFactory_Release
,
104 MSTASK_IClassFactory_CreateInstance
,
105 MSTASK_IClassFactory_LockServer
108 ClassFactoryImpl MSTASK_ClassFactory
= { &IClassFactory_Vtbl
};