ReactOS 0.4.16-dev-2354-g16de117
antimoniker.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wine/debug.h"
#include "moniker.h"
Include dependency graph for antimoniker.c:

Go to the source code of this file.

Classes

struct  AntiMonikerImpl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct AntiMonikerImpl AntiMonikerImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static AntiMonikerImplimpl_from_IMoniker (IMoniker *iface)
 
static AntiMonikerImplimpl_from_IROTData (IROTData *iface)
 
static AntiMonikerImplunsafe_impl_from_IMoniker (IMoniker *iface)
 
BOOL is_anti_moniker (IMoniker *iface, DWORD *order)
 
static HRESULT WINAPI AntiMonikerImpl_QueryInterface (IMoniker *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI AntiMonikerImpl_AddRef (IMoniker *iface)
 
static ULONG WINAPI AntiMonikerImpl_Release (IMoniker *iface)
 
static HRESULT WINAPI AntiMonikerImpl_GetClassID (IMoniker *iface, CLSID *pClassID)
 
static HRESULT WINAPI AntiMonikerImpl_IsDirty (IMoniker *iface)
 
static HRESULT WINAPI AntiMonikerImpl_Load (IMoniker *iface, IStream *stream)
 
static HRESULT WINAPI AntiMonikerImpl_Save (IMoniker *iface, IStream *stream, BOOL clear_dirty)
 
static HRESULT WINAPI AntiMonikerImpl_GetSizeMax (IMoniker *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI AntiMonikerImpl_BindToObject (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
 
static HRESULT WINAPI AntiMonikerImpl_BindToStorage (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
 
static HRESULT WINAPI AntiMonikerImpl_Reduce (IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
 
static HRESULT WINAPI AntiMonikerImpl_ComposeWith (IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
 
static HRESULT WINAPI AntiMonikerImpl_Enum (IMoniker *iface, BOOL forward, IEnumMoniker **ppenumMoniker)
 
static HRESULT WINAPI AntiMonikerImpl_IsEqual (IMoniker *iface, IMoniker *other)
 
static HRESULT WINAPI AntiMonikerImpl_Hash (IMoniker *iface, DWORD *hash)
 
static HRESULT WINAPI AntiMonikerImpl_IsRunning (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
 
static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pAntiTime)
 
static HRESULT WINAPI AntiMonikerImpl_Inverse (IMoniker *iface, IMoniker **ppmk)
 
static HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith (IMoniker *iface, IMoniker *other, IMoniker **prefix)
 
static HRESULT WINAPI AntiMonikerImpl_RelativePathTo (IMoniker *iface, IMoniker *other, IMoniker **result)
 
static HRESULT WINAPI AntiMonikerImpl_GetDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *displayname)
 
static HRESULT WINAPI AntiMonikerImpl_ParseDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
 
static HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker (IMoniker *iface, DWORD *pwdMksys)
 
static HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface (IROTData *iface, REFIID riid, VOID **ppvObject)
 
static ULONG WINAPI AntiMonikerROTDataImpl_AddRef (IROTData *iface)
 
static ULONG WINAPI AntiMonikerROTDataImpl_Release (IROTData *iface)
 
static HRESULT WINAPI AntiMonikerROTDataImpl_GetComparisonData (IROTData *iface, BYTE *data, ULONG data_len, ULONG *data_req)
 
HRESULT create_anti_moniker (DWORD order, IMoniker **ret)
 
HRESULT WINAPI CreateAntiMoniker (IMoniker **moniker)
 
HRESULT WINAPI AntiMoniker_CreateInstance (IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
 

Variables

static const IMonikerVtbl VT_AntiMonikerImpl
 
static const IROTDataVtbl VT_ROTDataImpl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file antimoniker.c.

Typedef Documentation

◆ AntiMonikerImpl

Function Documentation

◆ AntiMoniker_CreateInstance()

HRESULT WINAPI AntiMoniker_CreateInstance ( IClassFactory iface,
IUnknown pUnk,
REFIID  riid,
void **  ppv 
)

Definition at line 633 of file antimoniker.c.

635{
636 IMoniker *pMoniker;
637 HRESULT hr;
638
639 TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
640
641 *ppv = NULL;
642
643 if (pUnk)
645
646 hr = CreateAntiMoniker(&pMoniker);
647 if (FAILED(hr))
648 return hr;
649
650 hr = IMoniker_QueryInterface(pMoniker, riid, ppv);
651 IMoniker_Release(pMoniker);
652
653 return hr;
654}
HRESULT WINAPI CreateAntiMoniker(IMoniker **moniker)
Definition: antimoniker.c:626
#define NULL
Definition: types.h:112
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ AntiMonikerImpl_AddRef()

static ULONG WINAPI AntiMonikerImpl_AddRef ( IMoniker iface)
static

Definition at line 115 of file antimoniker.c.

116{
118 ULONG refcount = InterlockedIncrement(&moniker->refcount);
119
120 TRACE("%p, refcount %lu.\n", iface, refcount);
121
122 return refcount;
123}
static AntiMonikerImpl * impl_from_IMoniker(IMoniker *iface)
Definition: antimoniker.c:42
#define InterlockedIncrement
Definition: armddk.h:53
Definition: main.c:40
uint32_t ULONG
Definition: typedefs.h:59

Referenced by AntiMonikerImpl_Reduce(), and AntiMonikerROTDataImpl_AddRef().

◆ AntiMonikerImpl_BindToObject()

static HRESULT WINAPI AntiMonikerImpl_BindToObject ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
REFIID  riid,
VOID **  ppvResult 
)
static

Definition at line 241 of file antimoniker.c.

243{
244 TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
245 return E_NOTIMPL;
246}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ AntiMonikerImpl_BindToStorage()

static HRESULT WINAPI AntiMonikerImpl_BindToStorage ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
REFIID  riid,
VOID **  ppvResult 
)
static

Definition at line 252 of file antimoniker.c.

254{
255 TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
256 return E_NOTIMPL;
257}

◆ AntiMonikerImpl_CommonPrefixWith()

static HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith ( IMoniker iface,
IMoniker other,
IMoniker **  prefix 
)
static

Definition at line 401 of file antimoniker.c.

402{
403 AntiMonikerImpl *moniker = impl_from_IMoniker(iface), *other_moniker;
404 HRESULT hr;
405
406 TRACE("%p, %p, %p.\n", iface, other, prefix);
407
408 other_moniker = unsafe_impl_from_IMoniker(other);
409 if (other_moniker)
410 {
411 if (moniker->count <= other_moniker->count)
412 {
413 *prefix = iface;
414 hr = moniker->count == other_moniker->count ? MK_S_US : MK_S_ME;
415 }
416 else
417 {
418 *prefix = other;
419 hr = MK_S_HIM;
420 }
421
422 IMoniker_AddRef(*prefix);
423 return hr;
424 }
425
426 return MonikerCommonPrefixWith(iface, other, prefix);
427}
static AntiMonikerImpl * unsafe_impl_from_IMoniker(IMoniker *iface)
Definition: antimoniker.c:589
HRESULT WINAPI MonikerCommonPrefixWith(IMoniker *pmkThis, IMoniker *pmkOther, IMoniker **ppmkCommon)
int other
Definition: msacm.c:1376
Character const *const prefix
Definition: tempnam.cpp:195
#define MK_S_ME
Definition: winerror.h:3895
#define MK_S_HIM
Definition: winerror.h:3897
#define MK_S_US
Definition: winerror.h:3899

◆ AntiMonikerImpl_ComposeWith()

static HRESULT WINAPI AntiMonikerImpl_ComposeWith ( IMoniker iface,
IMoniker pmkRight,
BOOL  fOnlyIfNotGeneric,
IMoniker **  ppmkComposite 
)
static

Definition at line 278 of file antimoniker.c.

280{
281
282 TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
283
284 if ((ppmkComposite==NULL)||(pmkRight==NULL))
285 return E_POINTER;
286
287 *ppmkComposite=0;
288
289 if (fOnlyIfNotGeneric)
290 return MK_E_NEEDGENERIC;
291 else
292 return CreateGenericComposite(iface,pmkRight,ppmkComposite);
293}
HRESULT WINAPI CreateGenericComposite(IMoniker *left, IMoniker *right, IMoniker **composite)
#define MK_E_NEEDGENERIC
Definition: winerror.h:3893
#define E_POINTER
Definition: winerror.h:3480

◆ AntiMonikerImpl_Enum()

static HRESULT WINAPI AntiMonikerImpl_Enum ( IMoniker iface,
BOOL  forward,
IEnumMoniker **  ppenumMoniker 
)
static

Definition at line 295 of file antimoniker.c.

296{
297 TRACE("%p, %d, %p.\n", iface, forward, ppenumMoniker);
298
299 if (ppenumMoniker == NULL)
300 return E_INVALIDARG;
301
302 *ppenumMoniker = NULL;
303
304 return S_OK;
305}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

◆ AntiMonikerImpl_GetClassID()

static HRESULT WINAPI AntiMonikerImpl_GetClassID ( IMoniker iface,
CLSID pClassID 
)
static

Definition at line 148 of file antimoniker.c.

149{
150 TRACE("(%p,%p)\n",iface,pClassID);
151
152 if (pClassID==NULL)
153 return E_POINTER;
154
155 *pClassID = CLSID_AntiMoniker;
156
157 return S_OK;
158}

◆ AntiMonikerImpl_GetDisplayName()

static HRESULT WINAPI AntiMonikerImpl_GetDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR displayname 
)
static

Definition at line 446 of file antimoniker.c.

447{
449 static const WCHAR nameW[] = {'\\','.','.'};
450 WCHAR *ptrW;
451 int i;
452
453 TRACE("%p, %p, %p, %p.\n", iface, pbc, pmkToLeft, displayname);
454
455 if (!displayname)
456 return E_POINTER;
457
458 if (pmkToLeft!=NULL){
459 FIXME("() pmkToLeft!=NULL not implemented\n");
460 return E_NOTIMPL;
461 }
462
463 *displayname = ptrW = CoTaskMemAlloc((moniker->count * ARRAY_SIZE(nameW) + 1) * sizeof(WCHAR));
464 if (!*displayname)
465 return E_OUTOFMEMORY;
466
467 for (i = 0; i < moniker->count; ++i)
468 memcpy(ptrW + i * ARRAY_SIZE(nameW), nameW, sizeof(nameW));
469 ptrW[moniker->count * ARRAY_SIZE(nameW)] = 0;
470
471 return S_OK;
472}
static const WCHAR nameW[]
Definition: main.c:49
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
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 CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ AntiMonikerImpl_GetSizeMax()

static HRESULT WINAPI AntiMonikerImpl_GetSizeMax ( IMoniker iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 216 of file antimoniker.c.

217{
218 TRACE("(%p,%p)\n",iface,pcbSize);
219
220 if (!pcbSize)
221 return E_POINTER;
222
223 /* for more details see AntiMonikerImpl_Save comments */
224
225 /*
226 * Normally the sizemax must be sizeof DWORD, but
227 * I tested this function it usually return 16 bytes
228 * more than the number of bytes used by AntiMoniker::Save function
229 */
230 pcbSize->u.LowPart = sizeof(DWORD)+16;
231
232 pcbSize->u.HighPart=0;
233
234 return S_OK;
235}
#define DWORD
Definition: nt_native.h:44
struct _ULARGE_INTEGER::@4458 u

◆ AntiMonikerImpl_GetTimeOfLastChange()

static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
FILETIME pAntiTime 
)
static

Definition at line 373 of file antimoniker.c.

377{
378 TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pAntiTime);
379 return E_NOTIMPL;
380}

◆ AntiMonikerImpl_Hash()

static HRESULT WINAPI AntiMonikerImpl_Hash ( IMoniker iface,
DWORD hash 
)
static

Definition at line 329 of file antimoniker.c.

330{
332
333 TRACE("%p, %p.\n", iface, hash);
334
335 if (!hash)
336 return E_POINTER;
337
338 *hash = 0x80000000 | moniker->count;
339
340 return S_OK;
341}
Definition: _hash_fun.h:40

◆ AntiMonikerImpl_Inverse()

static HRESULT WINAPI AntiMonikerImpl_Inverse ( IMoniker iface,
IMoniker **  ppmk 
)
static

Definition at line 386 of file antimoniker.c.

387{
388 TRACE("(%p,%p)\n",iface,ppmk);
389
390 if (ppmk==NULL)
391 return E_POINTER;
392
393 *ppmk=0;
394
395 return MK_E_NOINVERSE;
396}
#define MK_E_NOINVERSE
Definition: winerror.h:3907

◆ AntiMonikerImpl_IsDirty()

static HRESULT WINAPI AntiMonikerImpl_IsDirty ( IMoniker iface)
static

Definition at line 164 of file antimoniker.c.

165{
166 /* Note that the OLE-provided implementations of the IPersistStream::IsDirty
167 method in the OLE-provided moniker interfaces always return S_FALSE because
168 their internal state never changes. */
169
170 TRACE("(%p)\n",iface);
171
172 return S_FALSE;
173}
#define S_FALSE
Definition: winerror.h:3451

◆ AntiMonikerImpl_IsEqual()

static HRESULT WINAPI AntiMonikerImpl_IsEqual ( IMoniker iface,
IMoniker other 
)
static

Definition at line 310 of file antimoniker.c.

311{
312 AntiMonikerImpl *moniker = impl_from_IMoniker(iface), *other_moniker;
313
314 TRACE("%p, %p.\n", iface, other);
315
316 if (!other)
317 return E_INVALIDARG;
318
319 other_moniker = unsafe_impl_from_IMoniker(other);
320 if (!other_moniker)
321 return S_FALSE;
322
323 return moniker->count == other_moniker->count ? S_OK : S_FALSE;
324}

◆ AntiMonikerImpl_IsRunning()

static HRESULT WINAPI AntiMonikerImpl_IsRunning ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
IMoniker pmkNewlyRunning 
)
static

Definition at line 347 of file antimoniker.c.

349{
351 HRESULT res;
352
353 TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pmkNewlyRunning);
354
355 if (pbc==NULL)
356 return E_INVALIDARG;
357
358 res=IBindCtx_GetRunningObjectTable(pbc,&rot);
359
360 if (FAILED(res))
361 return res;
362
363 res = IRunningObjectTable_IsRunning(rot,iface);
364
365 IRunningObjectTable_Release(rot);
366
367 return res;
368}
GLfloat rot
Definition: 3dtext.c:36
GLuint res
Definition: glext.h:9613

