/*
 * Copyright (C) 2004 TransGaming Technologies
 *
 * All interfaces that are in the windows version of urlmon.idl are here,
 * however a large number of the cpp_quote defines/structs/functions etc
 * have been removed for cleanliness.
 */

#if defined(UNIX) || defined(__WIDL__)
typedef unsigned long HANDLE_PTR;
#endif

import "objidl.idl";
import "oleidl.idl";
import "servprov.idl";
/*import "msxml.idl";*/

interface IPersistMoniker;
interface IBindProtocol;
interface IBinding;
interface IBindStatusCallback;
interface IBindStatusCallbackMsg;
interface IAuthenticate;
interface IWindowForBindingUI;
interface ICodeInstall;
interface IHttpNegotiate;
interface IHttpNegotiate2;

cpp_quote("#define MK_S_ASYNCHRONOUS                0x000401E8")
cpp_quote("#define S_ASYNCHRONOUS                   MK_S_ASYNCHRONOUS")

cpp_quote("#define INET_E_ERROR_FIRST               0x800C0002L")
cpp_quote("#define INET_E_INVALID_URL               0x800C0002L")
cpp_quote("#define INET_E_NO_SESSION                0x800C0003L")
cpp_quote("#define INET_E_CANNOT_CONNECT            0x800C0004L")
cpp_quote("#define INET_E_RESOURCE_NOT_FOUND        0x800C0005L")
cpp_quote("#define INET_E_OBJECT_NOT_FOUND          0x800C0006L")
cpp_quote("#define INET_E_DATA_NOT_AVAILABLE        0x800C0007L")
cpp_quote("#define INET_E_DOWNLOAD_FAILURE          0x800C0008L")
cpp_quote("#define INET_E_AUTHENTICATION_REQUIRED   0x800C0009L")
cpp_quote("#define INET_E_NO_VALID_MEDIA            0x800C000AL")
cpp_quote("#define INET_E_CONNECTION_TIMEOUT        0x800C000BL")
cpp_quote("#define INET_E_INVALID_REQUEST           0x800C000CL")
cpp_quote("#define INET_E_UNKNOWN_PROTOCOL          0x800C000DL")
cpp_quote("#define INET_E_SECURITY_PROBLEM          0x800C000EL")
cpp_quote("#define INET_E_CANNOT_LOAD_DATA          0x800C000FL")
cpp_quote("#define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L")
cpp_quote("#define INET_E_QUERYOPTION_UNKNOWN       0x800C0013L")
cpp_quote("#define INET_E_REDIRECT_FAILED           0x800C0014L")
cpp_quote("#define INET_E_REDIRECT_TO_DIR           0x800C0015L")
cpp_quote("#define INET_E_CANNOT_LOCK_REQUEST       0x800C0016L")
cpp_quote("#define INET_E_ERROR_LAST                INET_E_REDIRECT_TO_DIR")

cpp_quote("HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk);")
cpp_quote("HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbsc, DWORD dwReserved);")
cpp_quote("HRESULT WINAPI CompareSecurityIds(BYTE*,DWORD,BYTE*,DWORD,DWORD);")
/*cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN pCaller, LPCSTR szURL,  LPCSTR  szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")
cpp_quote("HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")*/
cpp_quote("HRESULT WINAPI CoInternetGetSession(DWORD,/*IInternetSession*/void**,DWORD);")
cpp_quote("HRESULT WINAPI MkParseDisplayNameEx(IBindCtx*,LPCWSTR,ULONG*,IMoniker**);")
cpp_quote("HRESULT WINAPI IsAsyncMoniker(IMoniker* pmk);")
cpp_quote("HRESULT WINAPI CreateAsyncBindCtx(DWORD, IBindStatusCallback*, IEnumFORMATETC*, IBindCtx**);")


/*****************************************************************************
 * Interface: IPersistMoniker
 */

