Fixed install rule (reported by Vincent BĂ©ron).
[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  * IMonikerProp interface
445  */
446 [
447     object,
448     uuid(A5CA5F7F-1847-4D87-9C5B-918509F7511D),
449     pointer_default(unique)
450 ]
451 interface IMonikerProp : IUnknown
452 {
453     typedef [unique] IMonikerProp *LPMONIKERPROP;
454
455     typedef enum {
456         MIMETYPEPROP = 0x00000000,
457         USE_SRC_URL  = 0x00000001
458     } MONIKERPROPERTY;
459
460     HRESULT PutProperty(
461         [in] MONIKERPROPERTY mkp,
462         [in] LPCWSTR val);
463 }
464
465 /*****************************************************************************
466  * IInternetBindInfo interface
467  */
468 [
469     local,
470     object,
471     uuid(79EAC9E1-BAF9-11CE-8C82-00AA004BA90B),
472     pointer_default(unique)
473 ]
474 interface IInternetBindInfo : IUnknown
475 {
476     typedef [unique] IInternetBindInfo *LPIINTERNETBINDINFO;
477
478     typedef enum tagBINDSTRING
479     {
480         BINDSTRING_HEADERS = 1,
481         BINDSTRING_ACCEPT_MIMES,
482         BINDSTRING_EXTRA_URL,
483         BINDSTRING_LANGUAGE,
484         BINDSTRING_USERNAME,
485         BINDSTRING_PASSWORD,
486         BINDSTRING_UA_PIXELS,
487         BINDSTRING_UA_COLOR,
488         BINDSTRING_OS,
489         BINDSTRING_USER_AGENT,
490         BINDSTRING_ACCEPT_ENCODINGS,
491         BINDSTRING_POST_COOKIE,
492         BINDSTRING_POST_DATA_MIME,
493         BINDSTRING_URL
494     } BINDSTRING;
495
496     HRESULT GetBindInfo(
497         [out] DWORD *grfBINDF,
498         [in, out, unique] BINDINFO *pbindinfo);
499
500     HRESULT GetBindString(
501         [in]      ULONG ulStringType,
502         [in, out] LPOLESTR *ppwzStr,
503         [in]      ULONG cEl,
504         [in, out] ULONG *pcElFetched);
505 }
506
507 /*****************************************************************************
508  * IInternetPriority interface
509  */
510 [
511     local,
512     object,
513     uuid(79EAC9EB-BAF9-11CE-8C82-00AA004BA90B),
514     pointer_default(unique)
515 ]
516 interface IInternetPriority : IUnknown
517 {
518     typedef [unique] IInternetPriority *LPIINTERNETPRIORITY;
519
520     HRESULT SetPriority([in] LONG nPriority);
521     HRESULT GetPriority([out] LONG *pnPriority);
522 }
523
524 /*****************************************************************************
525  * IInternetProtocolRoot interface
526  */
527 [
528     local,
529     object,
530     uuid(79EAC9E3-BAF9-11CE-8C82-00AA004BA90B),
531     pointer_default(unique)
532 ]
533 interface IInternetProtocolRoot : IUnknown
534 {
535     typedef [unique] IInternetProtocolRoot *LPIINTERNETPROTOCOLROOT;
536
537     typedef enum _tagPI_FLAGS
538     {
539         PI_PARSE_URL         = 0x00000001,
540         PI_FILTER_MODE       = 0x00000002,
541         PI_FORCE_ASYNC       = 0x00000004,
542         PI_USE_WORKERTHREAD  = 0x00000008,
543         PI_MIMEVERIFICATION  = 0x00000010,
544         PI_CLSIDLOOKUP       = 0x00000020,
545         PI_DATAPROGRESS      = 0x00000040,
546         PI_SYNCHRONOUS       = 0x00000080,
547         PI_APARTMENTTHREADED = 0x00000100,
548         PI_CLASSINSTALL      = 0x00000200,
549         PD_FORCE_SWITCH      = 0x00010000
550     } PI_FLAGS;
551
552     typedef struct _tagPROTOCOLDATA
553     {
554         DWORD grfFlags;
555         DWORD dwState;
556         LPVOID pData;
557         ULONG cbData;
558     } PROTOCOLDATA;
559
560     HRESULT Start(
561         [in] LPCWSTR szUrl,
562         [in] IInternetProtocolSink *pOIProtSink,
563         [in] IInternetBindInfo *pOIBindInfo,
564         [in] DWORD grfPI,
565         [in] DWORD dwReserved);
566
567     HRESULT Continue(
568         [in] PROTOCOLDATA *pProtocolData);
569
570     HRESULT Abort(
571         [in] HRESULT hrReason,
572         [in] DWORD dwOptions);
573
574     HRESULT Terminate(
575         [in] DWORD dwOptions);
576
577     HRESULT Suspend();
578
579     HRESULT Resume();
580 }
581
582 /*****************************************************************************
583  * IInternetProtocolSink interface
584  */
585 [
586     local,
587     object,
588     uuid(79EAC9E5-BAF9-11CE-8C82-00AA004BA90B),
589     pointer_default(unique)
590 ]
591 interface IInternetProtocolSink : IUnknown
592 {
593     typedef [unique] IInternetProtocolSink *LPIINTERNETPROTOCOLSINK;
594
595     HRESULT Switch(
596         [in] PROTOCOLDATA *pProtocolData);
597
598     HRESULT ReportProgress(
599         [in] ULONG ulStatusCode,
600         [in] LPCWSTR szStatusText);
601
602     HRESULT ReportData(
603         [in] DWORD grfBSCF,
604         [in] ULONG ulProgress,
605         [in] ULONG ulProgressMax);
606
607     HRESULT ReportResult(
608         [in] HRESULT hrResult,
609         [in] DWORD dwError,
610         [in] LPCWSTR szResult);
611 }
612
613 /*****************************************************************************
614  * IInternetProtocol interface
615  */
616 [
617     local,
618     object,
619     uuid(79EAC9E4-BAF9-11CE-8C82-00AA004BA90B),
620     pointer_default(unique)
621 ]
622 interface IInternetProtocol : IInternetProtocolRoot
623 {
624     typedef [unique] IInternetProtocol *LPIINTERNETPROTOCOL;
625
626     HRESULT Read(
627         [in,out, size_is(cb), length_is(*pcbRead)] void *pv,
628         [in]  ULONG cb,
629         [out] ULONG *pcbRead);
630
631     HRESULT Seek(
632         [in]  LARGE_INTEGER dlibMove,
633         [in]  DWORD dwOrigin,
634         [out] ULARGE_INTEGER *plibNewPosition);
635
636     HRESULT LockRequest(
637         [in] DWORD dwOptions);
638
639     HRESULT UnlockRequest();
640 }
641
642 /*****************************************************************************
643  * IInternetProtocolInfo interface
644  */
645 [
646     local,
647     object,
648     uuid(79eac9ec-baf9-11ce-8c82-00aa004ba90b),
649     pointer_default(unique)
650 ]
651 interface IInternetProtocolInfo : IUnknown
652 {
653     typedef [unique] IInternetProtocolInfo *LPIINTERNETPROTOCOLINFO;
654
655     typedef enum _tagPARSEACTION
656     {
657         PARSE_CANONICALIZE = 1,
658         PARSE_FRIENDLY,
659         PARSE_SECURITY_URL,
660         PARSE_ROOTDOCUMENT,
661         PARSE_DOCUMENT,
662         PARSE_ANCHOR,
663         PARSE_ENCODE,
664         PARSE_DECODE,
665         PARSE_PATH_FROM_URL,
666         PARSE_URL_FROM_PATH,
667         PARSE_MIME,
668         PARSE_SERVER,
669         PARSE_SCHEMA,
670         PARSE_SITE,
671         PARSE_DOMAIN,
672         PARSE_LOCATION,
673         PARSE_SECURITY_DOMAIN,
674         PARSE_ESCAPE,
675         PARSE_UNESCAPE
676     } PARSEACTION;
677
678     typedef enum _tagPSUACTION
679     {
680         PSU_DEFAULT = 1,
681         PSU_SECURITY_URL_ONLY
682     } PSUACTION;
683
684     typedef enum _tagQUERYOPTION
685     {
686         QUERY_EXPIRATION_DATE = 1,
687         QUERY_TIME_OF_LAST_CHANGE,
688         QUERY_CONTENT_ENCODING,
689         QUERY_CONTENT_TYPE,
690         QUERY_REFRESH,
691         QUERY_RECOMBINE,
692         QUERY_CAN_NAVIGATE,
693         QUERY_USES_NETWORK,
694         QUERY_IS_CACHED,
695         QUERY_IS_INSTALLEDENTRY,
696         QUERY_IS_CACHED_OR_MAPPED,
697         QUERY_USES_CACHE,
698         QUERY_IS_SECURE,
699         QUERY_IS_SAFE
700     } QUERYOPTION;
701
702     HRESULT ParseUrl(
703         [in] LPCWSTR pwzUrl,
704         [in] PARSEACTION ParseAction,
705         [in] DWORD dwParseFlags,
706         [out] LPWSTR pwzResult,
707         [in] DWORD cchResult,
708         [out] DWORD *pcchResult,
709         [in] DWORD dwReserved);
710
711     HRESULT CombineUrl(
712         [in] LPCWSTR pwzBaseUrl,
713         [in] LPCWSTR pwzRelativeUrl,
714         [in] DWORD dwCombineFlags,
715         [out] LPWSTR pwzResult,
716         [in] DWORD cchResult,
717         [out] DWORD *pcchResult,
718         [in] DWORD dwReserved);
719
720     HRESULT CompareUrl(
721         [in] LPCWSTR pwzUrl1,
722         [in] LPCWSTR pwzUrl2,
723         [in] DWORD dwCompareFlags);
724
725     HRESULT QueryInfo(
726         [in] LPCWSTR pwzUrl,
727         [in] QUERYOPTION OueryOption,
728         [in] DWORD dwQueryFlags,
729         [in, out,size_is(*pcbBuf)] LPVOID pBuffer,
730         [in] DWORD cbBuffer,
731         [in, out] DWORD *pcbBuf,
732         [in] DWORD dwReserved);
733 }
734
735 /*****************************************************************************
736  * IInternetSession interface
737  */
738 [
739     local,
740     object,
741     uuid(79eac9e7-baf9-11ce-8c82-00aa004ba90b),
742     pointer_default(unique)
743 ]
744 interface IInternetSession : IUnknown
745 {
746     typedef [unique] IInternetSession *LPIINTERNETSESSION;
747
748     typedef enum _tagOIBDG_FLAGS
749     {
750         OIBDG_APARTMENTTHREADED = 0x0100,
751         OIBDG_DATAONLY          = 0x1000
752     } OIBDG_FLAGS;
753
754     HRESULT RegisterNameSpace(
755         [in] IClassFactory *pCF,
756         [in] REFCLSID rclsid,
757         [in] LPCWSTR pwzProtocol,
758         [in] ULONG cPatterns,
759         [in] const LPCWSTR *ppwzPatterns,
760         [in] DWORD dwReserved);
761
762     HRESULT UnregisterNameSpace(
763         [in] IClassFactory *pCF,
764         [in] LPCWSTR pszProtocol);
765
766     HRESULT RegisterMimeFilter(
767         [in] IClassFactory *pCF,
768         [in] REFCLSID rclsid,
769         [in] LPCWSTR pwzType);
770
771     HRESULT UnregisterMimeFilter(
772         [in] IClassFactory *pCF,
773         [in] LPCWSTR pwzType);
774
775     HRESULT CreateBinding(
776         [in] LPBC pBC,
777         [in] LPCWSTR szUrl,
778         [in] IUnknown *pUnkOuter,
779         [out, unique] IUnknown **ppUnk,
780         [out, unique] /*IInternetProtocol*/ void **ppOInetProt,
781         [in] DWORD dwOption);
782
783     HRESULT SetSessionOption(
784         [in] DWORD dwOption,
785         [in] LPVOID pBuffer,
786         [in] DWORD dwBufferLength,
787         [in] DWORD dwReserved);
788 }
789
790 /*****************************************************************************
791  * IInternetSecurityMgrSite interface
792  */
793 [
794     local,
795     object,
796     uuid(79eac9ed-baf9-11ce-8c82-00aa004ba90b),
797     pointer_default(unique)
798 ]
799 interface IInternetSecurityMgrSite : IUnknown
800 {
801     HRESULT GetWindow(
802         [out] HWND *phwnd);
803
804     HRESULT EnableModeless(
805         [in] BOOL fEnable);
806 };
807
808
809 /*****************************************************************************
810  * IInternetSecurityManager interface
811  */
812 cpp_quote("#define SID_SInternetSecurityManager IID_IInternetSecurityManager")
813
814 [
815     object,
816     uuid(79eac9ee-baf9-11ce-8c82-00aa004ba90b),
817     pointer_default(unique)
818 ]
819 interface IInternetSecurityManager : IUnknown
820 {
821     HRESULT SetSecuritySite(
822         [in, unique] IInternetSecurityMgrSite *pSite);
823
824     HRESULT GetSecuritySite(
825         [out] IInternetSecurityMgrSite **ppSite);
826
827     HRESULT MapUrlToZone(
828         [in] LPCWSTR pwszUrl,
829         [out] DWORD *pdwZone,
830         [in] DWORD dwFlags);
831
832 cpp_quote("#define MAX_SIZE_SECURITY_ID 512")
833
834     HRESULT GetSecurityId(
835         [in] LPCWSTR pwszUrl,
836         [out, size_is(*pcbSecurityId)] BYTE *pbSecurityId,
837         [in, out] DWORD *pcbSecurityId,
838         [in] DWORD dwReserved);
839
840
841     typedef enum {
842         PUAF_DEFAULT                = 0x00,
843         PUAF_NOUI                   = 0x01,
844         PUAF_ISFILE                 = 0x02,
845         PUAF_WARN_IF_DENIED         = 0x04,
846         PUAF_FORCEUI_FOREGROUND     = 0x08,
847         PUAF_CHECK_TIPS             = 0x10
848     } PUAF;
849
850     HRESULT ProcessUrlAction(
851         [in] LPCWSTR pwszUrl,
852         [in] DWORD dwAction,
853         [out, size_is(cbPolicy)] BYTE *pPolicy,
854         [in] DWORD cbPolicy,
855         [in] BYTE *pContext,
856         [in] DWORD cbContext,
857         [in] DWORD dwFlags,
858         [in] DWORD dwReserved);
859
860     HRESULT QueryCustomPolicy(
861         [in] LPCWSTR pwszUrl,
862         [in] REFGUID guidKey,
863         [out, size_is(*pcbPolicy)] BYTE **ppPolicy,
864         [out] DWORD *pcbPolicy,
865         [in] BYTE *pContext,
866         [in] DWORD cbContext,
867         [in] DWORD dwReserved);
868
869     typedef enum {
870         SZM_CREATE = 0x0,
871         SZM_DELETE = 0x1
872     } SZM_FLAGS;
873
874     HRESULT SetZoneMapping(
875         [in] DWORD dwZone,
876         [in] LPCWSTR lpszPattern,
877         [in] DWORD dwFlags);
878
879     HRESULT GetZoneMappings(
880         [in] DWORD dwZone,
881         [out] IEnumString **ppenumString,
882         [in] DWORD dwFlags);
883 };
884
885 /*****************************************************************************
886  * IInternetZoneManager interface
887  */
888 [
889     local,
890     object,
891     uuid(79EAC9EF-BAf9-11CE-8C82-00AA004BA90B),
892     pointer_default(unique)
893 ]
894 interface IInternetZoneManager : IUnknown
895 {
896     typedef [unique] IInternetZoneManager* LPURLZONEMANAGER;
897
898     typedef enum tagURLZONE
899     {
900         URLZONE_PREDEFINED_MIN  = 0,
901         URLZONE_LOCAL_MACHINE   = 0,
902         URLZONE_INTRANET        = 1,
903         URLZONE_TRUSTED         = 2,
904         URLZONE_INTERNET        = 3,
905         URLZONE_UNTRUSTED       = 4,
906         URLZONE_PREDEFINED_MAX  = 999,
907         URLZONE_USER_MIN        = 1000,
908         URLZONE_USER_MAX        = 10000,
909     }  URLZONE;
910
911     typedef enum tagURLTEMPLATE
912     {
913         URLTEMPLATE_CUSTOM         = 0x00000,
914         URLTEMPLATE_PREDEFINED_MIN = 0x10000,
915         URLTEMPLATE_LOW            = 0x10000,
916         URLTEMPLATE_MEDIUM         = 0x11000,
917         URLTEMPLATE_HIGH           = 0x12000,
918         URLTEMPLATE_PREDEFINED_MAX = 0x20000,
919     } URLTEMPLATE ;
920
921     typedef enum {
922         ZAFLAGS_CUSTOM_EDIT            = 0x00000001,
923         ZAFLAGS_ADD_SITES              = 0x00000002,
924         ZAFLAGS_REQUIRE_VERIFICATION   = 0x00000004,
925         ZAFLAGS_INCLUDE_PROXY_OVERRIDE = 0x00000008,
926         ZAFLAGS_INCLUDE_INTRANET_SITES = 0x00000010,
927         ZAFLAGS_NO_UI                  = 0x00000020,
928         ZAFLAGS_SUPPORTS_VERIFICATION  = 0x00000040,
929         ZAFLAGS_UNC_AS_INTRANET        = 0x00000080,
930     } ZAFLAGS ;
931
932     enum {
933         MAX_ZONE_PATH        = 260,
934         MAX_ZONE_DESCRIPTION = 200
935     };
936
937     typedef struct _ZONEATTRIBUTES {
938         ULONG cbSize;
939         WCHAR szDisplayName[MAX_ZONE_PATH];
940         WCHAR szDescription[MAX_ZONE_DESCRIPTION];
941         WCHAR szIconPath[MAX_ZONE_PATH];
942         DWORD dwTemplateMinLevel;
943         DWORD dwTemplateRecommended;
944         DWORD dwTemplateCurrentLevel;
945         DWORD dwFlags;
946     } ZONEATTRIBUTES, *LPZONEATTRIBUTES;
947
948     typedef enum _URLZONEREG {
949         URLZONEREG_DEFAULT,
950         URLZONEREG_HKLM,
951         URLZONEREG_HKCU
952     } URLZONEREG;
953
954     HRESULT GetZoneAttributes(
955         [in]              DWORD dwZone,
956         [in, out, unique] ZONEATTRIBUTES* pZoneAttributes);
957
958     HRESULT SetZoneAttributes(
959         [in] DWORD dwZone,
960         [in] ZONEATTRIBUTES* pZoneAttributes);
961
962     HRESULT GetZoneCustomPolicy(
963         [in]  DWORD dwZone,
964         [in]  REFGUID guidKey,
965         [out] BYTE **ppPolicy,
966         [out] DWORD* pcbPolicy,
967         [in]  URLZONEREG ulrZoneReg);
968
969     HRESULT SetZoneCustomPolicy(
970         [in] DWORD dwZone,
971         [in] REFGUID guidKey,
972         [in] BYTE *ppPolicy,
973         [in] DWORD pcbPolicy,
974         [in] URLZONEREG ulrZoneReg);
975
976     HRESULT GetZoneActionPolicy(
977         [in]  DWORD dwZone,
978         [in]  DWORD dwAction,
979         [out] BYTE* pPolicy,
980         [in]  DWORD cbPolicy,
981         [in]  URLZONEREG urlZoneReg);
982
983     HRESULT SetZoneActionPolicy(
984         [in] DWORD dwZone,
985         [in] DWORD dwAction,
986         [in] BYTE* pPolicy,
987         [in] DWORD cbPolicy,
988         [in] URLZONEREG urlZoneReg);
989
990     HRESULT PromptAction(
991         [in] DWORD dwAction,
992         [in] HWND hwndParent,
993         [in] LPCWSTR pwszUrl,
994         [in] LPCWSTR pwszText,
995         [in] DWORD dwPromptFlags );
996
997     HRESULT LogAction(
998         [in] DWORD dwAction,
999         [in] LPCWSTR pwszUrl,
1000         [in] LPCWSTR pwszText,
1001         [in] DWORD dwLogFlags);
1002
1003     HRESULT CreateZoneEnumerator(
1004         [out] DWORD* pdwEnum,
1005         [out] DWORD* pdwCount,
1006         [in]  DWORD dwFlags);
1007
1008     HRESULT GetZoneAt(
1009         [in]  DWORD dwEnum,
1010         [in]  DWORD dwIndex,
1011         [out] DWORD* pdwZone);
1012
1013     HRESULT DestroyZoneEnumerator(
1014         [in] DWORD dwEnum);
1015
1016     HRESULT CopyTemplatePoliciesToZone(
1017         [in] DWORD dwTemplate,
1018         [in] DWORD dwZone,
1019         [in] DWORD dwReserved);
1020 }
1021
1022 typedef struct _tagSOFTDISTINFO
1023 {
1024     ULONG cbSize;
1025     DWORD dwFlags;
1026     DWORD dwAdState;
1027     LPWSTR szTitle;
1028     LPWSTR szAbstract;
1029     LPWSTR szHREF;
1030     DWORD dwInstalledVersionMS;
1031     DWORD dwInstalledVersionLS;
1032     DWORD dwUpdateVersionMS;
1033     DWORD dwUpdateVersionLS;
1034     DWORD dwAdvertisedVersionMS;
1035     DWORD dwAdvertisedVersionLS;
1036     DWORD dwReserved;
1037 } SOFTDISTINFO, *LPSOFTDISTINFO;
1038
1039 typedef struct _tagCODEBASEHOLD
1040 {
1041     DWORD cbSize;
1042     LPWSTR szDistUnit;
1043     LPWSTR szCodeBase;
1044     DWORD dwVersionMS;
1045     DWORD dwVersionLS;
1046     DWORD dwStyle;
1047 } CODEBASEHOLD, *LPCODEBASEHOLD;
1048
1049 [
1050     local,
1051     object,
1052     uuid(b15b8dc1-c7e1-11d0-8680-00aa00bdcb71),
1053     pointer_default(unique)
1054 ]
1055 interface ISoftDistExt : IUnknown
1056 {
1057     HRESULT ProcessSoftDist(
1058         [in] LPCWSTR szCDFURL,
1059         [in] IXMLElement *pSoftDistElement,
1060         [in, out] LPSOFTDISTINFO lpsdi );
1061
1062     HRESULT GetFirstCodeBase(
1063         [in] LPWSTR *szCodeBase,
1064         [in] LPDWORD dwMaxSize );
1065
1066     HRESULT GetNextCodeBase(
1067         [in] LPWSTR *szCodeBase,
1068         [in] LPDWORD dwMaxSize );
1069
1070     HRESULT AsyncInstallDistributionUnit(
1071         [in] IBindCtx *pbc,
1072         [in] LPVOID lpReserved,
1073         [in] DWORD flags,
1074         [in] LPCODEBASEHOLD lpcbh);
1075 }
1076
1077 cpp_quote("DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);")
1078 cpp_quote("DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);")
1079 cpp_quote("DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
1080 cpp_quote("DEFINE_GUID(IID_IAsyncBindCtx, 0x79EAC9D4, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
1081 cpp_quote("DEFINE_GUID(CLSID_StdURLMoniker, 0x79EAC9E0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
1082
1083 cpp_quote("#define MK_S_ASYNCHRONOUS                0x000401E8")
1084 cpp_quote("#define S_ASYNCHRONOUS                   MK_S_ASYNCHRONOUS")
1085
1086 cpp_quote("#define INET_E_ERROR_FIRST               0x800C0002L")
1087 cpp_quote("#define INET_E_INVALID_URL               0x800C0002L")
1088 cpp_quote("#define INET_E_NO_SESSION                0x800C0003L")
1089 cpp_quote("#define INET_E_CANNOT_CONNECT            0x800C0004L")
1090 cpp_quote("#define INET_E_RESOURCE_NOT_FOUND        0x800C0005L")
1091 cpp_quote("#define INET_E_OBJECT_NOT_FOUND          0x800C0006L")
1092 cpp_quote("#define INET_E_DATA_NOT_AVAILABLE        0x800C0007L")
1093 cpp_quote("#define INET_E_DOWNLOAD_FAILURE          0x800C0008L")
1094 cpp_quote("#define INET_E_AUTHENTICATION_REQUIRED   0x800C0009L")
1095 cpp_quote("#define INET_E_NO_VALID_MEDIA            0x800C000AL")
1096 cpp_quote("#define INET_E_CONNECTION_TIMEOUT        0x800C000BL")
1097 cpp_quote("#define INET_E_INVALID_REQUEST           0x800C000CL")
1098 cpp_quote("#define INET_E_UNKNOWN_PROTOCOL          0x800C000DL")
1099 cpp_quote("#define INET_E_SECURITY_PROBLEM          0x800C000EL")
1100 cpp_quote("#define INET_E_CANNOT_LOAD_DATA          0x800C000FL")
1101 cpp_quote("#define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L")
1102 cpp_quote("#define INET_E_USE_DEFAULT_PROTOCOLHANDLER 0x800C0011L")
1103 cpp_quote("#define INET_E_QUERYOPTION_UNKNOWN       0x800C0013L")
1104 cpp_quote("#define INET_E_REDIRECT_FAILED           0x800C0014L")
1105 cpp_quote("#define INET_E_REDIRECT_TO_DIR           0x800C0015L")
1106 cpp_quote("#define INET_E_CANNOT_LOCK_REQUEST       0x800C0016L")
1107 cpp_quote("#define INET_E_ERROR_LAST                INET_E_REDIRECT_TO_DIR")
1108
1109 cpp_quote("HRESULT WINAPI CoGetClassObjectFromURL(REFCLSID, LPCWSTR, DWORD, DWORD, LPCWSTR, LPBINDCTX, DWORD, LPVOID, REFIID, LPVOID*);")
1110 cpp_quote("HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk);")
1111 cpp_quote("HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbsc, DWORD dwReserved);")
1112 cpp_quote("HRESULT WINAPI CompareSecurityIds(BYTE*,DWORD,BYTE*,DWORD,DWORD);")
1113 cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN pCaller, LPCSTR szURL,  LPCSTR  szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")
1114 cpp_quote("HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")
1115 cpp_quote("HRESULT WINAPI CoInternetGetSession(DWORD,IInternetSession**,DWORD);")
1116 cpp_quote("HRESULT WINAPI MkParseDisplayNameEx(IBindCtx*,LPCWSTR,ULONG*,IMoniker**);")
1117 cpp_quote("HRESULT WINAPI IsAsyncMoniker(IMoniker* pmk);")
1118 cpp_quote("HRESULT WINAPI CreateAsyncBindCtx(DWORD, IBindStatusCallback*, IEnumFORMATETC*, IBindCtx**);")
1119 cpp_quote("HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx*,DWORD,IBindStatusCallback*,IEnumFORMATETC*,IBindCtx**,DWORD);");
1120 cpp_quote("HRESULT WINAPI CoInternetCombineUrl(LPCWSTR,LPCWSTR,DWORD,LPWSTR,DWORD,DWORD*,DWORD);")
1121 cpp_quote("HRESULT WINAPI CoInternetCompareUrl(LPCWSTR,LPCWSTR,DWORD);");
1122 cpp_quote("HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider*, IInternetZoneManager**, DWORD);");
1123 cpp_quote("HRESULT WINAPI GetSoftwareUpdateInfo( LPCWSTR szDistUnit, LPSOFTDISTINFO psdi);");
1124
1125 cpp_quote("#define OInetCombineUrl CoInternetCombineUrl")
1126 cpp_quote("#define OInetCompareUrl CoInternetCompareUrl")
1127 cpp_quote("#define OInetGetSession CoInternetGetSession")
1128
1129 cpp_quote("#define MKSYS_URLMONIKER 6")