◆ AntiMonikerImpl_IsSystemMoniker()

static HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker ( IMoniker iface,
DWORD pwdMksys 
)
static

Definition at line 490 of file antimoniker.c.

491{
492 TRACE("(%p,%p)\n",iface,pwdMksys);
493
494 if (!pwdMksys)
495 return E_POINTER;
496
497 (*pwdMksys)=MKSYS_ANTIMONIKER;
498
499 return S_OK;
500}

◆ AntiMonikerImpl_Load()

static HRESULT WINAPI AntiMonikerImpl_Load ( IMoniker iface,
IStream stream 
)
static

Definition at line 178 of file antimoniker.c.

179{
181 DWORD count = 0;
182 HRESULT hr;
183
184 TRACE("%p, %p.\n", iface, stream);
185
186 if (FAILED(hr = IStream_Read(stream, &count, sizeof(count), NULL)))
187 return hr;
188
189 if (count > 0xfffff)
190 return E_INVALIDARG;
191
192 moniker->count = count;
193
194 return S_OK;
195}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: parse.h:23

◆ AntiMonikerImpl_ParseDisplayName()

static HRESULT WINAPI AntiMonikerImpl_ParseDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR  pszDisplayName,
ULONG pchEaten,
IMoniker **  ppmkOut 
)
static

