//+--------------------------------------------------------------------------
//
//  Copyright (C) 1994, Microsoft Corporation.  All Rights Reserved.
//
//  File:       Wrapper.h
//
//  Contents:   ANSI Wrappers for Unicode CompObj Interfaces and APIs.
//
//  Functions:  WrapIStorageW
//
//  History:    01-Nov-93   v-kentc     Created.
//
//---------------------------------------------------------------------------


//
//  Define wrapper prototypes.
//
IDINTERFACE WrapTranslateIID(REFIID riid);

LPUNKNOWN WrapAnyAFromW(LPUNKNOWN, IDINTERFACE, LPUNKNOWN);
LPUNKNOWN WrapAnyWFromA(LPUNKNOWN, IDINTERFACE, LPUNKNOWN);

HRESULT WrapInterfaceAFromW(IDINTERFACE idRef, LPUNKNOWN pobj, LPUNKNOWN * ppobjA);
HRESULT WrapInterfaceWFromA(IDINTERFACE idRef, LPUNKNOWN pobjA, LPUNKNOWN * ppobj);

STDAPI WrapIUnknownAFromW(LPUNKNOWN pobj, LPUNKNOWN * ppobjA);
STDAPI WrapIUnknownWFromA(LPUNKNOWN pobjA, LPUNKNOWN * ppobj);

