ReactOS 0.4.15-dev-7934-g1dc8d80
classmoniker.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wine/debug.h"
#include "ole2.h"
#include "moniker.h"
Include dependency graph for classmoniker.c:

Go to the source code of this file.

Classes

class  ClassMoniker
 

Macros

#define COBJMACROS
 
#define CHARS_IN_GUID   39
 

Typedefs

typedef struct ClassMoniker ClassMoniker
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static ClassMonikerimpl_from_IMoniker (IMoniker *iface)
 
static ClassMonikerimpl_from_IROTData (IROTData *iface)
 
static HRESULT WINAPI ClassMoniker_QueryInterface (IMoniker *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ClassMoniker_AddRef (IMoniker *iface)
 
static ULONG WINAPI ClassMoniker_Release (IMoniker *iface)
 
static HRESULT WINAPI ClassMoniker_GetClassID (IMoniker *iface, CLSID *pClassID)
 
static HRESULT WINAPI ClassMoniker_IsDirty (IMoniker *iface)
 
static HRESULT WINAPI ClassMoniker_Load (IMoniker *iface, IStream *pStm)
 
static HRESULT WINAPI ClassMoniker_Save (IMoniker *iface, IStream *pStm, BOOL fClearDirty)
 
static HRESULT WINAPI ClassMoniker_GetSizeMax (IMoniker *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI ClassMoniker_BindToObject (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
 
static HRESULT WINAPI ClassMoniker_BindToStorage (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
 
static HRESULT WINAPI ClassMoniker_Reduce (IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
 
static HRESULT WINAPI ClassMoniker_ComposeWith (IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
 
static HRESULT WINAPI ClassMoniker_Enum (IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
 
static HRESULT WINAPI ClassMoniker_IsEqual (IMoniker *iface, IMoniker *pmkOtherMoniker)
 
static HRESULT WINAPI ClassMoniker_Hash (IMoniker *iface, DWORD *pdwHash)
 
static HRESULT WINAPI ClassMoniker_IsRunning (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
 
static HRESULT WINAPI ClassMoniker_GetTimeOfLastChange (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pItemTime)
 
static HRESULT WINAPI ClassMoniker_Inverse (IMoniker *iface, IMoniker **ppmk)
 
static HRESULT WINAPI ClassMoniker_CommonPrefixWith (IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
 
static HRESULT WINAPI ClassMoniker_RelativePathTo (IMoniker *iface, IMoniker *pmOther, IMoniker **ppmkRelPath)
 
static HRESULT WINAPI ClassMoniker_GetDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
 
static HRESULT WINAPI ClassMoniker_ParseDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
 
static HRESULT WINAPI ClassMoniker_IsSystemMoniker (IMoniker *iface, DWORD *pwdMksys)
 
static HRESULT WINAPI ClassMonikerROTData_QueryInterface (IROTData *iface, REFIID riid, VOID **ppvObject)
 
static ULONG WINAPI ClassMonikerROTData_AddRef (IROTData *iface)
 
static ULONG WINAPI ClassMonikerROTData_Release (IROTData *iface)
 
static HRESULT WINAPI ClassMonikerROTData_GetComparisonData (IROTData *iface, BYTE *pbData, ULONG cbMax, ULONG *pcbData)
 
static HRESULT ClassMoniker_Construct (ClassMoniker *This, REFCLSID rclsid)
 
HRESULT WINAPI CreateClassMoniker (REFCLSID rclsid, IMoniker **ppmk)
 
HRESULT ClassMoniker_CreateFromDisplayName (LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, IMoniker **ppmk)
 
HRESULT WINAPI ClassMoniker_CreateInstance (IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
 

Variables

static const IMonikerVtbl ClassMonikerVtbl
 
static const IROTDataVtbl ROTDataVtbl
 

Macro Definition Documentation

◆ CHARS_IN_GUID

#define CHARS_IN_GUID   39

Definition at line 38 of file classmoniker.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file classmoniker.c.

Typedef Documentation

◆ ClassMoniker

Function Documentation

◆ ClassMoniker_AddRef()

static ULONG WINAPI ClassMoniker_AddRef ( IMoniker iface)
static

Definition at line 109 of file classmoniker.c.

110{
112
113 TRACE("(%p)\n",This);
114
115 return InterlockedIncrement(&This->ref);
116}
#define InterlockedIncrement
Definition: armddk.h:53
static ClassMoniker * impl_from_IMoniker(IMoniker *iface)
Definition: classmoniker.c:50
#define TRACE(s)
Definition: solgame.cpp:4

◆ ClassMoniker_BindToObject()

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

Definition at line 222 of file classmoniker.c.

227{
229 BIND_OPTS2 bindopts;
230 IClassActivator *pActivator;
231 HRESULT hr;
232
233 TRACE("(%p, %p, %s, %p)\n", pbc, pmkToLeft, debugstr_guid(riid), ppvResult);
234
235 bindopts.cbStruct = sizeof(bindopts);
236 IBindCtx_GetBindOptions(pbc, (BIND_OPTS *)&bindopts);
237
238 if (!pmkToLeft)
239 return CoGetClassObject(&This->clsid, bindopts.dwClassContext, NULL,
240 riid, ppvResult);
241 else
242 {
243 hr = IMoniker_BindToObject(pmkToLeft, pbc, NULL, &IID_IClassActivator,
244 (void **)&pActivator);
245 if (FAILED(hr)) return hr;
246
247 hr = IClassActivator_GetClassObject(pActivator, &This->clsid,
248 bindopts.dwClassContext,
249 bindopts.locale, riid, ppvResult);
250
251 IClassActivator_Release(pActivator);
252
253 return hr;
254 }
255}
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3103
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hr
Definition: shlfolder.c:183

◆ ClassMoniker_BindToStorage()

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

Definition at line 260 of file classmoniker.c.

265{
266 TRACE("(%p, %p, %s, %p)\n", pbc, pmkToLeft, debugstr_guid(riid), ppvResult);
267 return IMoniker_BindToObject(iface, pbc, pmkToLeft, riid, ppvResult);
268}

◆ ClassMoniker_CommonPrefixWith()

static HRESULT WINAPI ClassMoniker_CommonPrefixWith ( IMoniker iface,
IMoniker pmkOther,
IMoniker **  ppmkPrefix 
)
static

Definition at line 470 of file classmoniker.c.

471{
472 DWORD mkSys;
473
474 TRACE("(%p, %p)\n", pmkOther, ppmkPrefix);
475
476 *ppmkPrefix = NULL;
477
478 IMoniker_IsSystemMoniker(pmkOther, &mkSys);
479
480 /* If the other moniker is an class moniker that is equal to this moniker, this method sets *ppmkPrefix */
481 /* to this moniker and returns MK_S_US */
482
483 if (mkSys == MKSYS_CLASSMONIKER)
484 {
485 if (IMoniker_IsEqual(iface, pmkOther) == S_OK)
486 {
487 *ppmkPrefix = iface;
488
489 IMoniker_AddRef(iface);
490
491 return MK_S_US;
492 }
493 else
494 return MK_E_NOPREFIX;
495 }
496 else
497 /* otherwise, the method calls the MonikerCommonPrefixWith function. This function correctly handles */
498 /* the case where the other moniker is a generic composite. */
499 return MonikerCommonPrefixWith(iface, pmkOther, ppmkPrefix);
500}
HRESULT WINAPI MonikerCommonPrefixWith(IMoniker *pmkThis, IMoniker *pmkOther, IMoniker **ppmkCommon)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
#define MK_E_NOPREFIX
Definition: winerror.h:2795
#define MK_S_US
Definition: winerror.h:2776

◆ ClassMoniker_ComposeWith()

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

Definition at line 293 of file classmoniker.c.

297{
299 DWORD mkSys,mkSys2;
300 IEnumMoniker* penumMk=0;
301 IMoniker *pmostLeftMk=0;
302 IMoniker* tempMkComposite=0;
303
304 TRACE("(%p,%d,%p)\n", pmkRight, fOnlyIfNotGeneric, ppmkComposite);
305
306 if ((ppmkComposite==NULL)||(pmkRight==NULL))
307 return E_POINTER;
308
309 *ppmkComposite=0;
310
311 IMoniker_IsSystemMoniker(pmkRight,&mkSys);
312
313 /* If pmkRight is an anti-moniker, the returned moniker is NULL */
314 if(mkSys==MKSYS_ANTIMONIKER)
315 return res;
316
317 else
318 /* if pmkRight is a composite whose leftmost component is an anti-moniker, */
319 /* the returned moniker is the composite after the leftmost anti-moniker is removed. */
320
321 if(mkSys==MKSYS_GENERICCOMPOSITE){
322
323 res=IMoniker_Enum(pmkRight,TRUE,&penumMk);
324
325 if (FAILED(res))
326 return res;
327
328 res=IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL);
329
330 IMoniker_IsSystemMoniker(pmostLeftMk,&mkSys2);
331
332 if(mkSys2==MKSYS_ANTIMONIKER){
333
334 IMoniker_Release(pmostLeftMk);
335
336 tempMkComposite=iface;
337 IMoniker_AddRef(iface);
338
339 while(IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL)==S_OK){
340
341 res=CreateGenericComposite(tempMkComposite,pmostLeftMk,ppmkComposite);
342
343 IMoniker_Release(tempMkComposite);
344 IMoniker_Release(pmostLeftMk);
345
346 tempMkComposite=*ppmkComposite;
347 IMoniker_AddRef(tempMkComposite);
348 }
349 return res;
350 }
351 else
352 return CreateGenericComposite(iface,pmkRight,ppmkComposite);
353 }
354 /* If pmkRight is not an anti-moniker, the method combines the two monikers into a generic
355 composite if fOnlyIfNotGeneric is FALSE; if fOnlyIfNotGeneric is TRUE, the method returns
356 a NULL moniker and a return value of MK_E_NEEDGENERIC */
357 else
358 if (!fOnlyIfNotGeneric)
359 return CreateGenericComposite(iface,pmkRight,ppmkComposite);
360
361 else
362 return MK_E_NEEDGENERIC;
363}
HRESULT WINAPI CreateGenericComposite(IMoniker *pmkFirst, IMoniker *pmkRest, IMoniker **ppmkComposite)
#define TRUE
Definition: types.h:120
GLuint res
Definition: glext.h:9613
#define MK_E_NEEDGENERIC
Definition: winerror.h:2783
#define E_POINTER
Definition: winerror.h:2365

◆ ClassMoniker_Construct()

static HRESULT ClassMoniker_Construct ( ClassMoniker This,
REFCLSID  rclsid 
)
static

Definition at line 684 of file classmoniker.c.

685{
686 TRACE("(%p,%s)\n",This,debugstr_guid(rclsid));
687
688 /* Initialize the virtual function table. */
689 This->IMoniker_iface.lpVtbl = &ClassMonikerVtbl;
690 This->IROTData_iface.lpVtbl = &ROTDataVtbl;
691 This->ref = 0;
692 This->clsid = *rclsid;
693 This->pMarshal = NULL;
694
695 return S_OK;
696}
static const IMonikerVtbl ClassMonikerVtbl
Definition: classmoniker.c:644
static const IROTDataVtbl ROTDataVtbl
Definition: classmoniker.c:673

Referenced by CreateClassMoniker().

◆ ClassMoniker_CreateFromDisplayName()

HRESULT ClassMoniker_CreateFromDisplayName ( LPBC  pbc,
LPCOLESTR  szDisplayName,
LPDWORD  pchEaten,
IMoniker **  ppmk 
)

Definition at line 725 of file classmoniker.c.

727{
728 HRESULT hr;
729 LPCWSTR s = wcschr(szDisplayName, ':');
730 LPCWSTR end;
731 CLSID clsid;
732 BYTE table[256];
733 int i;
734
735 if (!s)
736 return MK_E_SYNTAX;
737
738 s++;
739
740 for (end = s; *end && (*end != ':'); end++)
741 ;
742
743 TRACE("parsing %s\n", debugstr_wn(s, end - s));
744
745 /* validate the CLSID string */
746 if (s[0] == '{')
747 {
748 if ((end - s != 38) || (s[37] != '}'))
749 return MK_E_SYNTAX;
750 s++;
751 }
752 else
753 {
754 if (end - s != 36)
755 return MK_E_SYNTAX;
756 }
757
758 for (i=0; i<36; i++)
759 {
760 if ((i == 8)||(i == 13)||(i == 18)||(i == 23))
761 {
762 if (s[i] != '-')
763 return MK_E_SYNTAX;
764 continue;
765 }
766 if (!(((s[i] >= '0') && (s[i] <= '9')) ||
767 ((s[i] >= 'a') && (s[i] <= 'f')) ||
768 ((s[i] >= 'A') && (s[i] <= 'F'))))
769 return MK_E_SYNTAX;
770 }
771
772 /* quick lookup table */
773 memset(table, 0, 256);
774
775 for (i = 0; i < 10; i++)
776 table['0' + i] = i;
777 for (i = 0; i < 6; i++)
778 {
779 table['A' + i] = i+10;
780 table['a' + i] = i+10;
781 }
782
783 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
784
785 clsid.Data1 = (table[s[0]] << 28 | table[s[1]] << 24 | table[s[2]] << 20 | table[s[3]] << 16 |
786 table[s[4]] << 12 | table[s[5]] << 8 | table[s[6]] << 4 | table[s[7]]);
787 clsid.Data2 = table[s[9]] << 12 | table[s[10]] << 8 | table[s[11]] << 4 | table[s[12]];
788 clsid.Data3 = table[s[14]] << 12 | table[s[15]] << 8 | table[s[16]] << 4 | table[s[17]];
789
790 /* these are just sequential bytes */
791 clsid.Data4[0] = table[s[19]] << 4 | table[s[20]];
792 clsid.Data4[1] = table[s[21]] << 4 | table[s[22]];
793 clsid.Data4[2] = table[s[24]] << 4 | table[s[25]];
794 clsid.Data4[3] = table[s[26]] << 4 | table[s[27]];
795 clsid.Data4[4] = table[s[28]] << 4 | table[s[29]];
796 clsid.Data4[5] = table[s[30]] << 4 | table[s[31]];
797 clsid.Data4[6] = table[s[32]] << 4 | table[s[33]];
798 clsid.Data4[7] = table[s[34]] << 4 | table[s[35]];
799
800 hr = CreateClassMoniker(&clsid, ppmk);
801 if (SUCCEEDED(hr))
802 *pchEaten = (*end == ':' ? end + 1 : end) - szDisplayName;
803 return hr;
804}
HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, IMoniker **ppmk)
Definition: classmoniker.c:701
#define wcschr
Definition: compat.h:17
GLdouble s
Definition: gl.h:2039
GLuint GLuint end
Definition: gl.h:1545
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
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_wn
Definition: kernel32.h:33
REFCLSID clsid
Definition: msctf.c:82
#define memset(x, y, z)
Definition: compat.h:39
#define MK_E_SYNTAX
Definition: winerror.h:2785
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193

Referenced by MkParseDisplayName().

◆ ClassMoniker_CreateInstance()

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

Definition at line 806 of file classmoniker.c.

808{
809 HRESULT hr;
810 IMoniker *pmk;
811
812 TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
813
814 *ppv = NULL;
815
816 if (pUnk)
818
820 if (FAILED(hr)) return hr;
821
822 hr = IMoniker_QueryInterface(pmk, riid, ppv);
823 IMoniker_Release(pmk);
824
825 return hr;
826}
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLSID_NULL
Definition: guiddef.h:99
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ ClassMoniker_Enum()

static HRESULT WINAPI ClassMoniker_Enum ( IMoniker iface,
BOOL  fForward,
IEnumMoniker **  ppenumMoniker 
)
static

Definition at line 368 of file classmoniker.c.

369{
370 TRACE("(%p,%d,%p)\n",iface,fForward,ppenumMoniker);
371
372 if (ppenumMoniker == NULL)
373 return E_POINTER;
374
375 *ppenumMoniker = NULL;
376
377 return S_OK;
378}

◆ ClassMoniker_GetClassID()

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

Definition at line 143 of file classmoniker.c.

144{
145 TRACE("(%p,%p),stub!\n",iface,pClassID);
146
147 if (pClassID==NULL)
148 return E_POINTER;
149
150 *pClassID = CLSID_ClassMoniker;
151
152 return S_OK;
153}

◆ ClassMoniker_GetDisplayName()

static HRESULT WINAPI ClassMoniker_GetDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR ppszDisplayName 
)
static

Definition at line 520 of file classmoniker.c.

524{
526 static const WCHAR wszClsidPrefix[] = {'c','l','s','i','d',':',0};
527
528 TRACE("(%p, %p, %p)\n", pbc, pmkToLeft, ppszDisplayName);
529
530 if (!ppszDisplayName)
531 return E_POINTER;
532
533 if (pmkToLeft)
534 return E_INVALIDARG;
535
536 *ppszDisplayName = CoTaskMemAlloc(sizeof(wszClsidPrefix) + (CHARS_IN_GUID-2) * sizeof(WCHAR));
537
538 StringFromGUID2(&This->clsid, *ppszDisplayName+ARRAY_SIZE(wszClsidPrefix)-2, CHARS_IN_GUID);
539
540 /* note: this overwrites the opening curly bracket of the CLSID string generated above */
541 memcpy(*ppszDisplayName, wszClsidPrefix, sizeof(wszClsidPrefix)-sizeof(WCHAR));
542
543 /* note: this overwrites the closing curly bracket of the CLSID string generated above */
544 (*ppszDisplayName)[ARRAY_SIZE(wszClsidPrefix)-2+CHARS_IN_GUID-2] = ':';
545 (*ppszDisplayName)[ARRAY_SIZE(wszClsidPrefix)-2+CHARS_IN_GUID-1] = '\0';
546
547 TRACE("string is %s\n", debugstr_w(*ppszDisplayName));
548 return S_OK;
549}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define CHARS_IN_GUID
Definition: classmoniker.c:38
#define E_INVALIDARG
Definition: ddrawi.h:101
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define debugstr_w
Definition: kernel32.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ClassMoniker_GetSizeMax()

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

Definition at line 209 of file classmoniker.c.

211{
212 TRACE("(%p)\n", pcbSize);
213
214 pcbSize->QuadPart = sizeof(CLSID) + sizeof(DWORD);
215
216 return S_OK;
217}
IID CLSID
Definition: mstsclib_i.c:62
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185

◆ ClassMoniker_GetTimeOfLastChange()

static HRESULT WINAPI ClassMoniker_GetTimeOfLastChange ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
FILETIME pItemTime 
)
static

Definition at line 444 of file classmoniker.c.

448{
449 TRACE("(%p, %p, %p)\n", pbc, pmkToLeft, pItemTime);
450
451 return MK_E_UNAVAILABLE;
452}
#define MK_E_UNAVAILABLE
Definition: winerror.h:2784

◆ ClassMoniker_Hash()

static HRESULT WINAPI ClassMoniker_Hash ( IMoniker iface,
DWORD pdwHash 
)
static

Definition at line 416 of file classmoniker.c.

417{
419
420 TRACE("(%p)\n", pdwHash);
421
422 *pdwHash = This->clsid.Data1;
423
424 return S_OK;
425}

◆ ClassMoniker_Inverse()

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

Definition at line 457 of file classmoniker.c.

458{
459 TRACE("(%p)\n",ppmk);
460
461 if (!ppmk)
462 return E_POINTER;
463
464 return CreateAntiMoniker(ppmk);
465}
HRESULT WINAPI CreateAntiMoniker(IMoniker **ppmk)
Definition: antimoniker.c:608

◆ ClassMoniker_IsDirty()

static HRESULT WINAPI ClassMoniker_IsDirty ( IMoniker iface)
static

Definition at line 158 of file classmoniker.c.

159{
160 /* Note that the OLE-provided implementations of the IPersistStream::IsDirty
161 method in the OLE-provided moniker interfaces always return S_FALSE because
162 their internal state never changes. */
163
164 TRACE("(%p)\n",iface);
165
166 return S_FALSE;
167}
#define S_FALSE
Definition: winerror.h:2357

◆ ClassMoniker_IsEqual()

static HRESULT WINAPI ClassMoniker_IsEqual ( IMoniker iface,
IMoniker pmkOtherMoniker 
)
static

Definition at line 383 of file classmoniker.c.

384{
385
386 CLSID clsid;
387 LPOLESTR dispName1,dispName2;
388 IBindCtx* bind;
390
391 TRACE("(%p,%p)\n",iface,pmkOtherMoniker);
392
393 if (!pmkOtherMoniker) return S_FALSE;
394
395
396 /* check if both are ClassMoniker */
397 if(FAILED (IMoniker_GetClassID(pmkOtherMoniker,&clsid))) return S_FALSE;
398 if(!IsEqualCLSID(&clsid,&CLSID_ClassMoniker)) return S_FALSE;
399
400 /* check if both displaynames are the same */
401 if(SUCCEEDED ((res = CreateBindCtx(0,&bind)))) {
402 if(SUCCEEDED (IMoniker_GetDisplayName(iface,bind,NULL,&dispName1))) {
403 if(SUCCEEDED (IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2))) {
404 if(wcscmp(dispName1,dispName2)==0) res = S_OK;
405 CoTaskMemFree(dispName2);
406 }
407 CoTaskMemFree(dispName1);
408 }
409 }
410 return res;
411}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static LPOLESTR
Definition: stg_prop.c:27
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36

◆ ClassMoniker_IsRunning()

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

Definition at line 430 of file classmoniker.c.

434{
435 TRACE("(%p, %p, %p)\n", pbc, pmkToLeft, pmkNewlyRunning);
436
437 /* as in native */
438 return E_NOTIMPL;
439}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClassMoniker_IsSystemMoniker()

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

Definition at line 568 of file classmoniker.c.

569{
570 TRACE("(%p,%p)\n",iface,pwdMksys);
571
572 if (!pwdMksys)
573 return E_POINTER;
574
575 *pwdMksys = MKSYS_CLASSMONIKER;
576
577 return S_OK;
578}

◆ ClassMoniker_Load()

static HRESULT WINAPI ClassMoniker_Load ( IMoniker iface,
IStream pStm 
)
static

Definition at line 172 of file classmoniker.c.

173{
175 HRESULT hr;
176 DWORD zero;
177
178 TRACE("(%p)\n", pStm);
179
180 hr = IStream_Read(pStm, &This->clsid, sizeof(This->clsid), NULL);
181 if (hr != S_OK) return STG_E_READFAULT;
182
183 hr = IStream_Read(pStm, &zero, sizeof(zero), NULL);
184 if ((hr != S_OK) || (zero != 0)) return STG_E_READFAULT;
185
186 return S_OK;
187}
int zero
Definition: sehframes.cpp:29
#define STG_E_READFAULT
Definition: winerror.h:2576

◆ ClassMoniker_ParseDisplayName()

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

Definition at line 554 of file classmoniker.c.

560{
561 FIXME("(%p, %p, %s, %p, %p)\n", pbc, pmkToLeft, debugstr_w(pszDisplayName), pchEaten, ppmkOut);
562 return E_NOTIMPL;
563}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ClassMoniker_QueryInterface()

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

Definition at line 63 of file classmoniker.c.

64{
66
67 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
68
69 /* Perform a sanity check on the parameters.*/
70 if (!ppvObject)
71 return E_POINTER;
72
73 /* Initialize the return parameter */
74 *ppvObject = 0;
75
76 /* Compare the riid with the interface IDs implemented by this object.*/
80 IsEqualIID(&IID_IMoniker, riid))
81 {
82 *ppvObject = iface;
83 }
84 else if (IsEqualIID(&IID_IROTData, riid))
85 *ppvObject = &This->IROTData_iface;
86 else if (IsEqualIID(&IID_IMarshal, riid))
87 {
88 HRESULT hr = S_OK;
89 if (!This->pMarshal)
90 hr = MonikerMarshal_Create(iface, &This->pMarshal);
91 if (hr != S_OK)
92 return hr;
93 return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject);
94 }
95
96 /* Check that we obtained an interface.*/
97 if (!*ppvObject)
98 return E_NOINTERFACE;
99
100 /* Query Interface always increases the reference count by one when it is successful */
101 IMoniker_AddRef(iface);
102
103 return S_OK;
104}
const GUID IID_IUnknown
HRESULT MonikerMarshal_Create(IMoniker *inner, IUnknown **outer)
Definition: moniker.c:1677
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by CreateClassMoniker().

◆ ClassMoniker_Reduce()

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

Definition at line 273 of file classmoniker.c.

278{
279 TRACE("(%p,%p,%d,%p,%p)\n",iface,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
280
281 if (!ppmkReduced)
282 return E_POINTER;
283
284 IMoniker_AddRef(iface);
285
286 *ppmkReduced = iface;
287
289}
#define MK_S_REDUCED_TO_SELF
Definition: winerror.h:2773

◆ ClassMoniker_RelativePathTo()

static HRESULT WINAPI ClassMoniker_RelativePathTo ( IMoniker iface,
IMoniker pmOther,
IMoniker **  ppmkRelPath 
)
static

Definition at line 505 of file classmoniker.c.

506{
507 TRACE("(%p, %p)\n",pmOther,ppmkRelPath);
508
509 if (!ppmkRelPath)
510 return E_POINTER;
511
512 *ppmkRelPath = NULL;
513
514 return MK_E_NOTBINDABLE;
515}
#define MK_E_NOTBINDABLE
Definition: winerror.h:2789

◆ ClassMoniker_Release()

static ULONG WINAPI ClassMoniker_Release ( IMoniker iface)
static

Definition at line 121 of file classmoniker.c.

122{
124 ULONG ref;
125
126 TRACE("(%p)\n",This);
127
129
130 /* destroy the object if there are no more references to it */
131 if (ref == 0)
132 {
133 if (This->pMarshal) IUnknown_Release(This->pMarshal);
135 }
136
137 return ref;
138}
#define InterlockedDecrement
Definition: armddk.h:52
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ ClassMoniker_Save()

static HRESULT WINAPI ClassMoniker_Save ( IMoniker iface,
IStream pStm,
BOOL  fClearDirty 
)
static

Definition at line 192 of file classmoniker.c.

193{
195 HRESULT hr;
196 DWORD zero = 0;
197
198 TRACE("(%p, %s)\n", pStm, fClearDirty ? "TRUE" : "FALSE");
199
200 hr = IStream_Write(pStm, &This->clsid, sizeof(This->clsid), NULL);
201 if (FAILED(hr)) return hr;
202
203 return IStream_Write(pStm, &zero, sizeof(zero), NULL);
204}

◆ ClassMonikerROTData_AddRef()

static ULONG WINAPI ClassMonikerROTData_AddRef ( IROTData iface)
static

Definition at line 596 of file classmoniker.c.

597{
599
600 TRACE("(%p)\n",iface);
601
602 return IMoniker_AddRef(&This->IMoniker_iface);
603}
static ClassMoniker * impl_from_IROTData(IROTData *iface)
Definition: classmoniker.c:55

◆ ClassMonikerROTData_GetComparisonData()

static HRESULT WINAPI ClassMonikerROTData_GetComparisonData ( IROTData iface,
BYTE pbData,
ULONG  cbMax,
ULONG pcbData 
)
static

Definition at line 620 of file classmoniker.c.

624{
626
627 TRACE("(%p, %u, %p)\n", pbData, cbMax, pcbData);
628
629 *pcbData = 2*sizeof(CLSID);
630 if (cbMax < *pcbData)
631 return E_OUTOFMEMORY;
632
633 /* write CLSID of the moniker */
634 memcpy(pbData, &CLSID_ClassMoniker, sizeof(CLSID));
635 /* write CLSID the moniker represents */
636 memcpy(pbData+sizeof(CLSID), &This->clsid, sizeof(CLSID));
637
638 return S_OK;
639}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_updates_bytes_to_ pdwDataLen BYTE * pbData
Definition: wincrypt.h:4201
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4950

◆ ClassMonikerROTData_QueryInterface()

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

Definition at line 583 of file classmoniker.c.

584{
585
587
588 TRACE("(%p, %s, %p)\n", iface, debugstr_guid(riid), ppvObject);
589
590 return IMoniker_QueryInterface(&This->IMoniker_iface, riid, ppvObject);
591}

◆ ClassMonikerROTData_Release()

static ULONG WINAPI ClassMonikerROTData_Release ( IROTData iface)
static

Definition at line 608 of file classmoniker.c.

609{
611
612 TRACE("(%p)\n",iface);
613
614 return IMoniker_Release(&This->IMoniker_iface);
615}

◆ CreateClassMoniker()

HRESULT WINAPI CreateClassMoniker ( REFCLSID  rclsid,
IMoniker **  ppmk 
)

Definition at line 701 of file classmoniker.c.

702{
703 ClassMoniker* newClassMoniker;
704 HRESULT hr;
705
706 TRACE("(%s,%p)\n", debugstr_guid(rclsid), ppmk);
707
708 newClassMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(ClassMoniker));
709
710 if (!newClassMoniker)
712
713 hr = ClassMoniker_Construct(newClassMoniker, rclsid);
714
715 if (FAILED(hr))
716 {
717 HeapFree(GetProcessHeap(), 0, newClassMoniker);
718 return hr;
719 }
720
721 return ClassMoniker_QueryInterface(&newClassMoniker->IMoniker_iface, &IID_IMoniker,
722 (void**)ppmk);
723}
static HRESULT WINAPI ClassMoniker_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
Definition: classmoniker.c:63
static HRESULT ClassMoniker_Construct(ClassMoniker *This, REFCLSID rclsid)
Definition: classmoniker.c:684
#define HeapAlloc
Definition: compat.h:733
IMoniker IMoniker_iface
Definition: classmoniker.c:43
#define STG_E_INSUFFICIENTMEMORY
Definition: winerror.h:2570

Referenced by ClassMoniker_CreateFromDisplayName(), ClassMoniker_CreateInstance(), get_moniker_for_progid_display_name(), SHCreateQueryCancelAutoPlayMoniker(), test_class_moniker(), and test_ROT().

◆ impl_from_IMoniker()

static ClassMoniker * impl_from_IMoniker ( IMoniker iface)
inlinestatic

◆ impl_from_IROTData()

static ClassMoniker * impl_from_IROTData ( IROTData iface)
inlinestatic

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ ClassMonikerVtbl

const IMonikerVtbl ClassMonikerVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ClassMoniker_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
Definition: classmoniker.c:368
static HRESULT WINAPI ClassMoniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
Definition: classmoniker.c:209
static ULONG WINAPI ClassMoniker_AddRef(IMoniker *iface)
Definition: classmoniker.c:109
static HRESULT WINAPI ClassMoniker_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
Definition: classmoniker.c:192
static HRESULT WINAPI ClassMoniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
Definition: classmoniker.c:293
static HRESULT WINAPI ClassMoniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
Definition: classmoniker.c:222
static HRESULT WINAPI ClassMoniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
Definition: classmoniker.c:260
static ULONG WINAPI ClassMoniker_Release(IMoniker *iface)
Definition: classmoniker.c:121
static HRESULT WINAPI ClassMoniker_IsSystemMoniker(IMoniker *iface, DWORD *pwdMksys)
Definition: classmoniker.c:568
static HRESULT WINAPI ClassMoniker_IsDirty(IMoniker *iface)
Definition: classmoniker.c:158
static HRESULT WINAPI ClassMoniker_Load(IMoniker *iface, IStream *pStm)
Definition: classmoniker.c:172
static HRESULT WINAPI ClassMoniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
Definition: classmoniker.c:383
static HRESULT WINAPI ClassMoniker_GetClassID(IMoniker *iface, CLSID *pClassID)
Definition: classmoniker.c:143
static HRESULT WINAPI ClassMoniker_CommonPrefixWith(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
Definition: classmoniker.c:470
static HRESULT WINAPI ClassMoniker_IsRunning(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
Definition: classmoniker.c:430
static HRESULT WINAPI ClassMoniker_Inverse(IMoniker *iface, IMoniker **ppmk)
Definition: classmoniker.c:457
static HRESULT WINAPI ClassMoniker_RelativePathTo(IMoniker *iface, IMoniker *pmOther, IMoniker **ppmkRelPath)
Definition: classmoniker.c:505
static HRESULT WINAPI ClassMoniker_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: classmoniker.c:554
static HRESULT WINAPI ClassMoniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
Definition: classmoniker.c:520
static HRESULT WINAPI ClassMoniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
Definition: classmoniker.c:273
static HRESULT WINAPI ClassMoniker_Hash(IMoniker *iface, DWORD *pdwHash)
Definition: classmoniker.c:416
static HRESULT WINAPI ClassMoniker_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pItemTime)
Definition: classmoniker.c:444

Definition at line 644 of file classmoniker.c.

Referenced by ClassMoniker_Construct().

◆ ROTDataVtbl

const IROTDataVtbl ROTDataVtbl
static
Initial value:
=
{
}
static ULONG WINAPI ClassMonikerROTData_Release(IROTData *iface)
Definition: classmoniker.c:608
static HRESULT WINAPI ClassMonikerROTData_GetComparisonData(IROTData *iface, BYTE *pbData, ULONG cbMax, ULONG *pcbData)
Definition: classmoniker.c:620
static HRESULT WINAPI ClassMonikerROTData_QueryInterface(IROTData *iface, REFIID riid, VOID **ppvObject)
Definition: classmoniker.c:583
static ULONG WINAPI ClassMonikerROTData_AddRef(IROTData *iface)
Definition: classmoniker.c:596

Definition at line 673 of file classmoniker.c.

Referenced by ClassMoniker_Construct().