4 * Copyright 1999 Noomen Hamza
5 * Copyright 2005-2007 Robert Shearman
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
38 #define CHARS_IN_GUID 39
40 /* ClassMoniker data structure */
41 typedef struct ClassMoniker
43 IMoniker IMoniker_iface
;
44 IROTData IROTData_iface
;
46 CLSID clsid
; /* clsid identified by this moniker */
47 IUnknown
*pMarshal
; /* custom marshaler */
50 static inline ClassMoniker
*impl_from_IMoniker(IMoniker
*iface
)
52 return CONTAINING_RECORD(iface
, ClassMoniker
, IMoniker_iface
);
55 static inline ClassMoniker
*impl_from_IROTData(IROTData
*iface
)
57 return CONTAINING_RECORD(iface
, ClassMoniker
, IROTData_iface
);
60 /*******************************************************************************
61 * ClassMoniker_QueryInterface
62 *******************************************************************************/
63 static HRESULT WINAPI
ClassMoniker_QueryInterface(IMoniker
*iface
, REFIID riid
, void **ppvObject
)
65 ClassMoniker
*This
= impl_from_IMoniker(iface
);
67 TRACE("%p, %s, %p.\n", iface
, debugstr_guid(riid
), ppvObject
);
74 if (IsEqualIID(&IID_IUnknown
, riid
) ||
75 IsEqualIID(&IID_IPersist
, riid
) ||
76 IsEqualIID(&IID_IPersistStream
, riid
) ||
77 IsEqualIID(&IID_IMoniker
, riid
) ||
78 IsEqualGUID(&CLSID_ClassMoniker
, riid
))
82 else if (IsEqualIID(&IID_IROTData
, riid
))
83 *ppvObject
= &This
->IROTData_iface
;
84 else if (IsEqualIID(&IID_IMarshal
, riid
))
88 hr
= MonikerMarshal_Create(iface
, &This
->pMarshal
);
91 return IUnknown_QueryInterface(This
->pMarshal
, riid
, ppvObject
);
97 IMoniker_AddRef(iface
);
102 /******************************************************************************
103 * ClassMoniker_AddRef
104 ******************************************************************************/
105 static ULONG WINAPI
ClassMoniker_AddRef(IMoniker
* iface
)
107 ClassMoniker
*This
= impl_from_IMoniker(iface
);
109 TRACE("(%p)\n",This
);
111 return InterlockedIncrement(&This
->ref
);
114 /******************************************************************************
115 * ClassMoniker_Release
116 ******************************************************************************/
117 static ULONG WINAPI
ClassMoniker_Release(IMoniker
* iface
)
119 ClassMoniker
*This
= impl_from_IMoniker(iface
);
122 TRACE("(%p)\n",This
);
124 ref
= InterlockedDecrement(&This
->ref
);
126 /* destroy the object if there are no more references to it */
129 if (This
->pMarshal
) IUnknown_Release(This
->pMarshal
);
130 HeapFree(GetProcessHeap(),0,This
);
136 /******************************************************************************
137 * ClassMoniker_GetClassID
138 ******************************************************************************/
139 static HRESULT WINAPI
ClassMoniker_GetClassID(IMoniker
* iface
,CLSID
*pClassID
)
141 TRACE("(%p, %p)\n", iface
, pClassID
);
146 *pClassID
= CLSID_ClassMoniker
;
151 /******************************************************************************
152 * ClassMoniker_IsDirty
153 ******************************************************************************/
154 static HRESULT WINAPI
ClassMoniker_IsDirty(IMoniker
* iface
)
156 /* Note that the OLE-provided implementations of the IPersistStream::IsDirty
157 method in the OLE-provided moniker interfaces always return S_FALSE because
158 their internal state never changes. */
160 TRACE("(%p)\n",iface
);
165 /******************************************************************************
167 ******************************************************************************/
168 static HRESULT WINAPI
ClassMoniker_Load(IMoniker
* iface
,IStream
* pStm
)
170 ClassMoniker
*This
= impl_from_IMoniker(iface
);
174 TRACE("(%p)\n", pStm
);
176 hr
= IStream_Read(pStm
, &This
->clsid
, sizeof(This
->clsid
), NULL
);
177 if (hr
!= S_OK
) return STG_E_READFAULT
;
179 hr
= IStream_Read(pStm
, &zero
, sizeof(zero
), NULL
);
180 if ((hr
!= S_OK
) || (zero
!= 0)) return STG_E_READFAULT
;
185 /******************************************************************************
187 ******************************************************************************/
188 static HRESULT WINAPI
ClassMoniker_Save(IMoniker
* iface
, IStream
* pStm
, BOOL fClearDirty
)
190 ClassMoniker
*This
= impl_from_IMoniker(iface
);
194 TRACE("(%p, %s)\n", pStm
, fClearDirty
? "TRUE" : "FALSE");
196 hr
= IStream_Write(pStm
, &This
->clsid
, sizeof(This
->clsid
), NULL
);
197 if (FAILED(hr
)) return hr
;
199 return IStream_Write(pStm
, &zero
, sizeof(zero
), NULL
);
202 /******************************************************************************
203 * ClassMoniker_GetSizeMax
204 ******************************************************************************/
205 static HRESULT WINAPI
ClassMoniker_GetSizeMax(IMoniker
* iface
,
206 ULARGE_INTEGER
* pcbSize
)/* Pointer to size of stream needed to save object */
208 TRACE("(%p)\n", pcbSize
);
210 pcbSize
->QuadPart
= sizeof(CLSID
) + sizeof(DWORD
);
215 /******************************************************************************
216 * ClassMoniker_BindToObject
217 ******************************************************************************/
218 static HRESULT WINAPI
ClassMoniker_BindToObject(IMoniker
* iface
,
224 ClassMoniker
*This
= impl_from_IMoniker(iface
);
226 IClassActivator
*pActivator
;
229 TRACE("(%p, %p, %s, %p)\n", pbc
, pmkToLeft
, debugstr_guid(riid
), ppvResult
);
231 bindopts
.cbStruct
= sizeof(bindopts
);
232 IBindCtx_GetBindOptions(pbc
, (BIND_OPTS
*)&bindopts
);
235 return CoGetClassObject(&This
->clsid
, bindopts
.dwClassContext
, NULL
,
239 hr
= IMoniker_BindToObject(pmkToLeft
, pbc
, NULL
, &IID_IClassActivator
,
240 (void **)&pActivator
);
241 if (FAILED(hr
)) return hr
;
243 hr
= IClassActivator_GetClassObject(pActivator
, &This
->clsid
,
244 bindopts
.dwClassContext
,
245 bindopts
.locale
, riid
, ppvResult
);
247 IClassActivator_Release(pActivator
);
253 /******************************************************************************
254 * ClassMoniker_BindToStorage
255 ******************************************************************************/
256 static HRESULT WINAPI
ClassMoniker_BindToStorage(IMoniker
* iface
,
262 TRACE("(%p, %p, %s, %p)\n", pbc
, pmkToLeft
, debugstr_guid(riid
), ppvResult
);
263 return IMoniker_BindToObject(iface
, pbc
, pmkToLeft
, riid
, ppvResult
);
266 /******************************************************************************
267 * ClassMoniker_Reduce
268 ******************************************************************************/
269 static HRESULT WINAPI
ClassMoniker_Reduce(IMoniker
* iface
,
271 DWORD dwReduceHowFar
,
272 IMoniker
** ppmkToLeft
,
273 IMoniker
** ppmkReduced
)
275 TRACE("(%p,%p,%d,%p,%p)\n",iface
,pbc
,dwReduceHowFar
,ppmkToLeft
,ppmkReduced
);
280 IMoniker_AddRef(iface
);
282 *ppmkReduced
= iface
;
284 return MK_S_REDUCED_TO_SELF
;
286 /******************************************************************************
287 * ClassMoniker_ComposeWith
288 ******************************************************************************/
289 static HRESULT WINAPI
ClassMoniker_ComposeWith(IMoniker
* iface
,
291 BOOL fOnlyIfNotGeneric
,
292 IMoniker
** ppmkComposite
)
296 IEnumMoniker
* penumMk
=0;
297 IMoniker
*pmostLeftMk
=0;
298 IMoniker
* tempMkComposite
=0;
300 TRACE("(%p,%d,%p)\n", pmkRight
, fOnlyIfNotGeneric
, ppmkComposite
);
302 if ((ppmkComposite
==NULL
)||(pmkRight
==NULL
))
307 IMoniker_IsSystemMoniker(pmkRight
,&mkSys
);
309 /* If pmkRight is an anti-moniker, the returned moniker is NULL */
310 if(mkSys
==MKSYS_ANTIMONIKER
)
314 /* if pmkRight is a composite whose leftmost component is an anti-moniker, */
315 /* the returned moniker is the composite after the leftmost anti-moniker is removed. */
317 if(mkSys
==MKSYS_GENERICCOMPOSITE
){
319 res
=IMoniker_Enum(pmkRight
,TRUE
,&penumMk
);
324 res
=IEnumMoniker_Next(penumMk
,1,&pmostLeftMk
,NULL
);
326 IMoniker_IsSystemMoniker(pmostLeftMk
,&mkSys2
);
328 if(mkSys2
==MKSYS_ANTIMONIKER
){
330 IMoniker_Release(pmostLeftMk
);
332 tempMkComposite
=iface
;
333 IMoniker_AddRef(iface
);
335 while(IEnumMoniker_Next(penumMk
,1,&pmostLeftMk
,NULL
)==S_OK
){
337 res
=CreateGenericComposite(tempMkComposite
,pmostLeftMk
,ppmkComposite
);
339 IMoniker_Release(tempMkComposite
);
340 IMoniker_Release(pmostLeftMk
);
342 tempMkComposite
=*ppmkComposite
;
343 IMoniker_AddRef(tempMkComposite
);
348 return CreateGenericComposite(iface
,pmkRight
,ppmkComposite
);
350 /* If pmkRight is not an anti-moniker, the method combines the two monikers into a generic
351 composite if fOnlyIfNotGeneric is FALSE; if fOnlyIfNotGeneric is TRUE, the method returns
352 a NULL moniker and a return value of MK_E_NEEDGENERIC */
354 if (!fOnlyIfNotGeneric
)
355 return CreateGenericComposite(iface
,pmkRight
,ppmkComposite
);
358 return MK_E_NEEDGENERIC
;
361 /******************************************************************************
363 ******************************************************************************/
364 static HRESULT WINAPI
ClassMoniker_Enum(IMoniker
* iface
,BOOL fForward
, IEnumMoniker
** ppenumMoniker
)
366 TRACE("(%p,%d,%p)\n",iface
,fForward
,ppenumMoniker
);
368 if (ppenumMoniker
== NULL
)
371 *ppenumMoniker
= NULL
;
376 /******************************************************************************
377 * ClassMoniker_IsEqual
378 ******************************************************************************/
379 static HRESULT WINAPI
ClassMoniker_IsEqual(IMoniker
* iface
,IMoniker
* pmkOtherMoniker
)
383 LPOLESTR dispName1
,dispName2
;
385 HRESULT res
= S_FALSE
;
387 TRACE("(%p,%p)\n",iface
,pmkOtherMoniker
);
389 if (!pmkOtherMoniker
) return S_FALSE
;
392 /* check if both are ClassMoniker */
393 if(FAILED (IMoniker_GetClassID(pmkOtherMoniker
,&clsid
))) return S_FALSE
;
394 if(!IsEqualCLSID(&clsid
,&CLSID_ClassMoniker
)) return S_FALSE
;
396 /* check if both displaynames are the same */
397 if(SUCCEEDED ((res
= CreateBindCtx(0,&bind
)))) {
398 if(SUCCEEDED (IMoniker_GetDisplayName(iface
,bind
,NULL
,&dispName1
))) {
399 if(SUCCEEDED (IMoniker_GetDisplayName(pmkOtherMoniker
,bind
,NULL
,&dispName2
))) {
400 if(wcscmp(dispName1
,dispName2
)==0) res
= S_OK
;
401 CoTaskMemFree(dispName2
);
403 CoTaskMemFree(dispName1
);
409 /******************************************************************************
411 ******************************************************************************/
412 static HRESULT WINAPI
ClassMoniker_Hash(IMoniker
* iface
,DWORD
* pdwHash
)
414 ClassMoniker
*This
= impl_from_IMoniker(iface
);
416 TRACE("(%p)\n", pdwHash
);
418 *pdwHash
= This
->clsid
.Data1
;
423 /******************************************************************************
424 * ClassMoniker_IsRunning
425 ******************************************************************************/
426 static HRESULT WINAPI
ClassMoniker_IsRunning(IMoniker
* iface
,
429 IMoniker
* pmkNewlyRunning
)
431 TRACE("(%p, %p, %p)\n", pbc
, pmkToLeft
, pmkNewlyRunning
);
437 /******************************************************************************
438 * ClassMoniker_GetTimeOfLastChange
439 ******************************************************************************/
440 static HRESULT WINAPI
ClassMoniker_GetTimeOfLastChange(IMoniker
* iface
,
445 TRACE("(%p, %p, %p)\n", pbc
, pmkToLeft
, pItemTime
);
447 return MK_E_UNAVAILABLE
;
450 /******************************************************************************
451 * ClassMoniker_Inverse
452 ******************************************************************************/
453 static HRESULT WINAPI
ClassMoniker_Inverse(IMoniker
* iface
,IMoniker
** ppmk
)
455 TRACE("(%p)\n",ppmk
);
460 return CreateAntiMoniker(ppmk
);
463 /******************************************************************************
464 * ClassMoniker_CommonPrefixWith
465 ******************************************************************************/
466 static HRESULT WINAPI
ClassMoniker_CommonPrefixWith(IMoniker
* iface
,IMoniker
* pmkOther
,IMoniker
** ppmkPrefix
)
470 TRACE("(%p, %p)\n", pmkOther
, ppmkPrefix
);
474 IMoniker_IsSystemMoniker(pmkOther
, &mkSys
);
476 /* If the other moniker is an class moniker that is equal to this moniker, this method sets *ppmkPrefix */
477 /* to this moniker and returns MK_S_US */
479 if (mkSys
== MKSYS_CLASSMONIKER
)
481 if (IMoniker_IsEqual(iface
, pmkOther
) == S_OK
)
485 IMoniker_AddRef(iface
);
490 return MK_E_NOPREFIX
;
493 /* otherwise, the method calls the MonikerCommonPrefixWith function. This function correctly handles */
494 /* the case where the other moniker is a generic composite. */
495 return MonikerCommonPrefixWith(iface
, pmkOther
, ppmkPrefix
);
498 /******************************************************************************
499 * ClassMoniker_RelativePathTo
500 ******************************************************************************/
501 static HRESULT WINAPI
ClassMoniker_RelativePathTo(IMoniker
* iface
,IMoniker
* pmOther
, IMoniker
** ppmkRelPath
)
503 TRACE("(%p, %p)\n",pmOther
,ppmkRelPath
);
510 return MK_E_NOTBINDABLE
;
513 /******************************************************************************
514 * ClassMoniker_GetDisplayName
515 ******************************************************************************/
516 static HRESULT WINAPI
ClassMoniker_GetDisplayName(IMoniker
* iface
,
519 LPOLESTR
*ppszDisplayName
)
521 ClassMoniker
*This
= impl_from_IMoniker(iface
);
522 static const WCHAR wszClsidPrefix
[] = L
"clsid:";
524 TRACE("(%p, %p, %p)\n", pbc
, pmkToLeft
, ppszDisplayName
);
526 if (!ppszDisplayName
)
532 *ppszDisplayName
= CoTaskMemAlloc(sizeof(wszClsidPrefix
) + (CHARS_IN_GUID
-2) * sizeof(WCHAR
));
534 StringFromGUID2(&This
->clsid
, *ppszDisplayName
+ARRAY_SIZE(wszClsidPrefix
)-2, CHARS_IN_GUID
);
536 /* note: this overwrites the opening curly bracket of the CLSID string generated above */
537 memcpy(*ppszDisplayName
, wszClsidPrefix
, sizeof(wszClsidPrefix
)-sizeof(WCHAR
));
539 /* note: this overwrites the closing curly bracket of the CLSID string generated above */
540 (*ppszDisplayName
)[ARRAY_SIZE(wszClsidPrefix
)-2+CHARS_IN_GUID
-2] = ':';
541 (*ppszDisplayName
)[ARRAY_SIZE(wszClsidPrefix
)-2+CHARS_IN_GUID
-1] = '\0';
543 TRACE("string is %s\n", debugstr_w(*ppszDisplayName
));
547 /******************************************************************************
548 * ClassMoniker_ParseDisplayName
549 ******************************************************************************/
550 static HRESULT WINAPI
ClassMoniker_ParseDisplayName(IMoniker
* iface
,
553 LPOLESTR pszDisplayName
,
557 FIXME("(%p, %p, %s, %p, %p)\n", pbc
, pmkToLeft
, debugstr_w(pszDisplayName
), pchEaten
, ppmkOut
);
561 /******************************************************************************
562 * ClassMoniker_IsSystemMoniker
563 ******************************************************************************/
564 static HRESULT WINAPI
ClassMoniker_IsSystemMoniker(IMoniker
* iface
,DWORD
* pwdMksys
)
566 TRACE("(%p,%p)\n",iface
,pwdMksys
);
571 *pwdMksys
= MKSYS_CLASSMONIKER
;
576 /*******************************************************************************
577 * ClassMonikerIROTData_QueryInterface
578 *******************************************************************************/
579 static HRESULT WINAPI
ClassMonikerROTData_QueryInterface(IROTData
*iface
,REFIID riid
,VOID
** ppvObject
)
582 ClassMoniker
*This
= impl_from_IROTData(iface
);
584 TRACE("(%p, %s, %p)\n", iface
, debugstr_guid(riid
), ppvObject
);
586 return IMoniker_QueryInterface(&This
->IMoniker_iface
, riid
, ppvObject
);
589 /***********************************************************************
590 * ClassMonikerIROTData_AddRef
592 static ULONG WINAPI
ClassMonikerROTData_AddRef(IROTData
*iface
)
594 ClassMoniker
*This
= impl_from_IROTData(iface
);
596 TRACE("(%p)\n",iface
);
598 return IMoniker_AddRef(&This
->IMoniker_iface
);
601 /***********************************************************************
602 * ClassMonikerIROTData_Release
604 static ULONG WINAPI
ClassMonikerROTData_Release(IROTData
* iface
)
606 ClassMoniker
*This
= impl_from_IROTData(iface
);
608 TRACE("(%p)\n",iface
);
610 return IMoniker_Release(&This
->IMoniker_iface
);
613 /******************************************************************************
614 * ClassMonikerIROTData_GetComparisonData
615 ******************************************************************************/
616 static HRESULT WINAPI
ClassMonikerROTData_GetComparisonData(IROTData
* iface
,
621 ClassMoniker
*This
= impl_from_IROTData(iface
);
623 TRACE("(%p, %u, %p)\n", pbData
, cbMax
, pcbData
);
625 *pcbData
= 2*sizeof(CLSID
);
626 if (cbMax
< *pcbData
)
627 return E_OUTOFMEMORY
;
629 /* write CLSID of the moniker */
630 memcpy(pbData
, &CLSID_ClassMoniker
, sizeof(CLSID
));
631 /* write CLSID the moniker represents */
632 memcpy(pbData
+sizeof(CLSID
), &This
->clsid
, sizeof(CLSID
));
637 /********************************************************************************/
638 /* Virtual function table for the ClassMoniker class which include IPersist,*/
639 /* IPersistStream and IMoniker functions. */
640 static const IMonikerVtbl ClassMonikerVtbl
=
642 ClassMoniker_QueryInterface
,
644 ClassMoniker_Release
,
645 ClassMoniker_GetClassID
,
646 ClassMoniker_IsDirty
,
649 ClassMoniker_GetSizeMax
,
650 ClassMoniker_BindToObject
,
651 ClassMoniker_BindToStorage
,
653 ClassMoniker_ComposeWith
,
655 ClassMoniker_IsEqual
,
657 ClassMoniker_IsRunning
,
658 ClassMoniker_GetTimeOfLastChange
,
659 ClassMoniker_Inverse
,
660 ClassMoniker_CommonPrefixWith
,
661 ClassMoniker_RelativePathTo
,
662 ClassMoniker_GetDisplayName
,
663 ClassMoniker_ParseDisplayName
,
664 ClassMoniker_IsSystemMoniker
667 /********************************************************************************/
668 /* Virtual function table for the IROTData class. */
669 static const IROTDataVtbl ROTDataVtbl
=
671 ClassMonikerROTData_QueryInterface
,
672 ClassMonikerROTData_AddRef
,
673 ClassMonikerROTData_Release
,
674 ClassMonikerROTData_GetComparisonData
677 /******************************************************************************
678 * ClassMoniker_Construct (local function)
679 *******************************************************************************/
680 static HRESULT
ClassMoniker_Construct(ClassMoniker
* This
, REFCLSID rclsid
)
682 TRACE("(%p,%s)\n",This
,debugstr_guid(rclsid
));
684 /* Initialize the virtual function table. */
685 This
->IMoniker_iface
.lpVtbl
= &ClassMonikerVtbl
;
686 This
->IROTData_iface
.lpVtbl
= &ROTDataVtbl
;
688 This
->clsid
= *rclsid
;
689 This
->pMarshal
= NULL
;
694 /******************************************************************************
695 * CreateClassMoniker [OLE32.@]
696 ******************************************************************************/
697 HRESULT WINAPI
CreateClassMoniker(REFCLSID rclsid
, IMoniker
**ppmk
)
699 ClassMoniker
* newClassMoniker
;
702 TRACE("(%s,%p)\n", debugstr_guid(rclsid
), ppmk
);
704 newClassMoniker
= HeapAlloc(GetProcessHeap(), 0, sizeof(ClassMoniker
));
706 if (!newClassMoniker
)
707 return STG_E_INSUFFICIENTMEMORY
;
709 hr
= ClassMoniker_Construct(newClassMoniker
, rclsid
);
713 HeapFree(GetProcessHeap(), 0, newClassMoniker
);
717 return ClassMoniker_QueryInterface(&newClassMoniker
->IMoniker_iface
, &IID_IMoniker
,
721 HRESULT
ClassMoniker_CreateFromDisplayName(LPBC pbc
, LPCOLESTR szDisplayName
, LPDWORD pchEaten
,
725 LPCWSTR s
= wcschr(szDisplayName
, ':');
736 for (end
= s
; *end
&& (*end
!= ':'); end
++)
739 TRACE("parsing %s\n", debugstr_wn(s
, end
- s
));
741 /* validate the CLSID string */
744 if ((end
- s
!= 38) || (s
[37] != '}'))
756 if ((i
== 8)||(i
== 13)||(i
== 18)||(i
== 23))
762 if (!(((s
[i
] >= '0') && (s
[i
] <= '9')) ||
763 ((s
[i
] >= 'a') && (s
[i
] <= 'f')) ||
764 ((s
[i
] >= 'A') && (s
[i
] <= 'F'))))
768 /* quick lookup table */
769 memset(table
, 0, 256);
771 for (i
= 0; i
< 10; i
++)
773 for (i
= 0; i
< 6; i
++)
775 table
['A' + i
] = i
+10;
776 table
['a' + i
] = i
+10;
779 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
781 clsid
.Data1
= (table
[s
[0]] << 28 | table
[s
[1]] << 24 | table
[s
[2]] << 20 | table
[s
[3]] << 16 |
782 table
[s
[4]] << 12 | table
[s
[5]] << 8 | table
[s
[6]] << 4 | table
[s
[7]]);
783 clsid
.Data2
= table
[s
[9]] << 12 | table
[s
[10]] << 8 | table
[s
[11]] << 4 | table
[s
[12]];
784 clsid
.Data3
= table
[s
[14]] << 12 | table
[s
[15]] << 8 | table
[s
[16]] << 4 | table
[s
[17]];
786 /* these are just sequential bytes */
787 clsid
.Data4
[0] = table
[s
[19]] << 4 | table
[s
[20]];
788 clsid
.Data4
[1] = table
[s
[21]] << 4 | table
[s
[22]];
789 clsid
.Data4
[2] = table
[s
[24]] << 4 | table
[s
[25]];
790 clsid
.Data4
[3] = table
[s
[26]] << 4 | table
[s
[27]];
791 clsid
.Data4
[4] = table
[s
[28]] << 4 | table
[s
[29]];
792 clsid
.Data4
[5] = table
[s
[30]] << 4 | table
[s
[31]];
793 clsid
.Data4
[6] = table
[s
[32]] << 4 | table
[s
[33]];
794 clsid
.Data4
[7] = table
[s
[34]] << 4 | table
[s
[35]];
796 hr
= CreateClassMoniker(&clsid
, ppmk
);
798 *pchEaten
= (*end
== ':' ? end
+ 1 : end
) - szDisplayName
;
802 HRESULT WINAPI
ClassMoniker_CreateInstance(IClassFactory
*iface
,
803 IUnknown
*pUnk
, REFIID riid
, void **ppv
)
808 TRACE("(%p, %s, %p)\n", pUnk
, debugstr_guid(riid
), ppv
);
813 return CLASS_E_NOAGGREGATION
;
815 hr
= CreateClassMoniker(&CLSID_NULL
, &pmk
);
816 if (FAILED(hr
)) return hr
;
818 hr
= IMoniker_QueryInterface(pmk
, riid
, ppv
);
819 IMoniker_Release(pmk
);