Definition at line 478 of file antimoniker.c.

481{
482 TRACE("(%p,%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
483 return E_NOTIMPL;
484}

◆ AntiMonikerImpl_QueryInterface()

static HRESULT WINAPI AntiMonikerImpl_QueryInterface ( IMoniker iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 73 of file antimoniker.c.

74{
76
77 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
78
79 if ( ppvObject==0 )
80 return E_INVALIDARG;
81
82 *ppvObject = 0;
83
87 IsEqualIID(&IID_IMoniker, riid) ||
88 IsEqualGUID(&CLSID_AntiMoniker, riid))
89 {
90 *ppvObject = iface;
91 }
92 else if (IsEqualIID(&IID_IROTData, riid))
93 *ppvObject = &This->IROTData_iface;
94 else if (IsEqualIID(&IID_IMarshal, riid))
95 {
96 HRESULT hr = S_OK;
97 if (!This->pMarshal)
98 hr = MonikerMarshal_Create(iface, &This->pMarshal);
99 if (hr != S_OK)
100 return hr;
101 return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject);
102 }
103
104 if ((*ppvObject)==0)
105 return E_NOINTERFACE;
106
107 IMoniker_AddRef(iface);
108
109 return S_OK;
110}
const GUID IID_IUnknown
HRESULT MonikerMarshal_Create(IMoniker *inner, IUnknown **outer)
Definition: moniker.c:1361
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

