Added a framework for testing CreateProcess and a few tests.
[wine] / dlls / oleaut32 / disptype.c
1 /*
2  * Copyright 2001 Hidenori Takeshima
3  *
4  *      FIXME - stub
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22
23 #include "winerror.h"
24 #include "winnls.h"         /* for PRIMARYLANGID */
25 #include "winreg.h"         /* for HKEY_LOCAL_MACHINE */
26 #include "winuser.h"
27 #include "oleauto.h"
28
29 #include "typelib.h"
30
31 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(ole);
33
34 typedef struct CTypeInfo2Impl
35 {
36         ICOM_VFIELD(ITypeInfo2);
37         UINT ref;
38
39         INTERFACEDATA   ifd;
40         LCID    lcid;
41 } CTypeInfo2Impl;
42
43 static OLECHAR* olestrdup(OLECHAR* psz)
44 {
45         OLECHAR*        pret;
46         DWORD   cb;
47
48         cb = (lstrlenW(psz)+1) * sizeof(OLECHAR);
49         pret = (OLECHAR*)HeapAlloc( GetProcessHeap(), 0, cb );
50         if ( pret != NULL )
51                 memcpy( pret, psz, cb );
52         return pret;
53 }
54
55 static HRESULT CTypeInfo2Impl_Construct(
56         CTypeInfo2Impl* This,INTERFACEDATA* pifd,LCID lcid)
57 {
58         DWORD   n,k;
59         METHODDATA*     pmdst;
60         const METHODDATA*       pmsrc;
61         PARAMDATA*      pPdst;
62         const PARAMDATA*        pPsrc;
63
64         This->ifd.pmethdata = (METHODDATA*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(METHODDATA)*pifd->cMembers);
65         if ( This->ifd.pmethdata == NULL ) return E_OUTOFMEMORY;
66         This->ifd.cMembers = pifd->cMembers;
67         for ( n = 0; n < pifd->cMembers; n++ )
68         {
69                 pmdst = &This->ifd.pmethdata[n];
70                 pmsrc = &pifd->pmethdata[n];
71
72                 pmdst->szName = olestrdup(pmsrc->szName);
73                 if ( pmdst->szName == NULL ) return E_OUTOFMEMORY;
74                 pmdst->ppdata = NULL;
75                 pmdst->dispid = pmsrc->dispid;
76                 pmdst->iMeth = pmsrc->iMeth;
77                 pmdst->cc = pmsrc->cc;
78                 pmdst->cArgs = pmsrc->cArgs;
79                 pmdst->wFlags = pmsrc->wFlags;
80                 pmdst->vtReturn = pmsrc->vtReturn;
81
82                 if ( pmsrc->cArgs <= 0 ) continue;
83                 pmdst->ppdata = (PARAMDATA*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PARAMDATA)*pmsrc->cArgs);
84                 if ( pmdst->ppdata == NULL ) return E_OUTOFMEMORY;
85
86                 for ( k = 0; k < pmsrc->cArgs; k++ )
87                 {
88                         pPdst = &pmdst->ppdata[k];
89                         pPsrc = &pmsrc->ppdata[k];
90                         pPdst->szName = olestrdup(pPsrc->szName);
91                         if ( pPdst->szName == NULL ) return E_OUTOFMEMORY;
92                         pPdst->vt = pPsrc->vt;
93                 }
94         }
95
96         This->lcid = lcid;
97
98         return S_OK;
99 }
100
101 static void CTypeInfo2Impl_Destruct(CTypeInfo2Impl* This)
102 {
103         DWORD   n,k;
104         METHODDATA*     pm;
105         PARAMDATA*      pP;
106
107         if ( This->ifd.pmethdata != NULL )
108         {
109                 for ( n = 0; n < This->ifd.cMembers; n++ )
110                 {
111                         pm = &This->ifd.pmethdata[n];
112                         if ( pm->szName != NULL )
113                                 HeapFree(GetProcessHeap(),0,pm->szName);
114                         if ( pm->ppdata == NULL ) continue;
115
116                         for ( k = 0; k < pm->cArgs; k++ )
117                         {
118                                 pP = &pm->ppdata[k];
119                                 if ( pP->szName != NULL )
120                                         HeapFree(GetProcessHeap(),0,pP->szName);
121                         }
122                         HeapFree(GetProcessHeap(),0,pm->ppdata);
123                 }
124                 HeapFree(GetProcessHeap(),0,This->ifd.pmethdata);
125                 This->ifd.pmethdata = NULL;
126         }
127 }
128
129 /****************************************************************************/
130
131 static const METHODDATA* CTypeInfo2Impl_SearchMethodByName(
132         CTypeInfo2Impl* This,const OLECHAR* pName)
133 {
134         DWORD   n;
135         METHODDATA*     pm;
136
137         for ( n = 0; n < This->ifd.cMembers; n++ )
138         {
139                 pm = &This->ifd.pmethdata[n];
140                 if ( !lstrcmpiW(pm->szName,pName) )
141                         return pm;
142         }
143
144         return NULL;
145 }
146
147 static const METHODDATA* CTypeInfo2Impl_SearchMethodByDispIDAndFlags(
148         CTypeInfo2Impl* This,DISPID dispid,UINT16 wFlags)
149 {
150         DWORD   n;
151         METHODDATA*     pm;
152
153         for ( n = 0; n < This->ifd.cMembers; n++ )
154         {
155                 pm = &This->ifd.pmethdata[n];
156                 if ( (pm->dispid == dispid) && (pm->wFlags & wFlags) )
157                         return pm;
158         }
159
160         return NULL;
161 }
162
163
164 static int CTypeInfo2Impl_SearchParamByName(
165         const METHODDATA* pm,const OLECHAR* pName)
166 {
167         PARAMDATA*      pP;
168         DWORD   k;
169
170         for ( k = 0; k < pm->cArgs; k++ )
171         {
172                 pP = &pm->ppdata[k];
173                 if ( !lstrcmpiW(pP->szName,pName) )
174                         return (int)k;
175         }
176
177         return -1;
178 }
179
180
181 /****************************************************************************/
182
183 static HRESULT WINAPI CTypeInfo2Impl_fnQueryInterface(
184         ITypeInfo2* iface,REFIID riid,void** ppvobj)
185 {
186     ICOM_THIS(CTypeInfo2Impl,iface);
187
188     TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
189
190     *ppvobj = NULL;
191         if ( IsEqualIID(riid, &IID_IUnknown) ||
192              IsEqualIID(riid, &IID_ITypeInfo) ||
193              IsEqualIID(riid, &IID_ITypeInfo2) )
194         {
195                 *ppvobj = (void*)iface;
196                 ITypeInfo2_AddRef(iface);
197                 return S_OK;
198         }
199
200         return E_NOINTERFACE;
201 }
202
203 static ULONG WINAPI CTypeInfo2Impl_fnAddRef(ITypeInfo2* iface)
204 {
205     ICOM_THIS(CTypeInfo2Impl,iface);
206
207         return ++ This->ref;
208 }
209
210 static ULONG WINAPI CTypeInfo2Impl_fnRelease(ITypeInfo2* iface)
211 {
212     ICOM_THIS(CTypeInfo2Impl,iface);
213
214         if ( -- This->ref > 0 ) return This->ref;
215
216         ++ This->ref;
217         CTypeInfo2Impl_Destruct(This);
218         HeapFree(GetProcessHeap(),0,This);
219         return 0;
220 }
221
222 static HRESULT WINAPI CTypeInfo2Impl_fnGetTypeAttr(
223         ITypeInfo2* iface,LPTYPEATTR* ppTypeAttr)
224 {
225     ICOM_THIS(CTypeInfo2Impl,iface);
226     TYPEATTR*   pta;
227
228     FIXME("(%p)\n",This);
229
230         if ( ppTypeAttr == NULL )
231                 return E_POINTER;
232         pta = (TYPEATTR*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TYPEATTR));
233         if ( pta == NULL ) return E_OUTOFMEMORY;
234
235         /* FIXME!!! */
236         pta->lcid = This->lcid;
237         pta->memidConstructor = MEMBERID_NIL;
238         pta->memidDestructor = MEMBERID_NIL;
239         pta->lpstrSchema = NULL;
240         pta->cbSizeInstance = 0;
241         pta->typekind = 0;
242         pta->cFuncs = This->ifd.cMembers;
243         pta->cVars = 0;
244         pta->cImplTypes = 1;
245         pta->cbSizeVft = sizeof(DWORD)*This->ifd.cMembers;
246         pta->cbAlignment = sizeof(DWORD);
247         pta->wTypeFlags = 0;
248         pta->wMajorVerNum = 1;
249         pta->wMinorVerNum = 0;
250         ZeroMemory( &pta->idldescType, sizeof(pta->idldescType) );
251
252         *ppTypeAttr = pta;
253         return S_OK;
254 }
255
256 static HRESULT WINAPI CTypeInfo2Impl_fnGetTypeComp(
257         ITypeInfo2* iface,ITypeComp** ppTComp)
258 {
259     ICOM_THIS(CTypeInfo2Impl,iface);
260
261     FIXME("(%p) stub!\n",This);
262
263         return E_NOTIMPL;
264 }
265
266 static HRESULT WINAPI CTypeInfo2Impl_fnGetFuncDesc(
267         ITypeInfo2* iface,UINT index,LPFUNCDESC* ppFuncDesc)
268 {
269     ICOM_THIS(CTypeInfo2Impl,iface);
270
271     FIXME("(%p) stub!\n",This);
272
273         return E_NOTIMPL;
274 }
275
276 static HRESULT WINAPI CTypeInfo2Impl_fnGetVarDesc(
277         ITypeInfo2* iface,UINT index,LPVARDESC* ppVarDesc)
278 {
279     ICOM_THIS(CTypeInfo2Impl,iface);
280
281     FIXME("(%p) stub!\n",This);
282
283         return E_NOTIMPL;
284 }
285
286 static HRESULT WINAPI CTypeInfo2Impl_fnGetNames(
287         ITypeInfo2* iface, MEMBERID memid,BSTR* rgBstrNames,
288         UINT cMaxNames, UINT* pcNames)
289 {
290     ICOM_THIS(CTypeInfo2Impl,iface);
291
292     FIXME("(%p) stub!\n",This);
293
294         return E_NOTIMPL;
295 }
296
297 static HRESULT WINAPI CTypeInfo2Impl_fnGetRefTypeOfImplType(
298         ITypeInfo2* iface,UINT index,HREFTYPE* pRefType)
299 {
300     ICOM_THIS(CTypeInfo2Impl,iface);
301
302     FIXME("(%p) stub!\n",This);
303
304         return E_NOTIMPL;
305 }
306
307 static HRESULT WINAPI CTypeInfo2Impl_fnGetImplTypeFlags(
308         ITypeInfo2* iface,UINT index,INT* pImplTypeFlags)
309 {
310     ICOM_THIS(CTypeInfo2Impl,iface);
311
312     FIXME("(%p) stub!\n",This);
313
314         return E_NOTIMPL;
315 }
316
317 static HRESULT WINAPI CTypeInfo2Impl_fnGetIDsOfNames(
318         ITypeInfo2* iface,LPOLESTR* rgszNames,UINT cNames,MEMBERID* pMemId)
319 {
320     ICOM_THIS(CTypeInfo2Impl,iface);
321         const METHODDATA*       pm;
322         DWORD   n;
323         int     index;
324
325         TRACE("(%p,%s,%u,%p)\n",This,debugstr_w(*rgszNames),cNames,pMemId);
326
327         if ( rgszNames == NULL || pMemId == NULL ) return E_POINTER;
328         if ( cNames <= 0 ) return E_INVALIDARG;
329         for ( n = 0; n < cNames; n++ )
330         {
331                 if ( rgszNames[n] == NULL ) return E_POINTER;
332         }
333
334         pm = CTypeInfo2Impl_SearchMethodByName(This,rgszNames[0]);
335         if ( pm == NULL ) return DISP_E_UNKNOWNNAME;
336         pMemId[0] = (MEMBERID)pm->dispid;
337
338         for ( n = 1; n < cNames; n++ )
339         {
340                 index = CTypeInfo2Impl_SearchParamByName(pm,rgszNames[n]);
341                 if ( index < 0 ) return DISP_E_UNKNOWNNAME;
342                 pMemId[n] = (MEMBERID)index;
343         }
344
345         return S_OK;
346 }
347
348 static HRESULT WINAPI CTypeInfo2Impl_fnInvoke(
349         ITypeInfo2* iface,VOID* punk,MEMBERID memid,
350         UINT16 wFlags,DISPPARAMS* pDispParams,VARIANT* pVarResult,
351         EXCEPINFO* pExcepInfo,UINT* pArgErr)
352 {
353     ICOM_THIS(CTypeInfo2Impl,iface);
354         const METHODDATA*       pm;
355         DWORD   res;
356         HRESULT hr;
357         int             n;
358         DWORD   cargs;
359         DWORD*  pargs = NULL;
360         VARIANT varError;
361         VARIANT varRet;
362
363         FIXME("(%p,%p,%ld,%08x,%p,%p,%p,%p)\n",
364                 This,punk,(long)memid,(int)wFlags,
365                 pDispParams,pVarResult,pExcepInfo,pArgErr);
366
367         if ( punk == NULL || pArgErr == NULL )
368                 return E_POINTER;
369
370         pm = CTypeInfo2Impl_SearchMethodByDispIDAndFlags(
371                 This,memid,wFlags);
372         if ( pm == NULL )
373         {
374                 ERR("did not find member id %ld, flags %d!\n", (long)memid, (int)wFlags);
375                 return DISP_E_MEMBERNOTFOUND;
376         }
377
378         cargs = pm->cArgs + 1;
379         pargs = (DWORD*)HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)*(pm->cArgs+2) );
380         if ( pargs == NULL ) { hr = E_OUTOFMEMORY; goto err_invoke; }
381
382         V_VT(&varError) = VT_ERROR;
383         pargs[0] = (DWORD)punk;
384         for ( n = 1; n <= (int)pm->cArgs; n++ )
385                 pargs[n] = (DWORD)&varError; /* FIXME? */
386
387         if ( (int)pDispParams->cArgs > (int)pm->cArgs )
388         {
389                 hr = E_FAIL; /* FIXME? */
390                 goto err_invoke;
391         }
392
393         for ( n = 1; n <= (int)pm->cArgs; n++ )
394         {
395                 if ( n <= (int)pDispParams->cNamedArgs )
396                 {
397                         /* FIXME - handle named args. */
398                         /* FIXME - check types. */
399
400                         /* pDispParams->rgdispidNamedArgs */
401                         /* pDispParams->cNamedArgs */
402                         FIXME("named args - %d\n",n);
403                         pargs[n] = V_UNION(&pDispParams->rgvarg[pDispParams->cArgs-n],lVal);
404                 }
405                 else
406                 {
407                         /* FIXME - check types. */
408                         pargs[n] = V_UNION(&pDispParams->rgvarg[pDispParams->cArgs-n],lVal);
409                 }
410         }
411
412         VariantInit( &varRet );
413         if ( pm->vtReturn != VT_EMPTY &&
414                  (!(wFlags & (DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF))) )
415         {
416                 if ( pVarResult != NULL )
417                 {
418                         pargs[cargs] = (DWORD)pVarResult;
419                 }
420                 else
421                 {
422                         pargs[cargs] = (DWORD)(&varRet);
423                 }
424                 cargs ++;
425         }
426
427         res = _invoke(
428                 (*(DWORD***)punk)[pm->iMeth],
429                 pm->cc, cargs, pargs );
430         VariantClear( &varRet );
431
432         if ( res == (DWORD)-1 ) /* FIXME? */
433         {
434                 hr = E_FAIL;
435                 goto err_invoke;
436         }
437
438         hr = S_OK;
439 err_invoke:
440         HeapFree( GetProcessHeap(), 0, pargs );
441
442         return hr;
443 }
444
445 static HRESULT WINAPI CTypeInfo2Impl_fnGetDocumentation(
446         ITypeInfo2* iface,
447         MEMBERID memid, BSTR* pBstrName, BSTR* pBstrDocString,
448         DWORD* pdwHelpContext, BSTR* pBstrHelpFile)
449 {
450     ICOM_THIS(CTypeInfo2Impl,iface);
451
452     FIXME("(%p) stub!\n",This);
453
454         return E_NOTIMPL;
455 }
456
457 static HRESULT WINAPI CTypeInfo2Impl_fnGetDllEntry(
458         ITypeInfo2* iface,MEMBERID memid,
459         INVOKEKIND invKind,BSTR* pBstrDllName,BSTR* pBstrName,
460         WORD* pwOrdinal)
461 {
462     ICOM_THIS(CTypeInfo2Impl,iface);
463
464     FIXME("(%p) stub!\n",This);
465
466         return E_NOTIMPL;
467 }
468
469 static HRESULT WINAPI CTypeInfo2Impl_fnGetRefTypeInfo(
470         ITypeInfo2* iface,HREFTYPE hRefType,ITypeInfo** ppTInfo)
471 {
472     ICOM_THIS(CTypeInfo2Impl,iface);
473
474     FIXME("(%p) stub!\n",This);
475
476         return E_NOTIMPL;
477 }
478
479 static HRESULT WINAPI CTypeInfo2Impl_fnAddressOfMember(
480         ITypeInfo2 *iface,
481         MEMBERID memid,INVOKEKIND invKind,PVOID* ppv)
482 {
483     ICOM_THIS(CTypeInfo2Impl,iface);
484
485     FIXME("(%p) stub!\n",This);
486
487         return E_NOTIMPL;
488 }
489
490 static HRESULT WINAPI CTypeInfo2Impl_fnCreateInstance(
491         ITypeInfo2* iface,
492         IUnknown* punk,REFIID riid,VOID** ppvObj)
493 {
494     ICOM_THIS(CTypeInfo2Impl,iface);
495
496     FIXME("(%p) stub!\n",This);
497
498         return E_NOTIMPL;
499 }
500
501 static HRESULT WINAPI CTypeInfo2Impl_fnGetMops(
502         ITypeInfo2* iface,MEMBERID memid,BSTR* pBstrMops)
503 {
504     ICOM_THIS(CTypeInfo2Impl,iface);
505
506     FIXME("(%p) stub!\n",This);
507
508         return E_NOTIMPL;
509 }
510
511 static HRESULT WINAPI CTypeInfo2Impl_fnGetContainingTypeLib(
512         ITypeInfo2* iface,ITypeLib** ppTLib,UINT* pIndex)
513 {
514     ICOM_THIS(CTypeInfo2Impl,iface);
515
516     FIXME("(%p) stub!\n",This);
517
518         return E_NOTIMPL;
519 }
520
521 static HRESULT WINAPI CTypeInfo2Impl_fnReleaseTypeAttr(
522         ITypeInfo2* iface,TYPEATTR* pTypeAttr)
523 {
524     ICOM_THIS(CTypeInfo2Impl,iface);
525
526     FIXME("(%p)\n",This);
527
528         if ( pTypeAttr != NULL )
529                 HeapFree(GetProcessHeap(),0,pTypeAttr);
530
531         return S_OK;
532 }
533
534 static HRESULT WINAPI CTypeInfo2Impl_fnReleaseFuncDesc(
535         ITypeInfo2* iface,FUNCDESC* pFuncDesc)
536 {
537     ICOM_THIS(CTypeInfo2Impl,iface);
538
539     FIXME("(%p) stub!\n",This);
540
541         return E_NOTIMPL;
542 }
543
544 static HRESULT WINAPI CTypeInfo2Impl_fnReleaseVarDesc(
545         ITypeInfo2* iface,VARDESC* pVarDesc)
546 {
547     ICOM_THIS(CTypeInfo2Impl,iface);
548
549     FIXME("(%p) stub!\n",This);
550
551         return E_NOTIMPL;
552 }
553
554 static HRESULT WINAPI CTypeInfo2Impl_fnGetTypeKind(
555         ITypeInfo2* iface,TYPEKIND* pTypeKind)
556 {
557     ICOM_THIS(CTypeInfo2Impl,iface);
558
559     FIXME("(%p) stub!\n",This);
560
561         return E_NOTIMPL;
562 }
563
564 static HRESULT WINAPI CTypeInfo2Impl_fnGetTypeFlags(
565         ITypeInfo2* iface,UINT* pTypeFlags)
566 {
567     ICOM_THIS(CTypeInfo2Impl,iface);
568
569     FIXME("(%p) stub!\n",This);
570
571         return E_NOTIMPL;
572 }
573
574 static HRESULT WINAPI CTypeInfo2Impl_fnGetFuncIndexOfMemId(
575         ITypeInfo2* iface,
576     MEMBERID memid,INVOKEKIND invKind,UINT* pFuncIndex)
577 {
578     ICOM_THIS(CTypeInfo2Impl,iface);
579
580     FIXME("(%p) stub!\n",This);
581
582         return E_NOTIMPL;
583 }
584
585 static HRESULT WINAPI CTypeInfo2Impl_fnGetVarIndexOfMemId(
586         ITypeInfo2* iface,
587     MEMBERID memid,UINT* pVarIndex)
588 {
589     ICOM_THIS(CTypeInfo2Impl,iface);
590
591     FIXME("(%p) stub!\n",This);
592
593         return E_NOTIMPL;
594 }
595
596 static HRESULT WINAPI CTypeInfo2Impl_fnGetCustData(
597         ITypeInfo2* iface,REFGUID guid,VARIANT* pVarVal)
598 {
599     ICOM_THIS(CTypeInfo2Impl,iface);
600
601     FIXME("(%p) stub!\n",This);
602
603         return E_NOTIMPL;
604 }
605
606 static HRESULT WINAPI CTypeInfo2Impl_fnGetFuncCustData(
607         ITypeInfo2* iface,UINT index,REFGUID guid,VARIANT* pVarVal)
608 {
609     ICOM_THIS(CTypeInfo2Impl,iface);
610
611     FIXME("(%p) stub!\n",This);
612
613         return E_NOTIMPL;
614 }
615
616 static HRESULT WINAPI CTypeInfo2Impl_fnGetParamCustData(
617         ITypeInfo2* iface,UINT indexFunc,UINT indexParam,
618         REFGUID guid,VARIANT* pVarVal)
619 {
620     ICOM_THIS(CTypeInfo2Impl,iface);
621
622     FIXME("(%p) stub!\n",This);
623
624         return E_NOTIMPL;
625 }
626
627 static HRESULT WINAPI CTypeInfo2Impl_fnGetVarCustData(
628         ITypeInfo2* iface,UINT index,REFGUID guid,VARIANT* pVarVal)
629 {
630     ICOM_THIS(CTypeInfo2Impl,iface);
631
632     FIXME("(%p) stub!\n",This);
633
634         return E_NOTIMPL;
635 }
636
637 static HRESULT WINAPI CTypeInfo2Impl_fnGetImplTypeCustData(
638         ITypeInfo2 * iface,UINT index,REFGUID guid,VARIANT* pVarVal)
639 {
640     ICOM_THIS(CTypeInfo2Impl,iface);
641
642     FIXME("(%p) stub!\n",This);
643
644         return E_NOTIMPL;
645 }
646
647 static HRESULT WINAPI CTypeInfo2Impl_fnGetDocumentation2(
648         ITypeInfo2* iface,MEMBERID memid,LCID lcid,
649         BSTR* pbstrHelpString,DWORD* pdwHelpStringContext,BSTR* pbstrHelpStringDll)
650 {
651     ICOM_THIS(CTypeInfo2Impl,iface);
652
653     FIXME("(%p) stub!\n",This);
654
655         return E_NOTIMPL;
656 }
657
658 static HRESULT WINAPI CTypeInfo2Impl_fnGetAllCustData(
659         ITypeInfo2* iface,CUSTDATA* pCustData)
660 {
661     ICOM_THIS(CTypeInfo2Impl,iface);
662
663     FIXME("(%p) stub!\n",This);
664
665         return E_NOTIMPL;
666 }
667
668 static HRESULT WINAPI CTypeInfo2Impl_fnGetAllFuncCustData(
669         ITypeInfo2* iface,UINT index,CUSTDATA* pCustData)
670 {
671     ICOM_THIS(CTypeInfo2Impl,iface);
672
673     FIXME("(%p) stub!\n",This);
674
675         return E_NOTIMPL;
676 }
677
678 static HRESULT WINAPI CTypeInfo2Impl_fnGetAllParamCustData(
679         ITypeInfo2* iface,UINT indexFunc,UINT indexParam,CUSTDATA* pCustData)
680 {
681     ICOM_THIS(CTypeInfo2Impl,iface);
682
683     FIXME("(%p) stub!\n",This);
684
685         return E_NOTIMPL;
686 }
687
688 static HRESULT WINAPI CTypeInfo2Impl_fnGetAllVarCustData(
689         ITypeInfo2* iface,UINT index,CUSTDATA* pCustData)
690 {
691     ICOM_THIS(CTypeInfo2Impl,iface);
692
693     FIXME("(%p) stub!\n",This);
694
695         return E_NOTIMPL;
696 }
697
698 static HRESULT WINAPI CTypeInfo2Impl_fnGetAllImplTypeCustData(
699         ITypeInfo2* iface,UINT index,CUSTDATA* pCustData)
700 {
701     ICOM_THIS(CTypeInfo2Impl,iface);
702
703     FIXME("(%p) stub!\n",This);
704
705         return E_NOTIMPL;
706 }
707
708 static ICOM_VTABLE(ITypeInfo2) itypeinfo2 =
709 {
710         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
711
712         /* IUnknown */
713     CTypeInfo2Impl_fnQueryInterface,
714     CTypeInfo2Impl_fnAddRef,
715     CTypeInfo2Impl_fnRelease,
716         /* ITypeInfo */
717     CTypeInfo2Impl_fnGetTypeAttr,
718     CTypeInfo2Impl_fnGetTypeComp,
719     CTypeInfo2Impl_fnGetFuncDesc,
720     CTypeInfo2Impl_fnGetVarDesc,
721     CTypeInfo2Impl_fnGetNames,
722     CTypeInfo2Impl_fnGetRefTypeOfImplType,
723     CTypeInfo2Impl_fnGetImplTypeFlags,
724     CTypeInfo2Impl_fnGetIDsOfNames,
725     CTypeInfo2Impl_fnInvoke,
726     CTypeInfo2Impl_fnGetDocumentation,
727     CTypeInfo2Impl_fnGetDllEntry,
728     CTypeInfo2Impl_fnGetRefTypeInfo,
729     CTypeInfo2Impl_fnAddressOfMember,
730     CTypeInfo2Impl_fnCreateInstance,
731     CTypeInfo2Impl_fnGetMops,
732     CTypeInfo2Impl_fnGetContainingTypeLib,
733     CTypeInfo2Impl_fnReleaseTypeAttr,
734     CTypeInfo2Impl_fnReleaseFuncDesc,
735     CTypeInfo2Impl_fnReleaseVarDesc,
736         /* ITypeInfo2 */
737     CTypeInfo2Impl_fnGetTypeKind,
738     CTypeInfo2Impl_fnGetTypeFlags,
739     CTypeInfo2Impl_fnGetFuncIndexOfMemId,
740     CTypeInfo2Impl_fnGetVarIndexOfMemId,
741     CTypeInfo2Impl_fnGetCustData,
742     CTypeInfo2Impl_fnGetFuncCustData,
743     CTypeInfo2Impl_fnGetParamCustData,
744     CTypeInfo2Impl_fnGetVarCustData,
745     CTypeInfo2Impl_fnGetImplTypeCustData,
746     CTypeInfo2Impl_fnGetDocumentation2,
747     CTypeInfo2Impl_fnGetAllCustData,
748     CTypeInfo2Impl_fnGetAllFuncCustData,
749     CTypeInfo2Impl_fnGetAllParamCustData,
750     CTypeInfo2Impl_fnGetAllVarCustData,
751     CTypeInfo2Impl_fnGetAllImplTypeCustData,
752 };
753
754 /*****************************************************************************/
755
756 HRESULT WINAPI CreateDispTypeInfo(
757         INTERFACEDATA* pifd,
758         LCID lcid,
759         ITypeInfo** ppinfo )
760 {
761         HRESULT hr;
762         CTypeInfo2Impl* This;
763
764         if ( ppinfo == NULL )
765                 return E_POINTER;
766
767         This = (CTypeInfo2Impl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(CTypeInfo2Impl));
768         if ( This == NULL ) return E_OUTOFMEMORY;
769         ICOM_VTBL(This) = &itypeinfo2;
770         This->ref = 1;
771
772         hr = CTypeInfo2Impl_Construct(This,pifd,lcid);
773         if ( FAILED(hr) )
774         {
775                 IUnknown_Release((IUnknown*)This);
776                 return hr;
777         }
778         *ppinfo = (ITypeInfo*)This;
779
780         return S_OK;
781 }