rpcrt4: Retrieve the maximum token length from the security provider rather than...
[wine] / dlls / ole32 / antimoniker.c
1 /*
2  *                            AntiMonikers implementation
3  *
4  *               Copyright 1999  Noomen Hamza
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include <assert.h>
22 #include <stdarg.h>
23 #include <string.h>
24
25 #define COBJMACROS
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winerror.h"
32 #include "objbase.h"
33 #include "wine/debug.h"
34 #include "moniker.h"
35
36 WINE_DEFAULT_DEBUG_CHANNEL(ole);
37
38 /* AntiMoniker data structure */
39 typedef struct AntiMonikerImpl{
40
41     const IMonikerVtbl*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
42
43     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
44      * two monikers are equal. That's whay IROTData interface is implemented by monikers.
45      */
46     const IROTDataVtbl*  lpvtbl2;  /* VTable relative to the IROTData interface.*/
47
48     LONG ref; /* reference counter for this object */
49
50     IUnknown *pMarshal; /* custom marshaler */
51 } AntiMonikerImpl;
52
53 static inline IMoniker *impl_from_IROTData( IROTData *iface )
54 {
55     return (IMoniker *)((char*)iface - FIELD_OFFSET(AntiMonikerImpl, lpvtbl2));
56 }
57
58
59 /*******************************************************************************
60  *        AntiMoniker_QueryInterface
61  *******************************************************************************/
62 static HRESULT WINAPI
63 AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
64 {
65     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
66
67     TRACE("(%p,%p,%p)\n",This,riid,ppvObject);
68
69     /* Perform a sanity check on the parameters.*/
70     if ( (This==0) || (ppvObject==0) )
71         return E_INVALIDARG;
72
73     /* Initialize the return parameter */
74     *ppvObject = 0;
75
76     /* Compare the riid with the interface IDs implemented by this object.*/
77     if (IsEqualIID(&IID_IUnknown, riid) ||
78         IsEqualIID(&IID_IPersist, riid) ||
79         IsEqualIID(&IID_IPersistStream, riid) ||
80         IsEqualIID(&IID_IMoniker, riid))
81         *ppvObject = iface;
82     else if (IsEqualIID(&IID_IROTData, riid))
83         *ppvObject = (IROTData*)&(This->lpvtbl2);
84     else if (IsEqualIID(&IID_IMarshal, riid))
85     {
86         HRESULT hr = S_OK;
87         if (!This->pMarshal)
88             hr = MonikerMarshal_Create(iface, &This->pMarshal);
89         if (hr != S_OK)
90             return hr;
91         return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject);
92     }
93
94     /* Check that we obtained an interface.*/
95     if ((*ppvObject)==0)
96         return E_NOINTERFACE;
97
98     /* always increase the reference count by one when it is successful */
99     IMoniker_AddRef(iface);
100
101     return S_OK;
102 }
103
104 /******************************************************************************
105  *        AntiMoniker_AddRef
106  ******************************************************************************/
107 static ULONG WINAPI
108 AntiMonikerImpl_AddRef(IMoniker* iface)
109 {
110     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
111
112     TRACE("(%p)\n",This);
113
114     return InterlockedIncrement(&This->ref);
115 }
116
117 /******************************************************************************
118  *        AntiMoniker_Release
119  ******************************************************************************/
120 static ULONG WINAPI
121 AntiMonikerImpl_Release(IMoniker* iface)
122 {
123     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
124     ULONG ref;
125
126     TRACE("(%p)\n",This);
127
128     ref = InterlockedDecrement(&This->ref);
129
130     /* destroy the object if there's no more reference on it */
131     if (ref == 0)
132     {
133         if (This->pMarshal) IUnknown_Release(This->pMarshal);
134         HeapFree(GetProcessHeap(),0,This);
135     }
136
137     return ref;
138 }
139
140 /******************************************************************************
141  *        AntiMoniker_GetClassID
142  ******************************************************************************/
143 static HRESULT WINAPI
144 AntiMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID)
145 {
146     TRACE("(%p,%p)\n",iface,pClassID);
147
148     if (pClassID==NULL)
149         return E_POINTER;
150
151     *pClassID = CLSID_AntiMoniker;
152
153     return S_OK;
154 }
155
156 /******************************************************************************
157  *        AntiMoniker_IsDirty
158  ******************************************************************************/
159 static HRESULT WINAPI
160 AntiMonikerImpl_IsDirty(IMoniker* iface)
161 {
162     /* Note that the OLE-provided implementations of the IPersistStream::IsDirty
163        method in the OLE-provided moniker interfaces always return S_FALSE because
164        their internal state never changes. */
165
166     TRACE("(%p)\n",iface);
167
168     return S_FALSE;
169 }
170
171 /******************************************************************************
172  *        AntiMoniker_Load
173  ******************************************************************************/
174 static HRESULT WINAPI
175 AntiMonikerImpl_Load(IMoniker* iface,IStream* pStm)
176 {
177     DWORD constant=1,dwbuffer;
178     HRESULT res;
179
180     /* data read by this function is only a DWORD constant (must be 1) ! */
181     res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),NULL);
182
183     if (SUCCEEDED(res)&& dwbuffer!=constant)
184         return E_FAIL;
185
186     return res;
187 }
188
189 /******************************************************************************
190  *        AntiMoniker_Save
191  ******************************************************************************/
192 static HRESULT WINAPI
193 AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDirty)
194 {
195     DWORD constant=1;
196     HRESULT res;
197
198     /* data written by this function is only a DWORD constant set to 1 ! */
199     res=IStream_Write(pStm,&constant,sizeof(constant),NULL);
200
201     return res;
202 }
203
204 /******************************************************************************
205  *        AntiMoniker_GetSizeMax
206  *
207  * PARAMS
208  * pcbSize [out] Pointer to size of stream needed to save object
209  ******************************************************************************/
210 static HRESULT WINAPI
211 AntiMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
212 {
213     TRACE("(%p,%p)\n",iface,pcbSize);
214
215     if (!pcbSize)
216         return E_POINTER;
217
218     /* for more details see AntiMonikerImpl_Save coments */
219
220     /*
221      * Normally the sizemax must be sizeof DWORD, but
222      * I tested this function it usually return 16 bytes
223      * more than the number of bytes used by AntiMoniker::Save function
224      */
225     pcbSize->u.LowPart =  sizeof(DWORD)+16;
226
227     pcbSize->u.HighPart=0;
228
229     return S_OK;
230 }
231
232 /******************************************************************************
233  *                  AntiMoniker_BindToObject
234  ******************************************************************************/
235 static HRESULT WINAPI
236 AntiMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
237                              REFIID riid, VOID** ppvResult)
238 {
239     TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
240     return E_NOTIMPL;
241 }
242
243 /******************************************************************************
244  *        AntiMoniker_BindToStorage
245  ******************************************************************************/
246 static HRESULT WINAPI
247 AntiMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
248                               REFIID riid, VOID** ppvResult)
249 {
250     TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult);
251     return E_NOTIMPL;
252 }
253
254 /******************************************************************************
255  *        AntiMoniker_Reduce
256  ******************************************************************************/
257 static HRESULT WINAPI
258 AntiMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar,
259                        IMoniker** ppmkToLeft, IMoniker** ppmkReduced)
260 {
261     TRACE("(%p,%p,%d,%p,%p)\n",iface,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
262
263     if (ppmkReduced==NULL)
264         return E_POINTER;
265
266     AntiMonikerImpl_AddRef(iface);
267
268     *ppmkReduced=iface;
269
270     return MK_S_REDUCED_TO_SELF;
271 }
272 /******************************************************************************
273  *        AntiMoniker_ComposeWith
274  ******************************************************************************/
275 static HRESULT WINAPI
276 AntiMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight,
277                             BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite)
278 {
279
280     TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
281
282     if ((ppmkComposite==NULL)||(pmkRight==NULL))
283         return E_POINTER;
284
285     *ppmkComposite=0;
286
287     if (fOnlyIfNotGeneric)
288         return MK_E_NEEDGENERIC;
289     else
290         return CreateGenericComposite(iface,pmkRight,ppmkComposite);
291 }
292
293 /******************************************************************************
294  *        AntiMoniker_Enum
295  ******************************************************************************/
296 static HRESULT WINAPI
297 AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
298 {
299     TRACE("(%p,%d,%p)\n",iface,fForward,ppenumMoniker);
300
301     if (ppenumMoniker == NULL)
302         return E_POINTER;
303
304     *ppenumMoniker = NULL;
305
306     return S_OK;
307 }
308
309 /******************************************************************************
310  *        AntiMoniker_IsEqual
311  ******************************************************************************/
312 static HRESULT WINAPI
313 AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
314 {
315     DWORD mkSys;
316
317     TRACE("(%p,%p)\n",iface,pmkOtherMoniker);
318
319     if (pmkOtherMoniker==NULL)
320         return S_FALSE;
321
322     IMoniker_IsSystemMoniker(pmkOtherMoniker,&mkSys);
323
324     if (mkSys==MKSYS_ANTIMONIKER)
325         return S_OK;
326     else
327         return S_FALSE;
328 }
329
330 /******************************************************************************
331  *        AntiMoniker_Hash
332  ******************************************************************************/
333 static HRESULT WINAPI AntiMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
334 {
335     if (pdwHash==NULL)
336         return E_POINTER;
337
338     *pdwHash = 0x80000001;
339
340     return S_OK;
341 }
342
343 /******************************************************************************
344  *        AntiMoniker_IsRunning
345  ******************************************************************************/
346 static HRESULT WINAPI
347 AntiMonikerImpl_IsRunning(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft,
348                           IMoniker* pmkNewlyRunning)
349 {
350     IRunningObjectTable* rot;
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 }
369
370 /******************************************************************************
371  *        AntiMoniker_GetTimeOfLastChange
372  ******************************************************************************/
373 static HRESULT WINAPI AntiMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
374                                                    IBindCtx* pbc,
375                                                    IMoniker* pmkToLeft,
376                                                    FILETIME* pAntiTime)
377 {
378     TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pAntiTime);
379     return E_NOTIMPL;
380 }
381
382 /******************************************************************************
383  *        AntiMoniker_Inverse
384  ******************************************************************************/
385 static HRESULT WINAPI
386 AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
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 }
397
398 /******************************************************************************
399  *        AntiMoniker_CommonPrefixWith
400  ******************************************************************************/
401 static HRESULT WINAPI
402 AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
403 {
404     DWORD mkSys;
405
406     IMoniker_IsSystemMoniker(pmkOther,&mkSys);
407
408     if(mkSys==MKSYS_ANTIMONIKER){
409
410         IMoniker_AddRef(iface);
411
412         *ppmkPrefix=iface;
413
414         IMoniker_AddRef(iface);
415
416         return MK_S_US;
417     }
418     else
419         return MonikerCommonPrefixWith(iface,pmkOther,ppmkPrefix);
420 }
421
422 /******************************************************************************
423  *        AntiMoniker_RelativePathTo
424  ******************************************************************************/
425 static HRESULT WINAPI
426 AntiMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
427 {
428     TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
429
430     if (ppmkRelPath==NULL)
431         return E_POINTER;
432
433     IMoniker_AddRef(pmOther);
434
435     *ppmkRelPath=pmOther;
436
437     return MK_S_HIM;
438 }
439
440 /******************************************************************************
441  *        AntiMoniker_GetDisplayName
442  ******************************************************************************/
443 static HRESULT WINAPI
444 AntiMonikerImpl_GetDisplayName(IMoniker* iface, IBindCtx* pbc,
445                                IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName)
446 {
447     static const WCHAR back[]={'\\','.','.',0};
448
449     TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);
450
451     if (ppszDisplayName==NULL)
452         return E_POINTER;
453
454     if (pmkToLeft!=NULL){
455         FIXME("() pmkToLeft!=NULL not implemented\n");
456         return E_NOTIMPL;
457     }
458
459     *ppszDisplayName=CoTaskMemAlloc(sizeof(back));
460
461     if (*ppszDisplayName==NULL)
462         return E_OUTOFMEMORY;
463
464     lstrcpyW(*ppszDisplayName,back);
465
466     return S_OK;
467 }
468
469 /******************************************************************************
470  *        AntiMoniker_ParseDisplayName
471  ******************************************************************************/
472 static HRESULT WINAPI
473 AntiMonikerImpl_ParseDisplayName(IMoniker* iface, IBindCtx* pbc,
474                                  IMoniker* pmkToLeft, LPOLESTR pszDisplayName,
475                                  ULONG* pchEaten, IMoniker** ppmkOut)
476 {
477     TRACE("(%p,%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
478     return E_NOTIMPL;
479 }
480
481 /******************************************************************************
482  *        AntiMoniker_IsSystemMoniker
483  ******************************************************************************/
484 static HRESULT WINAPI
485 AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
486 {
487     TRACE("(%p,%p)\n",iface,pwdMksys);
488
489     if (!pwdMksys)
490         return E_POINTER;
491
492     (*pwdMksys)=MKSYS_ANTIMONIKER;
493
494     return S_OK;
495 }
496
497 /*******************************************************************************
498  *        AntiMonikerIROTData_QueryInterface
499  *******************************************************************************/
500 static HRESULT WINAPI
501 AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
502 {
503     IMoniker *This = impl_from_IROTData(iface);
504
505     TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
506
507     return AntiMonikerImpl_QueryInterface(This, riid, ppvObject);
508 }
509
510 /***********************************************************************
511  *        AntiMonikerIROTData_AddRef
512  */
513 static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
514 {
515     IMoniker *This = impl_from_IROTData(iface);
516
517     TRACE("(%p)\n",iface);
518
519     return AntiMonikerImpl_AddRef(This);
520 }
521
522 /***********************************************************************
523  *        AntiMonikerIROTData_Release
524  */
525 static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
526 {
527     IMoniker *This = impl_from_IROTData(iface);
528
529     TRACE("(%p)\n",iface);
530
531     return AntiMonikerImpl_Release(This);
532 }
533
534 /******************************************************************************
535  *        AntiMonikerIROTData_GetComparaisonData
536  ******************************************************************************/
537 static HRESULT WINAPI
538 AntiMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData,
539                                           ULONG cbMax, ULONG* pcbData)
540 {
541     DWORD constant = 1;
542
543     TRACE("(%p, %u, %p)\n", pbData, cbMax, pcbData);
544
545     *pcbData = sizeof(CLSID) + sizeof(DWORD);
546     if (cbMax < *pcbData)
547         return E_OUTOFMEMORY;
548
549     memcpy(pbData, &CLSID_AntiMoniker, sizeof(CLSID));
550     memcpy(pbData+sizeof(CLSID), &constant, sizeof(DWORD));
551
552     return S_OK;
553 }
554
555 /********************************************************************************/
556 /* Virtual function table for the AntiMonikerImpl class which  include IPersist,*/
557 /* IPersistStream and IMoniker functions.                                       */
558 static const IMonikerVtbl VT_AntiMonikerImpl =
559 {
560     AntiMonikerImpl_QueryInterface,
561     AntiMonikerImpl_AddRef,
562     AntiMonikerImpl_Release,
563     AntiMonikerImpl_GetClassID,
564     AntiMonikerImpl_IsDirty,
565     AntiMonikerImpl_Load,
566     AntiMonikerImpl_Save,
567     AntiMonikerImpl_GetSizeMax,
568     AntiMonikerImpl_BindToObject,
569     AntiMonikerImpl_BindToStorage,
570     AntiMonikerImpl_Reduce,
571     AntiMonikerImpl_ComposeWith,
572     AntiMonikerImpl_Enum,
573     AntiMonikerImpl_IsEqual,
574     AntiMonikerImpl_Hash,
575     AntiMonikerImpl_IsRunning,
576     AntiMonikerImpl_GetTimeOfLastChange,
577     AntiMonikerImpl_Inverse,
578     AntiMonikerImpl_CommonPrefixWith,
579     AntiMonikerImpl_RelativePathTo,
580     AntiMonikerImpl_GetDisplayName,
581     AntiMonikerImpl_ParseDisplayName,
582     AntiMonikerImpl_IsSystemMoniker
583 };
584
585 /********************************************************************************/
586 /* Virtual function table for the IROTData class.                               */
587 static const IROTDataVtbl VT_ROTDataImpl =
588 {
589     AntiMonikerROTDataImpl_QueryInterface,
590     AntiMonikerROTDataImpl_AddRef,
591     AntiMonikerROTDataImpl_Release,
592     AntiMonikerROTDataImpl_GetComparisonData
593 };
594
595 /******************************************************************************
596  *         AntiMoniker_Construct (local function)
597  *******************************************************************************/
598 static HRESULT AntiMonikerImpl_Construct(AntiMonikerImpl* This)
599 {
600
601     TRACE("(%p)\n",This);
602
603     /* Initialize the virtual fgunction table. */
604     This->lpvtbl1      = &VT_AntiMonikerImpl;
605     This->lpvtbl2      = &VT_ROTDataImpl;
606     This->ref          = 0;
607     This->pMarshal     = NULL;
608
609     return S_OK;
610 }
611
612 /******************************************************************************
613  *        CreateAntiMoniker     [OLE32.@]
614  ******************************************************************************/
615 HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk)
616 {
617     AntiMonikerImpl* newAntiMoniker = 0;
618     HRESULT        hr = S_OK;
619     IID riid=IID_IMoniker;
620
621     TRACE("(%p)\n",ppmk);
622
623     newAntiMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(AntiMonikerImpl));
624
625     if (newAntiMoniker == 0)
626         return STG_E_INSUFFICIENTMEMORY;
627
628     hr = AntiMonikerImpl_Construct(newAntiMoniker);
629     if (FAILED(hr))
630     {
631         HeapFree(GetProcessHeap(),0,newAntiMoniker);
632         return hr;
633     }
634
635     hr = AntiMonikerImpl_QueryInterface((IMoniker*)newAntiMoniker,&riid,(void**)ppmk);
636
637     return hr;
638 }
639
640 static HRESULT WINAPI AntiMonikerCF_QueryInterface(LPCLASSFACTORY iface,
641                                                   REFIID riid, LPVOID *ppv)
642 {
643     *ppv = NULL;
644     if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
645     {
646         *ppv = iface;
647         IUnknown_AddRef(iface);
648         return S_OK;
649     }
650     return E_NOINTERFACE;
651 }
652
653 static ULONG WINAPI AntiMonikerCF_AddRef(LPCLASSFACTORY iface)
654 {
655     return 2; /* non-heap based object */
656 }
657
658 static ULONG WINAPI AntiMonikerCF_Release(LPCLASSFACTORY iface)
659 {
660     return 1; /* non-heap based object */
661 }
662
663 static HRESULT WINAPI AntiMonikerCF_CreateInstance(LPCLASSFACTORY iface,
664     LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
665 {
666     IMoniker *pMoniker;
667     HRESULT  hr;
668
669     TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
670
671     *ppv = NULL;
672
673     if (pUnk)
674         return CLASS_E_NOAGGREGATION;
675
676     hr = CreateAntiMoniker(&pMoniker);
677     if (FAILED(hr))
678         return hr;
679
680         hr = IMoniker_QueryInterface(pMoniker, riid, ppv);
681
682     if (FAILED(hr))
683         IMoniker_Release(pMoniker);
684
685     return hr;
686 }
687
688 static HRESULT WINAPI AntiMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
689 {
690     FIXME("(%d), stub!\n",fLock);
691     return S_OK;
692 }
693
694 static const IClassFactoryVtbl AntiMonikerCFVtbl =
695 {
696     AntiMonikerCF_QueryInterface,
697     AntiMonikerCF_AddRef,
698     AntiMonikerCF_Release,
699     AntiMonikerCF_CreateInstance,
700     AntiMonikerCF_LockServer
701 };
702 static const IClassFactoryVtbl *AntiMonikerCF = &AntiMonikerCFVtbl;
703
704 HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv)
705 {
706     return IClassFactory_QueryInterface((IClassFactory *)&AntiMonikerCF, riid, ppv);
707 }