[
        object,
        uuid(79eac9c9-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IPersistMoniker : IUnknown
{
    typedef [unique] IPersistMoniker *LPPERSISTMONIKER;

    HRESULT GetClassID(
        [out] CLSID *pClassID
        );

    HRESULT IsDirty(void);

    HRESULT Load(
        [in] BOOL fFullyAvailable,
        [in] IMoniker * pimkName,
        [in] LPBC pibc,
        [in] DWORD grfMode
        );

    HRESULT Save(
        [in] IMoniker * pimkName,
        [in] LPBC pbc,
        [in] BOOL fRemember);

    HRESULT SaveCompleted(
        [in] IMoniker * pimkName,
        [in] LPBC pibc);

    HRESULT GetCurMoniker(
        [out] IMoniker ** ppimkName);
}

/*****************************************************************************
 * Interface: IMonikerProp
 */

[
        object,
        uuid(a5ca5f7f-1847-4d87-9c5b-918509f7511d),
        pointer_default(unique)
]
interface IMonikerProp : IUnknown
{
    typedef [unique] IMonikerProp *LPMONIKERPROP;

    typedef enum {
        MIMETYPEPROP  = 0x00000000
    } MONIKERPROPERTY;

    HRESULT PutProperty (
        [in] MONIKERPROPERTY mkp,
        [in] LPCWSTR val
    );
}

/*****************************************************************************
 * Interface: IBindProtocol
 */

[
        local,
        object,
        uuid(79eac9cd-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IBindProtocol : IUnknown
{
        typedef [unique] IBindProtocol *LPBINDPROTOCOL;

        HRESULT CreateBinding(
                [in] LPCWSTR szUrl,
                [in] IBindCtx *pbc,
                [out] IBinding ** ppb);
}

/*****************************************************************************
 * Interface: IBinding
 */

[
        object,
        uuid(79eac9c0-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IBinding: IUnknown
{
        typedef [unique] IBinding *LPBINDING;

        HRESULT Abort();

        HRESULT Suspend();

        HRESULT Resume();

        HRESULT SetPriority(
                [in] LONG nPriority);

        HRESULT GetPriority(
                [out] LONG * pnPriority);

        [local]
        HRESULT GetBindResult(
                [out]       CLSID *pclsidProtocol,
                [out]       DWORD *pdwResult,
                [out]       LPOLESTR *pszResult,
                [in, out]   DWORD   *pdwReserved);

        [call_as(GetBindResult)]
        HRESULT RemoteGetBindResult(
                [out]   CLSID       *pclsidProtocol,
                [out]   DWORD       *pdwResult,
                [out]   LPOLESTR    *pszResult,
                [in]    DWORD       dwReserved);

}

/*****************************************************************************
 * Interface: IBindStatusCallback
 */

[
        object,
        uuid(79eac9c1-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IBindStatusCallback: IUnknown
{
        typedef [unique] IBindStatusCallback *LPBINDSTATUSCALLBACK;

        typedef enum
        {
            BINDVERB_GET       = 0x00000000,
            BINDVERB_POST      = 0x00000001,
            BINDVERB_PUT       = 0x00000002,
            BINDVERB_CUSTOM    = 0x00000003,
        } BINDVERB;

        typedef enum
        {
            BINDINFOF_URLENCODESTGMEDDATA   = 0x00000001,
            BINDINFOF_URLENCODEDEXTRAINFO   = 0x00000002,
        } BINDINFOF;

        typedef enum
        {
             BINDF_ASYNCHRONOUS              = 0x00000001
            ,BINDF_ASYNCSTORAGE              = 0x00000002
            ,BINDF_NOPROGRESSIVERENDERING    = 0x00000004
            ,BINDF_OFFLINEOPERATION          = 0x00000008
            ,BINDF_GETNEWESTVERSION          = 0x00000010
            ,BINDF_NOWRITECACHE              = 0x00000020
            ,BINDF_NEEDFILE                  = 0x00000040
            ,BINDF_PULLDATA                  = 0x00000080
            ,BINDF_IGNORESECURITYPROBLEM     = 0x00000100
            ,BINDF_RESYNCHRONIZE             = 0x00000200
            ,BINDF_HYPERLINK                 = 0x00000400
            ,BINDF_NO_UI                     = 0x00000800
            ,BINDF_SILENTOPERATION           = 0x00001000
            ,BINDF_PRAGMA_NO_CACHE           = 0x00002000

            ,BINDF_GETCLASSOBJECT            = 0x00004000
            ,BINDF_RESERVED_1                = 0x00008000

            ,BINDF_FREE_THREADED             = 0x00010000
            ,BINDF_DIRECT_READ               = 0x00020000
            ,BINDF_FORMS_SUBMIT              = 0x00040000
            ,BINDF_GETFROMCACHE_IF_NET_FAIL  = 0x00080000
            ,BINDF_FROMURLMON                = 0x00100000
            ,BINDF_FWD_BACK                  = 0x00200000

            ,BINDF_PREFERDEFAULTHANDLER      = 0x00400000
            ,BINDF_ENFORCERESTRICTED         = 0x00800000
        } BINDF;

        typedef enum
        {
             URL_ENCODING_NONE               = 0x00000000
            ,URL_ENCODING_ENABLE_UTF8        = 0x10000000
            ,URL_ENCODING_DISABLE_UTF8       = 0x20000000
        } URL_ENCODING;

        typedef struct _tagBINDINFO
        {
            ULONG       cbSize;
            LPWSTR      szExtraInfo;
            STGMEDIUM   stgmedData;
            DWORD       grfBindInfoF;
            DWORD       dwBindVerb;
            LPWSTR      szCustomVerb;
            DWORD       cbstgmedData;
            DWORD       dwOptions;
            DWORD       dwOptionsFlags;
            DWORD       dwCodePage;
            SECURITY_ATTRIBUTES securityAttributes;
            IID         iid;
            IUnknown    *pUnk;
            DWORD       dwReserved;

        } BINDINFO;

        typedef struct _REMSECURITY_ATTRIBUTES
        {
            DWORD nLength;
            DWORD lpSecurityDescriptor;
            BOOL  bInheritHandle;
        } REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES;

        typedef struct _tagRemBINDINFO
        {
            ULONG       cbSize;
            LPWSTR      szExtraInfo;
            DWORD       grfBindInfoF;
            DWORD       dwBindVerb;
            LPWSTR      szCustomVerb;
            DWORD       cbstgmedData;
            DWORD       dwOptions;
            DWORD       dwOptionsFlags;
            DWORD       dwCodePage;
            REMSECURITY_ATTRIBUTES securityAttributes;
            IID         iid;
            IUnknown    *pUnk;
            DWORD       dwReserved;
        } RemBINDINFO;

        typedef struct tagRemFORMATETC {
            DWORD cfFormat;
            DWORD ptd;
            DWORD dwAspect;
            LONG lindex;
            DWORD tymed;
        } RemFORMATETC, *LPREMFORMATETC;

        typedef enum
        {
             BINDINFO_OPTIONS_WININETFLAG        = 0x00010000

            ,BINDINFO_OPTIONS_ENABLE_UTF8        = 0x00020000
            ,BINDINFO_OPTIONS_DISABLE_UTF8       = 0x00040000
            ,BINDINFO_OPTIONS_USE_IE_ENCODING    = 0x00080000

            ,BINDINFO_OPTIONS_BINDTOOBJECT       = 0x00100000
        } BINDINFO_OPTIONS;

        typedef enum
        {
             BSCF_FIRSTDATANOTIFICATION          = 0x00000001
            ,BSCF_INTERMEDIATEDATANOTIFICATION   = 0x00000002
            ,BSCF_LASTDATANOTIFICATION           = 0x00000004
            ,BSCF_DATAFULLYAVAILABLE             = 0x00000008
            ,BSCF_AVAILABLEDATASIZEUNKNOWN       = 0x00000010

        } BSCF;

        typedef enum tagBINDSTATUS
        {
             BINDSTATUS_FINDINGRESOURCE          = 1
            ,BINDSTATUS_CONNECTING
            ,BINDSTATUS_REDIRECTING
            ,BINDSTATUS_BEGINDOWNLOADDATA
            ,BINDSTATUS_DOWNLOADINGDATA
            ,BINDSTATUS_ENDDOWNLOADDATA
            ,BINDSTATUS_BEGINDOWNLOADCOMPONENTS
            ,BINDSTATUS_INSTALLINGCOMPONENTS
            ,BINDSTATUS_ENDDOWNLOADCOMPONENTS
            ,BINDSTATUS_USINGCACHEDCOPY
            ,BINDSTATUS_SENDINGREQUEST
            ,BINDSTATUS_CLASSIDAVAILABLE
            ,BINDSTATUS_MIMETYPEAVAILABLE
            ,BINDSTATUS_CACHEFILENAMEAVAILABLE
            ,BINDSTATUS_BEGINSYNCOPERATION
            ,BINDSTATUS_ENDSYNCOPERATION
            ,BINDSTATUS_BEGINUPLOADDATA
            ,BINDSTATUS_UPLOADINGDATA
            ,BINDSTATUS_ENDUPLOADDATA
            ,BINDSTATUS_PROTOCOLCLASSID
            ,BINDSTATUS_ENCODING
            ,BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE
            ,BINDSTATUS_CLASSINSTALLLOCATION
            ,BINDSTATUS_DECODING
            ,BINDSTATUS_LOADINGMIMEHANDLER
            ,BINDSTATUS_CONTENTDISPOSITIONATTACH
            ,BINDSTATUS_FILTERREPORTMIMETYPE
            ,BINDSTATUS_CLSIDCANINSTANTIATE
            ,BINDSTATUS_IUNKNOWNAVAILABLE
            ,BINDSTATUS_DIRECTBIND
            ,BINDSTATUS_RAWMIMETYPE
            ,BINDSTATUS_PROXYDETECTING
            ,BINDSTATUS_ACCEPTRANGES
            ,BINDSTATUS_COOKIE_SENT
            ,BINDSTATUS_COMPACT_POLICY_RECEIVED
            ,BINDSTATUS_COOKIE_SUPPRESSED
            ,BINDSTATUS_COOKIE_STATE_UNKNOWN
            ,BINDSTATUS_COOKIE_STATE_ACCEPT
            ,BINDSTATUS_COOKIE_STATE_REJECT
            ,BINDSTATUS_COOKIE_STATE_PROMPT
            ,BINDSTATUS_COOKIE_STATE_LEASH
            ,BINDSTATUS_COOKIE_STATE_DOWNGRADE
            ,BINDSTATUS_POLICY_HREF
            ,BINDSTATUS_P3P_HEADER
            ,BINDSTATUS_SESSION_COOKIE_RECEIVED
            ,BINDSTATUS_PERSISTENT_COOKIE_RECEIVED
            ,BINDSTATUS_SESSION_COOKIES_ALLOWED
        } BINDSTATUS;


        HRESULT OnStartBinding(
                [in] DWORD dwReserved,
                [in] IBinding * pib);

        HRESULT GetPriority(
                [out] LONG * pnPriority);

        HRESULT OnLowResource(
                [in] DWORD reserved);

        HRESULT OnProgress(
                [in] ULONG ulProgress,
                [in] ULONG ulProgressMax,
                [in] ULONG ulStatusCode,
                [in] LPCWSTR szStatusText);

        HRESULT OnStopBinding(
                [in] HRESULT hresult,
                [in, unique] LPCWSTR szError
                );

        [local]
        HRESULT GetBindInfo(
                [out] DWORD *grfBINDF,
                [in, out, unique] BINDINFO * pbindinfo
                );

        [call_as(GetBindInfo)]
        HRESULT RemoteGetBindInfo(
                [out] DWORD *grfBINDF,
                [in, out, unique] RemBINDINFO * pbindinfo,
                [in, out, unique] RemSTGMEDIUM* pstgmed
                );

        [local]
        HRESULT OnDataAvailable(
                [in] DWORD grfBSCF,
                [in] DWORD dwSize,
                [in] FORMATETC* pformatetc,
                [in] STGMEDIUM* pstgmed
                );

        [call_as(OnDataAvailable)]
        HRESULT RemoteOnDataAvailable(
                [in] DWORD grfBSCF,
                [in] DWORD dwSize,
                [in] RemFORMATETC *pformatetc,
                [in] RemSTGMEDIUM* pstgmed
                );

        HRESULT OnObjectAvailable(
                [in] REFIID riid,
                [in, iid_is(riid)] IUnknown* punk
                );

}

/*****************************************************************************
 * Interface: IAuthenticate
 */

[
    object,
    uuid(79eac9d0-baf9-11ce-8c82-00aa004ba90b),
    pointer_default(unique)
]
interface IAuthenticate : IUnknown
{
    typedef [unique] IAuthenticate *LPAUTHENTICATION;

    HRESULT Authenticate(
                [out] HWND* phwnd,
                [out] LPWSTR *pszUsername,
                [out] LPWSTR *pszPassword
                );
}

/*****************************************************************************
 * Interface: IHttpNegotiate
 */

[
    object,
    uuid(79eac9d2-baf9-11ce-8c82-00aa004ba90b),
    pointer_default(unique)
]

interface IHttpNegotiate : IUnknown
{
    typedef [unique] IHttpNegotiate *LPHTTPNEGOTIATE;

    HRESULT BeginningTransaction(
                [in]         LPCWSTR szURL,
                [in, unique] LPCWSTR szHeaders,
                [in]         DWORD dwReserved,
                [out]        LPWSTR *pszAdditionalHeaders
                );

    HRESULT OnResponse(
                [in]         DWORD dwResponseCode,
                [in, unique] LPCWSTR szResponseHeaders,
                [in, unique] LPCWSTR szRequestHeaders,
                [out]        LPWSTR *pszAdditionalRequestHeaders
                );
}

/*****************************************************************************
 * Interface: IHttpNegotiate2
 */

[
    object,
    uuid(4F9F9FCB-E0F4-48eb-B7AB-FA2EA9365CB4),
    pointer_default(unique)
]
interface IHttpNegotiate2 : IHttpNegotiate
{
    typedef [unique] IHttpNegotiate2 *LPHTTPNEGOTIATE2;

    HRESULT GetRootSecurityId
    (
        [out, size_is(*pcbSecurityId)]
                BYTE*   pbSecurityId,
        [in, out]
                DWORD*  pcbSecurityId,
        [in]    DWORD_PTR dwReserved
    );
}

/*****************************************************************************
 * Interface: IWindowForBindingUI
 */
[
    local,
    object,
    uuid(79eac9d5-bafa-11ce-8c82-00aa004ba90b),
    pointer_default(unique)
]

interface IWindowForBindingUI : IUnknown
{
    typedef [unique] IWindowForBindingUI *LPWINDOWFORBINDINGUI;

    HRESULT GetWindow(
                [in]  REFGUID rguidReason,
                [out] HWND* phwnd);
}

/*****************************************************************************
 * Interface: ICodeInstall
 */

[
    local,
    object,
    uuid(79eac9d1-baf9-11ce-8c82-00aa004ba90b),
    pointer_default(unique)
]
interface ICodeInstall : IWindowForBindingUI
{
    typedef [unique] ICodeInstall *LPCODEINSTALL;

    typedef enum {
        CIP_DISK_FULL,
        CIP_ACCESS_DENIED,
        CIP_NEWER_VERSION_EXISTS,
        CIP_OLDER_VERSION_EXISTS,
        CIP_NAME_CONFLICT,
        CIP_TRUST_VERIFICATION_COMPONENT_MISSING,
        CIP_EXE_SELF_REGISTERATION_TIMEOUT,
        CIP_UNSAFE_TO_ABORT,
        CIP_NEED_REBOOT
    } CIP_STATUS;

    HRESULT OnCodeInstallProblem(
            [in] ULONG ulStatusCode,
            [in, unique] LPCWSTR szDestination,
            [in, unique] LPCWSTR szSource,
            [in] DWORD dwReserved
    );

}

/*****************************************************************************
 * Interface: IWinInetInfo
 */
[
    object,
    uuid(79eac9d6-bafa-11ce-8c82-00aa004ba90b),
    pointer_default(unique)
]

interface IWinInetInfo : IUnknown
{

    typedef [unique] IWinInetInfo *LPWININETINFO;

    [local]
    HRESULT QueryOption(
            [in]      DWORD  dwOption,
            [in, out, size_is(*pcbBuf)]     LPVOID pBuffer,
            [in, out] DWORD *pcbBuf);

    [call_as(QueryOption)]
    HRESULT RemoteQueryOption(
            [in]      DWORD  dwOption,
            [in, out, size_is(*pcbBuf)]     BYTE *pBuffer,
            [in, out] DWORD *pcbBuf);

}

/*****************************************************************************
 * Interface: IHttpSecurity
 */

[
    local,
    object,
    uuid(79eac9d7-bafa-11ce-8c82-00aa004ba90b),

    pointer_default(unique)
]
interface IHttpSecurity : IWindowForBindingUI
{
    typedef [unique] IHttpSecurity *LPHTTPSECURITY;

   HRESULT OnSecurityProblem(
            [in] DWORD dwProblem);

}

/*****************************************************************************
 * Interface: IWinInetHttpInfo
 */

[
    object,
    uuid(79eac9d8-bafa-11ce-8c82-00aa004ba90b),
    pointer_default(unique)
]

interface IWinInetHttpInfo : IWinInetInfo
{
    typedef [unique] IWinInetHttpInfo *LPWININETHTTPINFO;

    [local]
    HRESULT QueryInfo(
            [in]      DWORD  dwOption,
            [in, out,size_is(*pcbBuf)]     LPVOID pBuffer,
            [in, out] DWORD *pcbBuf,
            [in, out] DWORD *pdwFlags,
            [in, out] DWORD *pdwReserved
            );

    [call_as(QueryInfo)]
    HRESULT RemoteQueryInfo(
            [in]      DWORD  dwOption,
            [in,out,size_is(*pcbBuf)] BYTE *pBuffer,
            [in, out] DWORD *pcbBuf,
            [in, out] DWORD *pdwFlags,
            [in, out] DWORD *pdwReserved
            );

}

/*****************************************************************************
 * Interface: IBindHost
 */

[
        object,
        uuid(fc4801a1-2ba9-11cf-a229-00aa003d7352),
        pointer_default(unique)
]
interface IBindHost : IUnknown
{
        typedef [unique] IBindHost *LPBINDHOST;

        HRESULT CreateMoniker(
            [in]    LPOLESTR    szName,
            [in]    IBindCtx   *pBC,
            [out]   IMoniker**  ppmk,
            [in]    DWORD       dwReserved);

        [local]
        HRESULT MonikerBindToStorage(
            [in]    IMoniker            *pMk,
            [in]    IBindCtx            *pBC,
            [in]    IBindStatusCallback *pBSC,
            [in]    REFIID              riid,
            [out]   void                **ppvObj);

        [call_as(MonikerBindToStorage)]
        HRESULT RemoteMonikerBindToStorage(
            [in, unique]    IMoniker            *pMk,
            [in, unique]    IBindCtx            *pBC,
            [in, unique]    IBindStatusCallback *pBSC,
            [in]            REFIID riid,
            [out, iid_is(riid)] IUnknown **ppvObj);

        [local]
        HRESULT MonikerBindToObject(
            [in]    IMoniker            *pMk,
            [in]    IBindCtx            *pBC,
            [in]    IBindStatusCallback *pBSC,
            [in]    REFIID              riid,
            [out]   void                **ppvObj);

        [call_as(MonikerBindToObject)]
        HRESULT RemoteMonikerBindToObject(
            [in, unique]    IMoniker            *pMk,
            [in, unique]    IBindCtx            *pBC,
            [in, unique]    IBindStatusCallback *pBSC,
            [in]            REFIID riid,
            [out, iid_is(riid)] IUnknown **ppvObj);
}

interface IInternet;
interface IInternetBindInfo;
interface IInternetProtocolRoot;
interface IInternetProtocol;
interface IInternetProtocolSink;
interface IInternetProtocolInfo;
interface IInternetSession;
interface IInternetProtocolSinkStackable;


/*****************************************************************************
 * Interface: IInternet
 */

[
        local,
        object,
        uuid(79eac9e0-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IInternet : IUnknown
{
        typedef [unique] IInternet *LPIINTERNET;
}

/*****************************************************************************
 * Interface: IInternetBindInfo
 */

[
        local,
        object,
        uuid(79eac9e1-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]

interface IInternetBindInfo : IUnknown
{
        typedef [unique] IInternetBindInfo *LPIINTERNETBINDINFO;

        typedef enum tagBINDSTRING
        {
             BINDSTRING_HEADERS  = 1
            ,BINDSTRING_ACCEPT_MIMES
            ,BINDSTRING_EXTRA_URL
            ,BINDSTRING_LANGUAGE
            ,BINDSTRING_USERNAME
            ,BINDSTRING_PASSWORD
            ,BINDSTRING_UA_PIXELS
            ,BINDSTRING_UA_COLOR
            ,BINDSTRING_OS
            ,BINDSTRING_USER_AGENT
            ,BINDSTRING_ACCEPT_ENCODINGS
            ,BINDSTRING_POST_COOKIE
            ,BINDSTRING_POST_DATA_MIME
            ,BINDSTRING_URL
            ,BINDSTRING_IID
            ,BINDSTRING_FLAG_BIND_TO_OBJECT
            ,BINDSTRING_PTR_BIND_CONTEXT
        } BINDSTRING;


        HRESULT GetBindInfo(
                [out] DWORD *grfBINDF,
                [in, out, unique] BINDINFO * pbindinfo
                );

        HRESULT GetBindString(
                [in]  ULONG ulStringType,
                [in, out] LPOLESTR *ppwzStr,
                [in]      ULONG cEl,
                [in, out] ULONG *pcElFetched
                );

}


/*****************************************************************************
 * Interface: IInternetProtocolRoot
 */

[
        local,
        object,
        uuid(79eac9e3-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]

interface IInternetProtocolRoot : IUnknown
{
        typedef [unique] IInternetProtocolRoot *LPIINTERNETPROTOCOLROOT;

        typedef enum _tagPI_FLAGS
        {
             PI_PARSE_URL               = 0x00000001
            ,PI_FILTER_MODE             = 0x00000002
            ,PI_FORCE_ASYNC             = 0x00000004
            ,PI_USE_WORKERTHREAD        = 0x00000008
            ,PI_MIMEVERIFICATION        = 0x00000010
            ,PI_CLSIDLOOKUP             = 0x00000020
            ,PI_DATAPROGRESS            = 0x00000040
            ,PI_SYNCHRONOUS             = 0x00000080
            ,PI_APARTMENTTHREADED       = 0x00000100
            ,PI_CLASSINSTALL            = 0x00000200
            ,PI_PASSONBINDCTX                   = 0x00002000
            ,PI_NOMIMEHANDLER                   = 0x00008000
            ,PI_LOADAPPDIRECT                   = 0x00004000
            ,PD_FORCE_SWITCH            = 0x00010000
            ,PI_PREFERDEFAULTHANDLER            = 0x00020000
        } PI_FLAGS;

        typedef struct _tagPROTOCOLDATA
        {
            DWORD   grfFlags;
            DWORD   dwState;
            LPVOID  pData;
            ULONG   cbData;
        } PROTOCOLDATA;

        typedef struct _tagStartParam
        {
            IID       iid;
            IBindCtx  *pIBindCtx;
            IUnknown  *pItf;    
        } StartParam;


        HRESULT Start(
            [in] LPCWSTR szUrl,
            [in] IInternetProtocolSink *pOIProtSink,
            [in] IInternetBindInfo *pOIBindInfo,
            [in] DWORD grfPI,
            [in] HANDLE_PTR dwReserved
            );

        HRESULT Continue(
            [in] PROTOCOLDATA *pProtocolData
            );

        HRESULT Abort(
            [in] HRESULT hrReason,
            [in] DWORD dwOptions
            );

        HRESULT Terminate(
            [in] DWORD dwOptions
            );

        HRESULT Suspend();

        HRESULT Resume();

}

/*****************************************************************************
 * Interface: IInternetProtocol
 */

[
        local,
        object,
        uuid(79eac9e4-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IInternetProtocol : IInternetProtocolRoot
{

        typedef [unique] IInternetProtocol *LPIINTERNETPROTOCOL;

        HRESULT Read(
            [in,out, size_is(cb), length_is(*pcbRead)]
            void *pv,
            [in] ULONG cb,
            [out] ULONG *pcbRead);

        HRESULT Seek(
            [in] LARGE_INTEGER dlibMove,
            [in] DWORD dwOrigin,
            [out] ULARGE_INTEGER *plibNewPosition);

        HRESULT LockRequest(
            [in] DWORD dwOptions
            );

        HRESULT UnlockRequest();
}

/*****************************************************************************
 * Interface: IInternetProtocolSink
 */

[
        local,
        object,
        uuid(79eac9e5-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]

interface IInternetProtocolSink : IUnknown
{
        typedef [unique] IInternetProtocolSink *LPIINTERNETPROTOCOLSINK;

        HRESULT Switch(
            [in] PROTOCOLDATA *pProtocolData
            );

        HRESULT ReportProgress(
            [in] ULONG   ulStatusCode,
            [in] LPCWSTR szStatusText
            );

        HRESULT ReportData(
            [in] DWORD grfBSCF,
            [in] ULONG ulProgress,
            [in] ULONG ulProgressMax
            );

        HRESULT ReportResult(
            [in] HRESULT hrResult,
            [in] DWORD   dwError,
            [in] LPCWSTR szResult
            );
}

/*****************************************************************************
 * Interface: IInternetProtocolSinkStackable
 */

[
        local,
        object,
        uuid(79eac9f0-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IInternetProtocolSinkStackable : IUnknown
{
        typedef [unique] IInternetProtocolSinkStackable *LPIINTERNETPROTOCOLSINKStackable;

        HRESULT SwitchSink(
            [in] IInternetProtocolSink *pOIProtSink
            );

        HRESULT CommitSwitch();
        HRESULT RollbackSwitch();
}

/*****************************************************************************
 * Interface: IInternetSession
 */

[
        local,
        object,
        uuid(79eac9e7-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IInternetSession : IUnknown
{
        typedef [unique] IInternetSession *LPIINTERNETSESSION;

        typedef enum _tagOIBDG_FLAGS
        {
             OIBDG_APARTMENTTHREADED        = 0x00000100
            ,OIBDG_DATAONLY                 = 0x00001000
        } OIBDG_FLAGS;

        HRESULT RegisterNameSpace(
            [in] IClassFactory *pCF,
            [in] REFCLSID rclsid,
            [in] LPCWSTR pwzProtocol,
            [in] ULONG          cPatterns,
            [in] const LPCWSTR *ppwzPatterns,
            [in] DWORD          dwReserved
            );

        HRESULT UnregisterNameSpace(
            [in] IClassFactory *pCF,
            [in] LPCWSTR pszProtocol
            );

        HRESULT RegisterMimeFilter(
            [in] IClassFactory *pCF,
            [in] REFCLSID rclsid,
            [in] LPCWSTR pwzType
            );

        HRESULT UnregisterMimeFilter(
            [in] IClassFactory *pCF,
            [in] LPCWSTR pwzType
            );

        HRESULT CreateBinding(
            [in] LPBC pBC,
            [in] LPCWSTR szUrl,
            [in] IUnknown *pUnkOuter,
            [out, unique] IUnknown **ppUnk,
            [out, unique] IInternetProtocol **ppOInetProt,
            [in] DWORD dwOption
            );

        HRESULT SetSessionOption(
            [in] DWORD dwOption,
            [in] LPVOID pBuffer,
            [in] DWORD dwBufferLength,
            [in] DWORD dwReserved
            );

        HRESULT GetSessionOption(
            [in] DWORD dwOption,
            [in, out] LPVOID pBuffer,
            [in, out] DWORD *pdwBufferLength,
            [in] DWORD dwReserved
            );
}

/*****************************************************************************
 * Interface: IInternetThreadSwitch
 */

[
        local,
        object,
        uuid(79eac9e8-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]
interface IInternetThreadSwitch : IUnknown
{
        typedef [unique] IInternetThreadSwitch *LPIINTERNETTHREADSWITCH;

        HRESULT Prepare();

        HRESULT Continue();
}


/*****************************************************************************
 * Interface: IInternetPriority
 */

[
        local,
        object,
        uuid(79eac9eb-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]

interface IInternetPriority : IUnknown
{
        typedef [unique] IInternetPriority *LPIINTERNETPRIORITY;

        HRESULT SetPriority(
            [in] LONG nPriority
            );

        HRESULT GetPriority(
            [out] LONG * pnPriority
            );

}



/*****************************************************************************
 * Interface: IInternetProtocolInfo
 */

[
        local,
        object,
        uuid(79eac9ec-baf9-11ce-8c82-00aa004ba90b),
        pointer_default(unique)
]

interface IInternetProtocolInfo : IUnknown
{
        typedef [unique] IInternetProtocolInfo *LPIINTERNETPROTOCOLINFO;

        typedef enum _tagPARSEACTION
        {
             PARSE_CANONICALIZE      = 1
            ,PARSE_FRIENDLY
            ,PARSE_SECURITY_URL
            ,PARSE_ROOTDOCUMENT
            ,PARSE_DOCUMENT
            ,PARSE_ANCHOR
            ,PARSE_ENCODE
            ,PARSE_DECODE
            ,PARSE_PATH_FROM_URL
            ,PARSE_URL_FROM_PATH
            ,PARSE_MIME
            ,PARSE_SERVER
            ,PARSE_SCHEMA
            ,PARSE_SITE
            ,PARSE_DOMAIN
            ,PARSE_LOCATION
            ,PARSE_SECURITY_DOMAIN
            ,PARSE_ESCAPE
            ,PARSE_UNESCAPE
        } PARSEACTION;

        typedef enum _tagPSUACTION
        {
            PSU_DEFAULT            = 1
            ,PSU_SECURITY_URL_ONLY
        } PSUACTION;

        typedef enum _tagQUERYOPTION
        {
             QUERY_EXPIRATION_DATE      = 1
            ,QUERY_TIME_OF_LAST_CHANGE
            ,QUERY_CONTENT_ENCODING
            ,QUERY_CONTENT_TYPE
            ,QUERY_REFRESH
            ,QUERY_RECOMBINE
            ,QUERY_CAN_NAVIGATE
            ,QUERY_USES_NETWORK
            ,QUERY_IS_CACHED
            ,QUERY_IS_INSTALLEDENTRY
            ,QUERY_IS_CACHED_OR_MAPPED
            ,QUERY_USES_CACHE
            ,QUERY_IS_SECURE
            ,QUERY_IS_SAFE
        } QUERYOPTION;

        HRESULT ParseUrl(
            [in]    LPCWSTR     pwzUrl,
            [in]    PARSEACTION ParseAction,
            [in]    DWORD       dwParseFlags,
            [out]   LPWSTR      pwzResult,
            [in]    DWORD       cchResult,
            [out]   DWORD      *pcchResult,
            [in]    DWORD       dwReserved
            );

        HRESULT CombineUrl(
            [in]    LPCWSTR     pwzBaseUrl,
            [in]    LPCWSTR     pwzRelativeUrl,
            [in]    DWORD       dwCombineFlags,
            [out]   LPWSTR      pwzResult,
            [in]    DWORD       cchResult,
            [out]   DWORD      *pcchResult,
            [in]    DWORD       dwReserved
            );

        HRESULT CompareUrl(
            [in]    LPCWSTR pwzUrl1,
            [in]    LPCWSTR pwzUrl2,
            [in]    DWORD dwCompareFlags
            );

        HRESULT QueryInfo(
            [in]        LPCWSTR pwzUrl,
            [in]        QUERYOPTION   OueryOption,
            [in]        DWORD         dwQueryFlags,
            [in, out,size_is(*pcbBuf)]  LPVOID pBuffer,
            [in]        DWORD   cbBuffer,
            [in, out]   DWORD  *pcbBuf,
            [in]        DWORD   dwReserved
            );

}

/*****************************************************************************
 * Interface: IInternetSecurityMgrSite
 */

[

    local,
    object,
    uuid(79eac9ed-baf9-11ce-8c82-00aa004ba90b),
    helpstring("IInternetSecurityMgrSite Interface"),
    pointer_default(unique)
]

interface IInternetSecurityMgrSite : IUnknown
{
    HRESULT GetWindow (
            [out] HWND* phwnd);
    HRESULT EnableModeless (
            [in] BOOL fEnable);
};

/*****************************************************************************
 * Interface: IInternetSecurityManager
 */

[

    uuid(79eac9ee-baf9-11ce-8c82-00aa004ba90b),
    helpstring("IInternetSecurityManager Interface"),
    pointer_default(unique)
]

interface IInternetSecurityManager : IUnknown
{
    HRESULT     SetSecuritySite
    (
        [in,unique]    IInternetSecurityMgrSite *pSite
    );

    HRESULT     GetSecuritySite
    (
        [out]   IInternetSecurityMgrSite **ppSite
    );

    HRESULT MapUrlToZone
    (
        [in]    LPCWSTR     pwszUrl,
        [out]   DWORD*      pdwZone,
        [in]    DWORD       dwFlags
    );

    HRESULT GetSecurityId
    (
        [in]    LPCWSTR     pwszUrl,
        [out, size_is(*pcbSecurityId)]
                BYTE*   pbSecurityId,
        [in, out]
                DWORD*  pcbSecurityId,
        [in]    DWORD_PTR dwReserved
    );

    typedef enum
    {
        PUAF_DEFAULT                        = 0x00000000,
        PUAF_NOUI                           = 0x00000001,
        PUAF_ISFILE                         = 0x00000002,
        PUAF_WARN_IF_DENIED                 = 0x00000004,
        PUAF_FORCEUI_FOREGROUND             = 0x00000008,
        PUAF_CHECK_TIFS                     = 0x00000010,
        PUAF_DONTCHECKBOXINDIALOG           = 0x00000020,
        PUAF_TRUSTED                        = 0x00000040,
        PUAF_ACCEPT_WILDCARD_SCHEME         = 0x00000080, 
        PUAF_ENFORCERESTRICTED              = 0x00000100,
    } PUAF ;

    HRESULT     ProcessUrlAction
    (
        [in]    LPCWSTR     pwszUrl,
        [in]    DWORD       dwAction,
        [out, size_is(cbPolicy)]
                BYTE*   pPolicy,
        [in]    DWORD   cbPolicy,
        [in]    BYTE*   pContext,
        [in]    DWORD   cbContext,
        [in]    DWORD   dwFlags,
        [in]    DWORD   dwReserved
    );

    HRESULT     QueryCustomPolicy
    (
        [in]    LPCWSTR     pwszUrl,
        [in]    REFGUID     guidKey,
        [out, size_is(,*pcbPolicy)]
                BYTE**  ppPolicy,
        [out]   DWORD*  pcbPolicy,
        [in]    BYTE*   pContext,
        [in]    DWORD   cbContext,
        [in]    DWORD   dwReserved
    );

    typedef enum
    {
        SZM_CREATE = 0x00000000,
        SZM_DELETE = 0x00000001,
    }
        SZM_FLAGS;

    HRESULT SetZoneMapping
    (
        [in]    DWORD   dwZone,
        [in]    LPCWSTR lpszPattern,
        [in]    DWORD   dwFlags
    );

    HRESULT GetZoneMappings
    (
        [in]    DWORD   dwZone,
        [out]   IEnumString  **ppenumString,
        [in]    DWORD   dwFlags
    );

};

/*****************************************************************************
 * Interface: IInternetHostSecurityManager
 */

[

    local,
    object,
    uuid(3af280b6-cb3f-11d0-891e-00c04fb6bfc4),
    helpstring("IInternetHostSecurityManager Interface"),
    pointer_default(unique)
]

interface IInternetHostSecurityManager : IUnknown
{

    HRESULT GetSecurityId
    (
        [out, size_is(*pcbSecurityId)]
                BYTE*   pbSecurityId,
        [in, out]
                DWORD*  pcbSecurityId,
        [in]    DWORD_PTR dwReserved
    );

    HRESULT     ProcessUrlAction
    (
        [in]    DWORD       dwAction,
        [out, size_is(cbPolicy)]
                BYTE*   pPolicy,
        [in]    DWORD   cbPolicy,
        [in]    BYTE*   pContext,
        [in]    DWORD   cbContext,
        [in]    DWORD   dwFlags,
        [in]    DWORD   dwReserved
    );

    HRESULT     QueryCustomPolicy
    (
        [in]    REFGUID     guidKey,
        [out, size_is(,*pcbPolicy)]
                BYTE**  ppPolicy,
        [out]   DWORD*  pcbPolicy,
        [in]    BYTE*   pContext,
        [in]    DWORD   cbContext,
        [in]    DWORD   dwReserved
    );

};

/*****************************************************************************
 * Interface: IInternetZoneManager
 */

[

    local,
    object,
    uuid(79eac9ef-baf9-11ce-8c82-00aa004ba90b),
    helpstring("IInternetZoneManager Interface"),
    pointer_default(unique)
]

interface IInternetZoneManager : IUnknown
{
    typedef [unique] IInternetZoneManager *LPURLZONEMANAGER;


    typedef enum tagURLZONE
    {
        URLZONE_PREDEFINED_MIN = 0,
        URLZONE_LOCAL_MACHINE  = 0,
        URLZONE_INTRANET,
        URLZONE_TRUSTED,
        URLZONE_INTERNET,
        URLZONE_UNTRUSTED,
        URLZONE_PREDEFINED_MAX = 999,

        URLZONE_USER_MIN = 1000,
        URLZONE_USER_MAX = 10000,
    }  URLZONE;

    typedef enum tagURLTEMPLATE
    {
        URLTEMPLATE_CUSTOM  =   0x000000,

        URLTEMPLATE_PREDEFINED_MIN =    0x10000,
        URLTEMPLATE_LOW =               0x10000,
        URLTEMPLATE_MEDLOW =            0x10500,
        URLTEMPLATE_MEDIUM =            0x11000,
        URLTEMPLATE_HIGH  =             0x12000,
        URLTEMPLATE_PREDEFINED_MAX =    0x20000
    } URLTEMPLATE ;



    enum { MAX_ZONE_PATH = 260, MAX_ZONE_DESCRIPTION = 200 };

    typedef enum {
        ZAFLAGS_CUSTOM_EDIT                 = 0x00000001,
        ZAFLAGS_ADD_SITES                   = 0x00000002,
        ZAFLAGS_REQUIRE_VERIFICATION        = 0x00000004,
        ZAFLAGS_INCLUDE_PROXY_OVERRIDE      = 0x00000008,
        ZAFLAGS_INCLUDE_INTRANET_SITES      = 0x00000010,
        ZAFLAGS_NO_UI                       = 0x00000020,
        ZAFLAGS_SUPPORTS_VERIFICATION       = 0x00000040,
        ZAFLAGS_UNC_AS_INTRANET             = 0x00000080,
    } ZAFLAGS ;

    typedef struct _ZONEATTRIBUTES
    {
        ULONG   cbSize;
        WCHAR   szDisplayName[MAX_ZONE_PATH];
        WCHAR   szDescription[MAX_ZONE_DESCRIPTION];
        WCHAR   szIconPath[MAX_ZONE_PATH];
        DWORD   dwTemplateMinLevel;
        DWORD   dwTemplateRecommended;
        DWORD   dwTemplateCurrentLevel;
        DWORD   dwFlags;
    } ZONEATTRIBUTES, *LPZONEATTRIBUTES;

    HRESULT GetZoneAttributes
    (
        [in]    DWORD   dwZone,
        [in, out, unique]
                ZONEATTRIBUTES* pZoneAttributes
    );

    HRESULT    SetZoneAttributes
    (
        [in]    DWORD   dwZone,
        [in]    ZONEATTRIBUTES* pZoneAttributes
    );

    typedef enum _URLZONEREG
    {
        URLZONEREG_DEFAULT=0,
        URLZONEREG_HKLM,
        URLZONEREG_HKCU
    } URLZONEREG;

    HRESULT GetZoneCustomPolicy
    (
        [in]    DWORD   dwZone,
        [in]    REFGUID guidKey,
        [out, size_is(,*pcbPolicy)]
                BYTE**  ppPolicy,
        [out]   DWORD*  pcbPolicy,
        [in]    URLZONEREG  urlZoneReg
    );

    HRESULT SetZoneCustomPolicy
    (
        [in]    DWORD   dwZone,
        [in]    REFGUID guidKey,
        [in, size_is(cbPolicy)]
                BYTE*   pPolicy,
        [in]    DWORD   cbPolicy,
        [in]    URLZONEREG urlZoneReg
    );

    HRESULT GetZoneActionPolicy
    (
        [in]    DWORD   dwZone,
        [in]    DWORD   dwAction,
        [out, size_is(cbPolicy)]
                BYTE*   pPolicy,
        [in]    DWORD   cbPolicy,
        [in]    URLZONEREG urlZoneReg
    );

    HRESULT SetZoneActionPolicy
    (
        [in]    DWORD   dwZone,
        [in]    DWORD   dwAction,
        [in, size_is(cbPolicy)]
                BYTE*   pPolicy,
        [in]    DWORD   cbPolicy,
        [in]    URLZONEREG urlZoneReg
    );

    HRESULT PromptAction
    (
        [in]    DWORD   dwAction,
        [in]    HWND    hwndParent,
        [in]    LPCWSTR pwszUrl,
        [in]    LPCWSTR pwszText,
        [in]    DWORD   dwPromptFlags
    );

    HRESULT LogAction
    (
        [in]    DWORD   dwAction,
        [in]    LPCWSTR pwszUrl,
        [in]    LPCWSTR pwszText,
        [in]    DWORD   dwLogFlags
    );

    HRESULT CreateZoneEnumerator
    (
        [out]   DWORD*  pdwEnum,
        [out]   DWORD*  pdwCount,
        [in]    DWORD   dwFlags
    );

    HRESULT    GetZoneAt
    (
        [in]    DWORD    dwEnum,
        [in]    DWORD    dwIndex,
        [out]   DWORD*    pdwZone
    );


    HRESULT DestroyZoneEnumerator
    (
        [in]    DWORD   dwEnum
    );

    HRESULT     CopyTemplatePoliciesToZone
    (
        [in]    DWORD dwTemplate,
        [in]    DWORD dwZone,
        [in]    DWORD dwReserved
    );

}

typedef struct _tagCODEBASEHOLD
{
     ULONG cbSize;
     LPWSTR szDistUnit;
     LPWSTR szCodeBase;
     DWORD dwVersionMS;
     DWORD dwVersionLS;
     DWORD dwStyle;
} CODEBASEHOLD, *LPCODEBASEHOLD;

typedef struct _tagSOFTDISTINFO
{
    ULONG       cbSize;
    DWORD       dwFlags;
        DWORD   dwAdState;
    LPWSTR      szTitle;
    LPWSTR      szAbstract;
    LPWSTR  szHREF;
    DWORD   dwInstalledVersionMS;
    DWORD   dwInstalledVersionLS;
    DWORD   dwUpdateVersionMS;
    DWORD   dwUpdateVersionLS;
    DWORD   dwAdvertisedVersionMS;
    DWORD   dwAdvertisedVersionLS;
    DWORD       dwReserved;
} SOFTDISTINFO, *LPSOFTDISTINFO;

/*****************************************************************************
 * Interface: ISoftDistExt
 */

[
    local,
    object,
    uuid(B15B8DC1-C7E1-11d0-8680-00AA00BDCB71),
    helpstring("ISoftDistExt Interface"),
    pointer_default(unique)
]
interface ISoftDistExt : IUnknown
{

    HRESULT ProcessSoftDist
    (
        [in]    LPCWSTR szCDFURL,
        /* WINE FIXME: need MsXml.Idl
        [in]    IXMLElement *pSoftDistElement, */
        [in]    void *pSoftDistElement,
        [in, out]    LPSOFTDISTINFO lpsdi
    );


    HRESULT GetFirstCodeBase
    (
        [in]    LPWSTR *szCodeBase,
        [in]    LPDWORD dwMaxSize
    );

    HRESULT GetNextCodeBase
    (
        [in]    LPWSTR *szCodeBase,
        [in]    LPDWORD dwMaxSize
    );

    HRESULT AsyncInstallDistributionUnit
    (
        [in]    IBindCtx *pbc,
        [in]    LPVOID pvReserved,
        [in]    DWORD flags,
        [in]    LPCODEBASEHOLD lpcbh
    );

}

/*****************************************************************************
 * Interface: ICatalogFileInfo
 */

[
    local,
    object,
    uuid(711C7600-6B48-11d1-B403-00AA00B92AF1),
    pointer_default(unique)
]
interface ICatalogFileInfo : IUnknown
{

    typedef [unique] ICatalogFileInfo *LPCATALOGFILEINFO;

    HRESULT GetCatalogFile(
            [out] LPSTR *ppszCatalogFile
            );
    HRESULT GetJavaTrust(
            [out] void **ppJavaTrust
            );

}

/*****************************************************************************
 * Interface: IDataFilter
 */

[
        object,
        uuid(69d14c80-c18e-11d0-a9ce-006097942311),
        pointer_default(unique)
]
interface IDataFilter: IUnknown
{
        typedef [unique] IDataFilter *LPDATAFILTER;

        HRESULT DoEncode(
            [in]    DWORD                   dwFlags,
            [in]    LONG                    lInBufferSize,
            [in, size_is(lInBufferSize)]
                    BYTE*                   pbInBuffer,
            [in]    LONG                    lOutBufferSize,
            [out, size_is(lOutBufferSize)]
                    BYTE*                   pbOutBuffer,
            [in]    LONG                    lInBytesAvailable,
            [out]   LONG*                   plInBytesRead,
            [out]   LONG*                   plOutBytesWritten,
            [in]    DWORD                   dwReserved
            );

        HRESULT DoDecode(
            [in]    DWORD                   dwFlags,
            [in]    LONG                    lInBufferSize,
            [in, size_is(lInBufferSize)]
                    BYTE*                   pbInBuffer,
            [in]    LONG                    lOutBufferSize,
            [out, size_is(lOutBufferSize)]
                    BYTE*                   pbOutBuffer,
            [in]    LONG                    lInBytesAvailable,
            [out]   LONG*                   plInBytesRead,
            [out]   LONG*                   plOutBytesWritten,
            [in]    DWORD                   dwReserved
            );

        HRESULT SetEncodingLevel(
            [in]   DWORD                    dwEncLevel
            );

}


typedef struct _tagPROTOCOLFILTERDATA
{
    DWORD                   cbSize;
    IInternetProtocolSink   *pProtocolSink;
    IInternetProtocol       *pProtocol;
    IUnknown                *pUnk;
    DWORD                   dwFilterFlags;
} PROTOCOLFILTERDATA;


/*****************************************************************************
 * Interface: IEncodingFilterFactory
 */

[
        local,
        object,
        uuid(70bdde00-c18e-11d0-a9ce-006097942311),
        pointer_default(unique)
]
interface IEncodingFilterFactory : IUnknown
{
        typedef [unique] IEncodingFilterFactory *LPENCODINGFILTERFACTORY;

        typedef struct _tagDATAINFO
        {
            ULONG   ulTotalSize;
            ULONG   ulavrPacketSize;
            ULONG   ulConnectSpeed;
            ULONG   ulProcessorSpeed;
        } DATAINFO ;


        HRESULT FindBestFilter(
            [in]    LPCWSTR                 pwzCodeIn,
            [in]    LPCWSTR                 pwzCodeOut,
            [in]    DATAINFO                info,
            [out]   IDataFilter**           ppDF
            );

        HRESULT GetDefaultFilter(
            [in]    LPCWSTR                 pwzCodeIn,
            [in]    LPCWSTR                 pwzCodeOut,
            [out]   IDataFilter**           ppDF
            );

}


/*****************************************************************************
 * Interface: IWrappedProtocol
 */

[
        local,
        object,
        uuid(53c84785-8425-4dc5-971b-e58d9c19f9b6),
        pointer_default(unique)
]

interface IWrappedProtocol : IUnknown
{
        typedef [unique] IWrappedProtocol *LPIWRAPPEDPROTOCOL;

        HRESULT GetWrapperCode(
            [out] LONG * pnCode,
            [in]  DWORD_PTR dwReserved
            );
}

