Index: trunk/src/oleaut32/iPicture.cpp
===================================================================
--- trunk/src/oleaut32/iPicture.cpp	(revision 6505)
+++ 	(revision )
@@ -1,781 +1,0 @@
-/* $Id: iPicture.cpp,v 1.4 2000-09-17 22:31:40 davidr Exp $ */
-/* 
- * OLE Picture functions
- *
- * Defines the OLE "Picture" object
- * This object has the following ingoing interfaces:
- *  IUnknown
- *  IPicture		- Picture manipulation
- *  IDispatch		- for Automation
- *  IPictureDisp	- for Automation
- *  IPersistStream	- Persist to stream
- * 
- * 12/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
- 
-#include "oleaut32.h"
-#include "olectl.h"
-#include "ipicture.h"
-
-
-// ======================================================================
-// Prototypes.
-// ======================================================================
-
-// ----------------------------------------------------------------------
-// IPictureImpl
-// ----------------------------------------------------------------------
-static IPictureImpl *   IPictureImpl_Constructor(LPPICTDESC description, BOOL fOwn);
-static void             IPictureImpl_Destructor(IPictureImpl * obj);
-
-static HRESULT WIN32API	IPictureImpl_QueryInterface(LPPICTURE iface,
-				REFIID refiid, LPVOID * obj);
-static ULONG   WIN32API	IPictureImpl_AddRef(LPPICTURE iface);
-static ULONG   WIN32API	IPictureImpl_Release(LPPICTURE iface);
-static HRESULT WIN32API	IPictureImpl_get_Handle(LPPICTURE iface,  
-				OLE_HANDLE * pHandle);
-static HRESULT WIN32API	IPictureImpl_get_hPal(LPPICTURE iface,
-				OLE_HANDLE * phPal);
-static HRESULT WIN32API	IPictureImpl_get_Type(LPPICTURE iface,
-				SHORT * pType);
-static HRESULT WIN32API	IPictureImpl_get_Width(LPPICTURE iface,
-				OLE_XSIZE_HIMETRIC * pWidth);
-static HRESULT WIN32API	IPictureImpl_get_Height(LPPICTURE iface,
-				OLE_YSIZE_HIMETRIC * pHeight);
-static HRESULT WIN32API	IPictureImpl_Render(LPPICTURE iface,
-				HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds);
-static HRESULT WIN32API	IPictureImpl_set_hPal(LPPICTURE iface,
-				OLE_HANDLE hPal);
-static HRESULT WIN32API	IPictureImpl_get_CurDC(LPPICTURE iface,
-				HDC * phDC);
-static HRESULT WIN32API	IPictureImpl_SelectPicture(LPPICTURE iface,
-				HDC hDCIn, HDC * phDCOut, OLE_HANDLE * phBmpOut);
-static HRESULT WIN32API	IPictureImpl_get_KeepOriginalFormat(LPPICTURE iface,
-				BOOL * pKeep);
-static HRESULT WIN32API	IPictureImpl_put_KeepOriginalFormat(LPPICTURE iface,
-				BOOL Keep);
-static HRESULT WIN32API	IPictureImpl_PictureChanged(LPPICTURE iface);
-static HRESULT WIN32API	IPictureImpl_SaveAsFile(LPPICTURE iface,
-				LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize);
-static HRESULT WIN32API	IPictureImpl_get_Attributes(LPPICTURE iface,
-				DWORD * pDwAttr);
-
-// ----------------------------------------------------------------------
-// IDispatch
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IDispatch_QueryInterface(LPDISPATCH iface,
-				REFIID riid, LPVOID * obj);
-static ULONG   WINAPI IPictureImpl_IDispatch_AddRef(LPDISPATCH iface);
-static ULONG   WINAPI IPictureImpl_IDispatch_Release(LPDISPATCH iface);
-static HRESULT WINAPI IPictureImpl_IDispatch_GetTypeInfoCount(LPDISPATCH iface, 
-				unsigned int* pctinfo);
-static HRESULT WINAPI IPictureImpl_IDispatch_GetTypeInfo(LPDISPATCH  iface,
-				UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo);
-static HRESULT WINAPI IPictureImpl_IDispatch_GetIDsOfNames(LPDISPATCH iface,
-				REFIID riid, LPOLESTR* rgszNames, UINT cNames,
-				LCID lcid, DISPID* rgDispId);
-static HRESULT WINAPI IPictureImpl_IDispatch_Invoke(LPDISPATCH iface,
-				DISPID dispIdMember, REFIID riid,
-				LCID lcid, WORD wFlags,
-				DISPPARAMS* pDispParams, VARIANT* pVarResult,
-				EXCEPINFO* pExepInfo, UINT* puArgErr);
-
-// ----------------------------------------------------------------------
-// IPersistStream
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_QueryInterface(LPPERSISTSTREAM iface,
-				REFIID riid, LPVOID * obj);
-static ULONG   WINAPI IPictureImpl_IPersistStream_AddRef(LPPERSISTSTREAM iface);
-static ULONG   WINAPI IPictureImpl_IPersistStream_Release(LPPERSISTSTREAM iface);
-static HRESULT WINAPI IPictureImpl_IPersistStream_GetClassID(LPPERSISTSTREAM iface,
-				CLSID * pClassID);
-static HRESULT WINAPI IPictureImpl_IPersistStream_IsDirty(LPPERSISTSTREAM iface);
-static HRESULT WINAPI IPictureImpl_IPersistStream_Load(LPPERSISTSTREAM iface,
-				LPSTREAM pLoadStream);
-static HRESULT WINAPI IPictureImpl_IPersistStream_Save(LPPERSISTSTREAM iface,
-				LPSTREAM pOutStream, BOOL fClearDirty);
-static HRESULT WINAPI IPictureImpl_IPersistStream_GetSizeMax(LPPERSISTSTREAM iface,
-				ULARGE_INTEGER * pcbSize);
-
-// ======================================================================
-// Local Data
-// ======================================================================
-static ICOM_VTABLE(IPicture) IPictureImpl_VTable =
-{
-    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
-    IPictureImpl_QueryInterface,
-    IPictureImpl_AddRef,
-    IPictureImpl_Release,
-    IPictureImpl_get_Handle,
-    IPictureImpl_get_hPal,
-    IPictureImpl_get_Type,
-    IPictureImpl_get_Width,
-    IPictureImpl_get_Height,
-    IPictureImpl_Render,
-    IPictureImpl_set_hPal,
-    IPictureImpl_get_CurDC,
-    IPictureImpl_SelectPicture,
-    IPictureImpl_get_KeepOriginalFormat,
-    IPictureImpl_put_KeepOriginalFormat,
-    IPictureImpl_PictureChanged,
-    IPictureImpl_SaveAsFile,
-    IPictureImpl_get_Attributes
-};
-
-static ICOM_VTABLE(IDispatch) IPictureImpl_IDispatch_VTable =
-{
-    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
-    IPictureImpl_IDispatch_QueryInterface,
-    IPictureImpl_IDispatch_AddRef,
-    IPictureImpl_IDispatch_Release,
-    IPictureImpl_IDispatch_GetTypeInfoCount,
-    IPictureImpl_IDispatch_GetTypeInfo,
-    IPictureImpl_IDispatch_GetIDsOfNames,
-    IPictureImpl_IDispatch_Invoke
-};
-
-static ICOM_VTABLE(IPersistStream) IPictureImpl_IPersistStream_VTable =
-{
-    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
-    IPictureImpl_IPersistStream_QueryInterface,
-    IPictureImpl_IPersistStream_AddRef,
-    IPictureImpl_IPersistStream_Release,
-    IPictureImpl_IPersistStream_GetClassID,
-    IPictureImpl_IPersistStream_IsDirty,
-    IPictureImpl_IPersistStream_Load,
-    IPictureImpl_IPersistStream_Save,
-    IPictureImpl_IPersistStream_GetSizeMax
-};
-
-// ======================================================================
-// Local Methods
-// ======================================================================
-
-// ----------------------------------------------------------------------
-// IPictureImpl_QueryInterface
-// ----------------------------------------------------------------------
-static IPictureImpl *   IPictureImpl_Constructor(LPPICTDESC description, BOOL fOwn)
-{
-    IPictureImpl *	pNewObject;
-
-    // Allocate a new object on the heap...
-    if ((pNewObject = (IPictureImpl *)HeapAlloc(GetProcessHeap(), 0, sizeof(IPictureImpl))) == 0)
-    	return 0;
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->Contructor(fOwn = %d)\n", pNewObject, fOwn));
-
-    // Initialise the vft's
-    pNewObject->lpvtbl1 = &IPictureImpl_VTable;
-    pNewObject->lpvtbl2 = &IPictureImpl_IDispatch_VTable;
-    pNewObject->lpvtbl3 = &IPictureImpl_IPersistStream_VTable;
-
-    // Initial reference count of 1...
-    pNewObject->ref = 1;
-    pNewObject->fOwn = fOwn;
-
-    // If a description is not passed then leave the picture uninitialised...
-    if (description == 0)
-	pNewObject->pStrat = new IPictureNone(pNewObject);
-    else
-    {
-	// Validate size...
-	if (description->cbSizeofstruct < sizeof(PICTDESC))
-	{
-	    dprintf(("OLEAUT32: IPictureImpl(%p)->Constructor - Invalid cbSizeofstruct!", pNewObject));
-	    return 0;
-	}
-	switch(description->picType)
-	{
-	    case PICTYPE_BITMAP:
-		pNewObject->pStrat = new IPictureBmp(
-					    pNewObject,
-					    description->u.bmp.hbitmap,
-					    description->u.bmp.hpal);
-		break;
-
-	    case PICTYPE_METAFILE:
-		pNewObject->pStrat = new IPictureMeta(pNewObject,
-					    description->u.wmf.hmeta,
-					    description->u.wmf.xExt,
-					    description->u.wmf.yExt);
-		break;
-
-	    case PICTYPE_ICON:
-		pNewObject->pStrat = new IPictureIcon(pNewObject,
-					    description->u.icon.hicon);
-		break;
-
-	    case PICTYPE_ENHMETAFILE:
-		pNewObject->pStrat = new IPictureIcon(pNewObject,
-					    description->u.emf.hemf);
-		break;
-
-	    default:
-	    	// assume uninitialised...
-		pNewObject->pStrat = new IPictureNone(pNewObject);
-		break;
-	}
-    }
-
-    return pNewObject;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_Destructor
-// ----------------------------------------------------------------------
-static void             IPictureImpl_Destructor(IPictureImpl * This)
-{
-    dprintf(("OLEAUT32: IPictureImpl(%p)->Destructor()\n", This));
-
-    delete This->pStrat;
-
-    HeapFree(GetProcessHeap(), 0, This);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_QueryInterface
-// ----------------------------------------------------------------------
-static HRESULT WIN32API IPictureImpl_QueryInterface(LPPICTURE iface, REFIID refiid, LPVOID *obj)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->QueryInterface()", This));
-
-    // Sanity check...
-    if ((This == 0) || (obj == 0))
-	return E_INVALIDARG;
-
-    // Initialise return jic...
-    *obj = 0;
-
-    // Go find the correct interface...
-    if (IsEqualIID(&IID_IUnknown, refiid))
-	*obj = &(This->lpvtbl1);
-    else if (IsEqualIID(&IID_IPicture, refiid))
-	*obj = &(This->lpvtbl1);
-    else if (IsEqualIID(&IID_IDispatch, refiid))
-	*obj = &(This->lpvtbl2);
-    else if (IsEqualIID(&IID_IPictureDisp, refiid))
-	*obj = &(This->lpvtbl2);
-    else if (IsEqualIID(&IID_IPersistStream, refiid))
-	*obj = &(This->lpvtbl3);
-    else
-	return OLE_E_ENUM_NOMORE; 
-
-    // Query Interface always increases the reference count by one...
-    IPictureImpl_AddRef((LPPICTURE)This);
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_AddRef
-// ----------------------------------------------------------------------
-static ULONG WIN32API IPictureImpl_AddRef(LPPICTURE iface)
-{ 
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->AddRef()", This));
-
-    return ++(This->ref);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_Release
-// ----------------------------------------------------------------------
-static ULONG WIN32API IPictureImpl_Release(LPPICTURE iface)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->Release()\n", This));
-
-    if (--(This->ref) == 0)
-    {
-	IPictureImpl_Destructor(This);
-	return 0;
-    }
-    return This->ref;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_Handle
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_Handle(LPPICTURE iface,  
-				OLE_HANDLE * pHandle)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_Handle()", This));
-
-    // Sanity check...
-    if (pHandle == 0)
-    	return E_POINTER;
-
-    // Return the handle...
-    return This->pStrat->get_Handle(pHandle);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_hPal
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_hPal(LPPICTURE iface,
-				OLE_HANDLE * phPal)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_hPal()", This));
-
-    // Sanity check...
-    if (phPal == 0)
-    	return E_POINTER;
-
-    // Return the handle...
-    return This->pStrat->get_hPal(phPal);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_Type
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_Type(LPPICTURE iface,
-				SHORT * pType)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_Type()", This));
-
-    // Sanity check...
-    if (pType == 0)
-	return E_POINTER;
-
-    // Return the type...
-    return This->pStrat->get_Type(pType);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_Width
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_Width(LPPICTURE iface,
-				OLE_XSIZE_HIMETRIC * pWidth)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_Width()", This));
-
-    // Sanity check...
-    if (pWidth == 0)
-	return E_POINTER;
-
-    // Return the width...
-    return This->pStrat->get_Width(pWidth);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_Height
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_Height(LPPICTURE iface,
-				OLE_YSIZE_HIMETRIC * pHeight)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_Height()", This));
-
-    // Sanity check...
-    if (pHeight == 0)
-	return E_POINTER;
-
-    // Return the height...
-    return This->pStrat->get_Height(pHeight);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_Render
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_Render(LPPICTURE iface,
-				HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->Render()", This));
-
-    // Delegate...
-    return This->pStrat->Render(hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, pRcWBounds);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_set_hPal
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_set_hPal(LPPICTURE iface,
-				OLE_HANDLE hPal)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->set_hPal()", This));
-
-    //Delegate...
-    return This->pStrat->set_hPal(hPal);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_CurDC
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_CurDC(LPPICTURE iface,
-				HDC * phDC)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_CurDC()", This));
-
-    // Sanity check
-    if (phDC == 0)
-	return E_POINTER;
-
-    // Return current hDC
-    *phDC = This->hCurDC;
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_SelectPicture
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_SelectPicture(LPPICTURE iface,
-				HDC hDCIn, HDC * phDCOut, OLE_HANDLE * phBmpOut)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->SelectPicture() - Stub", This));
-
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_KeepOriginalFormat
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_KeepOriginalFormat(LPPICTURE iface,
-				BOOL * pKeep)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_KeepOriginalFormat()", This));
-
-    // Sanity check...
-    if (pKeep == 0)
-	return E_POINTER;
-
-    // Return the current setting...
-    *pKeep = This->fKeepOriginalFormat;
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_put_KeepOriginalFormat
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_put_KeepOriginalFormat(LPPICTURE iface,
-				BOOL Keep)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->put_KeepOriginalFormat()", This));
-
-    // Save it...
-    This->fKeepOriginalFormat = Keep;
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_PictureChanged
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_PictureChanged(LPPICTURE iface)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->PictureChanged()", This));
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_SaveAsFile
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_SaveAsFile(LPPICTURE iface,
-				LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->SaveAsFile()", This));
-
-    //Delegate...
-    return This->pStrat->SaveAsFile(pStream, fSaveMemCopy, pCbSize);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_get_Attributes
-// ----------------------------------------------------------------------
-static HRESULT WIN32API	IPictureImpl_get_Attributes(LPPICTURE iface,
-				DWORD * pDwAttr)
-{
-    _ICOM_THIS(IPictureImpl, iface);
-
-    dprintf(("OLEAUT32: IPictureImpl(%p)->get_Attributes()", This));
-
-    // Sanity check
-    if (pDwAttr == 0)
-	return E_POINTER;
-
-    //Delegate...
-    return This->pStrat->get_Attributes(pDwAttr);
-}
-
-
-// ----------------------------------------------------------------------
-// IPictureImpl_IDispatch_QueryInterface
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IDispatch_QueryInterface(LPDISPATCH iface,
-				REFIID riid, LPVOID * obj)
-{
-    _ICOM_THIS_From_IDispatch(IPicture, iface);
-
-    return IPictureImpl_QueryInterface(This, riid, obj);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_IDispatch_AddRef
-// ----------------------------------------------------------------------
-static ULONG   WINAPI IPictureImpl_IDispatch_AddRef(LPDISPATCH iface)
-{
-    _ICOM_THIS_From_IDispatch(IPicture, iface);
-
-    return IPictureImpl_AddRef(This);
-}
-
-// ----------------------------------------------------------------------
-// IPictureImpl_IDispatch_Release
-// ----------------------------------------------------------------------
-static ULONG   WINAPI IPictureImpl_IDispatch_Release(LPDISPATCH iface)
-{
-    _ICOM_THIS_From_IDispatch(IPicture, iface);
-
-    return IPictureImpl_Release(This);
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IDispatch_GetTypeInfoCount(LPDISPATCH iface, 
-				unsigned int* pctinfo)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IDispatch_GetTypeInfo(LPDISPATCH  iface,
-				UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IDispatch_GetIDsOfNames(LPDISPATCH iface,
-				REFIID riid, LPOLESTR* rgszNames, UINT cNames,
-				LCID lcid, DISPID* rgDispId)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IDispatch_Invoke(LPDISPATCH iface,
-				DISPID dispIdMember, REFIID riid,
-				LCID lcid, WORD wFlags,
-				DISPPARAMS* pDispParams, VARIANT* pVarResult,
-				EXCEPINFO* pExepInfo, UINT* puArgErr)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_QueryInterface(LPPERSISTSTREAM iface,
-				REFIID riid, LPVOID * obj)
-{
-    _ICOM_THIS_From_IPersistStream(IPicture, iface);
-
-    return IPictureImpl_QueryInterface(This, riid, obj);
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static ULONG   WINAPI IPictureImpl_IPersistStream_AddRef(LPPERSISTSTREAM iface)
-{
-    _ICOM_THIS_From_IPersistStream(IPicture, iface);
-
-    return IPictureImpl_AddRef(This);
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static ULONG   WINAPI IPictureImpl_IPersistStream_Release(LPPERSISTSTREAM iface)
-{
-    _ICOM_THIS_From_IPersistStream(IPicture, iface);
-
-    return IPictureImpl_Release(This);
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_GetClassID(LPPERSISTSTREAM iface,
-				CLSID * pClassID)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_IsDirty(LPPERSISTSTREAM iface)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_Load(LPPERSISTSTREAM iface,
-				LPSTREAM pLoadStream)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_Save(LPPERSISTSTREAM iface,
-				LPSTREAM pOutStream, BOOL fClearDirty)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-static HRESULT WINAPI IPictureImpl_IPersistStream_GetSizeMax(LPPERSISTSTREAM iface,
-				ULARGE_INTEGER * pcbSize)
-{
-    dprintf(("%s: Stub", __FUNCTION__));
-    return E_NOTIMPL;
-}
-
-
-// ======================================================================
-// Public API's
-// ======================================================================
-
-// ----------------------------------------------------------------------
-//  OleLoadPicture
-// ----------------------------------------------------------------------
-HRESULT WIN32API OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
-    REFIID riid, LPVOID * lplpvObj)
-{
-    dprintf(("OLEAUT32: OleLoadPicture - stub"));
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// OleCreatePictureIndirect
-// ----------------------------------------------------------------------
-HRESULT WIN32API OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid,
-    BOOL fOwn, LPVOID * lplpvObj)
-{
-    IPictureImpl *	newPicture;
-    HRESULT		hr;
-
-    dprintf(("OLEAUT32: OleCreatePictureIndirect"));
-
-    // Validate input pointer...
-    if (lplpvObj == 0)
-    	return E_POINTER;
-
-    *lplpvObj = 0;
-
-    // Create new picture object...
-    newPicture = IPictureImpl_Constructor(lpPictDesc, fOwn);
-
-    if (newPicture == 0)
-	return E_OUTOFMEMORY;
-
-    // Grab and return the requested interface...
-    hr = IPictureImpl_QueryInterface((LPPICTURE)newPicture, riid, lplpvObj);
-
-    // We should now have two references :-)
-    // One from the constructor & one from QueryInterface
-    // Release one...
-    IPictureImpl_Release((LPPICTURE)newPicture);
-
-    return hr;
-}
-
-// ----------------------------------------------------------------------
-// OleLoadPictureFile
-// ----------------------------------------------------------------------
-HRESULT WIN32API OleLoadPictureFile(VARIANT varFileName, LPDISPATCH* lplpdispPicture)
-{
-    dprintf(("OLEAUT32: OleLoadPictureFile - stub"));
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// OleSavePictureFile
-// ----------------------------------------------------------------------
-HRESULT WIN32API OleSavePictureFile(LPDISPATCH lpdispPicture,
-    BSTR bstrFileName)
-{
-    dprintf(("OLEAUT32: OleSavePictureFile - stub"));
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// OleLoadPicturePath
-// ----------------------------------------------------------------------
-HRESULT WIN32API OleLoadPicturePath
-   (LPOLESTR  		szURLorPath,
-    LPUNKNOWN 		punkCaller,
-    DWORD     		dwReserved,
-    OLE_COLOR 		clrReserved,
-    REFIID    		riid,
-    LPVOID *  		ppvRet )
-{
-    dprintf(("OLEAUT32: OleLoadPicturePath - stub"));
-    return S_OK;
-}
-
-
Index: trunk/src/oleaut32/iPicture.h
===================================================================
--- trunk/src/oleaut32/iPicture.h	(revision 6505)
+++ 	(revision )
@@ -1,241 +1,0 @@
-/* $Id: iPicture.h,v 1.3 1999-11-23 20:46:04 davidr Exp $ */
-/* 
- * OLE Picture functions private header
- *
- * 12/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
-
-#if !defined(IPICTURE_INCLUDED)
-#define IPICTURE_INCLUDED
-
-class IPictureStrat;	// Forward defn.
-
-typedef struct IPictureImpl {
-
-    // IUnknown, IPicture
-    ICOM_VTABLE(IPicture) *     	lpvtbl1;
-
-    // IDispatch, IPictureDisp
-    ICOM_VTABLE(IDispatch) *		lpvtbl2;
-
-    // IPersistStream
-    ICOM_VTABLE(IPersistStream) *	lpvtbl3;
-
-    ULONG		ref;		// Reference counter...
-
-    IPictureStrat *	pStrat;		// Current object strategy.
-
-    union
-    {
-        struct
-        {
-            HBITMAP   hbitmap;        // Bitmap
-            HPALETTE  hpal;           // Accompanying palette
-        } bmp;
-
-        struct
-        {
-            HMETAFILE hmeta;          // Metafile
-            int       xExt;
-            int       yExt;           // Extent
-        } wmf;
-
-        struct
-        {
-            HICON hicon;              // Icon
-        } icon;
-
-        struct
-        {
-            HENHMETAFILE hemf;        // Enhanced Metafile
-        } emf;
-    } u;
-
-    BOOL		fKeepOriginalFormat;
-    BOOL		fOwn;
-    HDC			hCurDC;
-    ULONG		lAttrib;
-
-} IPictureImpl;
-
-class IPictureStrat
-{
-public:
-    virtual HRESULT get_Handle(OLE_HANDLE * pHandle) = 0;
-    virtual HRESULT get_hPal(OLE_HANDLE * phPal) = 0;
-    virtual HRESULT get_Type(SHORT * pType) = 0;
-    virtual HRESULT get_Width(OLE_XSIZE_HIMETRIC * pWidth) = 0;
-    virtual HRESULT get_Height(OLE_YSIZE_HIMETRIC * pHeight) = 0;
-    virtual HRESULT Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				    OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				    OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				    LPCRECT pRcWBounds) = 0;
-    virtual HRESULT set_hPal(OLE_HANDLE hPal) = 0;
-    virtual HRESULT SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize) = 0;
-    virtual HRESULT get_Attributes(DWORD * pDwAttr) = 0;
-
-    virtual ~IPictureStrat() {};
-
-protected:
-    IPictureStrat(IPictureImpl * a_pPicture) {pPicture = a_pPicture; }
-
-    IPictureImpl *	pPicture;
-
-private:
-
-};
-
-// ======================================================================
-// Uninitialised Picture
-// ======================================================================
-
-class IPictureNone : public IPictureStrat
-{
-public:
-    IPictureNone(IPictureImpl * a_pPicture) : IPictureStrat(a_pPicture) {}
-    HRESULT get_Handle(OLE_HANDLE * pHandle);
-    HRESULT get_hPal(OLE_HANDLE * phPal);
-    HRESULT get_Type(SHORT * pType);
-    HRESULT get_Width(OLE_XSIZE_HIMETRIC * pWidth);
-    HRESULT get_Height(OLE_YSIZE_HIMETRIC * pHeight);
-    HRESULT Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				    OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				    OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				    LPCRECT pRcWBounds);
-    HRESULT set_hPal(OLE_HANDLE hPal);
-    HRESULT SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize);
-    HRESULT get_Attributes(DWORD * pDwAttr);
-
-protected:
-
-private:
-
-};
-
-
-// ======================================================================
-// Bitmap Picture
-// ======================================================================
-
-class IPictureBmp : public IPictureStrat
-{
-public:
-    IPictureBmp(IPictureImpl * a_pPicture, HBITMAP hBitmap, HPALETTE hpal);
-    ~IPictureBmp();
-    HRESULT get_Handle(OLE_HANDLE * pHandle);
-    HRESULT get_hPal(OLE_HANDLE * phPal);
-    HRESULT get_Type(SHORT * pType);
-    HRESULT get_Width(OLE_XSIZE_HIMETRIC * pWidth);
-    HRESULT get_Height(OLE_YSIZE_HIMETRIC * pHeight);
-    HRESULT Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				    OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				    OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				    LPCRECT pRcWBounds);
-    HRESULT set_hPal(OLE_HANDLE hPal);
-    HRESULT SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize);
-    HRESULT get_Attributes(DWORD * pDwAttr);
-
-protected:
-
-private:
-
-};
-
-
-// ======================================================================
-// Icon Picture
-// ======================================================================
-
-class IPictureIcon : public IPictureStrat
-{
-public:
-    IPictureIcon(IPictureImpl * a_pPicture, HICON hicon);
-    ~IPictureIcon();
-    HRESULT get_Handle(OLE_HANDLE * pHandle);
-    HRESULT get_hPal(OLE_HANDLE * phPal);
-    HRESULT get_Type(SHORT * pType);
-    HRESULT get_Width(OLE_XSIZE_HIMETRIC * pWidth);
-    HRESULT get_Height(OLE_YSIZE_HIMETRIC * pHeight);
-    HRESULT Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				    OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				    OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				    LPCRECT pRcWBounds);
-    HRESULT set_hPal(OLE_HANDLE hPal);
-    HRESULT get_CurDC(HDC * phDC);
-    HRESULT put_KeepOriginalFormat(BOOL Keep);
-    HRESULT SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize);
-    HRESULT get_Attributes(DWORD * pDwAttr);
-
-protected:
-
-private:
-
-};
-
-// ======================================================================
-// Metafile Picture
-// ======================================================================
-
-class IPictureMeta : public IPictureStrat
-{
-public:
-    IPictureMeta(IPictureImpl * a_pPicture, HMETAFILE hmeta, int xExt, int yExt);
-    ~IPictureMeta();
-    HRESULT get_Handle(OLE_HANDLE * pHandle);
-    HRESULT get_hPal(OLE_HANDLE * phPal);
-    HRESULT get_Type(SHORT * pType);
-    HRESULT get_Width(OLE_XSIZE_HIMETRIC * pWidth);
-    HRESULT get_Height(OLE_YSIZE_HIMETRIC * pHeight);
-    HRESULT Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				    OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				    OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				    LPCRECT pRcWBounds);
-    HRESULT set_hPal(OLE_HANDLE hPal);
-    HRESULT SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize);
-    HRESULT get_Attributes(DWORD * pDwAttr);
-
-protected:
-
-private:
-
-};
-
-// ======================================================================
-// Enhanced Metafile Picture
-// ======================================================================
-
-class IPictureEmf : public IPictureStrat
-{
-public:
-    IPictureEmf(IPictureImpl * a_pPicture, HENHMETAFILE hemf);
-    ~IPictureEmf();
-    HRESULT get_Handle(OLE_HANDLE * pHandle);
-    HRESULT get_hPal(OLE_HANDLE * phPal);
-    HRESULT get_Type(SHORT * pType);
-    HRESULT get_Width(OLE_XSIZE_HIMETRIC * pWidth);
-    HRESULT get_Height(OLE_YSIZE_HIMETRIC * pHeight);
-    HRESULT Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				    OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				    OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				    LPCRECT pRcWBounds);
-    HRESULT set_hPal(OLE_HANDLE hPal);
-    HRESULT SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize);
-    HRESULT get_Attributes(DWORD * pDwAttr);
-
-protected:
-
-private:
-
-};
-
-// Access macros
-#define _ICOM_THIS(class, name) class* This = (class*)name;
-#define _ICOM_THIS_From_IDispatch(class, name) class * This = (class*)(((char*)name)-sizeof(void*));
-#define _ICOM_THIS_From_IPersistStream(class, name) class * This = (class*)(((char*)name)-2*sizeof(void*));
-
-#endif /* IPICTURE_INCLUDED */
Index: trunk/src/oleaut32/iPictureBmp.cpp
===================================================================
--- trunk/src/oleaut32/iPictureBmp.cpp	(revision 6505)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/* $Id: iPictureBmp.cpp,v 1.1 1999-11-23 20:45:23 davidr Exp $ */
-/* 
- * OLE Picture Bitmap Strategy object
- *
- * 20/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
- 
-#include "oleaut32.h"
-#include "olectl.h"
-#include "ipicture.h"
-
-// ======================================================================
-// Local Methods
-// ======================================================================
-
-// ----------------------------------------------------------------------
-// Bitmap Picture
-// ----------------------------------------------------------------------
-IPictureBmp::~IPictureBmp()
-{
-    if (pPicture->fOwn)
-    {
-	// Free bitmap...
-	DeleteObject(pPicture->u.bmp.hbitmap);
-	DeleteObject(pPicture->u.bmp.hpal);
-    }
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::get_Handle
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::get_Handle(OLE_HANDLE * pHandle)
-{
-    *pHandle = pPicture->u.bmp.hbitmap;
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::get_hPal
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::get_hPal(OLE_HANDLE * phPal)
-{
-    *phPal = pPicture->u.bmp.hpal;
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::get_Type
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::get_Type(SHORT * pType)
-{
-    *pType = PICTYPE_BITMAP;
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::get_Width
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
-{
-    SIZE	size;
-
-    if (GetBitmapDimensionEx( pPicture->u.bmp.hbitmap, &size) == 0)
-    {
-	*pWidth = 0;
-	return E_FAIL;
-    }
-
-    *pWidth = size.cx;
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::get_Height
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
-{
-    SIZE	size;
-
-    if (GetBitmapDimensionEx( pPicture->u.bmp.hbitmap, &size) == 0)
-    {
-	*pHeight = 0;
-	return E_FAIL;
-    }
-
-    *pHeight = size.cy;
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::Render
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds)
-{
-    return E_FAIL;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::set_hPal
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::set_hPal(OLE_HANDLE hPal)
-{
-    pPicture->u.bmp.hpal = hPal;
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// IPictureBmp::SaveAsFile
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
-{
-    return E_FAIL;
-}
-
-// ----------------------------------------------------------------------
-//  IPictureBmp::get_Attributes
-// ----------------------------------------------------------------------
-HRESULT IPictureBmp::get_Attributes(DWORD * pDwAttr)
-{
-    // Although bitmaps may be scaled, it is really stretching.
-    *pDwAttr = 0;
-    return S_OK;
-}
-
Index: trunk/src/oleaut32/iPictureEmf.cpp
===================================================================
--- trunk/src/oleaut32/iPictureEmf.cpp	(revision 6505)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/* $Id: iPictureEmf.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
-/* 
- * OLE Picture Enhanced Metafile Strategy object
- *
- * 20/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
- 
-#include "oleaut32.h"
-#include "olectl.h"
-#include "ipicture.h"
-
-// ----------------------------------------------------------------------
-// Enhanced Metafile Picture
-// ----------------------------------------------------------------------
-
-IPictureEmf::IPictureEmf(IPictureImpl * a_pPicture, HENHMETAFILE hemf)
-    : IPictureStrat(a_pPicture)
-{
-    pPicture->u.emf.hemf = hemf;
-}
-
-IPictureEmf::~IPictureEmf()
-{
-    if (pPicture->fOwn)
-    {
-	// Free metafile...
-	DeleteEnhMetaFile(pPicture->u.emf.hemf);
-    }
-}
-
-HRESULT IPictureEmf::get_Handle(OLE_HANDLE * pHandle)
-{
-    *pHandle = pPicture->u.emf.hemf;
-    return S_OK;
-}
-
-HRESULT IPictureEmf::get_hPal(OLE_HANDLE * phPal)
-{
-    *phPal = 0;
-    return S_OK;
-}
-
-HRESULT IPictureEmf::get_Type(SHORT * pType)
-{
-    *pType = PICTYPE_ENHMETAFILE;
-    return S_OK;
-}
-
-HRESULT IPictureEmf::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
-{
-    *pWidth = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureEmf::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
-{
-    *pHeight = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureEmf::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureEmf::set_hPal(OLE_HANDLE hPal)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureEmf::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureEmf::get_Attributes(DWORD * pDwAttr)
-{
-    *pDwAttr = PICTURE_SCALEABLE | PICTURE_TRANSPARENT;
-    return S_OK;
-}
-
Index: trunk/src/oleaut32/iPictureIcon.cpp
===================================================================
--- trunk/src/oleaut32/iPictureIcon.cpp	(revision 6505)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/* $Id: iPictureIcon.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
-/* 
- * OLE Picture Icon Strategy object
- *
- * 20/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
- 
-#include "oleaut32.h"
-#include "olectl.h"
-#include "ipicture.h"
-
-// ----------------------------------------------------------------------
-// Icon Picture
-// ----------------------------------------------------------------------
-IPictureIcon::IPictureIcon(IPictureImpl * a_pPicture, HICON hicon)
-    : IPictureStrat(a_pPicture)
-{
-    pPicture->u.icon.hicon = hicon;
-}
-
-IPictureIcon::~IPictureIcon()
-{
-    if (pPicture->fOwn)
-    {
-	// Free icon...
-	DestroyIcon(pPicture->u.icon.hicon);
-    }
-}
-
-HRESULT IPictureIcon::get_Handle(OLE_HANDLE * pHandle)
-{
-    *pHandle = pPicture->u.icon.hicon;
-    return S_OK;
-}
-
-HRESULT IPictureIcon::get_hPal(OLE_HANDLE * phPal)
-{
-    *phPal = 0;
-    return S_OK;
-}
-
-HRESULT IPictureIcon::get_Type(SHORT * pType)
-{
-    *pType = PICTYPE_ICON;
-    return S_OK;
-}
-
-HRESULT IPictureIcon::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
-{
-    // FIXME - Read from system constants...
-    *pWidth = 32;
-
-    return S_OK;
-}
-
-HRESULT IPictureIcon::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
-{
-    // FIXME - Read from system constants...
-    *pHeight = 32;
-
-    return S_OK;
-}
-
-HRESULT IPictureIcon::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureIcon::set_hPal(OLE_HANDLE hPal)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureIcon::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureIcon::get_Attributes(DWORD * pDwAttr)
-{
-    *pDwAttr = PICTURE_TRANSPARENT;
-    return S_OK;
-}
Index: trunk/src/oleaut32/iPictureMeta.cpp
===================================================================
--- trunk/src/oleaut32/iPictureMeta.cpp	(revision 6505)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/* $Id: iPictureMeta.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
-/* 
- * OLE Picture Metafile Strategy object
- *
- * 20/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
- 
-#include "oleaut32.h"
-#include "olectl.h"
-#include "ipicture.h"
-
-// ----------------------------------------------------------------------
-// Std Metafile Picture
-// ----------------------------------------------------------------------
-
-IPictureMeta::IPictureMeta(IPictureImpl * a_pPicture, HMETAFILE hmeta, int xExt, int yExt)
-    : IPictureStrat(a_pPicture)
-{
-    pPicture->u.wmf.hmeta = hmeta;
-    pPicture->u.wmf.xExt = xExt;
-    pPicture->u.wmf.yExt = yExt;
-}
-
-IPictureMeta::~IPictureMeta()
-{
-    if (pPicture->fOwn)
-    {
-	// Free metafile...
-	DeleteMetaFile(pPicture->u.wmf.hmeta);
-    }
-}
-
-HRESULT IPictureMeta::get_Handle(OLE_HANDLE * pHandle)
-{
-    *pHandle = pPicture->u.wmf.hmeta;
-    return S_OK;
-}
-
-HRESULT IPictureMeta::get_hPal(OLE_HANDLE * phPal)
-{
-    *phPal = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureMeta::get_Type(SHORT * pType)
-{
-    *pType = PICTYPE_METAFILE;
-    return S_OK;
-}
-
-HRESULT IPictureMeta::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
-{
-    *pWidth = pPicture->u.wmf.xExt;
-    return S_OK;
-}
-
-HRESULT IPictureMeta::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
-{
-    *pHeight = pPicture->u.wmf.yExt;
-    return S_OK;
-}
-
-HRESULT IPictureMeta::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureMeta::set_hPal(OLE_HANDLE hPal)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureMeta::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureMeta::get_Attributes(DWORD * pDwAttr)
-{
-    *pDwAttr = PICTURE_SCALEABLE | PICTURE_TRANSPARENT;
-    return S_OK;
-}
-
Index: trunk/src/oleaut32/iPictureNone.cpp
===================================================================
--- trunk/src/oleaut32/iPictureNone.cpp	(revision 6505)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/* $Id: iPictureNone.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
-/* 
- * OLE Picture Metafile Strategy object
- *
- * 20/11/99 - New Code
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
- 
-#include "oleaut32.h"
-#include "olectl.h"
-#include "ipicture.h"
-
-// ----------------------------------------------------------------------
-// Uninitialised Picture
-// ----------------------------------------------------------------------
-HRESULT IPictureNone::get_Handle(OLE_HANDLE * pHandle)
-{
-    *pHandle = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::get_hPal(OLE_HANDLE * phPal)
-{
-    *phPal = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::get_Type(SHORT * pType)
-{
-    *pType = PICTYPE_UNINITIALIZED;
-    return S_OK;
-}
-
-HRESULT IPictureNone::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
-{
-    *pWidth = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
-{
-    *pHeight = 0;
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
-				OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
-				OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
-				LPCRECT pRcWBounds)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::set_hPal(OLE_HANDLE hPal)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
-{
-    return E_FAIL;
-}
-
-HRESULT IPictureNone::get_Attributes(DWORD * pDwAttr)
-{
-    *pDwAttr = 0;
-    return S_OK;
-}
-
-IPictureBmp::IPictureBmp(IPictureImpl * a_pPicture, HBITMAP hbitmap, HPALETTE hpal)
-    : IPictureStrat(a_pPicture)
-{
-    pPicture->u.bmp.hbitmap = hbitmap;
-    pPicture->u.bmp.hpal = hpal;
-}
-
Index: trunk/src/oleaut32/itypecomp.cpp
===================================================================
--- trunk/src/oleaut32/itypecomp.cpp	(revision 6505)
+++ 	(revision )
@@ -1,163 +1,0 @@
-/* $Id: itypecomp.cpp,v 1.1 2000-09-17 22:28:54 davidr Exp $ */
-/* 
- * ITypeComp interface
- * 
- * 15/04/2000
- * 
- * Copyright 2000 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
-
-#include "oleaut32.h"
-#include "olectl.h"
-#include "oList.h"	// linked list template
-#include "itypelib.h"
-
-// ======================================================================
-// Local Data
-// ======================================================================
-static ICOM_VTABLE(ITypeComp) ITypeComp_VTable =
-{
-    ITypeCompImpl_QueryInterface,
-    ITypeCompImpl_AddRef,
-    ITypeCompImpl_Release,
-    ITypeCompImpl_Bind,
-    ITypeCompImpl_BindType
-};
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_Constructor
-// ----------------------------------------------------------------------
-ITypeCompImpl * ITypeCompImpl_Constructor()
-{
-    ITypeCompImpl *	pNew;
-
-//    dprintf(("OLEAUT32: ITypeComp()->Constructor()"));
-
-    pNew = new ITypeCompImpl;
-
-    // Initialise the vft
-    pNew->lpvtbl = &ITypeComp_VTable;
-    pNew->ref = 1;
-
-    return pNew;
-}
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_Destructor
-// ----------------------------------------------------------------------
-void ITypeCompImpl_Destructor(ITypeCompImpl * This)
-{
-    dprintf(("OLEAUT32: ITypeCompImpl(%p)->Destructor()", This));
-
-    // TODO - need to relase all substructures etc.
-//    delete This;
-}
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_QueryInterface
-//
-// This object supports IUnknown, ITypeComp, ITypeComp2
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeCompImpl_QueryInterface(LPTYPECOMP iface,
-				REFIID riid, VOID **ppvObject)
-{
-    ICOM_THIS(ITypeCompImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeCompImpl(%p)->QueryInterface()", This));
-
-    // Sanity check...
-    if ((This == 0) || (ppvObject == 0))
-	return E_INVALIDARG;
-
-    // Initialise return jic...
-    *ppvObject = 0;
-
-    // Go find the correct interface...
-    if (IsEqualIID(&IID_IUnknown, riid))
-    {
-	dprintf(("          ->IUnknown"));
-	*ppvObject = &(This->lpvtbl);
-    }
-    else if (IsEqualIID(&IID_ITypeComp, riid))
-    {
-	dprintf(("          ->ITypeComp"));
-	*ppvObject = &(This->lpvtbl);
-    }
-    else
-    {
-	char	tmp[50];
-
-	WINE_StringFromCLSID(riid, tmp);
-
-	dprintf(("          ->E_NOINTERFACE(%s)", tmp));
-	return E_NOINTERFACE; 
-    }
-
-    // Query Interface always increases the reference count by one...
-    ITypeCompImpl_AddRef(iface);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_AddRef
-// ----------------------------------------------------------------------
-ULONG   WIN32API ITypeCompImpl_AddRef(LPTYPECOMP iface)
-{
-    ICOM_THIS(ITypeCompImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeCompImpl(%p)->AddRef()", This));
-
-    return ++(This->ref);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_Release
-// ----------------------------------------------------------------------
-ULONG   WIN32API ITypeCompImpl_Release(LPTYPECOMP iface)
-{
-    ICOM_THIS(ITypeCompImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeCompImpl(%p)->Release()\n", This));
-
-    if (--(This->ref) == 0)
-    {
-	ITypeCompImpl_Destructor(This);
-	return 0;
-    }
-    return This->ref;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_Bind
-// ----------------------------------------------------------------------
-HRESULT	WIN32API ITypeCompImpl_Bind(LPTYPECOMP iface,
-				LPOLESTR szName, ULONG lHashVal, WORD wFlags,
-				ITypeInfo** ppTInfo, DESCKIND* pDescKind, BINDPTR* pBindPtr)
-{
-    ICOM_THIS(ITypeCompImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeCompImpl(%p)->Bind() - STUB\n", This));
-
-    return E_OUTOFMEMORY;
-}
-
-// ----------------------------------------------------------------------
-// ITypeCompImpl_BindType
-// ----------------------------------------------------------------------
-HRESULT	WIN32API ITypeCompImpl_BindType(LPTYPECOMP iface,
-				LPOLESTR szName, ULONG lHashVal, ITypeInfo** ppTInfo,
-				ITypeComp** ppTComp)
-{
-    ICOM_THIS(ITypeCompImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeCompImpl(%p)->BindType() - STUB\n", This));
-
-    return E_OUTOFMEMORY;
-}
Index: trunk/src/oleaut32/itypeinfo.cpp
===================================================================
--- trunk/src/oleaut32/itypeinfo.cpp	(revision 6505)
+++ 	(revision )
@@ -1,1622 +1,0 @@
-/* $Id: itypeinfo.cpp,v 1.7 2001-05-31 07:14:00 sandervl Exp $ */
-/* 
- * ITypeInfo interface
- * 
- * 5/12/99
- * 
- * Copyright 1999 David J. Raison
- * Some portions based on original work on Wine
- *   Copyright 1997 Marcus Meissner
- 	       1999 Rein Klazes
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
-#include "oleaut32.h"
-#include "olectl.h"
-#include "itypelib.h"
-#include <debugtools.h>
-#include "asmutil.h"
-
-HRESULT WINAPI LoadRegTypeLib(REFGUID rguid,
-		    WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib * * ppTLib);
-HRESULT WINAPI LoadTypeLib( LPCOLESTR szFile, ITypeLib * * ppTLib);
-
-// ======================================================================
-// Local Data
-// ======================================================================
-
-static ICOM_VTABLE(ITypeInfo2) ITypeInfo_Vtable =
-{
-    ITypeInfoImpl_QueryInterface,
-    ITypeInfoImpl_AddRef,
-    ITypeInfoImpl_Release,
-    ITypeInfoImpl_GetTypeAttr,
-    ITypeInfoImpl_GetTypeComp,
-    ITypeInfoImpl_GetFuncDesc,
-    ITypeInfoImpl_GetVarDesc,
-    ITypeInfoImpl_GetNames,
-    ITypeInfoImpl_GetRefTypeOfImplType,
-    ITypeInfoImpl_GetImplTypeFlags,
-    ITypeInfoImpl_GetIDsOfNames,
-    ITypeInfoImpl_Invoke,
-    ITypeInfoImpl_GetDocumentation,
-    ITypeInfoImpl_GetDllEntry,
-    ITypeInfoImpl_GetRefTypeInfo,
-    ITypeInfoImpl_AddressOfMember,
-    ITypeInfoImpl_CreateInstance,
-    ITypeInfoImpl_GetMops,
-    ITypeInfoImpl_GetContainingTypeLib,
-    ITypeInfoImpl_ReleaseTypeAttr,
-    ITypeInfoImpl_ReleaseFuncDesc,
-    ITypeInfoImpl_ReleaseVarDesc,
-    ITypeInfo2Impl_GetTypeKind,
-    ITypeInfo2Impl_GetTypeFlags,
-    ITypeInfo2Impl_GetFuncIndexOfMemId,
-    ITypeInfo2Impl_GetVarIndexOfMemId,
-    ITypeInfo2Impl_GetCustData,
-    ITypeInfo2Impl_GetFuncCustData,
-    ITypeInfo2Impl_GetParamCustData,
-    ITypeInfo2Impl_GetVarCustData,
-    ITypeInfo2Impl_GetImplTypeCustData,
-    ITypeInfo2Impl_GetDocumentation2,
-    ITypeInfo2Impl_GetAllCustData,
-    ITypeInfo2Impl_GetAllFuncCustData,
-    ITypeInfo2Impl_GetAllParamCustData,
-    ITypeInfo2Impl_GetAllVarCustData,
-    ITypeInfo2Impl_GetAllImplTypeCustData,
-};
-
-// ======================================================================
-// Local Methods
-// ======================================================================
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_Constructor
-// ----------------------------------------------------------------------
-ITypeInfoImpl * ITypeInfoImpl_Constructor()
-{
-    ITypeInfoImpl *	pNew;
-
-//    dprintf(("OLEAUT32: ITypeInfo()->Constructor()"));
-
-    pNew = new ITypeInfoImpl;
-
-    // Init vft.
-    pNew->lpvtbl = &ITypeInfo_Vtable;
-    pNew->ref = 1;
-
-    return pNew;
-}
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_Destructor
-// ----------------------------------------------------------------------
-void ITypeInfoImpl_Destructor(ITypeInfoImpl * This)
-{
-    dprintf(("OLEAUT32: ITypeInfo(%p)->Destructor()", This));
-
-//    delete This;		// FIXME! - release all substructures, etc.
-}
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_QueryInterface
-// 
-// This object supports IUnknown, ITypeInfo, ITypeInfo2
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_QueryInterface(ITypeInfo2 * iface,
-				REFIID riid, VOID **ppvObject)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->QueryInterface()", This));
-
-    // Sanity check...
-    if ((This == 0) || (ppvObject == 0))
-	return E_INVALIDARG;
-
-    // Initialise return jic...
-    *ppvObject = 0;
-
-    // Go find the correct interface...
-    if (IsEqualIID(&IID_IUnknown, riid))
-    {
-	*ppvObject = &(This->lpvtbl);
-	dprintf(("          ->IUnknown"));
-    }
-    else if (IsEqualIID(&IID_ITypeInfo, riid))
-    {
-	*ppvObject = &(This->lpvtbl);
-	dprintf(("          ->ITypeInfo"));
-    }
-    else if (IsEqualIID(&IID_ITypeInfo2, riid))
-    {
-	*ppvObject = &(This->lpvtbl);
-	dprintf(("          ->ITypeInfo2"));
-    }
-    else
-    {
-	char	tmp[50];
-
-	WINE_StringFromCLSID(riid, tmp);
-
-	dprintf(("          ->E_NOINTERFACE(%s)", tmp));
-	return E_NOINTERFACE; 
-    }
-
-    // Query Interface always increases the reference count by one...
-    ITypeInfoImpl_AddRef((ITypeInfo2 *)This);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_AddRef
-// ----------------------------------------------------------------------
-ULONG   WIN32API ITypeInfoImpl_AddRef(ITypeInfo2 * iface)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->AddRef()", This));
-
-    return ++(This->ref);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_Release
-// ----------------------------------------------------------------------
-ULONG   WIN32API ITypeInfoImpl_Release(ITypeInfo2 * iface)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->Release()\n", This));
-
-    if (--(This->ref) == 0)
-    {
-	ITypeInfoImpl_Destructor(This);
-	return 0;
-    }
-    return This->ref;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetTypeAttr
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetTypeAttr(ITypeInfo2 * iface,
-				LPTYPEATTR  *ppTypeAttr)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetTypeAttr()\n", This));
-
-    TYPEATTR *	pTypeAttr = (TYPEATTR *)HeapAlloc(GetProcessHeap(), 0, sizeof(TYPEATTR));
-
-    *pTypeAttr = This->TypeAttr;
-
-    *ppTypeAttr = pTypeAttr;
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetTypeComp(ITypeInfo2 * iface,
-				ITypeComp  * *ppTComp)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetTypeComp() - STUB\n", This));
-
-    return E_NOTIMPL;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetFuncDesc
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetFuncDesc(ITypeInfo2 * iface,
-				UINT index, LPFUNCDESC  *ppFuncDesc)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetFuncDesc()\n", This));
-
-    if (This->pFunctions.Count() < index) 
-	return E_INVALIDARG;
-
-    FUNCDESC *	pFuncDesc = (FUNCDESC *)HeapAlloc(GetProcessHeap(), 0, sizeof(FUNCDESC));
-    *pFuncDesc = This->pFunctions[index]->funcdesc;
-    *ppFuncDesc = pFuncDesc;
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetVarDesc
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetVarDesc(ITypeInfo2 * iface,
-				UINT index, LPVARDESC  *ppVarDesc)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetVarDesc()\n", This));
-
-    if (This->pVariables.Count() < index) 
-	return E_INVALIDARG;
-
-    VARDESC *	pVarDesc = (VARDESC *)HeapAlloc(GetProcessHeap(), 0, sizeof(VARDESC));
-    *pVarDesc = This->pVariables[index]->vardesc;
-    *ppVarDesc = pVarDesc;
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetNames
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetNames(ITypeInfo2 * iface,
-				MEMBERID memid, BSTR  *rgBstrNames,
-				UINT cMaxNames, UINT  *pcNames)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-    int		ii;
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetNames()\n", This));
-
-    // Sanity check...
-    if (pcNames == 0)
-	return E_INVALIDARG;
-
-    // Search the functions...
-    oListIter<TLBFuncDesc *>	itrFunc(This->pFunctions);
-
-    for (itrFunc.MoveStart(); itrFunc.IsValid(); itrFunc.MoveNext())
-    {
-	if (itrFunc.Element()->funcdesc.memid == memid)
-	{
-	    for (ii = 0; ii < cMaxNames && ii <= itrFunc.Element()->funcdesc.cParams; ii++)
-	    {
-		if (!ii)
-		    rgBstrNames[ii] = DupAtoBstr(
-			    itrFunc.Element()->szName);
-		else
-		    rgBstrNames[ii] = DupAtoBstr(
-			    itrFunc.Element()->pParamDesc[ii - 1].szName);
-	    }
-	    *pcNames = ii;
-	    return S_OK;
-	}
-
-    }
-
-    // Search the variables...
-    oListIter<TLBVarDesc *>	itrVar(This->pVariables);
-    for (itrVar.MoveStart(); itrVar.IsValid(); itrVar.MoveNext())
-    {
-	if (itrVar.Element()->vardesc.memid == memid)
-	{
-	    rgBstrNames[0] = DupAtoBstr(itrVar.Element()->szName);
-	    *pcNames = 1;
-	    return S_OK;
-	}
-    }
-
-    // Search interfaces...
-    if (This->TypeAttr.typekind == TKIND_INTERFACE)
-    {
-	oListIter<TLBRefType *>	itrRef(This->pImplements);
-	for (itrRef.MoveStart(); itrRef.IsValid(); itrRef.MoveNext())
-	{
-	    // recursive search
-	    ITypeInfo2 *	pTInfo;
-	    HRESULT		result;
-
-	    result = This->lpvtbl->fnGetRefTypeInfo(iface, itrRef.Element()->reference, (ITypeInfo **)&pTInfo);
-	    if(SUCCEEDED(result))
-	    {
-		result = ICOM_VTBL(pTInfo)->fnGetNames(
-			    pTInfo, memid, rgBstrNames, cMaxNames, pcNames);
-		ICOM_VTBL(pTInfo)->fnRelease(pTInfo);
-		return result;
-	    }
-	    dprintf((" could not search inherited interface 0x%x", itrRef.Element()->reference));
-	}
-    }
-
-    *pcNames = 0; // jic
-
-    dprintf((" :-( no names found"));
-    return TYPE_E_ELEMENTNOTFOUND;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetRefTypeOfImplType
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetRefTypeOfImplType(ITypeInfo2 * iface,
-				UINT index, HREFTYPE  *pRefType)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetRefTypeOfImplType()\n", This));
-
-    if(index==(UINT)-1)
-    {
-      /* only valid on dual interfaces;
-         retrieve the associated TKIND_INTERFACE handle for the current TKIND_DISPATCH
-      */
-      if( This->TypeAttr.typekind != TKIND_DISPATCH) return E_INVALIDARG;
-      
-      if (This->TypeAttr.wTypeFlags & TYPEFLAG_FDISPATCHABLE &&
-          This->TypeAttr.wTypeFlags & TYPEFLAG_FDUAL )
-      {
-        *pRefType = -1;
-      }
-      else
-      {
-        if (This->pImplements.Count() == 0) return TYPE_E_ELEMENTNOTFOUND;
-        *pRefType = This->pImplements[0]->reference;
-      }
-    }
-    else
-    {
-      if (This->pImplements.Count() < index)
-	return TYPE_E_ELEMENTNOTFOUND;
-
-      *pRefType = This->pImplements[index]->reference;
-    }
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-//  ITypeInfoImpl_GetImplTypeFlags
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetImplTypeFlags(ITypeInfo2 * iface,
-				UINT index, INT  *pImplTypeFlags)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetImplTypeFlags()\n", This));
-
-    if (This->pImplements.Count() < index)
-	return TYPE_E_ELEMENTNOTFOUND;
-
-    *pImplTypeFlags = This->pImplements[index]->flags;
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetIDsOfNames
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetIDsOfNames(ITypeInfo2 * iface,
-				LPOLESTR  *rgszNames, UINT cNames, MEMBERID  *pMemId)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetIDsOfNames()\n", This));
-
-    PCHAR		aszName = HEAP_strdupWtoA( GetProcessHeap(), 0, rgszNames[0]);
-    HRESULT		rc = S_OK;
-    int			ii;
-    int			jj;
-
-    if (cNames == 0)
-	return rc;
-
-    // Search the functions...
-    oListIter<TLBFuncDesc *>	itrFunc(This->pFunctions);
-
-    for (itrFunc.MoveStart(); itrFunc.IsValid(); itrFunc.MoveNext())
-    {
-	// Looking for a method of matching name...
-	if (!strcmp(itrFunc.Element()->szName, aszName))
-	{
-	    pMemId[0] = itrFunc.Element()->funcdesc.memid;
-
-	    for (ii = 1; ii < cNames; ii++)
-	    {
-	    	// Now match the methods (any order)
-		PCHAR		aszPar = HEAP_strdupWtoA( GetProcessHeap(), 0, rgszNames[ii]);
-		for (jj = 0; jj < itrFunc.Element()->funcdesc.cParams; jj++)
-		{
-                    if (!strcmp(aszPar, itrFunc.Element()->pParamDesc[jj].szName))
-                    {
-			pMemId[ii] = jj;
-			break;
-		    }
-		}
-		// Oops - blew it...
-		if (jj == itrFunc.Element()->funcdesc.cParams) 
-		    rc = DISP_E_UNKNOWNNAME;
-		HeapFree(GetProcessHeap(), 0, aszPar);
-
-	    }
-	    HeapFree(GetProcessHeap(), 0, aszName);
-	    return rc;
-	}
-
-    }
-
-    // Search the variables...
-    oListIter<TLBVarDesc *>	itrVar(This->pVariables);
-    for (itrVar.MoveStart(); itrVar.IsValid(); itrVar.MoveNext())
-    {
-	if (!strcmp(itrVar.Element()->szName, aszName))
-	{
-	    pMemId[0] = itrVar.Element()->vardesc.memid;
-	    HeapFree(GetProcessHeap(), 0, aszName);
-	    return rc;
-	}
-    }
-
-    HeapFree(GetProcessHeap(), 0, aszName);
-
-    // Search interfaces...
-    if (This->TypeAttr.typekind == TKIND_INTERFACE)
-    {
-	oListIter<TLBRefType *>	itrRef(This->pImplements);
-	for (itrRef.MoveStart(); itrRef.IsValid(); itrRef.MoveNext())
-	{
-	    // recursive search
-	    ITypeInfo *	pTInfo;
-
-	    rc = This->lpvtbl->fnGetRefTypeInfo(iface, itrRef.Element()->reference, &pTInfo);
-	    if(SUCCEEDED(rc))
-	    {
-		rc = ICOM_VTBL(pTInfo)->fnGetIDsOfNames(pTInfo, rgszNames, cNames, pMemId );
-		ICOM_VTBL(pTInfo)->fnRelease(pTInfo);
-		return rc;
-	    }
-	    dprintf((" could not search inherited interface 0x%x", itrRef.Element()->reference));
-	}
-    }
-    return DISP_E_UNKNOWNNAME;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-/**
- * Coerce arguments and, if necessary, sorts named arguments in the order 
- * specified in the function's FUNCDESC
- *
- * NOTE: the arguments are left in reverse order by design. 
- *       (see INVOKE_InvokeStdCallFunction for more information)
- */
-static HRESULT
-INVOKE_AllocateCoerceAndSortArguments(FUNCDESC*      pFuncDesc,
-                                      DISPPARAMS*    pDispParams, 
-                                      VARIANTARG**  ppaArgsCoerced,
-                                      unsigned int*  puBadArg)
-{
-    HRESULT     hr;
-    UINT        index;        
-
-    VARIANTARG* paArgsCoerced = (VARIANTARG*)HeapAlloc(GetProcessHeap(), 
-                                          HEAP_ZERO_MEMORY, 
-                                          pDispParams->cArgs * sizeof(VARIANTARG));
-
-    if ( !paArgsCoerced )
-    {
-        hr = E_OUTOFMEMORY;
-        goto cleanup;
-    }
-
-    if ( !pDispParams->cNamedArgs )
-    {
-        /* "Arguments are stored in pDispParams->rgvarg in reverse order"
-         * 
-         * Windows Platform SDK, IDispatch::Invoke.
-         * See puArgErr argument description.
-         */
-        VARIANTARG* paSrcArg = &pDispParams->rgvarg[pDispParams->cArgs - 1];
-        VARIANTARG* paDstArg = &paArgsCoerced[pDispParams->cArgs - 1];
-
-        /* sanity check to verify we have enough required 
-         * arguments to call the method
-         */
-        if ( pDispParams->cArgs < pFuncDesc->cParams - pFuncDesc->cParamsOpt )
-        {
-            hr = DISP_E_BADPARAMCOUNT;
-            goto cleanup;
-        }
-
-        /* coerce all the arguments, if required */
-        for ( index = 0; 
-            index < pDispParams->cArgs;  
-            ++index, --paSrcArg, --paDstArg )
-        {
-            /* checks if the VARTYPEs matches */
-            VARTYPE vtdest = pFuncDesc->lprgelemdescParam[index].tdesc.vt;
-
-            if ( V_VT(paSrcArg) != vtdest )
-            {
-                USHORT wFlags = 0;
-
-               /* we don't use VariantChangeTypeEx 
-                 * because we assume system lcid (e.g. 0)
-                 */
-                hr = VariantChangeType(paDstArg, paSrcArg, wFlags, vtdest); 
-
-                if ( FAILED(hr) ) goto bad_arg_err;
-            }
-            else
-            {
-                hr = VariantCopy(paDstArg, paSrcArg);
-
-                if ( FAILED(hr) ) goto bad_arg_err;
-            }
-        }
-    }
-    else
-    {
-        FIXME("Named arguments not supported!\n");
-        /*
-                named arguments not supported ?
-                    hr = DISP_E_NONAMEDARGS
-                    
-                For each argument
-                    Check if DISPID can be found in typeinfo
-    
-                    Found -> 
-                        required argument?
-                            yes -> increase required argument counter. next.
-                            no  -> next.
-                            
-                    Not Found -> DISP_E_PARAMNOTFOUND, puBadArg = arg index.
-                
-                if function required arguments != counter
-                    DISP_E_PARAMNOTOPTIONAL
-    
-                Coerce arguments at the right spot in the variant array
-        */
-    }
-
-    hr = S_OK;
-    *ppaArgsCoerced = paArgsCoerced;
-    return hr;
-
-
-bad_arg_err:
-    *puBadArg = index;
-
-cleanup:
-    if ( paArgsCoerced )
-    {
-        HeapFree(GetProcessHeap(), 0, paArgsCoerced);
-    }
-    
-    return hr;
-}
-
-/*
-static
-WINE_EXCEPTION_FILTER(INVOKE_ExceptionHandler)
-{
-    FIXME("Exception handler currently does nothing.\n");
-    return EXCEPTION_EXECUTE_HANDLER;
-}
-*/
-
-static HRESULT
-INVOKE_InvokeStdCallFunction(IUnknown*   pIUnk,
-                             FUNCDESC*   pFuncDesc,
-                             VARIANTARG* paArgsCoerced,
-                             VARIANT*    pVarResult,
-                             EXCEPINFO*  pExcepInfo)
-{
-    typedef DWORD  (WINAPI *pDWORDRetFunc) (IUnknown*);   
-    typedef double (WINAPI *pDoubleRetFunc)(IUnknown*); 
-
-    HRESULT hr = E_FAIL;
-
-    DWORD   dwVtblBaseAddr;               /* address of vtbl   */
-    DWORD   dwFuncAddr;                   /* address of method */
-    DWORD   paramsize = 0;
-
-    int     i;                            /* index of argument */
-
-    /* Process method arguments.
-     *
-     * Following stdcall convention, arguments are pushed on the stack from 
-     * right to left. However, since they were stored in reverse order 
-     * in DISPPARAMS structure (and left in that order during coercion)
-     * we push the arguments from 0 to cArgs - 1.
-     */
-    DWORD *pStack    = (DWORD *)alloca(sizeof(double)*pFuncDesc->cParams + 8);
-    PBYTE  pStackPtr = (PBYTE)((char *)pStack + sizeof(double)*pFuncDesc->cParams);
-
-    //Don't include the pIUnknown parameter
-    for ( i = 0; i < pFuncDesc->cParams; ++i )
-    {
-        /* Decision of pushing 32 or 64 bits is based on argument's VARTYPE */
-        VARIANT* pVar   = &(paArgsCoerced[i]);
-        PVOID    pValue = &(pVar->cVal);
-
-        if(pVar == NULL) {//TODO: Is this correct?
-            /* push 32 bits on stack */
-            pStackPtr -= sizeof(DWORD);
-            * (DWORD*) pStackPtr = 0;
-
-            paramsize += sizeof(DWORD);
-        }
-        else 
-        switch ( V_VT(pVar) )
-        {
-        /* QUAD-sized values */
-        case VT_R8:
-        case VT_DATE:
-            /* push 64 bits on stack */
-            pStackPtr -= sizeof(double);
-            * (double*) pStackPtr = *(double*) pValue;
-
-            paramsize += sizeof(double);
-            break;
-
-        /* DWORD-sized values */
-        default:
-            /* push 32 bits on stack */
-            pStackPtr -= sizeof(DWORD);
-            * (DWORD*) pStackPtr = * (DWORD*) pValue;
-
-            paramsize += sizeof(DWORD);
-            break;
-        }
-   }   
-    /* assign function pointer to ITypeImpl->vtbl[index] */
-   dwVtblBaseAddr =    (DWORD)  ((IUnknown*) pIUnk)->lpVtbl;
-   dwFuncAddr     =  * (DWORD*) (dwVtblBaseAddr + pFuncDesc->oVft);
-
-   /* remove comments around __TRY for SEH
-   __TRY
-   */
-   {
-        DWORD  dwRet  = 0;
-        double dblRet = 0;
-
-        //push pIUnk
-        pStackPtr -= sizeof(DWORD);
-        * (DWORD*) pStackPtr = * (DWORD*) pIUnk;
-        paramsize += sizeof(DWORD);
-
-        //reset to top
-        pStackPtr  = (PBYTE)((char *)pStack + sizeof(double)*pFuncDesc->cParams);
-        pStackPtr -= 4;
-
-         /* invoke function */
-        if ( pFuncDesc->elemdescFunc.tdesc.vt == VT_R8   ||
-             pFuncDesc->elemdescFunc.tdesc.vt == VT_DATE )
-        {
-            dblRet = invokeStdCallDouble((PVOID)dwFuncAddr, paramsize/4, pStackPtr);
-        }
-        else
-        {
-            dwRet = invokeStdCallDword((PVOID)dwFuncAddr, paramsize/4, pStackPtr);
-        }
-
-        /* fill result variant */
-        if ( pVarResult )
-        {
-            pVarResult->vt = pFuncDesc->elemdescFunc.tdesc.vt;
-
-            if ( pFuncDesc->elemdescFunc.tdesc.vt == VT_R8   ||
-                 pFuncDesc->elemdescFunc.tdesc.vt == VT_DATE )
-            {
-                V_UNION(pVarResult, dblVal) = dblRet;
-            }
-            else
-            {
-                V_UNION(pVarResult, lVal)   = dwRet;
-            }
-        }
-        hr = S_OK;
-    }
-    
-    /* remove comments to enable SEH
-    __EXCEPT (INVOKE_ExceptionHandler);
-    __ENDTRY;
-    */
-    
-    return hr;
-}
-
-static BOOL
-INVOKE_RetrieveFuncDesc(oListIter<TLBFuncDesc *> itrFunc,
-                        MEMBERID     memid,
-                        UINT16       wFlags,
-                        FUNCDESC**   ppFuncDesc)
-{
-    BOOL  bFound = FALSE;
-
-    // Search functions...
-    for (itrFunc.MoveStart(); itrFunc.IsValid(); itrFunc.MoveNext())
-    {
-	if (itrFunc.Element()->funcdesc.memid == memid && 
-            itrFunc.Element()->funcdesc.invkind == wFlags)
-	{
-            *ppFuncDesc = &(itrFunc.Element()->funcdesc);
-	    return TRUE;
-	}
-    }
-
-    return(bFound);
-}
-
-static HRESULT
-INVOKE_DeferToParentTypeInfos(ITypeInfo2*     iface,
-                              VOID*           pIUnk,
-                              MEMBERID        memid,
-                              UINT16          wFlags,
-                              DISPPARAMS*     pDispParams,
-                              VARIANT*        pVarResult,
-                              EXCEPINFO*      pExcepInfo,
-                              UINT*           puArgErr)
-{
-    HRESULT hr = E_FAIL;
-    
-    unsigned short index;
-    ITypeInfo*     pRefTypeInfo = NULL;
-
-    /* retrieve ITypeInfoImpl ptr from ITypeInfo ptr */
-    ICOM_THIS( ITypeInfoImpl, iface);
-    /* call Invoke on implemented type */
-    for ( index = 0; index < This->TypeAttr.cImplTypes ; ++index )
-    {
-        HREFTYPE    hRef;
-
-        hr = ITypeInfo_GetRefTypeOfImplType(iface, index, &hRef);
-
-        if ( FAILED(hr) )
-        {
-            hr = DISP_E_MEMBERNOTFOUND;
-            goto cleanup;
-        }
-
-        hr = ITypeInfo_GetRefTypeInfo(iface, hRef, &pRefTypeInfo);
-
-        if ( FAILED(hr) )
-        {
-            hr = DISP_E_MEMBERNOTFOUND;
-            goto cleanup;
-        }
-
-        hr = ITypeInfo_Invoke(pRefTypeInfo, 
-                              pIUnk,
-                              memid,
-                              wFlags,
-                              pDispParams,
-                              pVarResult,
-                              pExcepInfo,
-                              puArgErr);
-
-        if ( hr == S_OK )
-            break;
-    }
-cleanup:
-    if (pRefTypeInfo)
-        ITypeInfo2_Release(pRefTypeInfo);
-    
-    return hr;
-}
-/**
- * ITypeInfo::Invoke
- * 
- * Invokes a method, or accesses a property of an object, that implements the
- * interface described by the type description.
- *
- *  Handles all the "magic" between your Automation controller
- *  and components.
- *
- * 1. Find the method's position in the vtable based on
- *    the dispid and the information contained in the type library.
- *
- * 2. Push all the arguments on the stack, accordingly to the __stdcall 
- *    calling convention, e.g. right to left.
- *
- * 3. Coerce the retrieved value as the variant type stored in the type library.
- *
- * 4. Store return value in VarResult variant
- * 
- * 5. Return to the Invoke() caller the return value for dispid method.
- *
- * NOT SUPPORTED : inherited types
- *
- */
-HRESULT WIN32API ITypeInfoImpl_Invoke(ITypeInfo2 * iface,
-				VOID  *pIUnk, MEMBERID memid, UINT16 wFlags,
-				DISPPARAMS  *pDispParams, VARIANT *pVarResult,
-				EXCEPINFO  *pExcepInfo, UINT  *puArgErr)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-    HRESULT       hr = E_FAIL;
-    FUNCDESC*     pFuncDesc;
-    VARIANT*      paArgsCoerced = NULL;       /* coerced arguments */
-    BOOL          bFound;                     /* function found    */
-
-
-    dprintf(("TypeInfo_fnInvoke: (%p) (%p, memid=0x%08lx, 0x%08x, %p, %p, %p, %p)",
-          This, pIUnk, memid, wFlags, 
-          pDispParams, pVarResult, pExcepInfo, puArgErr ));
-
-//    dump_TypeInfo(This);
-
-    if ( pDispParams )
-    {
-//        dump_DispParms(pDispParams);
-
-        if ( pDispParams->cNamedArgs != pDispParams->cArgs )
-        {
-            WARN("named arguments count differs from number of arguments!\n");
-        }
-    }
-
-    if ( memid < 0 )
-    {
-        FIXME("standard MEMBERID resolution not fully implemented\n");
-
-        switch ( memid )
-        {
-        case DISPID_CONSTRUCTOR:
-            memid = This->TypeAttr.memidConstructor;
-            break;
-        case DISPID_DESTRUCTOR:
-            memid = This->TypeAttr.memidDestructor;
-            break;
-        case DISPID_UNKNOWN:
-        default:
-            return DISP_E_MEMBERNOTFOUND;
-        }
-    }
-
-    /* REMINDER:
-     *
-     * "properties are an equivalent expression of get and put functions 
-     *   for data members"
-     *  
-     *  (Brockschmidt - Inside OLE, 2nd Edition,
-     *                  Chap.14 # The Mechanics of OLE Automation)
-     *
-     * Thus, the following points to the list of methods AND properties
-     */
-
-    /* find FUNCDESC by memid */
-    FIXME("possible collision between property and method names\n");
-
-    bFound = INVOKE_RetrieveFuncDesc(This->pFunctions, 
-                                     memid, 
-                                     wFlags,
-                                    &pFuncDesc);
-
-    if ( !bFound )
-    {
-        if ( !(This->TypeAttr.cImplTypes) )     return DISP_E_MEMBERNOTFOUND;
-
-        /* indirect recursion : following function calls ITypeInfo::Invoke */
-        hr = INVOKE_DeferToParentTypeInfos(iface,
-                                           pIUnk,
-                                           memid,
-                                           wFlags,
-                                           pDispParams,
-                                           pVarResult,
-                                           pExcepInfo,
-                                           puArgErr );
-    }
-    else
-    {
-        /* Validate invoke context. No return value on property put/putref */
-        if ( wFlags & DISPATCH_PROPERTYPUTREF )
-        {
-            if ( pFuncDesc->lprgelemdescParam[0].tdesc.vt != VT_BYREF )
-            {
-                TRACE("Property put by reference not supported by object\n");
-                return DISP_E_MEMBERNOTFOUND;
-            }
-
-            pVarResult = NULL;
-        }
-        else if ( wFlags & DISPATCH_PROPERTYPUT )
-        {
-            pVarResult = NULL;
-        }
-        else if ( wFlags & DISPATCH_PROPERTYGET ||
-                  wFlags & DISPATCH_METHOD )
-        {
-            /* verify if property isn't read-only */
-        }
-        else
-        {
-            TRACE("Invalid method call context\n");
-            return DISP_E_MEMBERNOTFOUND;
-        }
-
-        if ( pDispParams && pDispParams->cArgs > 0 )
-        {
-            /* this allocates an array of VARIANTARG 
-             * in their final form for invocation
-             */
-            hr = INVOKE_AllocateCoerceAndSortArguments(pFuncDesc, 
-                                                       pDispParams, 
-                                                      &paArgsCoerced,
-                                                       puArgErr);
-            if ( FAILED(hr) ) return hr;
-        }
-
-        switch ( pFuncDesc->callconv )
-        {
-        case CC_STDCALL:
-            hr = INVOKE_InvokeStdCallFunction((IUnknown *)pIUnk,    
-                                              pFuncDesc,
-                                              paArgsCoerced,
-                                              pVarResult,
-                                              pExcepInfo);
-            break;
-        default:
-            FIXME("Calling convention not supported!\n");
-            return E_FAIL;
-        }
-    }
-    
-    return hr;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetDocumentation
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetDocumentation(ITypeInfo2 * iface,
-				MEMBERID memid, BSTR  *pBstrName, BSTR  *pBstrDocString,
-				DWORD  *pdwHelpContext, BSTR  *pBstrHelpFile)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetDocumentation()\n", This));
-
-    /* documentation for the typeinfo */
-    if (memid == MEMBERID_NIL)
-    {
-        if (pBstrName)
-            *pBstrName = DupAtoBstr(This->szName);
-        if (pBstrDocString)
-            *pBstrDocString = DupAtoBstr(This->szDocString);
-        if (pdwHelpContext)
-            *pdwHelpContext = This->lHelpContext;
-        if (pBstrHelpFile)
-            *pBstrHelpFile = DupAtoBstr(This->szDocString);/* FIXME */
-
-        return S_OK;
-    }
-
-    // Search functions...
-    oListIter<TLBFuncDesc *>	itrFunc(This->pFunctions);
-    for (itrFunc.MoveStart(); itrFunc.IsValid(); itrFunc.MoveNext())
-    {
-	if (itrFunc.Element()->funcdesc.memid == memid)
-	{
-	    if (pBstrName)
-		*pBstrName = DupAtoBstr(itrFunc.Element()->szName);
-	    if (pBstrDocString)
-		*pBstrDocString = DupAtoBstr(itrFunc.Element()->szHelpString);
-	    if (pdwHelpContext)
-		*pdwHelpContext = itrFunc.Element()->lHelpStringContext;
-	    if (pBstrHelpFile)
-		*pBstrHelpFile = DupAtoBstr(itrFunc.Element()->szHelpString);/* FIXME */
-	    return S_OK;
-	}
-    }
-
-    // Search variables...
-    oListIter<TLBVarDesc *>	itrVar(This->pVariables);
-    for (itrVar.MoveStart(); itrVar.IsValid(); itrVar.MoveNext())
-    {
-	if (itrVar.Element()->vardesc.memid == memid)
-	{
-	    if (pBstrName)
-		*pBstrName = DupAtoBstr(itrVar.Element()->szName);
-	    if (pBstrDocString)
-		*pBstrDocString = DupAtoBstr(itrVar.Element()->szHelpString);
-	    if (pdwHelpContext)
-		*pdwHelpContext = itrVar.Element()->lHelpStringContext;
-	    if (pBstrHelpFile)
-		*pBstrHelpFile = DupAtoBstr(itrVar.Element()->szHelpString);/* FIXME */
-	    return S_OK;
-	}
-    }
-
-    return TYPE_E_ELEMENTNOTFOUND;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetDllEntry(ITypeInfo2 * iface,
-				MEMBERID memid, INVOKEKIND invKind, BSTR  *pBstrDllName,
-				BSTR  *pBstrName, WORD  *pwOrdinal)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetDllEntry() - STUB!\n", This));
-
-    return E_NOTIMPL;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetRefTypeInfo(ITypeInfo2 * iface,
-				HREFTYPE hRefType, ITypeInfo  * *ppTInfo)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetRefTypeInfo()\n", This));
-
-    HRESULT rc;
-    if (HREFTYPE_INTHISFILE(hRefType))
-    {
-        ITypeLib *	pTLib;
-        int		index;
-        rc = This->lpvtbl->fnGetContainingTypeLib(iface, &pTLib, (UINT*)&index);
-        if (SUCCEEDED(rc))
-        {
-            rc = ICOM_VTBL(pTLib)->fnGetTypeInfo(pTLib, HREFTYPE_INDEX(hRefType), ppTInfo);
-            ICOM_VTBL(pTLib)->fnRelease(pTLib );
-        }
-        return rc;
-    }
-    else 
-    if (hRefType == -1 && 
-       (((ITypeInfoImpl*) This)->TypeAttr.typekind   == TKIND_DISPATCH) &&
-       (((ITypeInfoImpl*) This)->TypeAttr.wTypeFlags &  TYPEFLAG_FDUAL))
-    {
-	  /* when we meet a DUAL dispinterface, we must create the interface 
-	  * version of it.
-	  */
-	  ITypeInfoImpl* pTypeInfoImpl = (ITypeInfoImpl*) ITypeInfoImpl_Constructor();
-	
-	  /* the interface version contains the same information as the dispinterface
-	   * copy the contents of the structs.
-	   */
-	  *pTypeInfoImpl = *This;
-	  pTypeInfoImpl->ref = 1;
-		
-	  /* change the type to interface */
-	  pTypeInfoImpl->TypeAttr.typekind = TKIND_INTERFACE;
-		
-          *ppTInfo = (ITypeInfo*) pTypeInfoImpl;
-
-	  ITypeInfo_AddRef((ITypeInfo*) pTypeInfoImpl);
-
-          return S_OK;
-    }
-
-    /* imported type lib */
-    oListIter<TLBRefType *>	itrRef(This->pImplements);
-    for (itrRef.MoveStart(); itrRef.IsValid(); itrRef.MoveNext())
-    {
-	if (itrRef.Element()->reference == hRefType)
-	{
-	    TLBImpLib *		pImpLib;
-	    ITypeLibImpl *	pTypeLib;
-
-	    pTypeLib = itrRef.Element()->pImpTLInfo->pImpTypeLib;
-	    if (pTypeLib)
-	    {
-		return pTypeLib->lpvtbl->fnGetTypeInfoOfGuid(
-			(ITypeLib2 *)pTypeLib, &itrRef.Element()->guid, ppTInfo);
-	    }
-	    rc = LoadRegTypeLib( &itrRef.Element()->pImpTLInfo->guid,
-		    0,0,0, /* FIXME */
-		    (LPTYPELIB *)&pTypeLib);
-	    if (!SUCCEEDED(rc))
-	    {
-		BSTR libnam = DupAtoBstr(itrRef.Element()->pImpTLInfo->name);
-		rc = LoadTypeLib(libnam, (LPTYPELIB *)&pTypeLib);
-		SysFreeString(libnam);
-	    }
-	    if (SUCCEEDED(rc))
-	    {
-		rc = pTypeLib->lpvtbl->fnGetTypeInfoOfGuid(
-			(ITypeLib2 *)pTypeLib, &itrRef.Element()->guid, ppTInfo);
-		itrRef.Element()->pImpTLInfo->pImpTypeLib = pTypeLib;
-	    }
-	    return rc;
-	}
-    }
-
-    return TYPE_E_ELEMENTNOTFOUND; /* FIXME : correct? */
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_AddressOfMember(ITypeInfo2 * iface,
-				MEMBERID memid, INVOKEKIND invKind, PVOID *ppv)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->AddressOfMember()\n", This));
-
-    return E_NOTIMPL;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_CreateInstance(ITypeInfo2 * iface,
-				IUnknown *pUnk, REFIID riid, VOID  * *ppvObj)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->CreateInstance()\n", This));
-
-    return E_NOTIMPL;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetMops(ITypeInfo2 * iface,
-				MEMBERID memid, BSTR  *pBstrMops)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetMops()\n", This));
-
-    return E_NOTIMPL;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_GetContainingTypeLib
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_GetContainingTypeLib(ITypeInfo2 * iface,
-				ITypeLib  * *ppTLib, UINT  *pIndex)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetContainingTypeLib()\n", This));
-
-    ICOM_VTBL(*ppTLib)->fnAddRef(*ppTLib);
-
-    *ppTLib = (LPTYPELIB )(This->pTypeLib);
-    *pIndex = This->index;
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_ReleaseTypeAttr
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_ReleaseTypeAttr(ITypeInfo2 * iface,
-				TYPEATTR *pTypeAttr)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->ReleaseTypeAttr()\n", This));
-
-    HeapFree(GetProcessHeap(), 0, pTypeAttr);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_ReleaseFuncDesc
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_ReleaseFuncDesc(ITypeInfo2 * iface,
-				FUNCDESC *pFuncDesc)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->ReleaseFuncDesc()\n", This));
-
-    HeapFree(GetProcessHeap(), 0, pFuncDesc);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl_ReleaseVarDesc
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfoImpl_ReleaseVarDesc(ITypeInfo2 * iface,
-				VARDESC *pVarDesc)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->ReleaseVarDesc()\n", This));
-
-    HeapFree(GetProcessHeap(), 0, pVarDesc);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetTypeKind
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetTypeKind(ITypeInfo2 * iface,
-				TYPEKIND *pTypeKind)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetTypeKind()\n", This));
-
-    *pTypeKind = This->TypeAttr.typekind;
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetTypeFlags
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetTypeFlags(ITypeInfo2 * iface,
-				UINT *pTypeFlags)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetTypeFlags()\n", This));
-
-    *pTypeFlags = This->TypeAttr.wTypeFlags;
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetFuncIndexOfMemId
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetFuncIndexOfMemId(ITypeInfo2 * iface,
-				MEMBERID memid, INVOKEKIND invKind, UINT *pFuncIndex)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetFuncIndexOfMemId()\n", This));
-
-    int		index = 0;
-    oListIter<TLBFuncDesc *>	itrFunc(This->pFunctions);
-
-    for (itrFunc.MoveStart(); itrFunc.IsValid(); itrFunc.MoveNext())
-    {
-	if ((itrFunc.Element()->funcdesc.memid == memid)
-	    && (itrFunc.Element()->funcdesc.invkind == invKind))
-	{
-	    *pFuncIndex = index;
-	    return S_OK;
-	}
-	index += 1;
-    }
-    *pFuncIndex = 0;
-    return E_INVALIDARG;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetVarIndexOfMemId
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetVarIndexOfMemId(ITypeInfo2 * iface,
-				MEMBERID memid, UINT *pVarIndex)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetVarIndexOfMemId()\n", This));
-
-    int		index = 0;
-    oListIter<TLBVarDesc *>	itrVar(This->pVariables);
-
-    for (itrVar.MoveStart(); itrVar.IsValid(); itrVar.MoveNext())
-    {
-	if (itrVar.Element()->vardesc.memid == memid)
-	{
-	    *pVarIndex = index;
-	    return S_OK;
-	}
-	index += 1;
-    }
-    *pVarIndex = 0;
-    return E_INVALIDARG;
-}
-
-// ----------------------------------------------------------------------
-// FindCustData
-// ----------------------------------------------------------------------
-static HRESULT FindCustData(oList<TLBCustData *> & list, REFGUID guid, VARIANT *pVarVal)
-{
-    oListIter<TLBCustData *>	itrCust(list);
-
-    for (itrCust.MoveStart(); itrCust.IsValid(); itrCust.MoveNext())
-    {
-	if (IsEqualGUID(&itrCust.Element()->guid, guid))
-	{
-	    VariantInit( pVarVal);
-	    VariantCopy( pVarVal, &itrCust.Element()->data);
-	    return S_OK;
-	}
-    }
-
-    return E_INVALIDARG;
-}
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetCustData(ITypeInfo2 * iface,
-				REFGUID guid, VARIANT *pVarVal)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetCustData()\n", This));
-
-    return FindCustData(This->pCustData, guid, pVarVal);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetFuncCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetFuncCustData(ITypeInfo2 * iface,
-				UINT index, REFGUID guid, VARIANT *pVarVal)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetFuncCustData()\n", This));
-
-    if (This->pFunctions.Count() < index)
-	return E_INVALIDARG;
-
-    return FindCustData(This->pFunctions[index]->pCustData, guid, pVarVal);
-}
-
-
-// ----------------------------------------------------------------------
-//  ITypeInfo2Impl_GetParamCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetParamCustData(ITypeInfo2 * iface,
-				UINT indexFunc, UINT indexParam, REFGUID guid, VARIANT *pVarVal)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetParamCustData()\n", This));
-
-    TLBFuncDesc *	pFuncDesc;
-
-    if (This->pFunctions.Count() < indexFunc)
-	return E_INVALIDARG;
-
-    pFuncDesc = This->pFunctions[indexFunc];
-
-    if (pFuncDesc->funcdesc.cParams < indexParam)
-	return E_INVALIDARG;
-
-    return FindCustData(pFuncDesc->pParamDesc[indexParam].pCustData, guid, pVarVal);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetVarCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetVarCustData(ITypeInfo2 * iface,
-				UINT index, REFGUID guid, VARIANT *pVarVal)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetVarCustData()\n", This));
-
-    if (This->pVariables.Count() < index)
-	return E_INVALIDARG;
-
-    return FindCustData(This->pVariables[index]->pCustData, guid, pVarVal);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetImplTypeCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetImplTypeCustData(ITypeInfo2 * iface,
-				UINT index, REFGUID guid, VARIANT *pVarVal)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetImplTypeCustData()\n", This));
-
-    if (This->pImplements.Count() < index)
-	return E_INVALIDARG;
-
-    return FindCustData(This->pImplements[index]->pCustData, guid, pVarVal);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetDocumentation2
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetDocumentation2(ITypeInfo2 * iface,
-				MEMBERID memid, LCID lcid, BSTR *pbstrHelpString,
-				DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetDocumentation2()\n", This));
-
-    // Typeinfo itself...
-    if (memid == MEMBERID_NIL)
-    {
-        if (pbstrHelpString)
-            *pbstrHelpString = DupAtoBstr(This->szName);
-        if (pdwHelpStringContext)
-            *pdwHelpStringContext = This->lHelpStringContext;
-        if (pbstrHelpStringDll)
-            *pbstrHelpStringDll = DupAtoBstr(
-		    ((ITypeLibImpl *)This->pTypeLib)->szHelpStringDll);/* FIXME */
-        return S_OK;
-    }
-
-    // Search functions...
-    oListIter<TLBFuncDesc *>	itrFunc(This->pFunctions);
-    for (itrFunc.MoveStart(); itrFunc.IsValid(); itrFunc.MoveNext())
-    {
-	if (itrFunc.Element()->funcdesc.memid == memid)
-	{
-            if (pbstrHelpString)
-                *pbstrHelpString = DupAtoBstr(itrFunc.Element()->szHelpString);
-            if (pdwHelpStringContext)
-                *pdwHelpStringContext = itrFunc.Element()->lHelpStringContext;
-            if (pbstrHelpStringDll)
-                *pbstrHelpStringDll = DupAtoBstr(
-			((ITypeLibImpl *)This->pTypeLib)->szHelpStringDll);/* FIXME */
-        return S_OK;
-        }
-    }
-
-    // Search variables...
-    oListIter<TLBVarDesc *>	itrVar(This->pVariables);
-    for (itrVar.MoveStart(); itrVar.IsValid(); itrVar.MoveNext())
-    {
-	if (itrVar.Element()->vardesc.memid == memid)
-	{
-             if (pbstrHelpString)
-                *pbstrHelpString = DupAtoBstr(itrVar.Element()->szHelpString);
-            if (pdwHelpStringContext)
-                *pdwHelpStringContext = itrVar.Element()->lHelpStringContext;
-            if (pbstrHelpStringDll)
-                *pbstrHelpStringDll = DupAtoBstr(
-			((ITypeLibImpl *)This->pTypeLib)->szHelpStringDll);/* FIXME */
-            return S_OK;
-        }
-    }
-    return TYPE_E_ELEMENTNOTFOUND;
-}
-
-// ----------------------------------------------------------------------
-// GetAllCustData
-// ----------------------------------------------------------------------
-static HRESULT GetAllCustData(oList<TLBCustData *> & list, CUSTDATA *pCustData)
-{
-    if (list.Count() > 0)
-    {
-	pCustData->prgCustData = (CUSTDATAITEM *)
-		    HeapAlloc(GetProcessHeap(), 0, list.Count() * sizeof(CUSTDATAITEM));
-
-	if (!pCustData->prgCustData)
-	{
-	    dprintf(("OLEAUT32: GetAllCustData: E_OUTOFMEMORY"));
-	    return E_OUTOFMEMORY;
-	}
-
-	int		index = 0;
-	oListIter<TLBCustData *>	itrCust(list);
-
-	for (itrCust.MoveStart(); itrCust.IsValid(); itrCust.MoveNext())
-	{
-	    pCustData->prgCustData[index].guid = itrCust.Element()->guid;
-	    VariantCopy( &pCustData->prgCustData[index].varValue, &itrCust.Element()->data );
-	    index += 1;
-	}
-    }
-
-    return S_OK;
-}
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetAllCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetAllCustData(ITypeInfo2 * iface,
-				CUSTDATA *pCustData)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetAllCustData()\n", This));
-
-    return GetAllCustData(This->pCustData, pCustData);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetAllFuncCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetAllFuncCustData(ITypeInfo2 * iface,
-				UINT index, CUSTDATA *pCustData)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetAllFuncCustData()\n", This));
-
-    if (This->pFunctions.Count() < index)
-	return E_INVALIDARG;
-
-    return GetAllCustData(This->pFunctions[index]->pCustData, pCustData);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetAllParamCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetAllParamCustData(ITypeInfo2 * iface,
-				UINT indexFunc, UINT indexParam, CUSTDATA *pCustData)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetAllParamCustData()\n", This));
-
-    TLBFuncDesc *	pFuncDesc;
-
-    if (This->pFunctions.Count() < indexFunc)
-	return E_INVALIDARG;
-
-    pFuncDesc = This->pFunctions[indexFunc];
-
-    if (pFuncDesc->funcdesc.cParams < indexParam)
-	return E_INVALIDARG;
-
-    return GetAllCustData(pFuncDesc->pParamDesc[indexParam].pCustData, pCustData);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetAllVarCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetAllVarCustData(ITypeInfo2 * iface,
-				UINT index, CUSTDATA *pCustData)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetAllVarCustData()\n", This));
-
-    if (This->pVariables.Count() < index)
-	return E_INVALIDARG;
-
-    return GetAllCustData(This->pVariables[index]->pCustData,  pCustData);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeInfo2Impl_GetAllImplTypeCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeInfo2Impl_GetAllImplTypeCustData(ITypeInfo2 * iface,
-				UINT index, CUSTDATA *pCustData)
-{
-    ICOM_THIS(ITypeInfoImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeInfoImpl(%p)->GetAllImplTypeCustData()\n", This));
-
-    if (This->pImplements.Count() < index)
-	return E_INVALIDARG;
-
-    return GetAllCustData(This->pImplements[index]->pCustData, pCustData);
-}
-
-
-
Index: trunk/src/oleaut32/itypelib.cpp
===================================================================
--- trunk/src/oleaut32/itypelib.cpp	(revision 6505)
+++ 	(revision )
@@ -1,625 +1,0 @@
-/* $Id: itypelib.cpp,v 1.5 2001-01-18 18:12:21 sandervl Exp $ */
-/* 
- * ITypelib interface
- * 
- * 1/12/99
- * 
- * Copyright 1999 David J. Raison
- * Some portions based on original work on Wine
- *   Copyright 1997 Marcus Meissner
- 	       1999 Rein Klazes
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
-
-#include "oleaut32.h"
-#include "olectl.h"
-#include "oList.h"	// linked list template
-#include "itypelib.h"
-
-// ======================================================================
-// Local Data
-// ======================================================================
-static ICOM_VTABLE(ITypeLib2) ITypeLib_VTable =
-{
-    ITypeLibImpl_QueryInterface,
-    ITypeLibImpl_AddRef,
-    ITypeLibImpl_Release,
-    ITypeLibImpl_GetTypeInfoCount,
-    ITypeLibImpl_GetTypeInfo,
-    ITypeLibImpl_GetTypeInfoType,
-    ITypeLibImpl_GetTypeInfoOfGuid,
-    ITypeLibImpl_GetLibAttr,
-    ITypeLibImpl_GetTypeComp,
-    ITypeLibImpl_GetDocumentation,
-    ITypeLibImpl_IsName,
-    ITypeLibImpl_FindName,
-    ITypeLibImpl_ReleaseTLibAttr,
-    ITypeLib2Impl_GetCustData,
-    ITypeLib2Impl_GetLibStatistics,
-    ITypeLib2Impl_GetDocumentation2,
-    ITypeLib2Impl_GetAllCustData
-};
-
-// ======================================================================
-// Local Methods
-// ======================================================================
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_Constructor
-// ----------------------------------------------------------------------
-ITypeLibImpl * ITypeLibImpl_Constructor()
-{
-    ITypeLibImpl *	pNew;
-
-//    dprintf(("OLEAUT32: ITypeLib()->Constructor()"));
-
-    pNew = new ITypeLibImpl;
-
-    // Initialise the vft
-    pNew->lpvtbl = &ITypeLib_VTable;
-    pNew->ref = 1;
-
-    return pNew;
-}
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_Destructor
-// ----------------------------------------------------------------------
-void ITypeLibImpl_Destructor(ITypeLibImpl * This)
-{
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->Destructor()", This));
-
-    // TODO - need to relase all substructures etc.
-//    delete This;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_QueryInterface
-//
-// This object supports IUnknown, ITypeLib, ITypeLib2
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_QueryInterface(ITypeLib2 * iface,
-				REFIID riid, VOID **ppvObject)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->QueryInterface()", This));
-
-    // Sanity check...
-    if ((This == 0) || (ppvObject == 0))
-	return E_INVALIDARG;
-
-    // Initialise return jic...
-    *ppvObject = 0;
-
-    // Go find the correct interface...
-    if (IsEqualIID(&IID_IUnknown, riid))
-    {
-	dprintf(("          ->IUnknown"));
-	*ppvObject = &(This->lpvtbl);
-    }
-    else if (IsEqualIID(&IID_ITypeLib, riid))
-    {
-	dprintf(("          ->ITypeLib"));
-	*ppvObject = &(This->lpvtbl);
-    }
-    else if (IsEqualIID(&IID_ITypeLib2, riid))
-    {
-	dprintf(("          ->ITypeLib2"));
-	*ppvObject = &(This->lpvtbl);
-    }
-    else
-    {
-	char	tmp[50];
-
-	WINE_StringFromCLSID(riid, tmp);
-
-	dprintf(("          ->E_NOINTERFACE(%s)", tmp));
-	return E_NOINTERFACE; 
-    }
-
-    // Query Interface always increases the reference count by one...
-    ITypeLibImpl_AddRef((ITypeLib2 *)This);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_AddRef
-// ----------------------------------------------------------------------
-ULONG   WIN32API ITypeLibImpl_AddRef(ITypeLib2 * iface)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->AddRef()", This));
-
-    return ++(This->ref);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_Release
-// ----------------------------------------------------------------------
-ULONG   WIN32API ITypeLibImpl_Release(ITypeLib2 * iface)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->Release()\n", This));
-
-    if (--(This->ref) == 0)
-    {
-	ITypeLibImpl_Destructor(This);
-	return 0;
-    }
-    return This->ref;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetTypeInfoCount
-// ----------------------------------------------------------------------
-UINT    WIN32API ITypeLibImpl_GetTypeInfoCount(ITypeLib2 * iface)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetTypeInfoCount()\n", This));
-
-    return This->pTypeInfo.Count();
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetTypeInfo
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_GetTypeInfo(ITypeLib2 * iface,
-				UINT index, ITypeInfo **ppTInfo)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetTypeInfo()\n", This));
-
-    // Sanity check...
-    if (ppTInfo == 0)
-	return E_INVALIDARG;
-
-    *ppTInfo = 0;
-
-    if (index > (This->pTypeInfo.Count() - 1))
-	return TYPE_E_ELEMENTNOTFOUND;
-
-    // Fish out typeinfo (remembering to incr the ref count)...
-    ITypeInfoImpl * pInfo = This->pTypeInfo[index];
-    *ppTInfo = (ITypeInfo *)pInfo;
-    pInfo->lpvtbl->fnAddRef((ITypeInfo2 *)*ppTInfo);
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetTypeInfoType
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_GetTypeInfoType(ITypeLib2 * iface,
-				UINT index, TYPEKIND *pTKind)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetTypeInfoType()\n", This));
-
-    // Sanity check...
-    if (pTKind == 0)
-	return E_INVALIDARG;
-
-    if (index > (This->pTypeInfo.Count() - 1))
-	return TYPE_E_ELEMENTNOTFOUND;
-
-    // Fish out typeinfo & return typekind...
-    ITypeInfoImpl * pInfo = This->pTypeInfo[index];
-    *pTKind = pInfo->TypeAttr.typekind;
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetTypeInfoOfGuid
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_GetTypeInfoOfGuid(ITypeLib2 * iface,
-				REFGUID guid, ITypeInfo **ppTInfo)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetTypeInfoOfGuid()\n", This));
-
-    // Sanity check...
-    if (ppTInfo == 0)
-	return E_INVALIDARG;
-
-    *ppTInfo = 0;
-
-    oListIter<ITypeInfoImpl *>  itrTypeInfo(This->pTypeInfo);
-
-    // loop thru them to find the one we want.
-    for (itrTypeInfo.MoveStart(); itrTypeInfo.IsValid(); itrTypeInfo.MoveNext())
-	{
-	    if (IsEqualGUID(&itrTypeInfo.Element()->TypeAttr.guid, guid))
-	    {
-		// Fish out typeinfo...
-		ITypeInfoImpl * pInfo = itrTypeInfo.Element();
-		*ppTInfo = (ITypeInfo *)pInfo;
-		pInfo->lpvtbl->fnAddRef((ITypeInfo2 *)*ppTInfo);
-
-		return S_OK;
-	    }
-	}
-
-
-    return TYPE_E_ELEMENTNOTFOUND;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetLibAttr
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_GetLibAttr(ITypeLib2 * iface,
-				LPTLIBATTR *ppTLibAttr)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetLibAttr()\n", This));
-
-    TLIBATTR *	pTLibAttr = (TLIBATTR *)HeapAlloc(GetProcessHeap(), 0, sizeof(TLIBATTR));
-
-    memcpy(pTLibAttr, &This->LibAttr, sizeof(TLIBATTR));
-
-    *ppTLibAttr = pTLibAttr;
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetTypeComp
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_GetTypeComp(ITypeLib2 * iface,
-				ITypeComp **ppTComp)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetTypeComp()\n", This));
-
-    // Sanity check...
-    if (ppTComp == 0)
-	return E_INVALIDARG;
-
-    *ppTComp = 0;
-
-    return E_NOTIMPL;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_GetDocumentation
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_GetDocumentation(ITypeLib2 * iface,
-				INT index, BSTR *pBstrName, BSTR *pBstrDocString,
-				DWORD *plHelpContext, BSTR *pBstrHelpFile)
-{
-    HRESULT		rc;
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetDocumentation(idx = %i)\n", This, index));
-
-    /* if index is -Ve this is a request for documentation for the typelib */
-    if (index < 0)
-    {
-        if (pBstrName)
-            *pBstrName = DupAtoBstr(This->szName);
-        if (pBstrDocString)
-            *pBstrDocString = DupAtoBstr(This->szDocString);
-        if (plHelpContext)
-            *plHelpContext = This->lHelpContext;
-        if (pBstrHelpFile)
-            *pBstrHelpFile = DupAtoBstr(This->szHelpFile);
-
-	rc = S_OK;
-    }
-    else
-    { // for specified typeinfo
-	ITypeInfo2 *	pTInfo;
-
-	rc = ITypeLibImpl_GetTypeInfo(iface, index, (ITypeInfo **)&pTInfo);
-
-        if (SUCCEEDED(rc))
-        {
-	    // Delegate to typeinfo interface...
-            rc = ITypeInfoImpl_GetDocumentation(pTInfo,
-					    MEMBERID_NIL,
-					    pBstrName,
-					    pBstrDocString,
-					    plHelpContext,
-					    pBstrHelpFile);
-
-            ITypeInfo_Release(pTInfo);
-        }
-    }
-
-    return rc;
-}
-
-// ----------------------------------------------------------------------
-// IsNameSub
-// ----------------------------------------------------------------------
-static BOOL IsNameSub(ITypeLibImpl * This, char * pName)
-{
-    if (!strcmp(pName, This->szName))
-	return TRUE;
-
-    oListIter<ITypeInfoImpl *>	itrTypeInfo(This->pTypeInfo);
-
-    for (itrTypeInfo.MoveStart(); itrTypeInfo.IsValid(); itrTypeInfo.MoveNext())
-    {
-	if (!strcmp(pName, itrTypeInfo.Element()->szName))
-	    return TRUE;
-
-	oListIter<TLBFuncDesc *>    itrFuncDesc(itrTypeInfo.Element()->pFunctions);
-	for (itrFuncDesc.MoveStart(); itrFuncDesc.IsValid(); itrFuncDesc.MoveNext())
-	{
-	    if (!strcmp(pName, itrFuncDesc.Element()->szName))
-		return TRUE;
-	}
-
-	oListIter<TLBVarDesc *>	    itrVarDesc(itrTypeInfo.Element()->pVariables);
-	for (itrVarDesc.MoveStart(); itrVarDesc.IsValid(); itrVarDesc.MoveNext())
-	{
-	    if (!strcmp(pName, itrVarDesc.Element()->szName))
-		return TRUE;
-	}
-    }
-    return FALSE;
-}
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_IsName
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_IsName(ITypeLib2 * iface,
-				LPOLESTR szNameBuf, ULONG lHashVal, BOOL *pfName)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    char *	astr = HEAP_strdupWtoA( GetProcessHeap(), 0, szNameBuf );
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p,%s)->IsName(%s)\n", This, This->szName, astr));
-
-    BOOL	fFound = IsNameSub(This, astr);
-
-    *pfName = fFound;
-
-    dprintf((" Search for %s: %s", astr, fFound ? "TRUE" : "FALSE"));
-
-    HeapFree( GetProcessHeap(), 0, astr );
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// FindNameSub
-// ----------------------------------------------------------------------
-static BOOL FindNameSub(char *		pName,
-			ITypeInfoImpl *	pTInfo,
-			ULONG *		plMemID)
-{
-    if (!strcmp(pName, pTInfo->szName))
-    {
-	*plMemID = MEMBERID_NIL;	/* FIXME? */
-	return TRUE;
-    }
-
-    oListIter<TLBFuncDesc *>    itrFuncDesc(pTInfo->pFunctions);
-    for (itrFuncDesc.MoveStart(); itrFuncDesc.IsValid(); itrFuncDesc.MoveNext())
-    {
-	if (!strcmp(pName, itrFuncDesc.Element()->szName))
-	{
-	    *plMemID = itrFuncDesc.Element()->funcdesc.memid;
-	    return TRUE;
-	}
-    }
-
-    oListIter<TLBVarDesc *>	    itrVarDesc(pTInfo->pVariables);
-    for (itrVarDesc.MoveStart(); itrVarDesc.IsValid(); itrVarDesc.MoveNext())
-    {
-	if (!strcmp(pName, itrVarDesc.Element()->szName))
-	{
-	    *plMemID = itrVarDesc.Element()->vardesc.memid;
-	    return TRUE;
-	}
-    }
-    return FALSE;
-}
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl_FindName
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLibImpl_FindName(ITypeLib2 * iface,
-				LPOLESTR szNameBuf, ULONG lHashVal, ITypeInfo **ppTInfo,
-				MEMBERID *rgMemId, UINT16 *pcFound)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->FindName()\n", This));
-
-    char *	astr = HEAP_strdupWtoA( GetProcessHeap(), 0, szNameBuf );
-    UINT16	cMax = *pcFound;
-    UINT16	cFound = 0;
-    ULONG	lMemID = 0;
-
-    oListIter<ITypeInfoImpl *>	itrTypeInfo(This->pTypeInfo);
-
-    for (itrTypeInfo.MoveStart(); (cFound < cMax) && itrTypeInfo.IsValid(); itrTypeInfo.MoveNext())
-    {
-	ITypeInfoImpl * pInfo = itrTypeInfo.Element();
-
-	if (FindNameSub(astr, pInfo, &lMemID))
-	{
-	    ppTInfo[cFound] = (ITypeInfo *)pInfo;
-	    rgMemId[cFound] = lMemID;
-	    pInfo->lpvtbl->fnAddRef((ITypeInfo2 *)pInfo);
-	    cFound += 1;
-	}
-    }
-    *pcFound = cFound;
-
-    HeapFree( GetProcessHeap(), 0, astr );
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// 
-// ----------------------------------------------------------------------
-void WIN32API ITypeLibImpl_ReleaseTLibAttr(ITypeLib2 * iface,
-				TLIBATTR *pTLibAttr)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->ReleaseTLibAttr()\n", This));
-
-    HeapFree(GetProcessHeap(), 0, pTLibAttr);
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLib2Impl_GetCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLib2Impl_GetCustData(ITypeLib2 * iface,
-				REFGUID guid, VARIANT *pVarVal)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetCustData()\n", This));
-
-    oListIter<TLBCustData *>	itrCustData(This->pCustData);
-
-    for (itrCustData.MoveStart(); itrCustData.IsValid(); itrCustData.MoveNext())
-    {
-        if( IsEqualIID(guid, &itrCustData.Element()->guid))
-        {
-	    VariantInit( pVarVal);
-	    VariantCopy( pVarVal, &itrCustData.Element()->data);
-	    return S_OK;
-        }
-    }
-
-    return E_INVALIDARG;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLib2Impl_GetLibStatistics		STUB
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLib2Impl_GetLibStatistics(ITypeLib2 * iface,
-				ULONG *pcUniqueNames, ULONG *pcchUniqueNames)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetLibStatistics() - Stub\n", This));
-
-    if (pcUniqueNames)
-	*pcUniqueNames = 1;
-
-    if (pcchUniqueNames)
-	*pcchUniqueNames = 1;
-
-    return S_OK;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLib2Impl_GetDocumentation2
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLib2Impl_GetDocumentation2(ITypeLib2 * iface,
-				INT index, LCID lcid, BSTR *pbstrHelpString,
-				DWORD *plHelpStringContext, BSTR *pbstrHelpStringDll)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-    HRESULT	rc;
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetDocumentation2()\n", This));
-
-    /* if index is -Ve this is a request for documentation for the typelib */
-    if (index < 0)
-    {
-        if (pbstrHelpString)
-            *pbstrHelpString = DupAtoBstr(This->szDocString);
-        if (plHelpStringContext)
-            *plHelpStringContext = This->lHelpContext;
-        if (pbstrHelpStringDll)
-            *pbstrHelpStringDll = DupAtoBstr(This->szHelpStringDll);
-	rc = S_OK;
-    }
-    else
-    { // for specified typeinfo
-	ITypeInfo2 *	pTInfo;
-
-	rc = ITypeLibImpl_GetTypeInfo(iface, index, (ITypeInfo **)&pTInfo);
-
-        if (SUCCEEDED(rc))
-        {
-	    // Delegate to typeinfo interface...
-            rc = ITypeInfo2Impl_GetDocumentation2(pTInfo,
-					    MEMBERID_NIL,
-					    lcid,
-					    pbstrHelpString,
-					    plHelpStringContext,
-					    pbstrHelpStringDll);
-            ITypeInfo_Release(pTInfo);
-        }
-    }
-
-    return rc;
-}
-
-
-// ----------------------------------------------------------------------
-// ITypeLib2Impl_GetAllCustData
-// ----------------------------------------------------------------------
-HRESULT WIN32API ITypeLib2Impl_GetAllCustData(ITypeLib2 * iface,
-				CUSTDATA *pCustData)
-{
-    ICOM_THIS(ITypeLibImpl, iface);
-
-    dprintf(("OLEAUT32: ITypeLibImpl(%p)->GetAllCustData()\n", This));
-
-    CUSTDATAITEM *	pItem;
-
-    // Sanity check...
-    if (pCustData == 0)
-	return E_INVALIDARG;
-
-    pCustData->prgCustData = 0;
-    pCustData->cCustData = 0;
-
-    if ((pItem = (CUSTDATAITEM *)HeapAlloc(GetProcessHeap(), 0,
-			    sizeof(CUSTDATAITEM) * This->pCustData.Count())) == 0)
-    {
-	dprintf(("OLEAUT32: ITypeLib2Impl_GetAllCustData: E_OUTOFMEMORY"));
-        return E_OUTOFMEMORY;
-    }
-
-    pCustData->prgCustData = pItem;
-    pCustData->cCustData = This->pCustData.Count();
-
-    oListIter<TLBCustData *>	itrCustData(This->pCustData);
-
-    for (itrCustData.MoveStart(); itrCustData.IsValid(); itrCustData.MoveNext())
-    {
-	pItem->guid = itrCustData.Element()->guid;
-	VariantCopy(&pItem->varValue, &itrCustData.Element()->data);
-	pItem += 1;
-    }
-
-    return S_OK;
-}
Index: trunk/src/oleaut32/itypelib.h
===================================================================
--- trunk/src/oleaut32/itypelib.h	(revision 6505)
+++ 	(revision )
@@ -1,604 +1,0 @@
-/* $Id: itypelib.h,v 1.4 2001-01-18 18:12:21 sandervl Exp $ */
-/* 
- * OLE Typelib functions private header
- *
- * 18/11/99
- * 
- * Copyright 1999 David J. Raison
- * 
- * Project Odin Software License can be found in LICENSE.TXT
- * 
- */
-
-#if !defined(ITYPELIB_INCLUDED)
-#define ITYPELIB_INCLUDED
-
-#include "oList.h"
-
-#define TLBMAGIC2 "MSFT"
-#define TLBMAGIC1 "SLTG"
-#define HELPDLLFLAG (0x0100)
-#define DO_NOT_SEEK (-1)
-
-#define HREFTYPE_INTHISFILE(href) (!((href) & 3))
-#define HREFTYPE_INDEX(href) ((href) /sizeof(TLBTypeInfoBase))
-
-typedef struct TLBCustData
-{
-    GUID			guid;
-    VARIANT			data;
-} TLBCustData;
-
-/* internal Parameter data */
-typedef struct TLBParDesc
-{
-    PCHAR			szName;
-    oList<TLBCustData *>	pCustData;
-} TLBParDesc;
-
-/* internal Function data */
-typedef struct TLBFuncDesc
-{
-    FUNCDESC			funcdesc;	/* info on the function and its attributes. */
-    PCHAR			szName;		/* the name of this function */
-    TLBParDesc *		pParamDesc;	/* array with name and custom data */
-    ULONG			helpcontext;
-    ULONG			lHelpStringContext;
-    PCHAR			szHelpString;
-    PCHAR			szEntry;	/* if its Hiword==0, it numeric; -1 is not present*/
-    oList<TLBCustData *>	pCustData;
-} TLBFuncDesc;
-
-/* internal Variable data */
-typedef struct TLBVarDesc
-{
-    VARDESC			vardesc;          /* info on the variable and its attributes. */
-    PCHAR			szName;             /* the name of this variable */
-    ULONG			lHelpContext;
-    ULONG			lHelpStringContext;  /* fixme: where? */
-    PCHAR			szHelpString;
-    oList<TLBCustData *>	pCustData;
-} TLBVarDesc;
-
-/* data structure for import typelibs */
-typedef struct TLBImpLib
-{
-    ULONG			offset;                 /* offset in the file */
-    GUID			guid;                  	/* libid */
-    PCHAR			name;                 	/* name; */
-    struct ITypeLibImpl *	pImpTypeLib; 		/* pointer to loaded typelib */
-} TLBImpLib;
-
-/* data for refernced types in a coclass, or an inherited interface */
-typedef struct TLBRefType 
-{
-    GUID			guid;           	/* guid of the referenced type */
-							/* (important if its a imported type) */
-    HREFTYPE			reference;
-    ULONG			flags;
-    oList<TLBCustData *>	pCustData;
-    TLBImpLib *			pImpTLInfo;
-} TLBRefType;
-
-/* internal TypeInfo data */
-typedef struct ITypeInfoImpl
-{
-    ICOM_VTABLE(ITypeInfo2) *	lpvtbl;
-    ULONG			ref;			/* Reference count */
-    TYPEATTR			TypeAttr ;         	/* _lots_ of type information. */
-    ITypeLib *			pTypeLib; 		/* back pointer to typelib */
-    ULONG			index;                  /* index in this typelib; */
-    PCHAR			szName;
-    PCHAR			szDocString;
-    ULONG			lHelpContext;
-    ULONG			lHelpStringContext;
-
-    oList<TLBFuncDesc *>	pFunctions;    		/* Function descriptions */
-    oList<TLBVarDesc *>		pVariables;    		/* Variable descriptions */
-    oList<TLBRefType *>		pImplements;     	/* Implemented Interfaces  */
-    oList<TLBCustData *>	pCustData;	     	/* Custom Data  */
-
-} ITypeInfoImpl;
-
-/* internal TypeLib data */
-typedef struct ITypeLibImpl
-{
-    ICOM_VTABLE(ITypeLib2) *	lpvtbl;
-    ULONG			ref;			// Reference count...
-
-    TLIBATTR			LibAttr;               	/* guid,lcid,syskind,version,flags */
-    PCHAR			szName;
-    PCHAR			szDocString;
-    PCHAR			szHelpFile;
-    PCHAR			szHelpStringDll;
-    ULONG 			lHelpContext;
-
-    oList<ITypeInfoImpl *>	pTypeInfo;	     	/* Type info data */
-    oList<TLBCustData *>	pCustData;	    	/* Custom data */
-    oList<TLBImpLib *>		pImpLibs;	     	/* Imported typelibs */
-    oList<TYPEDESC *>		pTypedesc;	       	/* array of TypeDescriptions found in the libary */
-} ITypeLibImpl;
-
-/* internal TypeComp data */
-typedef struct ITypeCompImpl
-{
-    ICOM_VTABLE(ITypeComp) *	lpvtbl;
-    ULONG			ref;			// Reference count...
-} ITypeCompImpl;
-
-/*-------------------------FILE STRUCTURES-----------------------------------*/
-
-/*
- * structure of the typelib type2 header
- * it is at the beginning of a type lib file
- *  
- */
-typedef struct TLB2Header
-{
-/*0x00*/ULONG			magic1;       	/* 0x5446534D "MSFT" */
-        ULONG   		magic2;       	/* 0x00010002 version nr? */
-        ULONG   		posguid;     	/* position of libid in guid table  */
-						/* (should be,  else -1) */
-        ULONG   		lcid;         	/* locale id */
-/*0x10*/ULONG   		lcid2;
-        ULONG   		varflags;     	/* (largely) unknown flags ,seems to be always 41 */
-						/* becomes 0x51 with a helpfile defined */
-						/* if help dll defined its 0x151 */
-						/* update : the lower nibble is syskind */
-        ULONG   		version;      	/* set with SetVersion() */
-        ULONG   		flags;        	/* set with SetFlags() */
-/*0x20*/ULONG   		nrtypeinfos;  	/* number of typeinfo's (till so far) */
-        ULONG   		helpstring;   	/* position of help string in stringtable */
-        ULONG   		helpstringcontext;
-        ULONG   		helpcontext;
-/*0x30*/ULONG   		nametablecount; /* number of names in name table */
-        ULONG   		nametablechars; /* nr of characters in name table */
-        ULONG   		nameOffset;     /* offset of name in name table */
-        ULONG   		helpfile;       /* position of helpfile in stringtable */
-/*0x40*/ULONG   		customDataOffset; /* if -1 no custom data, else it is offset */
-						/* in customer data/guid offset table */
-        ULONG   		res44;          /* unknown always: 0x20 */
-        ULONG   		res48;          /* unknown always: 0x80 */
-        ULONG   		dispatchpos;    /* gets a value (1+n*0x0c) Idispatch interfaces */
-/*0x50*/ULONG   		res50;          /* is zero becomes one when an interface is derived */
-} TLB2Header;
-
-/* segments in the type lib file have a structure like this: */
-typedef struct _tp 
-{
-        ULONG   		offset;		/* absolute offset in file */
-        ULONG   		length;		/* length of segment */
-        ULONG   		res08;		/* unknown always -1 */
-        ULONG   		res0c;		/* unknown always 0x0f in the header */
-						/* 0x03 in the typeinfo_data */
-} pSeg;
-
-/* layout of the main segment directory */
-typedef struct TLBSegDir
-{
-/*1*/pSeg			pTypeInfoTab;	/* each type info get an entry of 0x64 bytes */
-						/* (25 ints) */
-/*2*/pSeg			pImpInfo;     	/* table with info for imported types */
-/*3*/pSeg 			pImpFiles;    	/* import libaries */
-/*4*/pSeg 			pRefTab;      	/* References table */
-/*5*/pSeg			pLibtab;      	/* always exists, alway same size (0x80) */
-						/* hash table w offsets to guid????? */
-/*6*/pSeg			pGuidTab;     	/* all guids are stored here together with  */
-						/* offset in some table???? */
-/*7*/pSeg			pRes7;        	/* always created, alway same size (0x200) */
-						/* purpose largely unknown */
-/*8*/pSeg			pNameTab;     	/* name tables */
-/*9*/pSeg			pStringTab;   	/*string table */
-/*A*/pSeg			pTypedescTab;  	/* table with type descriptors */
-/*B*/pSeg			pArrayDescriptions;
-/*C*/pSeg			pCustData;    	/*  data table, used for custom data and default */
-						/* parameter values */
-/*D*/pSeg			pCDGuids;     	/* table with offsets for the guids and into the customer data table */
-/*E*/pSeg			pResE;          /* unknown */
-/*F*/pSeg			pResF;          /* unknown  */
-} TLBSegDir;
-
-
-/* base type info data */
-typedef struct TLBTypeInfoBase
-{
-/*000*/ INT			typekind;       /*  it is the TKIND_xxx */
-						/* some byte alignment stuf */
-        INT     		memoffset;      /* points past the file, if no elements */
-        INT     		res2;           /* zero if no element, N*0x40 */
-        INT     		res3;           /* -1 if no lement, (N-1)*0x38 */
-/*010*/ INT     		res4;           /* always? 3 */
-        INT     		res5;           /* always? zero */
-        INT     		cElement;       /* counts elements, HI=cVars, LO=cFuncs */
-        INT     		res7;           /* always? zero */
-/*020*/ INT     		res8;           /* always? zero */
-        INT     		res9;           /* always? zero */
-        INT     		resA;           /* always? zero */
-        INT     		posguid;        /* position in guid table */
-/*030*/ INT     		flags;          /* Typeflags */
-        INT     		NameOffset;     /* offset in name table */
-        INT     		version;        /* element version */
-        INT     		docstringoffs;  /* offset of docstring in string tab */
-/*040*/ INT     		helpstringcontext;  /*  */
-        INT     		helpcontext;    /* */
-        INT     		oCustData;      /* offset in customer data table */
-        INT16   		cImplTypes;     /* nr of implemented interfaces */
-        INT16   		cbSizeVft;      /* virtual table size, not including inherits */
-/*050*/ INT     		size;           /* size in bytes, at least for structures */
-						/* fixme: name of this field */
-        INT     		datatype1;      /* position in type description table */
-						/* or in base intefaces */
-						/* if coclass: offset in reftable */
-						/* if interface: reference to inherited if */
-        INT     		datatype2;      /* if 0x8000, entry above is valid */
-						/* actually dunno */
-						/* else it is zero? */
-        INT     		res18;          /* always? 0 */
-/*060*/ INT     		res19;          /* always? -1 */
-} TLBTypeInfoBase;
-
-/* layout of an entry with information on imported types */
-typedef struct TLBImpInfo
-{
-    INT     			res0;           /* unknown */
-    INT     			oImpFile;       /* offset inthe Import File table */
-    INT     			oGuid;          /* offset in Guid table */
-} TLBImpInfo;
-
-/* function description data */
-typedef struct
-{
-    INT16   			recsize;	// record size including some xtra stuff 
-    INT16   			index;		// 99.12.19 This must be the function index :-)
-    INT   			DataType;       /* data type of memeber, eg return of function */
-    INT   			Flags;          /* something to do with attribute flags (LOWORD) */
-    INT16 			VtableOffset;   /* offset in vtable */
-    INT16 			res3;           /* some offset into dunno what */
-    INT   			FKCCIC;         /* bit string with the following  */
-						/* meaning (bit 0 is the msb): */
-						/* bit 2 indicates that oEntry is numeric */
-						/* bit 3 that parameter has default values */
-						/* calling convention (bits 4-7 ) */
-						/* bit 8 indicates that custom data is present */
-						/* Invokation kind (bits 9-12 ) */
-						/* function kind (eg virtual), bits 13-15  */
-    INT16 			nrargs;         /* number of arguments (including optional ????) */
-    INT16 			nroargs;        /* nr of optional arguments */
-						/* optional attribute fields, number variable */
-    INT   			OptAttr[1];
-/*
-0*  INT   helpcontext;
-1*  INT   oHelpString;
-2*  INT   oEntry;       // either offset in string table or numeric as it is //
-3*  INT   res9;         // unknown (-1) //
-4*  INT   resA;         // unknown (-1) //
-5*  INT   HelpStringContext;
-    // these are controlled by a bit set in the FKCCIC field  //
-6*  INT   oCustData;        // custom data for function //
-7*  INT   oArgCustData[1];  // custom data per argument //
-*/
-} TLBFuncRecord;
-
-/* after this may follow an array with default value pointers if the 
- * appropriate bit in the FKCCIC field has been set: 
- * INT   oDefautlValue[nrargs];
- */
-
-/* Parameter info one per argument*/
-typedef struct
-{
-    INT   			DataType;
-    INT   			oName;
-    INT   			Flags;
-} TLBParameterInfo;
-
-/* Variable description data */
-typedef struct
-{
-    INT16   			recsize;	// record size including some xtra stuff 
-    INT16   			unk02;		// 
-    INT   			DataType;     /* data type of the variable */
-    INT   			Flags;        /* VarFlags (LOWORD) */
-    INT16 			VarKind;      /* VarKind */
-    INT16 			res3;         /* some offset into dunno what */
-    INT   			OffsValue;    /* value of the variable or the offset  */
-
-    INT   			OptAttr[1];
-
-//                        /* in the data structure */
-//    /* optional attribute fields, the number of them is variable */
-//  /* controlled by record length */
-//    INT   			HelpContext;
-//    INT   			oHelpString;
-//    INT   			res9;         /* unknown (-1) */
-//    INT   			oCustData;        /* custom data for variable */
-//    INT   			HelpStringContext;
-} TLBVarRecord;
-
-/* Structure of the reference data  */
-typedef struct
-{
-    INT   			reftype;    /* either offset in type info table, then its */
-					    /* a multiple of 64 */
-					    /* or offset in the external reference table */
-					    /* with an offset of 1 */
-    INT   			flags;
-    INT   			oCustData;  /* custom data */
-    INT   			onext;      /* next offset, -1 if last */
-} TLBRefRecord;
-
-/* this is how a guid is stored */
-typedef struct
-{
-    GUID 			guid;
-    INT   			unk10;       /* differntiate with libid, classid etc? */
-					     /* its -2 for a libary */
-					     /* it's 0 for an interface */
-    INT   			unk14;       /* always? -1 */
-} TLBGuidEntry;
-
-/* some data preceding entries in the name table */
-typedef struct
-{
-    INT   			unk00;        /* sometimes -1 (lib, parameter) ,
-          			                 sometimes 0 (interface, func) */
-    INT   			unk02;        /* sometimes -1 (lib) , sometimes 0 (interface, func),
-						 sometime 0x10 (par) */
-    BYTE   			namelen;
-    BYTE   			unk04;
-    INT16   			unk05;
-    char			name[1];
-} TLBName;
-
-// String
-typedef struct
-{
-    INT16   			stringlen;
-    char			string[1];
-} TLBString;
-
-/* the custom data table directory has enties like this */
-typedef struct
-{
-    INT   			GuidOffset;
-    INT   			DataOffset;
-    INT   			next;     /* next offset in the table, -1 if its the last */
-} TLBCDGuid;
-
-// Typedef
-typedef struct
-{
-    INT16		rec0;
-    INT16		rec1;
-    INT16		rec2;
-    INT16		rec3;
-} TLBTypedesc;
-
-// Array
-typedef struct
-{
-    INT16		rec0;
-    INT16		rec1;
-    INT16		rec2;
-    INT16		rec3;
-} TLBArray;
-
-// ImpFile
-typedef struct
-{
-    INT			offGuid;
-    INT			unk4;
-    INT			unk8;
-    INT16		size;
-    char		name[1];
-} TLBImpFile;
-
-/*---------------------------END--------------------------------------------*/
-
-// Access macros
-
-// ======================================================================
-// Prototypes.
-// ======================================================================
-
-class TypeLibExtract
-{
-public:
-    TypeLibExtract(char * szName);
-    virtual ~TypeLibExtract();
-
-    ULONG	Type() const;
-    BOOL	Valid() const
-	{ return m_fValid; }
-
-    HRESULT MakeITypeLib(ITypeLibImpl * * ppObject);
-
-private:
-
-    ITypeLibImpl *	m_pITypeLib;		// Pointer to typelib resource...
-    BOOL		m_fFree;		// Set if we need to free m_pITypeLib
-    BOOL		m_fValid;
-    HANDLE		m_hHeap;		// Heap Handle
-    void *		m_pTypeLib;
-    TLB2Header *        m_pHeader;
-    ULONG *             m_pHelpStringOff;
-    ULONG *             m_pTypeInfoDir;
-    TLBSegDir *         m_pSegDir;
-
-    TLBTypeInfoBase *	m_pTypeInfo;		// Ptrs into the typelib resource
-    TLBImpInfo *	m_pImpInfo;
-    TLBImpFile *	m_pImpFile;
-    TLBRefRecord *	m_pRef;
-    GUID *         	m_pGUID;
-    TLBName *		m_pName;
-    TLBString *		m_pString;
-    TLBTypedesc *	m_pTypedesc;
-    TLBArray *		m_pArray;
-    void *		m_pCustData;
-    TLBCDGuid *		m_pCDGuid;
-    void *		m_pRes7;
-    void *		m_pResE;
-    void *		m_pResF;
-
-    BOOL	Read(HANDLE hFile, void * buffer, DWORD count, DWORD * pBytesRead, long where);
-    HRESULT	Load(char * szName);
-    HRESULT	EstablishPointers();
-
-    HRESULT	Parse();
-
-    // Helpers...
-    void	ParseGuid(int offset, GUID * pGuid);
-    void	ParseName(int offset, char * * ppName);
-    void	ParseString(int offset, char * * ppString);
-    void	ParseValue(int offset, VARIANT * pVar);
-    void	ParseArray(int offset, TLBArray * pArray);
-    void	ParseReference(int offset, TLBRefType * pNew);
-    void	ParseCustomData(int offset, oList<TLBCustData *> * pCustomData);
-    void	ParseTypeInfo(ITypeInfoImpl * pTypeInfo, TLBTypeInfoBase * pBase);
-    void	ParseMembers(ITypeInfoImpl * pTypeInfo, TLBTypeInfoBase * pBase);
-    void	ParseImplemented(ITypeInfoImpl * pTypeInfo, TLBTypeInfoBase * pBase);
-    void	GetTypedesc(int type, TYPEDESC * pTypedesc);
-
-};
-
-// ----------------------------------------------------------------------
-// ITypeLibImpl
-// ----------------------------------------------------------------------
-ITypeLibImpl *	ITypeLibImpl_Constructor();
-void	ITypeLibImpl_Destructor(ITypeLibImpl * This);
-
-HRESULT WIN32API ITypeLibImpl_QueryInterface(ITypeLib2 * iface,
-				REFIID riid, VOID **ppvObject);
-ULONG   WIN32API ITypeLibImpl_AddRef(ITypeLib2 * iface);
-ULONG   WIN32API ITypeLibImpl_Release(ITypeLib2 * iface);
-UINT    WIN32API ITypeLibImpl_GetTypeInfoCount(ITypeLib2 * iface);
-HRESULT WIN32API ITypeLibImpl_GetTypeInfo(ITypeLib2 * iface,
-				UINT index, ITypeInfo **ppTInfo);
-HRESULT WIN32API ITypeLibImpl_GetTypeInfoType(ITypeLib2 * iface,
-				UINT index, TYPEKIND *pTKind);
-HRESULT WIN32API ITypeLibImpl_GetTypeInfoOfGuid(ITypeLib2 * iface,
-				REFGUID guid, ITypeInfo **ppTinfo);
-HRESULT WIN32API ITypeLibImpl_GetLibAttr(ITypeLib2 * iface,
-				LPTLIBATTR *ppTLibAttr);
-HRESULT WIN32API ITypeLibImpl_GetTypeComp(ITypeLib2 * iface,
-				ITypeComp **ppTComp);
-HRESULT WIN32API ITypeLibImpl_GetDocumentation(ITypeLib2 * iface,
-				INT index, BSTR *pBstrName, BSTR *pBstrDocString,
-				DWORD *pdwHelpContext, BSTR *pBstrHelpFile);
-HRESULT WIN32API ITypeLibImpl_IsName(ITypeLib2 * iface,
-				LPOLESTR szNameBuf, ULONG lHashVal, BOOL *pfName);
-HRESULT WIN32API ITypeLibImpl_FindName(ITypeLib2 * iface,
-				LPOLESTR szNameBuf, ULONG lHashVal, ITypeInfo **ppTInfo,
-				MEMBERID *rgMemId, UINT16 *pcFound);
-VOID WIN32API ITypeLibImpl_ReleaseTLibAttr(ITypeLib2 * iface,
-				TLIBATTR *pTLibAttr);
-HRESULT WIN32API ITypeLib2Impl_GetCustData(ITypeLib2 * iface,
-				REFGUID guid, VARIANT *pVarVal);
-HRESULT WIN32API ITypeLib2Impl_GetLibStatistics(ITypeLib2 * iface,
-				ULONG *pcUniqueNames, ULONG *pcchUniqueNames);
-HRESULT WIN32API ITypeLib2Impl_GetDocumentation2(ITypeLib2 * iface,
-				INT index, LCID lcid, BSTR *pbstrHelpString,
-				DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll);
-HRESULT WIN32API ITypeLib2Impl_GetAllCustData(ITypeLib2 * iface,
-				CUSTDATA *pCustData);
-
-// ----------------------------------------------------------------------
-// ITypeInfoImpl
-// ----------------------------------------------------------------------
-ITypeInfoImpl *	ITypeInfoImpl_Constructor();
-void	ITypeInfoImpl_Destructor(ITypeInfoImpl * This);
-
-HRESULT WIN32API ITypeInfoImpl_QueryInterface(ITypeInfo2 * iface,
-				REFIID riid, VOID **ppvObject);
-ULONG   WIN32API ITypeInfoImpl_AddRef(ITypeInfo2 * iface);
-ULONG   WIN32API ITypeInfoImpl_Release(ITypeInfo2 * iface);
-HRESULT WIN32API ITypeInfoImpl_GetTypeAttr(ITypeInfo2 * iface,
-				LPTYPEATTR  *ppTypeAttr);
-HRESULT WIN32API ITypeInfoImpl_GetTypeComp(ITypeInfo2 * iface,
-				ITypeComp  * *ppTComp);
-HRESULT WIN32API ITypeInfoImpl_GetFuncDesc(ITypeInfo2 * iface,
-				UINT index, LPFUNCDESC  *ppFuncDesc);
-HRESULT WIN32API ITypeInfoImpl_GetVarDesc(ITypeInfo2 * iface,
-				UINT index, LPVARDESC  *ppVarDesc);
-HRESULT WIN32API ITypeInfoImpl_GetNames(ITypeInfo2 * iface,
-				MEMBERID memid, BSTR  *rgBstrNames,
-				UINT cMaxNames, UINT  *pcNames);
-HRESULT WIN32API ITypeInfoImpl_GetRefTypeOfImplType(ITypeInfo2 * iface,
-				UINT index, HREFTYPE  *pRefType);
-HRESULT WIN32API ITypeInfoImpl_GetImplTypeFlags(ITypeInfo2 * iface,
-				UINT index, INT  *pImplTypeFlags);
-HRESULT WIN32API ITypeInfoImpl_GetIDsOfNames(ITypeInfo2 * iface,
-				LPOLESTR  *rgszNames, UINT cNames, MEMBERID  *pMemId);
-HRESULT WIN32API ITypeInfoImpl_Invoke(ITypeInfo2 * iface,
-				VOID  *pIUnk, MEMBERID memid, UINT16 dwFlags,
-				DISPPARAMS  *pDispParams, VARIANT *pVarResult,
-				EXCEPINFO  *pExcepInfo, UINT  *pArgErr);
-HRESULT WIN32API ITypeInfoImpl_GetDocumentation(ITypeInfo2 * iface,
-				MEMBERID memid, BSTR  *pBstrName, BSTR  *pBstrDocString,
-				DWORD  *pdwHelpContext, BSTR  *pBstrHelpFile);
-HRESULT WIN32API ITypeInfoImpl_GetDllEntry(ITypeInfo2 * iface,
-				MEMBERID memid, INVOKEKIND invKind, BSTR  *pBstrDllName,
-				BSTR  *pBstrName, WORD  *pwOrdinal);
-HRESULT WIN32API ITypeInfoImpl_GetRefTypeInfo(ITypeInfo2 * iface,
-				HREFTYPE hRefType, ITypeInfo  * *ppTInfo);
-HRESULT WIN32API ITypeInfoImpl_AddressOfMember(ITypeInfo2 * iface,
-				MEMBERID memid, INVOKEKIND invKind, PVOID *ppv);
-HRESULT WIN32API ITypeInfoImpl_CreateInstance(ITypeInfo2 * iface,
-				IUnknown *pUnk, REFIID riid, VOID  * *ppvObj);
-HRESULT WIN32API ITypeInfoImpl_GetMops(ITypeInfo2 * iface,
-				MEMBERID memid, BSTR  *pBstrMops);
-HRESULT WIN32API ITypeInfoImpl_GetContainingTypeLib(ITypeInfo2 * iface,
-				ITypeLib  * *ppTLib, UINT  *pIndex);
-HRESULT WIN32API ITypeInfoImpl_ReleaseTypeAttr(ITypeInfo2 * iface,
-				TYPEATTR *pTypeAttr);
-HRESULT WIN32API ITypeInfoImpl_ReleaseFuncDesc(ITypeInfo2 * iface,
-				FUNCDESC *pFuncDesc);
-HRESULT WIN32API ITypeInfoImpl_ReleaseVarDesc(ITypeInfo2 * iface,
-				VARDESC *pVarDesc);
-HRESULT WIN32API ITypeInfo2Impl_GetTypeKind(ITypeInfo2 * iface,
-				TYPEKIND *pTypeKind);
-HRESULT WIN32API ITypeInfo2Impl_GetTypeFlags(ITypeInfo2 * iface,
-				UINT *pTypeFlags);
-HRESULT WIN32API ITypeInfo2Impl_GetFuncIndexOfMemId(ITypeInfo2 * iface,
-				MEMBERID memid, INVOKEKIND invKind, UINT *pFuncIndex);
-HRESULT WIN32API ITypeInfo2Impl_GetVarIndexOfMemId(ITypeInfo2 * iface,
-				MEMBERID memid, UINT *pVarIndex);
-HRESULT WIN32API ITypeInfo2Impl_GetCustData(ITypeInfo2 * iface,
-				REFGUID guid, VARIANT *pVarVal);
-HRESULT WIN32API ITypeInfo2Impl_GetFuncCustData(ITypeInfo2 * iface,
-				UINT index, REFGUID guid, VARIANT *pVarVal);
-HRESULT WIN32API ITypeInfo2Impl_GetParamCustData(ITypeInfo2 * iface,
-				UINT indexFunc, UINT indexParam, REFGUID guid, VARIANT *pVarVal);
-HRESULT WIN32API ITypeInfo2Impl_GetVarCustData(ITypeInfo2 * iface,
-				UINT index, REFGUID guid, VARIANT *pVarVal);
-HRESULT WIN32API ITypeInfo2Impl_GetImplTypeCustData(ITypeInfo2 * iface,
-				UINT index, REFGUID guid, VARIANT *pVarVal);
-HRESULT WIN32API ITypeInfo2Impl_GetDocumentation2(ITypeInfo2 * iface,
-				MEMBERID memid, LCID lcid, BSTR *pbstrHelpString,
-				DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll);
-HRESULT WIN32API ITypeInfo2Impl_GetAllCustData(ITypeInfo2 * iface,
-				CUSTDATA *pCustData);
-HRESULT WIN32API ITypeInfo2Impl_GetAllFuncCustData(ITypeInfo2 * iface,
-				UINT index, CUSTDATA *pCustData);
-HRESULT WIN32API ITypeInfo2Impl_GetAllParamCustData(ITypeInfo2 * iface,
-				UINT indexFunc, UINT indexParam, CUSTDATA *pCustData);
-HRESULT WIN32API ITypeInfo2Impl_GetAllVarCustData(ITypeInfo2 * iface,
-				UINT index, CUSTDATA *pCustData);
-HRESULT WIN32API ITypeInfo2Impl_GetAllImplTypeCustData(ITypeInfo2 * iface,
-				UINT index, CUSTDATA *pCustData);
-
-HRESULT WIN32API ITypeCompImpl_QueryInterface(LPTYPECOMP iface,
-				REFIID riid, VOID **ppvObject);
-ULONG   WIN32API ITypeCompImpl_AddRef(LPTYPECOMP iface);
-ULONG   WIN32API ITypeCompImpl_Release(LPTYPECOMP iface);
-HRESULT	WIN32API ITypeCompImpl_Bind(LPTYPECOMP iface,
-				LPOLESTR szName, ULONG lHashVal, WORD wFlags,
-				ITypeInfo** ppTInfo, DESCKIND* pDescKind, BINDPTR* pBindPtr);
-HRESULT	WIN32API ITypeCompImpl_BindType(LPTYPECOMP iface,
-				LPOLESTR szName, ULONG lHashVal, ITypeInfo** ppTInfo,
-				ITypeComp** ppTComp);
-
-// Helper functions
-extern BSTR DupAtoBstr(char * pAscii);
-
-#endif /* ITYPELIB_INCLUDED */
Index: trunk/src/oleaut32/safearray.c
===================================================================
--- trunk/src/oleaut32/safearray.c	(revision 6505)
+++ trunk/src/oleaut32/safearray.c	(revision 6507)
@@ -142,4 +142,6 @@
   ULONG  ulWholeArraySize;   /* to store the size of the whole thing */
 