Referenced by AntiMonikerROTDataImpl_QueryInterface().

◆ AntiMonikerImpl_Reduce()

static HRESULT WINAPI AntiMonikerImpl_Reduce ( IMoniker iface,
IBindCtx pbc,
DWORD  dwReduceHowFar,
IMoniker **  ppmkToLeft,
IMoniker **  ppmkReduced 
)
static

Definition at line 260 of file antimoniker.c.

262{
263 TRACE("%p, %p, %ld, %p, %p.\n", iface, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced);
264
265 if (ppmkReduced==NULL)
266 return E_POINTER;
267
269
270 *ppmkReduced=iface;
271
273}
static ULONG WINAPI AntiMonikerImpl_AddRef(IMoniker *iface)
Definition: antimoniker.c:115
#define MK_S_REDUCED_TO_SELF
Definition: winerror.h:3892

◆ AntiMonikerImpl_RelativePathTo()

static HRESULT WINAPI AntiMonikerImpl_RelativePathTo ( IMoniker iface,
IMoniker other,
IMoniker **  result 
)
static

Definition at line 429 of file antimoniker.c.

430{
431 TRACE("%p, %p, %p.\n", iface, other, result);
432
433 if (!other || !result)
434 return E_INVALIDARG;
435
436 IMoniker_AddRef(other);
437 *result = other;
438
439 return MK_S_HIM;
440}
GLuint64EXT * result
Definition: glext.h:11304

