ReactOS  0.4.14-dev-376-gaedba84
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,
37  REFIID riid,
38  LPVOID *ppvObj)
39 {
41 
42  TRACE("IID: %s\n",debugstr_guid(riid));
43  if (ppvObj == NULL)
44  return E_POINTER;
45 
46  if (IsEqualGUID(riid, &IID_IUnknown) ||
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,
76  REFIID riid,
77  LPVOID *ppvObj)
78 {
79  HRESULT res;
80  IUnknown *punk = NULL;
81  *ppvObj = NULL;
82 
83  TRACE("IID: %s\n",debugstr_guid(riid));
84 
85  if (pUnkOuter)
86  return CLASS_E_NOAGGREGATION;
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 
110 static const IClassFactoryVtbl IClassFactory_Vtbl =
111 {
117 };
118 
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI MSTASK_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
Definition: factory.c:35
static ULONG WINAPI MSTASK_IClassFactory_AddRef(IClassFactory *face)
Definition: factory.c:59
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
HRESULT TaskSchedulerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN
static const IClassFactoryVtbl IClassFactory_Vtbl
Definition: factory.c:110
ClassFactoryImpl MSTASK_ClassFactory
Definition: factory.c:119
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
static ClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: factory.c:30
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
LONG dll_ref
Definition: mstask_main.c:31
#define InterlockedDecrement
Definition: armddk.h:52
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
IClassFactory IClassFactory_iface
Definition: factory.c:26
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI MSTASK_IClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObj)
Definition: factory.c:73
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
WINE_DEFAULT_DEBUG_CHANNEL(avifile)
static HRESULT WINAPI MSTASK_IClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: factory.c:97
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
static ULONG WINAPI MSTASK_IClassFactory_Release(IClassFactory *iface)
Definition: factory.c:66
#define E_POINTER
Definition: winerror.h:2365
const GUID IID_IClassFactory
GLenum GLuint GLint GLenum face
Definition: glext.h:7025