Add some missing interfaces.
[wine] / include / urlmon.idl
1 /*
2  * Copyright (C) 2000 Ulrich Czekalla
3  * Copyright (C) 2003 Alexandre Julliard
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 import "objidl.idl";
21 import "oleidl.idl";
22 import "servprov.idl";
23 /*import "msxml.idl";*/
24
25 interface IInternetProtocolSink;
26
27 /*****************************************************************************
28  * IBinding interface
29  */
30 [
31     object,
32     uuid(79eac9c0-baf9-11ce-8c82-00aa004ba90b),
33     pointer_default(unique)
34 ]
35 interface IBinding : IUnknown
36 {
37     typedef [unique] IBinding *LPBINDING;
38
39     HRESULT Abort();
40     HRESULT Suspend();
41     HRESULT Resume();
42
43     HRESULT SetPriority(
44         [in] LONG nPriority);
45
46     HRESULT GetPriority(
47         [out] LONG * pnPriority);
48
49     [local]
50     HRESULT GetBindResult(
51         [out] CLSID *pclsidProtocol,
52         [out] DWORD *pdwResult,
53         [out] LPOLESTR *pszResult,
54         [in, out] DWORD *pdwReserved);
55
56     [call_as(GetBindResult)]
57     HRESULT RemoteGetBindResult(
58         [out] CLSID *pclsidProtocol,
59         [out] DWORD *pdwResult,
60         [out] LPOLESTR *pszResult,
61         [in] DWORD dwReserved);
62 }
63
64
65 /*****************************************************************************
66  * IBindStatusCallback interface
67  */
68 [
69     object,
70     uuid(79eac9c1-baf9-11ce-8c82-00aa004ba90b),
71     pointer_default(unique)
72 ]
73 interface IBindStatusCallback : IUnknown
74 {
75     typedef [unique] IBindStatusCallback *LPBINDSTATUSCALLBACK;
76
77     typedef enum
78     {
79         BINDVERB_GET    = 0x00000000,
80         BINDVERB_POST   = 0x00000001,
81         BINDVERB_PUT    = 0x00000002,
82         BINDVERB_CUSTOM = 0x00000003
83     } BINDVERB;
84
85     typedef enum
86     {
87         BINDF_ASYNCHRONOUS = 0x00000001,
88         BINDF_ASYNCSTORAGE = 0x00000002,
89         BINDF_NOPROGRESSIVERENDERING = 0x00000004,
90         BINDF_OFFLINEOPERATION = 0x00000008,
91         BINDF_GETNEWESTVERSION = 0x00000010,
92         BINDF_NOWRITECACHE = 0x00000020,
93         BINDF_NEEDFILE = 0x00000040,
94         BINDF_PULLDATA = 0x00000080,
95         BINDF_IGNORESECURITYPROBLEM = 0x00000100,
96         BINDF_RESYNCHRONIZE = 0x00000200,
97         BINDF_HYPERLINK = 0x00000400,
98         BINDF_NO_UI = 0x00000800,
99         BINDF_SILENTOPERATION = 0x00001000,
100         BINDF_PRAGMA_NO_CACHE = 0x00002000,
101         BINDF_GETCLASSOBJECT = 0x00004000,
102         BINDF_RESERVED_1 = 0x00008000,
103         BINDF_FREE_THREADED = 0x00010000,
104         BINDF_DIRECT_READ = 0x00020000,
105         BINDF_FORMS_SUBMIT = 0x00040000,
106         BINDF_GETFROMCACHE_IF_NET_FAIL = 0x00080000,
107         BINDF_FROMURLMON = 0x00100000,
108         BINDF_FWD_BACK = 0x00200000,
109         BINDF_PREFERDEFAULTHANDLER = 0x00400000,
110         BINDF_ENFORCERESTRICTED = 0x00800000
111     } BINDF;
112
113     typedef struct _tagBINDINFO
114     {
115         ULONG cbSize;
116         LPWSTR szExtraInfo;
117         STGMEDIUM stgmedData;
118         DWORD grfBindInfoF;
119         DWORD dwBindVerb;
120         LPWSTR szCustomVerb;
121         DWORD cbStgmedData;
122         DWORD dwOptions;
123         DWORD dwOptionsFlags;
124         DWORD dwCodePage;
125         SECURITY_ATTRIBUTES securityAttributes;
126         IID iid;
127         IUnknown *pUnk;
128         DWORD dwReserved;
129     } BINDINFO;
130
131     typedef struct _REMSECURITY_ATTRIBUTES
132     {
133         DWORD nLength;
134         DWORD lpSecurityDescriptor;
135         BOOL bInheritHandle;
136     } REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES;
137
138     typedef struct _tagRemBINDINFO
139     {
140         ULONG cbSize;
141         LPWSTR szExtraInfo;
142         DWORD grfBindInfoF;
143         DWORD dwBindVerb;
144         LPWSTR szCustomVerb;
145         DWORD cbstgmedData;
146         DWORD dwOptions;
147         DWORD dwOptionsFlags;
148         DWORD dwCodePage;
149         REMSECURITY_ATTRIBUTES securityAttributes;
150         IID iid;
151         IUnknown *pUnk;
152         DWORD dwReserved;
153     } RemBINDINFO;
154
155     typedef struct tagRemFORMATETC
156     {
157         DWORD cfFormat;
158         DWORD ptd;
159         DWORD dwAspect;
160         LONG lindex;
161         DWORD tymed;
162     } RemFORMATETC, *LPREMFORMATETC;
163
164     typedef enum
165     {
166         BSCF_FIRSTDATANOTIFICATION = 0x01,
167         BSCF_INTERMEDIATEDATANOTIFICATION = 0x02,
168         BSCF_LASTDATANOTIFICATION = 0x04,
169         BSCF_DATAFULLYAVAILABLE = 0x08,
170         BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10
171     } BSCF;
172
173     typedef enum BINDSTATUS
174     {
175         BINDSTATUS_FINDINGRESOURCE = 1,
176         BINDSTATUS_CONNECTING,
177         BINDSTATUS_REDIRECTING,
178         BINDSTATUS_BEGINDOWNLOADDATA,
179         BINDSTATUS_DOWNLOADINGDATA,
180         BINDSTATUS_ENDDOWNLOADDATA,
181         BINDSTATUS_BEGINDOWNLOADCOMPONENTS,
182         BINDSTATUS_INSTALLINGCOMPONENTS,
183         BINDSTATUS_ENDDOWNLOADCOMPONENTS,
184         BINDSTATUS_USINGCACHEDCOPY,
185         BINDSTATUS_SENDINGREQUEST,
186         BINDSTATUS_CLASSIDAVAILABLE,
187         BINDSTATUS_MIMETYPEAVAILABLE,
188         BINDSTATUS_CACHEFILENAMEAVAILABLE,
189         BINDSTATUS_BEGINSYNCOPERATION,
190         BINDSTATUS_ENDSYNCOPERATION,
191         BINDSTATUS_BEGINUPLOADDATA,
192         BINDSTATUS_UPLOADINGDATA,
193         BINDSTATUS_ENDUPLOADINGDATA,
194         BINDSTATUS_PROTOCOLCLASSID,
195         BINDSTATUS_ENCODING,
196         BINDSTATUS_VERFIEDMIMETYPEAVAILABLE,
197         BINDSTATUS_CLASSINSTALLLOCATION,
198         BINDSTATUS_DECODING,
199         BINDSTATUS_LOADINGMIMEHANDLER,
200         BINDSTATUS_CONTENTDISPOSITIONATTACH,
201         BINDSTATUS_FILTERREPORTMIMETYPE,
202         BINDSTATUS_CLSIDCANINSTANTIATE,
203         BINDSTATUS_IUNKNOWNAVAILABLE,
204         BINDSTATUS_DIRECTBIND,
205         BINDSTATUS_RAWMIMETYPE,
206         BINDSTATUS_PROXYDETECTING,
207         BINDSTATUS_ACCEPTRANGES,
208         BINDSTATUS_COOKIE_SENT,
209         BINDSTATUS_COMPACT_POLICY_RECEIVED,
210         BINDSTATUS_COOKIE_SUPPRESSED,
211         BINDSTATUS_COOKIE_STATE_UNKNOWN,
212         BINDSTATUS_COOKIE_STATE_ACCEPT,
213         BINDSTATUS_COOKIE_STATE_REJECT,
214         BINDSTATUS_COOKIE_STATE_PROMPT,
215         BINDSTATUS_COOKIE_STATE_LEASH,
216         BINDSTATUS_COOKIE_STATE_DOWNGRADE,
217         BINDSTATUS_POLICY_HREF,
218         BINDSTATUS_P3P_HEADER,
219         BINDSTATUS_SESSION_COOKIE_RECEIVED,
220         BINDSTATUS_PERSISTENT_COOKIE_RECEIVED,
221         BINDSTATUS_SESSION_COOKIES_ALLOWED,
222         BINDSTATUS_CACHECONTROL
223     } BINDSTATUS;
224
225
226     HRESULT OnStartBinding(
227         [in] DWORD dwReserved,
228         [in] IBinding * pib);
229
230     HRESULT GetPriority(
231         [out] LONG * pnPriority);
232
233     HRESULT OnLowResource(
234         [in] DWORD reserved);
235
236     HRESULT OnProgress(
237         [in] ULONG ulProgress,
238         [in] ULONG ulProgressMax,
239         [in] ULONG ulStatusCode,
240         [in] LPCWSTR szStatusText);
241
242     HRESULT OnStopBinding(
243         [in] HRESULT hresult,
244         [in, unique] LPCWSTR szError);
245
246     [local]
247     HRESULT GetBindInfo(
248         [out] DWORD *grfBINDF,
249         [in, out, unique] BINDINFO * pbindinfo);
250
251     [call_as(GetBindInfo)]
252     HRESULT RemoteGetBindInfo(
253         [out] DWORD *grfBINDF,
254         [in, out, unique] RemBINDINFO * pbindinfo,
255         [in, out, unique] RemSTGMEDIUM* pstgmed);
256
257     [local]
258     HRESULT OnDataAvailable(
259         [in] DWORD grfBSCF,
260         [in] DWORD dwSize,
261         [in] FORMATETC* pformatetc,
262         [in] STGMEDIUM* pstgmed);
263
264     [call_as(OnDataAvailable)]
265     HRESULT RemoteOnDataAvailable(
266         [in] DWORD grfBSCF,
267         [in] DWORD dwSize,
268         [in] RemFORMATETC *pformatetc,
269         [in] RemSTGMEDIUM* pstgmed);
270
271     HRESULT OnObjectAvailable(
272         [in] REFIID riid,
273         [in, iid_is(riid)] IUnknown* punk);
274 }
275
276 /*****************************************************************************
277  * IAuthenticate interface
278  */
279 [
280     local,
281     object,
282     uuid(79EAC9D0-BAf9-11CE-8C82-00AA004BA90B),
283     pointer_default(unique)
284 ]
285 interface IAuthenticate : IUnknown
286 {
287     typedef [unique] IAuthenticate *LPAUTHENTICATION;
288
289     HRESULT Authenticate(
290         [out] HWND* phwnd,
291         [out] LPWSTR *pszUsername,
292         [out] LPWSTR *pszPassword);
293 }
294
295 /*****************************************************************************
296  * IBindHost interface
297  */
298 cpp_quote("#define SID_IBindHost IID_IBindHost")
299 cpp_quote("#define SID_SBindHost IID_IBindHost")
300 [
301     object,
302     uuid(fc4801a1-2ba9-11cf-a229-00aa003d7352),
303     pointer_default(unique)
304 ]
305 interface IBindHost : IUnknown
306 {
307     typedef [unique] IBindHost *LPBINDHOST;
308
309     HRESULT CreateMoniker(
310         [in] LPOLESTR szName,
311         [in] IBindCtx *pBC,
312         [out] IMoniker** ppmk,
313         [in] DWORD dwReserved);
314
315     [local]
316     HRESULT MonikerBindToStorage(
317         [in] IMoniker *pMk,
318         [in] IBindCtx *pBC,
319         [in] IBindStatusCallback *pBSC,
320         [in] REFIID riid,
321         [out] void **ppvObj);
322
323     [call_as(MonikerBindToStorage)]
324     HRESULT RemoteMonikerBindToStorage(
325         [in, unique] IMoniker *pMk,
326         [in, unique] IBindCtx *pBC,
327         [in, unique] IBindStatusCallback *pBSC,
328         [in] REFIID riid,
329         [out, iid_is(riid)] IUnknown **ppvObj);
330
331     [local]
332     HRESULT MonikerBindToObject(
333         [in] IMoniker *pMk,
334         [in] IBindCtx *pBC,
335         [in] IBindStatusCallback *pBSC,
336         [in] REFIID riid,
337         [out] void **ppvObj);
338
339     [call_as(MonikerBindToObject)]
340     HRESULT RemoteMonikerBindToObject(
341         [in, unique] IMoniker *pMk,
342         [in, unique] IBindCtx *pBC,
343         [in, unique] IBindStatusCallback *pBSC,
344         [in] REFIID riid,
345         [out, iid_is(riid)] IUnknown **ppvObj);
346 }
347
348
349 /*****************************************************************************
350  * IWinInetInfo interface
351  */
352 [
353     object,
354     uuid(79eac9d6-bafa-11ce-8c82-00aa004ba90b),
355     pointer_default(unique)
356 ]
357 interface IWinInetInfo : IUnknown
358 {
359     typedef [unique] IWinInetInfo *LPWININETINFO;
360
361     [local]
362     HRESULT QueryOption(
363         [in] DWORD dwOption,
364         [in, out, size_is(*pcbBuf)] LPVOID pBuffer,
365         [in, out] DWORD *pcbBuf);
366
367     [call_as(QueryOption)]
368     HRESULT RemoteQueryOption(
369         [in] DWORD  dwOption,
370         [in, out, size_is(*pcbBuf)] BYTE *pBuffer,
371         [in, out] DWORD *pcbBuf);
372 }
373
374
375
376 /*****************************************************************************
377  * IWinInetHttpInfo interface
378  */
379 [
380     object,
381     uuid(79eac9d8-bafa-11ce-8c82-00aa004ba90b),
382     pointer_default(unique)
383 ]
384 interface IWinInetHttpInfo : IWinInetInfo
385 {
386     typedef [unique] IWinInetHttpInfo *LPWININETHTTPINFO;
387
388     [local]
389     HRESULT QueryInfo(
390         [in] DWORD dwOption,
391         [in, out,size_is(*pcbBuf)] LPVOID pBuffer,
392         [in, out] DWORD *pcbBuf,
393         [in, out] DWORD *pdwFlags,
394         [in, out] DWORD *pdwReserved);
395
396     [call_as(QueryInfo)]
397     HRESULT RemoteQueryInfo(
398         [in] DWORD dwOption,
399         [in,out,size_is(*pcbBuf)] BYTE *pBuffer,
400         [in, out] DWORD *pcbBuf,
401         [in, out] DWORD *pdwFlags,
402         [in, out] DWORD *pdwReserved);
403 }
404
405
406
407 /*****************************************************************************
408  * IPersistMoniker interface
409  */
410 [
411     object,
412     uuid(79eac9c9-baf9-11ce-8c82-00aa004ba90b),
413     pointer_default(unique)
414 ]
415 interface IPersistMoniker : IUnknown
416 {
417     typedef [unique] IPersistMoniker *LPPERSISTMONIKER;
418
419     HRESULT GetClassID(
420         [out] CLSID *pClassID);
421
422     HRESULT IsDirty();
423
424     HRESULT Load(
425         [in] BOOL fFullyAvailable,
426         [in] IMoniker *pimkName,
427         [in] LPBC pibc,
428         [in] DWORD grfMode);
429
430     HRESULT Save(
431         [in] IMoniker *pimkName,
432         [in] LPBC pbc,
433         [in] BOOL fRemember);
434
435     HRESULT SaveCompleted(
436         [in] IMoniker *pimkName,
437         [in] LPBC pibc);
438
439     HRESULT GetCurMoniker(
440         [out] IMoniker **ppimkName);
441 }
442
443 /*****************************************************************************
444  * IInternetBindInfo interface
445  */
446 [
447         local,
448         object,
449         uuid(79EAC9E1-BAF9-11CE-8C82-00AA004BA90B),
450         pointer_default(unique)
451 ]
452 interface IInternetBindInfo : IUnknown
453 {
454     typedef [unique] IInternetBindInfo *LPIINTERNETBINDINFO;
455
456     typedef enum tagBINDSTRING
457     {
458         BINDSTRING_HEADERS = 1,
459         BINDSTRING_ACCEPT_MIMES,
460         BINDSTRING_EXTRA_URL,
461         BINDSTRING_LANGUAGE,
462         BINDSTRING_USERNAME,
463         BINDSTRING_PASSWORD,
464         BINDSTRING_UA_PIXELS,
465         BINDSTRING_UA_COLOR,
466         BINDSTRING_OS,
467         BINDSTRING_USER_AGENT,
468         BINDSTRING_ACCEPT_ENCODINGS,
469         BINDSTRING_POST_COOKIE,
470         BINDSTRING_POST_DATA_MIME,
471         BINDSTRING_URL
472     } BINDSTRING;
473
474     HRESULT GetBindInfo(
475         [out] DWORD *grfBINDF,
476         [in, out, unique] BINDINFO *pbindinfo);
477
478     HRESULT GetBindString(
479         [in]      ULONG ulStringType,
480         [in, out] LPOLESTR *ppwzStr,
481         [in]      ULONG cEl,
482         [in, out] ULONG *pcElFetched);
483 }
484
485 /*****************************************************************************
486  * IInternetProtocolRoot interface
487  */
488 [
489     local,
490     object,
491     uuid(79EAC9E3-BAF9-11CE-8C82-00AA004BA90B),
492     pointer_default(unique)
493 ]
494 interface IInternetProtocolRoot : IUnknown
495 {
496     typedef [unique] IInternetProtocolRoot *LPIINTERNETPROTOCOLROOT;
497
498     typedef enum _tagPI_FLAGS
499     {
500         PI_PARSE_URL         = 0x00000001,
501         PI_FILTER_MODE       = 0x00000002,
502         PI_FORCE_ASYNC       = 0x00000004,
503         PI_USE_WORKERTHREAD  = 0x00000008,
504         PI_MIMEVERIFICATION  = 0x00000010,
505         PI_CLSIDLOOKUP       = 0x00000020,
506         PI_DATAPROGRESS      = 0x00000040,
507         PI_SYNCHRONOUS       = 0x00000080,
508         PI_APARTMENTTHREADED = 0x00000100,
509         PI_CLASSINSTALL      = 0x00000200,
510         PD_FORCE_SWITCH      = 0x00010000
511     } PI_FLAGS;
512
513     typedef struct _tagPROTOCOLDATA
514     {
515         DWORD grfFlags;
516         DWORD dwState;
517         LPVOID pData;
518         ULONG cbData;
519     } PROTOCOLDATA;
520
521     HRESULT Start(
522         [in] LPCWSTR szUrl,
523         [in] IInternetProtocolSink *pOIProtSink,
524         [in] IInternetBindInfo *pOIBindInfo,
525         [in] DWORD grfPI,
526         [in] DWORD dwReserved);
527
528     HRESULT Continue(
529         [in] PROTOCOLDATA *pProtocolData);
530
531     HRESULT Abort(
532         [in] HRESULT hrReason,
533         [in] DWORD dwOptions);
534
535     HRESULT Terminate(
536         [in] DWORD dwOptions);
537
538     HRESULT Suspend();
539
540     HRESULT Resume();
541 }
542
543 /*****************************************************************************
544  * IInternetProtocolSink interface
545  */
546 [
547     local,
548     object,
549     uuid(79EAC9E5-BAF9-11CE-8C82-00AA004BA90B),
550     pointer_default(unique)
551 ]
552 interface IInternetProtocolSink : IUnknown
553 {
554     typedef [unique] IInternetProtocolSink *LPIINTERNETPROTOCOLSINK;
555
556     HRESULT Switch(
557         [in] PROTOCOLDATA *pProtocolData);
558
559     HRESULT ReportProgress(
560         [in] ULONG ulStatusCode,
561         [in] LPCWSTR szStatusText);
562
563     HRESULT ReportData(
564         [in] DWORD grfBSCF,
565         [in] ULONG ulProgress,
566         [in] ULONG ulProgressMax);
567
568     HRESULT ReportResult(
569         [in] HRESULT hrResult,
570         [in] DWORD dwError,
571         [in] LPCWSTR szResult);
572 }
573
574 /*****************************************************************************
575  * IInternetProtocol interface
576  */
577 [
578     local,
579     object,
580     uuid(79EAC9E4-BAF9-11CE-8C82-00AA004BA90B),
581     pointer_default(unique)
582 ]
583 interface IInternetProtocol : IInternetProtocolRoot
584 {
585     typedef [unique] IInternetProtocol *LPIINTERNETPROTOCOL;
586
587     HRESULT Read(
588         [in,out, size_is(cb), length_is(*pcbRead)] void *pv,
589         [in]  ULONG cb,
590         [out] ULONG *pcbRead);
591
592     HRESULT Seek(
593         [in]  LARGE_INTEGER dlibMove,
594         [in]  DWORD dwOrigin,
595         [out] ULARGE_INTEGER *plibNewPosition);
596
597     HRESULT LockRequest(
598         [in] DWORD dwOptions);
599
600     HRESULT UnlockRequest();
601 }
602
603 /*****************************************************************************
604  * IInternetProtocolInfo interface
605  */
606 [
607     local,
608     object,
609     uuid(79eac9ec-baf9-11ce-8c82-00aa004ba90b),
610     pointer_default(unique)
611 ]
612 interface IInternetProtocolInfo : IUnknown
613 {
614     typedef [unique] IInternetProtocolInfo *LPIINTERNETPROTOCOLINFO;
615
616     typedef enum _tagPARSEACTION
617     {
618         PARSE_CANONICALIZE = 1,
619         PARSE_FRIENDLY,
620         PARSE_SECURITY_URL,
621         PARSE_ROOTDOCUMENT,
622         PARSE_DOCUMENT,
623         PARSE_ANCHOR,
624         PARSE_ENCODE,
625         PARSE_DECODE,
626         PARSE_PATH_FROM_URL,
627         PARSE_URL_FROM_PATH,
628         PARSE_MIME,
629         PARSE_SERVER,
630         PARSE_SCHEMA,
631         PARSE_SITE,
632         PARSE_DOMAIN,
633         PARSE_LOCATION,
634         PARSE_SECURITY_DOMAIN,
635         PARSE_ESCAPE,
636         PARSE_UNESCAPE
637     } PARSEACTION;
638
639     typedef enum _tagPSUACTION
640     {
641         PSU_DEFAULT = 1,
642         PSU_SECURITY_URL_ONLY
643     } PSUACTION;
644
645     typedef enum _tagQUERYOPTION
646     {
647         QUERY_EXPIRATION_DATE = 1,
648         QUERY_TIME_OF_LAST_CHANGE,
649         QUERY_CONTENT_ENCODING,
650         QUERY_CONTENT_TYPE,
651         QUERY_REFRESH,
652         QUERY_RECOMBINE,
653         QUERY_CAN_NAVIGATE,
654         QUERY_USES_NETWORK,
655         QUERY_IS_CACHED,
656         QUERY_IS_INSTALLEDENTRY,
657         QUERY_IS_CACHED_OR_MAPPED,
658         QUERY_USES_CACHE,
659         QUERY_IS_SECURE,
660         QUERY_IS_SAFE
661     } QUERYOPTION;
662
663     HRESULT ParseUrl(
664         [in] LPCWSTR pwzUrl,
665         [in] PARSEACTION ParseAction,
666         [in] DWORD dwParseFlags,
667         [out] LPWSTR pwzResult,
668         [in] DWORD cchResult,
669         [out] DWORD *pcchResult,
670         [in] DWORD dwReserved);
671
672     HRESULT CombineUrl(
673         [in] LPCWSTR pwzBaseUrl,
674         [in] LPCWSTR pwzRelativeUrl,
675         [in] DWORD dwCombineFlags,
676         [out] LPWSTR pwzResult,
677         [in] DWORD cchResult,
678         [out] DWORD *pcchResult,
679         [in] DWORD dwReserved);
680
681     HRESULT CompareUrl(
682         [in] LPCWSTR pwzUrl1,
683         [in] LPCWSTR pwzUrl2,
684         [in] DWORD dwCompareFlags);
685
686     HRESULT QueryInfo(
687         [in] LPCWSTR pwzUrl,
688         [in] QUERYOPTION OueryOption,
689         [in] DWORD dwQueryFlags,
690         [in, out,size_is(*pcbBuf)] LPVOID pBuffer,
691         [in] DWORD cbBuffer,
692         [in, out] DWORD *pcbBuf,
693         [in] DWORD dwReserved);
694 }
695
696 /*****************************************************************************
697  * IInternetSession interface
698  */
699 [
700     local,
701     object,
702     uuid(79eac9e7-baf9-11ce-8c82-00aa004ba90b),
703     pointer_default(unique)
704 ]
705 interface IInternetSession : IUnknown
706 {
707     typedef [unique] IInternetSession *LPIINTERNETSESSION;
708
709     typedef enum _tagOIBDG_FLAGS
710     {
711         OIBDG_APARTMENTTHREADED = 0x0100,
712         OIBDG_DATAONLY          = 0x1000
713     } OIBDG_FLAGS;
714
715     HRESULT RegisterNameSpace(
716         [in] IClassFactory *pCF,
717         [in] REFCLSID rclsid,
718         [in] LPCWSTR pwzProtocol,
719         [in] ULONG cPatterns,
720         [in] const LPCWSTR *ppwzPatterns,
721         [in] DWORD dwReserved);
722
723     HRESULT UnregisterNameSpace(
724         [in] IClassFactory *pCF,
725         [in] LPCWSTR pszProtocol);
726
727     HRESULT RegisterMimeFilter(
728         [in] IClassFactory *pCF,
729         [in] REFCLSID rclsid,
730         [in] LPCWSTR pwzType);
731
732     HRESULT UnregisterMimeFilter(
733         [in] IClassFactory *pCF,
734         [in] LPCWSTR pwzType);
735
736     HRESULT CreateBinding(
737         [in] LPBC pBC,
738         [in] LPCWSTR szUrl,
739         [in] IUnknown *pUnkOuter,
740         [out, unique] IUnknown **ppUnk,
741         [out, unique] /*IInternetProtocol*/ void **ppOInetProt,
742         [in] DWORD dwOption);
743
744     HRESULT SetSessionOption(
745         [in] DWORD dwOption,
746         [in] LPVOID pBuffer,
747         [in] DWORD dwBufferLength,
748         [in] DWORD dwReserved);
749 }
750
751 /*****************************************************************************
752  * IInternetSecurityMgrSite interface
753  */
754 [
755     local,
756     object,
757     uuid(79eac9ed-baf9-11ce-8c82-00aa004ba90b),
758     pointer_default(unique)
759 ]
760 interface IInternetSecurityMgrSite : IUnknown
761 {
762     HRESULT GetWindow(
763         [out] HWND *phwnd);
764
765     HRESULT EnableModeless(
766         [in] BOOL fEnable);
767 };
768
769
770 /*****************************************************************************
771  * IInternetSecurityManager interface
772  */
773 cpp_quote("#define SID_SInternetSecurityManager IID_IInternetSecurityManager")
774
775 [
776     object,
777     uuid(79eac9ee-baf9-11ce-8c82-00aa004ba90b),
778     pointer_default(unique)
779 ]
780 interface IInternetSecurityManager : IUnknown
781 {
782     HRESULT SetSecuritySite(
783         [in, unique] IInternetSecurityMgrSite *pSite);
784
785     HRESULT GetSecuritySite(
786         [out] IInternetSecurityMgrSite **ppSite);
787
788     HRESULT MapUrlToZone(
789         [in] LPCWSTR pwszUrl,
790         [out] DWORD *pdwZone,
791         [in] DWORD dwFlags);
792
793 cpp_quote("#define MAX_SIZE_SECURITY_ID 512")
794
795     HRESULT GetSecurityId(
796         [in] LPCWSTR pwszUrl,
797         [out, size_is(*pcbSecurityId)] BYTE *pbSecurityId,
798         [in, out] DWORD *pcbSecurityId,
799         [in] DWORD dwReserved);
800
801
802     typedef enum {
803         PUAF_DEFAULT                = 0x00,
804         PUAF_NOUI                   = 0x01,
805         PUAF_ISFILE                 = 0x02,
806         PUAF_WARN_IF_DENIED         = 0x04,
807         PUAF_FORCEUI_FOREGROUND     = 0x08,
808         PUAF_CHECK_TIPS             = 0x10
809     } PUAF;
810
811     HRESULT ProcessUrlAction(
812         [in] LPCWSTR pwszUrl,
813         [in] DWORD dwAction,
814         [out, size_is(cbPolicy)] BYTE *pPolicy,
815         [in] DWORD cbPolicy,
816         [in] BYTE *pContext,
817         [in] DWORD cbContext,
818         [in] DWORD dwFlags,
819         [in] DWORD dwReserved);
820
821     HRESULT QueryCustomPolicy(
822         [in] LPCWSTR pwszUrl,
823         [in] REFGUID guidKey,
824         [out, size_is(*pcbPolicy)] BYTE **ppPolicy,
825         [out] DWORD *pcbPolicy,
826         [in] BYTE *pContext,
827         [in] DWORD cbContext,
828         [in] DWORD dwReserved);
829
830     typedef enum {
831         SZM_CREATE = 0x0,
832         SZM_DELETE = 0x1
833     } SZM_FLAGS;
834
835     HRESULT SetZoneMapping(
836         [in] DWORD dwZone,
837         [in] LPCWSTR lpszPattern,
838         [in] DWORD dwFlags);
839
840     HRESULT GetZoneMappings(
841         [in] DWORD dwZone,
842         [out] IEnumString **ppenumString,
843         [in] DWORD dwFlags);
844 };
845
846 /*****************************************************************************
847  * IInternetZoneManager interface
848  */
849 [
850     local,
851     object,
852     uuid(79EAC9EF-BAf9-11CE-8C82-00AA004BA90B),
853     pointer_default(unique)
854 ]
855 interface IInternetZoneManager : IUnknown
856 {
857     typedef [unique] IInternetZoneManager* LPURLZONEMANAGER;
858
859     typedef enum tagURLZONE
860     {
861         URLZONE_PREDEFINED_MIN  = 0,
862         URLZONE_LOCAL_MACHINE   = 0,
863         URLZONE_INTRANET        = 1,
864         URLZONE_TRUSTED         = 2,
865         URLZONE_INTERNET        = 3,
866         URLZONE_UNTRUSTED       = 4,
867         URLZONE_PREDEFINED_MAX  = 999,
868         URLZONE_USER_MIN        = 1000,
869         URLZONE_USER_MAX        = 10000,
870     }  URLZONE;
871
872     typedef enum tagURLTEMPLATE
873     {
874         URLTEMPLATE_CUSTOM         = 0x00000,
875         URLTEMPLATE_PREDEFINED_MIN = 0x10000,
876         URLTEMPLATE_LOW            = 0x10000,
877         URLTEMPLATE_MEDIUM         = 0x11000,
878         URLTEMPLATE_HIGH           = 0x12000,
879         URLTEMPLATE_PREDEFINED_MAX = 0x20000,
880     } URLTEMPLATE ;
881
882     typedef enum {
883         ZAFLAGS_CUSTOM_EDIT            = 0x00000001,
884         ZAFLAGS_ADD_SITES              = 0x00000002,
885         ZAFLAGS_REQUIRE_VERIFICATION   = 0x00000004,
886         ZAFLAGS_INCLUDE_PROXY_OVERRIDE = 0x00000008,
887         ZAFLAGS_INCLUDE_INTRANET_SITES = 0x00000010,
888         ZAFLAGS_NO_UI                  = 0x00000020,
889         ZAFLAGS_SUPPORTS_VERIFICATION  = 0x00000040,
890         ZAFLAGS_UNC_AS_INTRANET        = 0x00000080,
891     } ZAFLAGS ;
892
893     enum {
894         MAX_ZONE_PATH        = 260,
895         MAX_ZONE_DESCRIPTION = 200
896     };
897
898     typedef struct _ZONEATTRIBUTES {
899         ULONG cbSize;
900         WCHAR szDisplayName[MAX_ZONE_PATH];
901         WCHAR szDescription[MAX_ZONE_DESCRIPTION];
902         WCHAR szIconPath[MAX_ZONE_PATH];
903         DWORD dwTemplateMinLevel;
904         DWORD dwTemplateRecommended;
905         DWORD dwTemplateCurrentLevel;
906         DWORD dwFlags;
907     } ZONEATTRIBUTES, *LPZONEATTRIBUTES;
908
909     typedef enum _URLZONEREG {
910         URLZONEREG_DEFAULT,
911         URLZONEREG_HKLM,
912         URLZONEREG_HKCU
913     } URLZONEREG;
914
915     HRESULT GetZoneAttributes(
916         [in]              DWORD dwZone,
917         [in, out, unique] ZONEATTRIBUTES* pZoneAttributes);
918
919     HRESULT SetZoneAttributes(
920         [in] DWORD dwZone,
921         [in] ZONEATTRIBUTES* pZoneAttributes);
922
923     HRESULT GetZoneCustomPolicy(
924         [in]  DWORD dwZone,
925         [in]  REFGUID guidKey,
926         [out] BYTE **ppPolicy,
927         [out] DWORD* pcbPolicy,
928         [in]  URLZONEREG ulrZoneReg);
929
930     HRESULT SetZoneCustomPolicy(
931         [in] DWORD dwZone,
932         [in] REFGUID guidKey,
933         [in] BYTE *ppPolicy,
934         [in] DWORD pcbPolicy,
935         [in] URLZONEREG ulrZoneReg);
936
937     HRESULT GetZoneActionPolicy(
938         [in]  DWORD dwZone,
939         [in]  DWORD dwAction,
940         [out] BYTE* pPolicy,
941         [in]  DWORD cbPolicy,
942         [in]  URLZONEREG urlZoneReg);
943
944     HRESULT SetZoneActionPolicy(
945         [in] DWORD dwZone,
946         [in] DWORD dwAction,
947         [in] BYTE* pPolicy,
948         [in] DWORD cbPolicy,
949         [in] URLZONEREG urlZoneReg);
950
951     HRESULT LogAction(
952         [in] DWORD dwAction,
953         [in] LPCWSTR pwszUrl,
954         [in] LPCWSTR pwszText,
955         [in] DWORD dwLogFlags);
956
957     HRESULT CreateZoneEnumerator(
958         [out] DWORD* pdwEnum,
959         [out] DWORD* pdwCount,
960         [in]  DWORD dwFlags);
961
962     HRESULT GetZoneAt(
963         [in]  DWORD dwEnum,
964         [in]  DWORD dwIndex,
965         [out] DWORD* pdwZone);
966
967     HRESULT DestroyZoneEnumerator(
968         [in] DWORD dwEnum);
969
970     HRESULT CopyTemplatePoliciesToZone(
971         [in] DWORD dwTemplate,
972         [in] DWORD dwZone,
973         [in] DWORD dwReserved);
974 }
975
976 cpp_quote("DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);")
977 cpp_quote("DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);")
978 cpp_quote("DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
979 cpp_quote("DEFINE_GUID(IID_IAsyncBindCtx, 0x79EAC9D4, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
980 cpp_quote("DEFINE_GUID(CLSID_StdURLMoniker, 0x79EAC9E0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
981
982 cpp_quote("#define MK_S_ASYNCHRONOUS                0x000401E8")
983 cpp_quote("#define S_ASYNCHRONOUS                   MK_S_ASYNCHRONOUS")
984
985 cpp_quote("#define INET_E_ERROR_FIRST               0x800C0002L")
986 cpp_quote("#define INET_E_INVALID_URL               0x800C0002L")
987 cpp_quote("#define INET_E_NO_SESSION                0x800C0003L")
988 cpp_quote("#define INET_E_CANNOT_CONNECT            0x800C0004L")
989 cpp_quote("#define INET_E_RESOURCE_NOT_FOUND        0x800C0005L")
990 cpp_quote("#define INET_E_OBJECT_NOT_FOUND          0x800C0006L")
991 cpp_quote("#define INET_E_DATA_NOT_AVAILABLE        0x800C0007L")
992 cpp_quote("#define INET_E_DOWNLOAD_FAILURE          0x800C0008L")
993 cpp_quote("#define INET_E_AUTHENTICATION_REQUIRED   0x800C0009L")
994 cpp_quote("#define INET_E_NO_VALID_MEDIA            0x800C000AL")
995 cpp_quote("#define INET_E_CONNECTION_TIMEOUT        0x800C000BL")
996 cpp_quote("#define INET_E_INVALID_REQUEST           0x800C000CL")
997 cpp_quote("#define INET_E_UNKNOWN_PROTOCOL          0x800C000DL")
998 cpp_quote("#define INET_E_SECURITY_PROBLEM          0x800C000EL")
999 cpp_quote("#define INET_E_CANNOT_LOAD_DATA          0x800C000FL")
1000 cpp_quote("#define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L")
1001 cpp_quote("#define INET_E_QUERYOPTION_UNKNOWN       0x800C0013L")
1002 cpp_quote("#define INET_E_REDIRECT_FAILED           0x800C0014L")
1003 cpp_quote("#define INET_E_REDIRECT_TO_DIR           0x800C0015L")
1004 cpp_quote("#define INET_E_CANNOT_LOCK_REQUEST       0x800C0016L")
1005 cpp_quote("#define INET_E_ERROR_LAST                INET_E_REDIRECT_TO_DIR")
1006
1007 cpp_quote("HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk);")
1008 cpp_quote("HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbsc, DWORD dwReserved);")
1009 cpp_quote("HRESULT WINAPI CompareSecurityIds(BYTE*,DWORD,BYTE*,DWORD,DWORD);")
1010 cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN pCaller, LPCSTR szURL,  LPCSTR  szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")
1011 cpp_quote("HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")
1012 cpp_quote("HRESULT WINAPI CoInternetGetSession(DWORD,IInternetSession**,DWORD);")
1013 cpp_quote("HRESULT WINAPI MkParseDisplayNameEx(IBindCtx*,LPCWSTR,ULONG*,IMoniker**);")
1014 cpp_quote("HRESULT WINAPI IsAsyncMoniker(IMoniker* pmk);")
1015 cpp_quote("HRESULT WINAPI CreateAsyncBindCtx(DWORD, IBindStatusCallback*, IEnumFORMATETC*, IBindCtx**);")
1016 cpp_quote("HRESULT WINAPI CoInternetCombineUrl(LPCWSTR,LPCWSTR,DWORD,LPWSTR,DWORD,DWORD*,DWORD);")
1017 cpp_quote("HRESULT WINAPI CoInternetCompareUrl(LPCWSTR,LPCWSTR,DWORD);");
1018 cpp_quote("HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider*, IInternetZoneManager**, DWORD);");
1019
1020 cpp_quote("#define OInetCombineUrl CoInternetCombineUrl")
1021 cpp_quote("#define OInetCompareUrl CoInternetCompareUrl")
1022 cpp_quote("#define OInetGetSession CoInternetGetSession")
1023
1024 cpp_quote("#define MKSYS_URLMONIKER 6")