HRESULT WrapIClassFactoryAFromW(LPCLASSFACTORY pobj, LPCLASSFACTORYA * ppobjA);
HRESULT WrapIClassFactoryWFromA(LPCLASSFACTORYA pobjA, LPCLASSFACTORY * ppobj);
HRESULT WrapIMarshalAFromW(LPMARSHAL pobj, LPMARSHALA * ppobjA);
HRESULT WrapIMarshalWFromA(LPMARSHALA pobjA, LPMARSHAL * ppobj);
HRESULT WrapIEnumStringAFromW(LPENUMSTRING pobj, LPENUMSTRINGA * ppobjA);
HRESULT WrapIEnumStringWFromA(LPENUMSTRINGA pobjA, LPENUMSTRING * ppobj);
HRESULT WrapIEnumFORMATETCAFromW(LPENUMFORMATETC pobj, LPENUMFORMATETCA * ppobjA);
HRESULT WrapIEnumFORMATETCWFromA(LPENUMFORMATETCA pobjA, LPENUMFORMATETC * ppobj);
HRESULT WrapIEnumSTATSTGAFromW(LPENUMSTATSTG pobj, LPENUMSTATSTGA * ppobjA);
HRESULT WrapIEnumSTATSTGWFromA(LPENUMSTATSTGA pobjA, LPENUMSTATSTG * ppobj);
HRESULT WrapILockBytesAFromW(LPLOCKBYTES pobj, LPLOCKBYTESA * ppobjA);
HRESULT WrapILockBytesWFromA(LPLOCKBYTESA pobjA, LPLOCKBYTES * ppobj);
HRESULT WrapIStreamAFromW(LPSTREAM pobj, LPSTREAMA * ppobjA);
HRESULT WrapIStreamWFromA(LPSTREAMA pobjA, LPSTREAM * ppobj);
STDAPI  WrapIStorageAFromW(LPSTORAGE pobj, LPSTORAGEA * ppobjA);
STDAPI  WrapIStorageWFromA(LPSTORAGEA pobjA, LPSTORAGE * ppobj);
HRESULT WrapIRootStorageAFromW(LPROOTSTORAGE pobj, LPROOTSTORAGEA * ppobjA);
HRESULT WrapIRootStorageWFromA(LPROOTSTORAGEA pobjA, LPROOTSTORAGE * ppobj);
HRESULT WrapIBindCtxAFromW(LPBINDCTX pobj, LPBINDCTXA * ppobjA);
HRESULT WrapIBindCtxWFromA(LPBINDCTXA pobjA, LPBINDCTX * ppobj);
HRESULT WrapIMonikerAFromW(LPMONIKER pobj, LPMONIKERA * ppobjA);
HRESULT WrapIMonikerWFromA(LPMONIKERA pobjA, LPMONIKER * ppobj);
HRESULT WrapIRunningObjectTableAFromW(LPRUNNINGOBJECTTABLE pobj, LPRUNNINGOBJECTTABLEA * ppobjA);
HRESULT WrapIRunningObjectTableWFromA(LPRUNNINGOBJECTTABLEA pobjA, LPRUNNINGOBJECTTABLE * ppobj);
HRESULT WrapIEnumMonikerAFromW(LPENUMMONIKER pobj, LPENUMMONIKERA * ppobjA);
HRESULT WrapIEnumMonikerWFromA(LPENUMMONIKERA pobjA, LPENUMMONIKER * ppobj);
HRESULT WrapIEnumSTATDATAAFromW(LPENUMSTATDATA pobj, LPENUMSTATDATAA * ppobjA);
HRESULT WrapIEnumSTATDATAWFromA(LPENUMSTATDATAA pobjA, LPENUMSTATDATA * ppobj);
HRESULT WrapIDataObjectAFromW(LPDATAOBJECT pobj, LPDATAOBJECTA * ppobjA);
HRESULT WrapIDataObjectWFromA(LPDATAOBJECTA pobjA, LPDATAOBJECT * ppobj);
HRESULT WrapIViewObjectAFromW(LPVIEWOBJECT pobj, LPVIEWOBJECTA * ppobjA);
HRESULT WrapIViewObjectWFromA(LPVIEWOBJECTA pobjA, LPVIEWOBJECT * ppobj);
HRESULT WrapIViewObject2AFromW(LPVIEWOBJECT2 pobj, LPVIEWOBJECT2A * ppobjA);
HRESULT WrapIViewObject2WFromA(LPVIEWOBJECT2A pobjA, LPVIEWOBJECT2 * ppobj);
HRESULT WrapIAdviseSinkAFromW(LPADVISESINK pobj, LPADVISESINKA * ppobjA);
HRESULT WrapIAdviseSinkWFromA(LPADVISESINKA pobjA, LPADVISESINK * ppobj);
HRESULT WrapIAdviseSink2AFromW(LPADVISESINK2 pobj, LPADVISESINK2A * ppobjA);
HRESULT WrapIAdviseSink2WFromA(LPADVISESINK2A pobjA, LPADVISESINK2 * ppobj);
HRESULT WrapIDataAdviseHolderAFromW(LPDATAADVISEHOLDER pobj, LPDATAADVISEHOLDERA * ppobjA);
HRESULT WrapIDataAdviseHolderWFromA(LPDATAADVISEHOLDERA pobjA, LPDATAADVISEHOLDER * ppobj);
HRESULT WrapIOleCacheAFromW(LPOLECACHE pobj, LPOLECACHEA * ppobjA);
HRESULT WrapIOleCacheWFromA(LPOLECACHEA pobjA, LPOLECACHE * ppobj);
HRESULT WrapIOleCache2AFromW(LPOLECACHE2 pobj, LPOLECACHE2A * ppobjA);
HRESULT WrapIOleCache2WFromA(LPOLECACHE2A pobjA, LPOLECACHE2 * ppobj);
HRESULT WrapIOleCacheControlAFromW(LPOLECACHECONTROL pobj, LPOLECACHECONTROLA * ppobjA);
HRESULT WrapIOleCacheControlWFromA(LPOLECACHECONTROLA pobjA, LPOLECACHECONTROL * ppobj);
HRESULT WrapIDropTargetAFromW(LPDROPTARGET pobj, LPDROPTARGETA * ppobjA);
HRESULT WrapIDropTargetWFromA(LPDROPTARGETA pobjA, LPDROPTARGET * ppobj);
HRESULT WrapIPersistAFromW(LPPERSIST pobj, LPPERSIST * ppobjA);
HRESULT WrapIPersistWFromA(LPPERSIST pobjA, LPPERSIST * ppobj);
HRESULT WrapIPersistStorageAFromW(LPPERSISTSTORAGE pobj, LPPERSISTSTORAGEA * ppobjA);
HRESULT WrapIPersistStorageWFromA(LPPERSISTSTORAGEA pobjA, LPPERSISTSTORAGE * ppobj);
HRESULT WrapIPersistStreamAFromW(LPPERSISTSTREAM pobj, LPPERSISTSTREAMA * ppobjA);
HRESULT WrapIPersistStreamWFromA(LPPERSISTSTREAMA pobjA, LPPERSISTSTREAM * ppobj);
HRESULT WrapIPersistFileAFromW(LPPERSISTFILE pobj, LPPERSISTFILEA * ppobjA);
HRESULT WrapIPersistFileWFromA(LPPERSISTFILEA pobjA, LPPERSISTFILE * ppobj);
HRESULT WrapIEnumOLEVERBAFromW(LPENUMOLEVERB pobj, LPENUMOLEVERBA * ppobjA);
HRESULT WrapIEnumOLEVERBWFromA(LPENUMOLEVERBA pobjA, LPENUMOLEVERB * ppobj);
HRESULT WrapIOleObjectAFromW(LPOLEOBJECT pobj, LPOLEOBJECTA * ppobjA);
HRESULT WrapIOleObjectWFromA(LPOLEOBJECTA pobjA, LPOLEOBJECT * ppobj);
HRESULT WrapIOleClientSiteAFromW(LPOLECLIENTSITE pobj, LPOLECLIENTSITEA * ppobjA);
HRESULT WrapIOleClientSiteWFromA(LPOLECLIENTSITEA pobjA, LPOLECLIENTSITE * ppobj);
HRESULT WrapIRunnableObjectAFromW(LPRUNNABLEOBJECT pobj, LPRUNNABLEOBJECTA * ppobjA);
HRESULT WrapIRunnableObjectWFromA(LPRUNNABLEOBJECTA pobjA, LPRUNNABLEOBJECT * ppobj);
HRESULT WrapIParseDisplayNameAFromW(LPPARSEDISPLAYNAME pobj, LPPARSEDISPLAYNAMEA * ppobjA);
HRESULT WrapIParseDisplayNameWFromA(LPPARSEDISPLAYNAMEA pobjA, LPPARSEDISPLAYNAME * ppobj);
HRESULT WrapIOleContainerAFromW(LPOLECONTAINER pobj, LPOLECONTAINERA * ppobjA);
HRESULT WrapIOleContainerWFromA(LPOLECONTAINERA pobjA, LPOLECONTAINER * ppobj);
HRESULT WrapIOleItemContainerAFromW(LPOLEITEMCONTAINER pobj, LPOLEITEMCONTAINERA * ppobjA);
HRESULT WrapIOleItemContainerWFromA(LPOLEITEMCONTAINERA pobjA, LPOLEITEMCONTAINER * ppobj);
HRESULT WrapIOleAdviseHolderAFromW(LPOLEADVISEHOLDER pobj, LPOLEADVISEHOLDERA * ppobjA);
HRESULT WrapIOleAdviseHolderWFromA(LPOLEADVISEHOLDERA pobjA, LPOLEADVISEHOLDER * ppobj);
HRESULT WrapIOleLinkAFromW(LPOLELINK pobj, LPOLELINKA * ppobjA);
HRESULT WrapIOleLinkWFromA(LPOLELINKA pobjA, LPOLELINK * ppobj);
HRESULT WrapIOleInPlaceActiveObjectAFromW(LPOLEINPLACEACTIVEOBJECT pobj, LPOLEINPLACEACTIVEOBJECTA * ppobjA);
HRESULT WrapIOleInPlaceActiveObjectWFromA(LPOLEINPLACEACTIVEOBJECTA pobjA, LPOLEINPLACEACTIVEOBJECT * ppobj);
HRESULT WrapIOleInPlaceUIWindowAFromW(LPOLEINPLACEUIWINDOW pobj, LPOLEINPLACEUIWINDOWA * ppobjA);
HRESULT WrapIOleInPlaceUIWindowWFromA(LPOLEINPLACEUIWINDOWA pobjA, LPOLEINPLACEUIWINDOW * ppobj);
HRESULT WrapIOleInPlaceFrameAFromW(LPOLEINPLACEFRAME pobj, LPOLEINPLACEFRAMEA * ppobjA);
HRESULT WrapIOleInPlaceFrameWFromA(LPOLEINPLACEFRAMEA pobjA, LPOLEINPLACEFRAME * ppobj);
HRESULT WrapIOleInPlaceSiteAFromW(LPOLEINPLACESITE pobj, LPOLEINPLACESITEA * ppobjA);
HRESULT WrapIOleInPlaceSiteWFromA(LPOLEINPLACESITEA pobjA, LPOLEINPLACESITE * ppobj);

