ReactOS 0.4.15-dev-7842-g558ab78
factory.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 Google (Roy Shea)
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include "mstask_private.h"
20#include "wine/debug.h"
21
23
25{
28};
29
31{
32 return CONTAINING_RECORD(iface, ClassFactoryImpl, IClassFactory_iface);
33}
34
36 LPCLASSFACTORY iface,
38 LPVOID *ppvObj)
39{
41
42 TRACE("IID: %s\n",debugstr_guid(riid));
43 if (ppvObj == NULL)
44 return E_POINTER;
45
48 {
49 *ppvObj = &This->IClassFactory_iface;
50 IClassFactory_AddRef(iface);
51 return S_OK;
52 }
53
54 WARN("Unknown interface: %s\n", debugstr_guid(riid));
55 *ppvObj = NULL;
56 return E_NOINTERFACE;
57}
58
60{
61 TRACE("\n");
63 return 2;
64}
65
67{
68 TRACE("\n");
70 return 1;
71}
72
74 IClassFactory *iface,
75 IUnknown *pUnkOuter,
77 LPVOID *ppvObj)
78{
80 IUnknown *punk = NULL;
81 *ppvObj = NULL;
82
83 TRACE("IID: %s\n",debugstr_guid(riid));
84
85 if (pUnkOuter)
87
89 if (FAILED(res))
90 return res;
91
92 res = IUnknown_QueryInterface(punk, riid, ppvObj);
93 IUnknown_Release(punk);
94 return res;
95}
96
98 IClassFactory *iface,
99 BOOL fLock)
100{
101 TRACE("\n");
102
103 if (fLock)
104 IClassFactory_AddRef(iface);
105 else
106 IClassFactory_Release(iface);
107 return S_OK;
108}
109
110static const IClassFactoryVtbl IClassFactory_Vtbl =
111{
117};
118
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: factory.c:51
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define WARN(fmt,...)
Definition: debug.h:112
#define NULL
Definition: types.h:112
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI MSTASK_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
Definition: factory.c:35
static const IClassFactoryVtbl IClassFactory_Vtbl
Definition: factory.c:110
ClassFactoryImpl MSTASK_ClassFactory
Definition: factory.c:119
static ULONG WINAPI MSTASK_IClassFactory_Release(IClassFactory *iface)
Definition: factory.c:66
static ULONG WINAPI MSTASK_IClassFactory_AddRef(IClassFactory *face)
Definition: factory.c:59
static HRESULT WINAPI MSTASK_IClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObj)
Definition: factory.c:73
static HRESULT WINAPI MSTASK_IClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: factory.c:97
LONG dll_ref
Definition: mstask_main.c:31
HRESULT TaskSchedulerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: factory.c:26
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define E_POINTER
Definition: winerror.h:2365