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
28 #include "mstask_private.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(mstask
);
33 struct ClassFactoryImpl
35 IClassFactory IClassFactory_iface
;
39 static inline ClassFactoryImpl
*impl_from_IClassFactory(IClassFactory
*iface
)
41 return CONTAINING_RECORD(iface
, ClassFactoryImpl
, IClassFactory_iface
);
44 static HRESULT WINAPI
MSTASK_IClassFactory_QueryInterface(
49 ClassFactoryImpl
*This
= impl_from_IClassFactory(iface
);
51 TRACE("IID: %s\n",debugstr_guid(riid
));
55 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
56 IsEqualGUID(riid
, &IID_IClassFactory
))
58 *ppvObj
= &This
->IClassFactory_iface
;
59 IClassFactory_AddRef(iface
);
63 WARN("Unknown interface: %s\n", debugstr_guid(riid
));
68 static ULONG WINAPI
MSTASK_IClassFactory_AddRef(IClassFactory
*face
)
71 InterlockedIncrement(&dll_ref
);
75 static ULONG WINAPI
MSTASK_IClassFactory_Release(IClassFactory
*iface
)
78 InterlockedDecrement(&dll_ref
);
82 static HRESULT WINAPI
MSTASK_IClassFactory_CreateInstance(
89 IUnknown
*punk
= NULL
;
92 TRACE("IID: %s\n",debugstr_guid(riid
));
95 return CLASS_E_NOAGGREGATION
;
97 res
= TaskSchedulerConstructor((LPVOID
*) &punk
);
101 res
= IUnknown_QueryInterface(punk
, riid
, ppvObj
);
102 IUnknown_Release(punk
);
106 static HRESULT WINAPI
MSTASK_IClassFactory_LockServer(
107 IClassFactory
*iface
,
113 IClassFactory_AddRef(iface
);
115 IClassFactory_Release(iface
);
119 static const IClassFactoryVtbl IClassFactory_Vtbl
=
121 MSTASK_IClassFactory_QueryInterface
,
122 MSTASK_IClassFactory_AddRef
,
123 MSTASK_IClassFactory_Release
,
124 MSTASK_IClassFactory_CreateInstance
,
125 MSTASK_IClassFactory_LockServer
128 ClassFactoryImpl MSTASK_ClassFactory
= { { &IClassFactory_Vtbl
} };