◆ AntiMonikerImpl_Release()

static ULONG WINAPI AntiMonikerImpl_Release ( IMoniker iface)
static

Definition at line 128 of file antimoniker.c.

129{
131 ULONG refcount = InterlockedDecrement(&moniker->refcount);
132
133 TRACE("%p, refcount %lu.\n", iface, refcount);
134
135 if (!refcount)
136 {
137 if (moniker->pMarshal) IUnknown_Release(moniker->pMarshal);
138 free(moniker);
139 }
140
141 return refcount;
142}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5

Referenced by AntiMonikerROTDataImpl_Release().

◆ AntiMonikerImpl_Save()

static HRESULT WINAPI AntiMonikerImpl_Save ( IMoniker iface,
IStream stream,
BOOL  clear_dirty 
)
static

Definition at line 200 of file antimoniker.c.

201{
203
204 TRACE("%p, %p, %d.\n", iface, stream, clear_dirty);
205
206 return IStream_Write(stream, &moniker->count, sizeof(moniker->count), NULL);
207}

◆ AntiMonikerROTDataImpl_AddRef()

static ULONG WINAPI AntiMonikerROTDataImpl_AddRef ( IROTData iface)
static

Definition at line 518 of file antimoniker.c.

519{
521
522 TRACE("(%p)\n",iface);
523
524 return AntiMonikerImpl_AddRef(&This->IMoniker_iface);
525}
static AntiMonikerImpl * impl_from_IROTData(IROTData *iface)
Definition: antimoniker.c:47