HRESULT WrapITypeLibAFromW(LPTYPELIB, LPTYPELIBA *);
HRESULT WrapITypeLibWFromA(LPTYPELIBA, LPTYPELIB *);
HRESULT WrapITypeInfoAFromW(LPTYPEINFO, LPTYPEINFOA *);
HRESULT WrapITypeInfoWFromA(LPTYPEINFOA, LPTYPEINFO *);
HRESULT WrapITypeCompAFromW(LPTYPECOMP, LPTYPECOMPA *);
HRESULT WrapITypeCompWFromA(LPTYPECOMPA, LPTYPECOMP *);
HRESULT WrapICreateTypeLibAFromW(LPCREATETYPELIB, LPCREATETYPELIBA *);
HRESULT WrapICreateTypeLibWFromA(LPCREATETYPELIBA, LPCREATETYPELIB *);
HRESULT WrapICreateTypeInfoAFromW(LPCREATETYPEINFO, LPCREATETYPEINFOA *);
HRESULT WrapICreateTypeInfoWFromA(LPCREATETYPEINFOA, LPCREATETYPEINFO *);
HRESULT WrapIEnumVARIANTAFromW(LPENUMVARIANT, LPENUMVARIANTA *);
HRESULT WrapIEnumVARIANTWFromA(LPENUMVARIANTA, LPENUMVARIANT *);
STDAPI  WrapIDispatchAFromW(LPDISPATCH, LPDISPATCHA *);
STDAPI  WrapIDispatchWFromA(LPDISPATCHA, LPDISPATCH *);
#ifndef NOERRORINFO
HRESULT WrapIErrorInfoAFromW(IErrorInfo *pobj, IErrorInfoA **ppobjA);
HRESULT WrapIErrorInfoWFromA(IErrorInfoA *pbojA, IErrorInfo **ppobj);
HRESULT WrapICreateErrorInfoAFromW(ICreateErrorInfo *pobj, ICreateErrorInfoA **ppobjA);
HRESULT WrapICreateErrorInfoWFromA(ICreateErrorInfoA *pbojA, ICreateErrorInfo **ppobj);
#endif //!NOERRORINFO

VOID    WrapDeleteWrapper(LPUNKNOWN);

BOOL    WrapInit(VOID);
VOID    WrapCleanup(VOID);
