ReactOS 0.4.15-dev-8231-g29a56f3
enummoniker.c File Reference
#include "quartz_private.h"
#include "wine/debug.h"
Include dependency graph for enummoniker.c:

Go to the source code of this file.

Classes

struct  EnumMonikerImpl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct EnumMonikerImpl EnumMonikerImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
static EnumMonikerImplimpl_from_IEnumMoniker (IEnumMoniker *iface)
 
static ULONG WINAPI EnumMonikerImpl_AddRef (LPENUMMONIKER iface)
 
HRESULT EnumMonikerImpl_Create (IMoniker **ppMoniker, ULONG nMonikerCount, IEnumMoniker **ppEnum)
 
static HRESULT WINAPI EnumMonikerImpl_QueryInterface (LPENUMMONIKER iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI EnumMonikerImpl_Release (LPENUMMONIKER iface)
 
static HRESULT WINAPI EnumMonikerImpl_Next (LPENUMMONIKER iface, ULONG celt, IMoniker **rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI EnumMonikerImpl_Skip (LPENUMMONIKER iface, ULONG celt)
 
static HRESULT WINAPI EnumMonikerImpl_Reset (LPENUMMONIKER iface)
 
static HRESULT WINAPI EnumMonikerImpl_Clone (LPENUMMONIKER iface, IEnumMoniker **ppenum)
 

Variables

static const IEnumMonikerVtbl EnumMonikerImpl_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file enummoniker.c.

Typedef Documentation

◆ EnumMonikerImpl

Function Documentation

◆ EnumMonikerImpl_AddRef()

static ULONG WINAPI EnumMonikerImpl_AddRef ( LPENUMMONIKER  iface)
static

Definition at line 102 of file enummoniker.c.

103{
105 ULONG ref;
106
107 if (This == NULL) return E_POINTER;
108
110
111 TRACE("(%p)->() AddRef from %d\n", iface, ref - 1);
112
113 return ref;
114}
#define InterlockedIncrement
Definition: armddk.h:53
#define NULL
Definition: types.h:112
static EnumMonikerImpl * impl_from_IEnumMoniker(IEnumMoniker *iface)
Definition: enummoniker.c:40
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59
#define E_POINTER
Definition: winerror.h:2365

Referenced by EnumMonikerImpl_QueryInterface().

◆ EnumMonikerImpl_Clone()

static HRESULT WINAPI EnumMonikerImpl_Clone ( LPENUMMONIKER  iface,
IEnumMoniker **  ppenum 
)
static

Definition at line 189 of file enummoniker.c.

190{
191 FIXME("(%p)->(%p): stub\n", iface, ppenum);
192
193 return E_NOTIMPL;
194}
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EnumMonikerImpl_Create()

HRESULT EnumMonikerImpl_Create ( IMoniker **  ppMoniker,
ULONG  nMonikerCount,
IEnumMoniker **  ppEnum 
)

Definition at line 47 of file enummoniker.c.

48{
49 /* NOTE: assumes that array of IMonikers has already been AddRef'd
50 * I.e. this function does not AddRef the array of incoming
51 * IMonikers */
53
54 TRACE("(%p, %d, %p)\n", ppMoniker, nMonikerCount, ppEnum);
55
56 *ppEnum = NULL;
57
58 if (!pemi)
59 return E_OUTOFMEMORY;
60
62 pemi->ref = 1;
63 pemi->ppMoniker = CoTaskMemAlloc(nMonikerCount * sizeof(IMoniker*));
64 memcpy(pemi->ppMoniker, ppMoniker, nMonikerCount*sizeof(IMoniker*));
65 pemi->nMonikerCount = nMonikerCount;
66 pemi->index = 0;
67
68 *ppEnum = &pemi->IEnumMoniker_iface;
69
70 return S_OK;
71}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IEnumMonikerVtbl EnumMonikerImpl_Vtbl
Definition: enummoniker.c:38
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define S_OK
Definition: intsafe.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
IEnumMoniker IEnumMoniker_iface
Definition: mediacatenum.c:36
IMoniker ** ppMoniker
Definition: enummoniker.c:33
ULONG nMonikerCount
Definition: enummoniker.c:34

Referenced by FilterMapper3_EnumMatchingFilters().

◆ EnumMonikerImpl_Next()

static HRESULT WINAPI EnumMonikerImpl_Next ( LPENUMMONIKER  iface,
ULONG  celt,
IMoniker **  rgelt,
ULONG pceltFetched 
)
static

Definition at line 141 of file enummoniker.c.

142{
143 ULONG fetched;
145
146 TRACE("(%p)->(%d, %p, %p)\n", iface, celt, rgelt, pceltFetched);
147
148 for (fetched = 0; (This->index + fetched < This->nMonikerCount) && (fetched < celt); fetched++)
149 {
150 rgelt[fetched] = This->ppMoniker[This->index + fetched];
151 IMoniker_AddRef(rgelt[fetched]);
152 }
153
154 This->index += fetched;
155
156 TRACE("-- fetched %d\n", fetched);
157
158 if (pceltFetched)
159 *pceltFetched = fetched;
160
161 if (fetched != celt)
162 return S_FALSE;
163 else
164 return S_OK;
165}
#define S_FALSE
Definition: winerror.h:2357

◆ EnumMonikerImpl_QueryInterface()

static HRESULT WINAPI EnumMonikerImpl_QueryInterface ( LPENUMMONIKER  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 76 of file enummoniker.c.

80{
82 TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
83
84 if (This == NULL || ppvObj == NULL) return E_POINTER;
85
88 {
89 *ppvObj = iface;
91 return S_OK;
92 }
93
94 *ppvObj = NULL;
95 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
96 return E_NOINTERFACE;
97}
const GUID IID_IUnknown
static ULONG WINAPI EnumMonikerImpl_AddRef(LPENUMMONIKER iface)
Definition: enummoniker.c:102
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IEnumMoniker
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ EnumMonikerImpl_Release()

static ULONG WINAPI EnumMonikerImpl_Release ( LPENUMMONIKER  iface)
static

Definition at line 119 of file enummoniker.c.

120{
123
124 TRACE("(%p)->() Release from %d\n", iface, ref + 1);
125
126 if (!ref)
127 {
128 ULONG i;
129
130 for (i = 0; i < This->nMonikerCount; i++)
131 IMoniker_Release(This->ppMoniker[i]);
132
133 CoTaskMemFree(This->ppMoniker);
134 This->ppMoniker = NULL;
136 return 0;
137 }
138 return ref;
139}
#define InterlockedDecrement
Definition: armddk.h:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442

◆ EnumMonikerImpl_Reset()

static HRESULT WINAPI EnumMonikerImpl_Reset ( LPENUMMONIKER  iface)
static

Definition at line 178 of file enummoniker.c.

179{
181
182 TRACE("(%p)->()\n", iface);
183
184 This->index = 0;
185
186 return S_OK;
187}

◆ EnumMonikerImpl_Skip()

static HRESULT WINAPI EnumMonikerImpl_Skip ( LPENUMMONIKER  iface,
ULONG  celt 
)
static

Definition at line 167 of file enummoniker.c.

168{
170
171 TRACE("(%p)->(%d)\n", iface, celt);
172
173 This->index += celt;
174
175 return S_OK;
176}

◆ impl_from_IEnumMoniker()

static EnumMonikerImpl * impl_from_IEnumMoniker ( IEnumMoniker iface)
inlinestatic

Definition at line 40 of file enummoniker.c.

41{
42 return CONTAINING_RECORD(iface, EnumMonikerImpl, IEnumMoniker_iface);
43}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by EnumMonikerImpl_AddRef(), EnumMonikerImpl_Next(), EnumMonikerImpl_QueryInterface(), EnumMonikerImpl_Release(), EnumMonikerImpl_Reset(), and EnumMonikerImpl_Skip().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ EnumMonikerImpl_Vtbl

static const IEnumMonikerVtbl EnumMonikerImpl_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI EnumMonikerImpl_Reset(LPENUMMONIKER iface)
Definition: enummoniker.c:178
static HRESULT WINAPI EnumMonikerImpl_Next(LPENUMMONIKER iface, ULONG celt, IMoniker **rgelt, ULONG *pceltFetched)
Definition: enummoniker.c:141
static HRESULT WINAPI EnumMonikerImpl_Clone(LPENUMMONIKER iface, IEnumMoniker **ppenum)
Definition: enummoniker.c:189
static HRESULT WINAPI EnumMonikerImpl_QueryInterface(LPENUMMONIKER iface, REFIID riid, LPVOID *ppvObj)
Definition: enummoniker.c:76
static ULONG WINAPI EnumMonikerImpl_Release(LPENUMMONIKER iface)
Definition: enummoniker.c:119
static HRESULT WINAPI EnumMonikerImpl_Skip(LPENUMMONIKER iface, ULONG celt)
Definition: enummoniker.c:167

Definition at line 38 of file enummoniker.c.

Referenced by EnumMonikerImpl_Create().