◆ AntiMonikerROTDataImpl_GetComparisonData()

static HRESULT WINAPI AntiMonikerROTDataImpl_GetComparisonData ( IROTData iface,
BYTE data,
ULONG  data_len,
ULONG data_req 
)
static

Definition at line 543 of file antimoniker.c.

544{
546
547 TRACE("%p, %p, %lu, %p.\n", iface, data, data_len, data_req);
548
549 *data_req = sizeof(CLSID) + sizeof(DWORD);
550 if (data_len < *data_req)
551 return E_OUTOFMEMORY;
552
553 memcpy(data, &CLSID_AntiMoniker, sizeof(CLSID));
554 memcpy(data + sizeof(CLSID), &moniker->count, sizeof(moniker->count));
555
556 return S_OK;
557}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
IID CLSID
Definition: mstsclib_i.c:62

◆ AntiMonikerROTDataImpl_QueryInterface()

static HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface ( IROTData iface,
REFIID  riid,
VOID **  ppvObject 
)
static

Definition at line 506 of file antimoniker.c.

507{
509
510 TRACE("(%p,%s,%p)\n",iface,debugstr_guid(riid),ppvObject);
511
512 return AntiMonikerImpl_QueryInterface(&This->IMoniker_iface, riid, ppvObject);
513}
static HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
Definition: antimoniker.c:73

◆ AntiMonikerROTDataImpl_Release()

static ULONG WINAPI AntiMonikerROTDataImpl_Release ( IROTData iface)
static

Definition at line 530 of file antimoniker.c.

531{
533
534 TRACE("(%p)\n",iface);
535
536 return AntiMonikerImpl_Release(&This->IMoniker_iface);
537}
static ULONG WINAPI AntiMonikerImpl_Release(IMoniker *iface)
Definition: antimoniker.c:128

◆ create_anti_moniker()

HRESULT create_anti_moniker ( DWORD  order,
IMoniker **  ret 
)

Definition at line 606 of file antimoniker.c.

607{
609
610 if (!(moniker = calloc(1, sizeof(*moniker))))
611 return E_OUTOFMEMORY;
612
614 moniker->IROTData_iface.lpVtbl = &VT_ROTDataImpl;
615 moniker->refcount = 1;
616 moniker->count = order;
617
619
620 return S_OK;
621}
static const IMonikerVtbl VT_AntiMonikerImpl
Definition: antimoniker.c:562
static const IROTDataVtbl VT_ROTDataImpl
Definition: antimoniker.c:598
return ret
Definition: mutex.c:146
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define calloc
Definition: rosglue.h:14
IMoniker IMoniker_iface
Definition: main.c:41

Referenced by CreateAntiMoniker(), FileMonikerImpl_ComposeWith(), ItemMonikerImpl_ComposeWith(), and PointerMonikerImpl_ComposeWith().

◆ CreateAntiMoniker()

HRESULT WINAPI CreateAntiMoniker ( IMoniker **  moniker)

◆ impl_from_IMoniker()

static AntiMonikerImpl * impl_from_IMoniker ( IMoniker iface)
inlinestatic

◆ impl_from_IROTData()

static AntiMonikerImpl * impl_from_IROTData ( IROTData iface)
inlinestatic

◆ is_anti_moniker()

BOOL is_anti_moniker ( IMoniker iface,
DWORD order 
)

Definition at line 54 of file antimoniker.c.