+  dprintf(("SafeArrayAllocData %x", psa));
+
   if(! validArg(psa)) 
     return E_INVALIDARG;
@@ -170,4 +172,6 @@
   HRESULT   hRes;
   USHORT    cDim;
+
+  dprintf(("SafeArrayCreate %x %d %x", vt, cDims, rgsabound));
 
   /* Validate supported VARTYPE */
@@ -210,4 +214,6 @@
   SAFEARRAY *psa)
 {
+  dprintf(("SafeArrayDestroyDescriptor %x", psa));
+
   /* Check for lockness before to free... */
   if(psa->cLocks > 0) 
@@ -233,4 +239,6 @@
   SAFEARRAY *psa)
 {
+  dprintf(("SafeArrayLock %x", psa));
+
   if(! validArg(psa))     
     return E_INVALIDARG;
@@ -248,4 +256,6 @@
   SAFEARRAY *psa)
 {
+  dprintf(("SafeArrayUnlock %x", psa));
+
   if(! validArg(psa)) 
     return E_INVALIDARG;
@@ -271,4 +281,6 @@
   PVOID elementStorageAddress = NULL; /* Adress to store the data */
   BSTR  pbstrReAllocStr     = NULL; /* BSTR reallocated */
+
+  dprintf(("SafeArrayPutElement %x %x %x", psa, rgIndices, pv));
 
   /* Validate the index given */
@@ -328,4 +340,6 @@
   PVOID elementStorageAddress = NULL; /* Adress to store the data */
   BSTR  pbstrReturnedStr    = NULL; /* BSTR reallocated */
+
+  dprintf(("SafeArrayGetElement %x %x %x", psa, rgIndices, pv));
 
   if(! validArg(psa)) 
@@ -373,4 +387,7 @@
   LONG      *plUbound)
 {
+
+  dprintf(("SafeArrayGetUBound %x %x %x", psa, nDim, plUbound));
+
   if(! validArg(psa))   
     return E_INVALIDARG;
@@ -791,5 +808,4 @@
   /* Check whether the size of the chunk makes sense... That's the only thing
      I can think of now... */
-
   psaSize = HeapSize(GetProcessHeap(), 0, psa);
   if (psaSize == -1)
Index: trunk/src/oleaut32/typelib.h
===================================================================
--- trunk/src/oleaut32/typelib.h	(revision 6507)
+++ trunk/src/oleaut32/typelib.h	(revision 6507)
@@ -0,0 +1,237 @@
+/*
+ * typelib.h  internal wine data structures
+ * used to decode typelib's
+ *
+ * Copyright 1999 Rein KLazes
+ *  
+ */
+#ifndef _WINE_TYPELIB_H
+#define _WINE_TYPELIB_H
+
+#include "oleauto.h"
+#include "wine/windef16.h"
+
+#define TLBMAGIC2 "MSFT"
+#define TLBMAGIC1 "SLTG"
+#define HELPDLLFLAG (0x0100)
+#define DO_NOT_SEEK (-1)
+
+#define HREFTYPE_INTHISFILE(href) (!((href) & 3))
+#define HREFTYPE_INDEX(href) ((href) /sizeof(TLBTypeInfoBase))
+
+/*-------------------------FILE STRUCTURES-----------------------------------*/
+
+
+/*
+ * structure of the typelib type2 header
+ * it is at the beginning of a type lib file
+ *  
+ */
+typedef struct tagTLB2Header {
+/*0x00*/INT magic1;       /* 0x5446534D "MSFT" */
+        INT   magic2;       /* 0x00010002 version nr? */
+        INT   posguid;      /* position of libid in guid table  */
+                            /* (should be,  else -1) */
+        INT   lcid;         /* locale id */
+/*0x10*/INT   lcid2;
+        INT   varflags;     /* (largely) unknown flags ,seems to be always 41 */
+                            /* becomes 0x51 with a helpfile defined */
+                            /* if help dll defined its 0x151 */
+                            /* update : the lower nibble is syskind */
+        INT   version;      /* set with SetVersion() */
+        INT   flags;        /* set with SetFlags() */
+/*0x20*/INT   nrtypeinfos;  /* number of typeinfo's (till so far) */
+        INT   helpstring;   /* position of help string in stringtable */
+        INT   helpstringcontext;
+        INT   helpcontext;
+/*0x30*/INT   nametablecount;   /* number of names in name table */
+        INT   nametablechars;   /* nr of characters in name table */
+        INT   NameOffset;       /* offset of name in name table */
+        INT   helpfile;         /* position of helpfile in stringtable */
+/*0x40*/INT   CustomDataOffset; /* if -1 no custom data, else it is offset */
+                                /* in customer data/guid offset table */
+        INT   res44;            /* unknown always: 0x20 */
+        INT   res48;            /* unknown always: 0x80 */
+        INT   dispatchpos;      /* gets a value (1+n*0x0c) with Idispatch interfaces */
+/*0x50*/INT   res50;            /* is zero becomes one when an interface is derived */
+} TLB2Header;
+
+/* segments in the type lib file have a structure like this: */
+typedef struct _tptag {
+        INT   offset;       /* absolute offset in file */
+        INT   length;       /* length of segment */
+        INT   res08;        /* unknown always -1 */
+        INT   res0c;        /* unknown always 0x0f in the header */
+                            /* 0x03 in the typeinfo_data */
+} pSeg;
+
+/* layout of the main segment directory */
+typedef struct tagTLBSegDir {
+/*1*/pSeg pTypeInfoTab; /* each type info get an entry of 0x64 bytes */
+                        /* (25 ints) */
+/*2*/pSeg pImpInfo;     /* table with info for imported types */
+/*3*/pSeg pImpFiles;    /* import libaries */
+/*4*/pSeg pRefTab;      /* References table */
+/*5*/pSeg pLibtab;      /* always exists, alway same size (0x80) */
+                        /* hash table w offsets to guid????? */
+/*6*/pSeg pGuidTab;     /* all guids are stored here together with  */
+                        /* offset in some table???? */
+/*7*/pSeg res07;        /* always created, alway same size (0x200) */
+                        /* purpose largely unknown */
+/*8*/pSeg pNametab;     /* name tables */
+/*9*/pSeg pStringtab;   /*string table */
+/*A*/pSeg pTypdescTab;  /* table with type descriptors */
+/*B*/pSeg pArrayDescriptions;
+/*C*/pSeg pCustData;    /*  data table, used for custom data and default */
+                        /* parameter values */
+/*D*/pSeg pCDGuids;     /* table with offsets for the guids and into the customer data table */
+/*E*/pSeg res0e;            /* unknown */
+/*F*/pSeg res0f;            /* unknown  */
+} TLBSegDir;
+
+
+/* base type info data */
+typedef struct tagTLBTypeInfoBase {
+/*000*/ INT   typekind;             /*  it is the TKIND_xxx */
+                                    /* some byte alignment stuf */
+        INT     memoffset;          /* points past the file, if no elements */
+        INT     res2;               /* zero if no element, N*0x40 */
+        INT     res3;               /* -1 if no lement, (N-1)*0x38 */
+/*010*/ INT     res4;               /* always? 3 */
+        INT     res5;               /* always? zero */
+        INT     cElement;           /* counts elements, HI=cVars, LO=cFuncs */
+        INT     res7;               /* always? zero */
+/*020*/ INT     res8;               /* always? zero */
+        INT     res9;               /* always? zero */
+        INT     resA;               /* always? zero */
+        INT     posguid;            /* position in guid table */
+/*030*/ INT     flags;              /* Typeflags */
+        INT     NameOffset;         /* offset in name table */
+        INT     version;            /* element version */
+        INT     docstringoffs;      /* offset of docstring in string tab */
+/*040*/ INT     helpstringcontext;  /*  */
+        INT     helpcontext;    /* */
+        INT     oCustData;          /* offset in customer data table */
+        INT16   cImplTypes;     /* nr of implemented interfaces */
+        INT16   cbSizeVft;      /* virtual table size, not including inherits */
+/*050*/ INT     size;           /* size in bytes, at least for structures */
+        /* fixme: name of this field */
+        INT     datatype1;      /* position in type description table */
+                                /* or in base intefaces */
+                                /* if coclass: offset in reftable */
+                                /* if interface: reference to inherited if */
+        INT     datatype2;      /* if 0x8000, entry above is valid */
+                                /* actually dunno */
+                                /* else it is zero? */
+        INT     res18;          /* always? 0 */
+/*060*/ INT     res19;          /* always? -1 */
+    } TLBTypeInfoBase;
+
+/* layout of an entry with information on imported types */
+typedef struct tagTLBImpInfo {
+    INT     res0;           /* unknown */
+    INT     oImpFile;       /* offset inthe Import File table */
+    INT     oGuid;          /* offset in Guid table */
+    } TLBImpInfo;
+
+/* function description data */
+typedef struct {
+/*  INT   recsize;       record size including some xtra stuff */
+    INT   DataType;     /* data type of the memeber, eg return of function */
+    INT   Flags;        /* something to do with attribute flags (LOWORD) */
+    INT16 VtableOffset; /* offset in vtable */
+    INT16 res3;         /* some offset into dunno what */
+    INT   FKCCIC;       /* bit string with the following  */
+                        /* meaning (bit 0 is the msb): */
+                        /* bit 2 indicates that oEntry is numeric */
+                        /* bit 3 that parameter has default values */
+                        /* calling convention (bits 4-7 ) */
+                        /* bit 8 indicates that custom data is present */
+                        /* Invokation kind (bits 9-12 ) */
+                        /* function kind (eg virtual), bits 13-15  */
+    INT16 nrargs;       /* number of arguments (including optional ????) */
+    INT16 nroargs;      /* nr of optional arguments */
+    /* optional attribute fields, the number of them is variable */
+    INT   OptAttr[1];
+/*
+0*  INT   helpcontext;
+1*  INT   oHelpString;
+2*  INT   oEntry;       // either offset in string table or numeric as it is //
+3*  INT   res9;         // unknown (-1) //
+4*  INT   resA;         // unknown (-1) //
+5*  INT   HelpStringContext;
+    // these are controlled by a bit set in the FKCCIC field  //
+6*  INT   oCustData;        // custom data for function //
+7*  INT   oArgCustData[1];  // custom data per argument //
+*/
+} TLBFuncRecord;
+
+/* after this may follow an array with default value pointers if the 
+ * appropriate bit in the FKCCIC field has been set: 
+ * INT   oDefautlValue[nrargs];
+ */
+
+    /* Parameter info one per argument*/
+typedef struct {
+        INT   DataType;
+        INT   oName;
+        INT   Flags;
+    } TLBParameterInfo;
+
+/* Variable description data */
+typedef struct {
+/*  INT   recsize;      // record size including some xtra stuff */
+    INT   DataType;     /* data type of the variable */
+    INT   Flags;        /* VarFlags (LOWORD) */
+    INT16 VarKind;      /* VarKind */
+    INT16 res3;         /* some offset into dunno what */
+    INT   OffsValue;    /* value of the variable or the offset  */
+                        /* in the data structure */
+    /* optional attribute fields, the number of them is variable */
+    /* controlled by record length */
+    INT   HelpContext;
+    INT   oHelpString;
+    INT   res9;         /* unknown (-1) */
+    INT   oCustData;        /* custom data for variable */
+    INT   HelpStringContext;
+
+} TLBVarRecord;
+
+/* Structure of the reference data  */
+typedef struct {
+    INT   reftype;  /* either offset in type info table, then its */
+                    /* a multiple of 64 */
+                    /* or offset in the external reference table */
+                    /* with an offset of 1 */
+    INT   flags;
+    INT   oCustData;    /* custom data */
+    INT   onext;    /* next offset, -1 if last */
+} TLBRefRecord;
+
+/* this is how a guid is stored */
+typedef struct {
+    GUID guid;
+    INT   unk10;        /* differntiate with libid, classid etc? */
+                        /* its -2 for a libary */
+                        /* it's 0 for an interface */
+    INT   unk14;        /* always? -1 */
+} TLBGuidEntry;
+/* some data preceding entries in the name table */
+typedef struct {
+    INT   unk00;        /* sometimes -1 (lib, parameter) ,
+                           sometimes 0 (interface, func) */
+    INT   unk10;        /* sometimes -1 (lib) , sometimes 0 (interface, func),
+                           sometime 0x10 (par) */
+    INT   namelen;      /* only lower 8 bits are valid */
+} TLBNameIntro;
+/* the custom data table directory has enties like this */
+typedef struct {
+    INT   GuidOffset;
+    INT   DataOffset;
+    INT   next;     /* next offset in the table, -1 if its the last */
+} TLBCDGuid;
+
+
+
+/*---------------------------END--------------------------------------------*/
+#endif
Index: trunk/src/oleaut32/variant.c
===================================================================
--- trunk/src/oleaut32/variant.c	(revision 6505)
+++ trunk/src/oleaut32/variant.c	(revision 6507)
@@ -48,16 +48,4 @@
 
 DEFAULT_DEBUG_CHANNEL(ole);
-
-#ifdef __WIN32OS2__
-#undef FIXME
-#undef TRACE
-#ifdef DEBUG
-#define FIXME WriteLogNoEOL("FIXME %s: ", __FUNCTION__); WriteLog
-#define TRACE WriteLogNoEOL("%s", __FUNCTION__); WriteLog
-#else
-#define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
-#define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
-#endif
-#endif
 
 #ifndef FLT_MAX