55{
57
58 if (!moniker)
59 {
60 *order = 0;
61 return FALSE;
62 }
63
64 *order = moniker->count;
65
66 return TRUE;
67}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by ClassMoniker_ComposeWith(), FileMonikerImpl_ComposeWith(), ItemMonikerImpl_ComposeWith(), and PointerMonikerImpl_ComposeWith().

◆ unsafe_impl_from_IMoniker()

static AntiMonikerImpl * unsafe_impl_from_IMoniker ( IMoniker iface)
static

Definition at line 589 of file antimoniker.c.

590{
591 if (iface->lpVtbl != &VT_AntiMonikerImpl)
592 return NULL;
593 return CONTAINING_RECORD(iface, AntiMonikerImpl, IMoniker_iface);
594}

Referenced by AntiMonikerImpl_CommonPrefixWith(), AntiMonikerImpl_IsEqual(), and is_anti_moniker().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ VT_AntiMonikerImpl

const IMonikerVtbl VT_AntiMonikerImpl
static
Initial value:
=
{
}
static HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker *iface, BOOL forward, IEnumMoniker **ppenumMoniker)
Definition: antimoniker.c:295
static HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker(IMoniker *iface, DWORD *pwdMksys)
Definition: antimoniker.c:490
static HRESULT WINAPI AntiMonikerImpl_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
Definition: antimoniker.c:216
static HRESULT WINAPI AntiMonikerImpl_Save(IMoniker *iface, IStream *stream, BOOL clear_dirty)
Definition: antimoniker.c:200
static HRESULT WINAPI AntiMonikerImpl_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
Definition: antimoniker.c:241
static HRESULT WINAPI AntiMonikerImpl_Load(IMoniker *iface, IStream *stream)
Definition: antimoniker.c:178
static HRESULT WINAPI AntiMonikerImpl_Inverse(IMoniker *iface, IMoniker **ppmk)
Definition: antimoniker.c:386
static HRESULT WINAPI AntiMonikerImpl_IsRunning(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
Definition: antimoniker.c:347
static HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker *iface, DWORD *hash)
Definition: antimoniker.c:329
static HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker *iface, IMoniker *other, IMoniker **prefix)
Definition: antimoniker.c:401
static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pAntiTime)
Definition: antimoniker.c:373
static HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *displayname)
Definition: antimoniker.c:446
static HRESULT WINAPI AntiMonikerImpl_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
Definition: antimoniker.c:260
static HRESULT WINAPI AntiMonikerImpl_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
Definition: antimoniker.c:252
static HRESULT WINAPI AntiMonikerImpl_GetClassID(IMoniker *iface, CLSID *pClassID)
Definition: antimoniker.c:148
static HRESULT WINAPI AntiMonikerImpl_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: antimoniker.c:478
static HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker *iface, IMoniker *other)
Definition: antimoniker.c:310
static HRESULT WINAPI AntiMonikerImpl_ComposeWith(IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
Definition: antimoniker.c:278
static HRESULT WINAPI AntiMonikerImpl_IsDirty(IMoniker *iface)
Definition: antimoniker.c:164
static HRESULT WINAPI AntiMonikerImpl_RelativePathTo(IMoniker *iface, IMoniker *other, IMoniker **result)
Definition: antimoniker.c:429

Definition at line 562 of file antimoniker.c.

Referenced by create_anti_moniker(), and unsafe_impl_from_IMoniker().

◆ VT_ROTDataImpl

const IROTDataVtbl VT_ROTDataImpl
static
Initial value:
=
{
}
static HRESULT WINAPI AntiMonikerROTDataImpl_QueryInterface(IROTData *iface, REFIID riid, VOID **ppvObject)
Definition: antimoniker.c:506
static HRESULT WINAPI AntiMonikerROTDataImpl_GetComparisonData(IROTData *iface, BYTE *data, ULONG data_len, ULONG *data_req)
Definition: antimoniker.c:543
static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData *iface)
Definition: antimoniker.c:530
static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
Definition: antimoniker.c:518

Definition at line 598 of file antimoniker.c.

Referenced by create_anti_moniker().