home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / URLMON.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  85KB  |  1,820 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Runtime Library                  }
  5. {       URL Moniker support interface unit              }
  6. {                                                       }
  7. {       Copyright (C) 1995-1998, Microsoft Corporation. }
  8. {       All Rights Reserved.                            }
  9. {                                                       }
  10. {       Obtained on behalf of Inprise through:          }
  11. {       Joint Endeavour of Delphi Innovators (JEDI)     }
  12. {       http://www.delphi-jedi.org                      }
  13. {       Translator: Rudolph Velthuis                    }
  14. {                                                       }
  15. {*******************************************************}
  16.  
  17. unit UrlMon;
  18.  
  19. {$WEAKPACKAGEUNIT}
  20.  
  21. interface
  22.  
  23. uses
  24.   Windows, ActiveX;
  25.  
  26. {$HPPEMIT '#include "rpc.h"'}
  27. {$HPPEMIT '#include "rpcndr.h"'}
  28. {$HPPEMIT '#include "urlmon.h"'}
  29. {$HPPEMIT '#ifndef COM_NO_WINDOWS_H'}
  30. {$HPPEMIT '#include "windows.h" '}
  31. {$HPPEMIT '#include "ole2.h"'}
  32. {$HPPEMIT '#endif'}
  33.  
  34. {$HPPEMIT 'typedef System::DelphiInterface<IPersistMoniker> _id_IPersistMoniker;'}
  35. {$HPPEMIT 'typedef System::DelphiInterface<IBindProtocol> _id_IBindProtocol;'}
  36. {$HPPEMIT 'typedef System::DelphiInterface<IBinding> _id_IBinding;'}
  37. {$HPPEMIT 'typedef System::DelphiInterface<IBindStatusCallback> _id_IBindStatusCallback;'}
  38. {$HPPEMIT 'typedef System::DelphiInterface<IAuthenticate> _id_IAuthenticate;'}
  39. {$HPPEMIT 'typedef System::DelphiInterface<IHttpNegotiate> _id_IHttpNegotiate;'}
  40. {$HPPEMIT 'typedef System::DelphiInterface<IWindowForBindingUI> _id_IWindowForBindingUI;'}
  41. {$HPPEMIT 'typedef System::DelphiInterface<ICodeInstall> _id_ICodeInstall;'}
  42. {$HPPEMIT 'typedef System::DelphiInterface<IWinInetInfo> _id_IWinInetInfo;'}
  43. {$HPPEMIT 'typedef System::DelphiInterface<IHttpSecurity> _id_IHttpSecurity;'}
  44. {$HPPEMIT 'typedef System::DelphiInterface<IWinInetHttpInfo> _id_IWinInetHttpInfo;'}
  45. {$HPPEMIT 'typedef System::DelphiInterface<IBindHost> _id_IBindHost;'}
  46. {$HPPEMIT 'typedef System::DelphiInterface<IInternet> _id_IInternet;'}
  47. {$HPPEMIT 'typedef System::DelphiInterface<IInternetBindInfo> _id_IInternetBindInfo;'}
  48. {$HPPEMIT 'typedef System::DelphiInterface<IInternetProtocolRoot> _id_IInternetProtocolRoot;'}
  49. {$HPPEMIT 'typedef System::DelphiInterface<IInternetProtocol> _id_IInternetProtocol;'}
  50. {$HPPEMIT 'typedef System::DelphiInterface<IInternetProtocolSink> _id_IInternetProtocolSink;'}
  51. {$HPPEMIT 'typedef System::DelphiInterface<IInternetSession> _id_IInternetSession;'}
  52. {$HPPEMIT 'typedef System::DelphiInterface<IInternetThreadSwitch> _id_IInternetThreadSwitch;'}
  53. {$HPPEMIT 'typedef System::DelphiInterface<IInternetPriority> _id_IInternetPriority;'}
  54. {$HPPEMIT 'typedef System::DelphiInterface<IInternetProtocolInfo> _id_IInternetProtocolInfo;'}
  55. {$HPPEMIT 'typedef System::DelphiInterface<IInternetSecurityMgrSite> _id_IInternetSecurityMgrSite;'}
  56. {$HPPEMIT 'typedef System::DelphiInterface<IInternetSecurityManager> _id_IInternetSecurityManager;'}
  57. {$HPPEMIT 'typedef System::DelphiInterface<IInternetHostSecurityManager> _id_IInternetHostSecurityManager;'}
  58. {$HPPEMIT 'typedef System::DelphiInterface<IInternetZoneManager> _id_IInternetZoneManager;'}
  59. {$HPPEMIT 'typedef System::DelphiInterface<ISoftDistExt> _id_ISoftDistExt;'}
  60. {$HPPEMIT 'typedef System::DelphiInterface<IDataFilter> _id_IDataFilter;'}
  61. {$HPPEMIT 'typedef System::DelphiInterface<IEncodingFilterFactory> _id_IEncodingFilterFactory;'}
  62.  
  63. const
  64.   {$EXTERNALSYM SZ_URLCONTEXT}
  65.   SZ_URLCONTEXT: POLEStr   = 'URL Context';
  66.   {$EXTERNALSYM SZ_ASYNC_CALLEE}
  67.   SZ_ASYNC_CALLEE: POLEStr = 'AsyncCallee';
  68.  
  69.   {$EXTERNALSYM MKSYS_URLMONIKER}
  70.   MKSYS_URLMONIKER = 6;
  71.  
  72. const
  73.   // GUIDs for interfaces declared in this unit
  74.  
  75.   {$EXTERNALSYM IID_IPersistMoniker}
  76.   IID_IPersistMoniker:       TGUID = '{79eac9c9-baf9-11ce-8c82-00aa004ba90b}';
  77.   {$EXTERNALSYM IID_IBinding}
  78.   IID_IBinding:              TGUID = '{79eac9c0-baf9-11ce-8c82-00aa004ba90b}';
  79.   {$EXTERNALSYM IID_IBindStatusCallback}
  80.   IID_IBindStatusCallback:   TGUID = '{79eac9c1-baf9-11ce-8c82-00aa004ba90b}';
  81.   {$EXTERNALSYM IID_IAuthenticate}
  82.   IID_IAuthenticate:         TGUID = '{79eac9d0-baf9-11ce-8c82-00aa004ba90b}';
  83.   {$EXTERNALSYM IID_IHttpNegotiate}
  84.   IID_IHttpNegotiate:        TGUID = '{79eac9d2-baf9-11ce-8c82-00aa004ba90b}';
  85.   {$EXTERNALSYM IID_IWindowForBindingUI}
  86.   IID_IWindowForBindingUI:   TGUID = '{79eac9d5-bafa-11ce-8c82-00aa004ba90b}';
  87.   {$EXTERNALSYM IID_ICodeInstall}
  88.   IID_ICodeInstall:          TGUID = '{79eac9d1-baf9-11ce-8c82-00aa004ba90b}';
  89.   {$EXTERNALSYM IID_IWinInetInfo}
  90.   IID_IWinInetInfo:          TGUID = '{79eac9d6-bafa-11ce-8c82-00aa004ba90b}';
  91.   {$EXTERNALSYM IID_IHttpSecurity}
  92.   IID_IHttpSecurity:         TGUID = '{79eac9d7-bafa-11ce-8c82-00aa004ba90b}';
  93.   {$EXTERNALSYM IID_IWinInetHttpInfo}
  94.   IID_IWinInetHttpInfo:      TGUID = '{79eac9d8-bafa-11ce-8c82-00aa004ba90b}';
  95.  
  96.   {$EXTERNALSYM IID_IBindHost}
  97.   IID_IBindHost:             TGUID = '{fc4801a1-2ba9-11cf-a229-00aa003d7352}';
  98.  
  99.   {$EXTERNALSYM IID_IInternet}
  100.   IID_IInternet:             TGUID = '{79eac9e0-baf9-11ce-8c82-00aa004ba90b}';
  101.   {$EXTERNALSYM IID_IInternetBindInfo}
  102.   IID_IInternetBindInfo:     TGUID = '{79eac9e1-baf9-11ce-8c82-00aa004ba90b}';
  103.   {$EXTERNALSYM IID_IInternetProtocolRoot}
  104.   IID_IInternetProtocolRoot: TGUID = '{79eac9e3-baf9-11ce-8c82-00aa004ba90b}';
  105.   {$EXTERNALSYM IID_IInternetProtocol}
  106.   IID_IInternetProtocol:     TGUID = '{79eac9e4-baf9-11ce-8c82-00aa004ba90b}';
  107.   {$EXTERNALSYM IID_IInternetProtocolSink}
  108.   IID_IInternetProtocolSink: TGUID = '{79eac9e5-baf9-11ce-8c82-00aa004ba90b}';
  109.   {$EXTERNALSYM IID_IInternetSession}
  110.   IID_IInternetSession:      TGUID = '{79eac9e7-baf9-11ce-8c82-00aa004ba90b}';
  111.   {$EXTERNALSYM IID_IInternetThreadSwitch}
  112.   IID_IInternetThreadSwitch: TGUID = '{79eac9e8-baf9-11ce-8c82-00aa004ba90b}';
  113.   {$EXTERNALSYM IID_IInternetPriority}
  114.   IID_IInternetPriority:     TGUID = '{79eac9eb-baf9-11ce-8c82-00aa004ba90b}';
  115.   {$EXTERNALSYM IID_IInternetProtocolInfo}
  116.   IID_IInternetProtocolInfo: TGUID = '{79eac9ec-baf9-11ce-8c82-00aa004ba90b}';
  117.  
  118.   {$EXTERNALSYM SID_IBindHost}
  119.   SID_IBindHost:             TGUID = '{fc4801a1-2ba9-11cf-a229-00aa003d7352}';
  120.   {$EXTERNALSYM SID_SBindHost}
  121.   SID_SBindHost:             TGUID = '{fc4801a1-2ba9-11cf-a229-00aa003d7352}';
  122.  
  123.   {$EXTERNALSYM IID_IOInet}
  124.   IID_IOInet:                TGUID = '{79eac9e0-baf9-11ce-8c82-00aa004ba90b}';
  125.   {$EXTERNALSYM IID_IOInetBindInfo}
  126.   IID_IOInetBindInfo:        TGUID = '{79eac9e1-baf9-11ce-8c82-00aa004ba90b}';
  127.   {$EXTERNALSYM IID_IOInetProtocolRoot}
  128.   IID_IOInetProtocolRoot:    TGUID = '{79eac9e3-baf9-11ce-8c82-00aa004ba90b}';
  129.   {$EXTERNALSYM IID_IOInetProtocol}
  130.   IID_IOInetProtocol:        TGUID = '{79eac9e4-baf9-11ce-8c82-00aa004ba90b}';
  131.   {$EXTERNALSYM IID_IOInetProtocolSink}
  132.   IID_IOInetProtocolSink:    TGUID = '{79eac9e5-baf9-11ce-8c82-00aa004ba90b}';
  133.   {$EXTERNALSYM IID_IOInetProtocolInfo}
  134.   IID_IOInetProtocolInfo:    TGUID = '{79eac9ec-baf9-11ce-8c82-00aa004ba90b}';
  135.   {$EXTERNALSYM IID_IOInetSession}
  136.   IID_IOInetSession:         TGUID = '{79eac9e7-baf9-11ce-8c82-00aa004ba90b}';
  137.   {$EXTERNALSYM IID_IOInetPriority}
  138.   IID_IOInetPriority:        TGUID = '{79eac9eb-baf9-11ce-8c82-00aa004ba90b}';
  139.   {$EXTERNALSYM IID_IOInetThreadSwitch}
  140.   IID_IOInetThreadSwitch:    TGUID = '{79eac9e8-baf9-11ce-8c82-00aa004ba90b}';
  141.  
  142.   {$EXTERNALSYM IID_IInternetSecurityMgrSite}
  143.   IID_IInternetSecurityMgrSite:     TGUID = '{79eac9ed-baf9-11ce-8c82-00aa004ba90b}';
  144.   {$EXTERNALSYM IID_IInternetSecurityManager}
  145.   IID_IInternetSecurityManager:     TGUID = '{79eac9ee-baf9-11ce-8c82-00aa004ba90b}';
  146.   {$EXTERNALSYM IID_IInternetHostSecurityManager}
  147.   IID_IInternetHostSecurityManager: TGUID = '{3af280b6-cb3f-11d0-891e-00c04fb6bfc4}';
  148.  
  149.   // This service is used for delegation support on the Security Manager interface
  150.   {$EXTERNALSYM SID_IInternetSecurityManager}
  151.   SID_IInternetSecurityManager:     TGUID = '{79eac9ee-baf9-11ce-8c82-00aa004ba90b}';
  152.   {$EXTERNALSYM SID_IInternetHostSecurityManager}
  153.   SID_IInternetHostSecurityManager: TGUID = '{3af280b6-cb3f-11d0-891e-00c04fb6bfc4}';
  154.  
  155.   {$EXTERNALSYM IID_IInternetZoneManager}
  156.   IID_IInternetZoneManager:   TGUID = '{79eac9ef-baf9-11ce-8c82-00aa004ba90b}';
  157.  
  158.   {$EXTERNALSYM IID_ISoftDistExt}
  159.   IID_ISoftDistExt:           TGUID = '{B15B8DC1-C7E1-11d0-8680-00AA00BDCB71}';
  160.   {$EXTERNALSYM IID_IDataFilter}
  161.   IID_IDataFilter:            TGUID = '{69d14c80-c18e-11d0-a9ce-006097942311}';
  162.   {$EXTERNALSYM IID_IEncodingFilterFactory}
  163.   IID_IEncodingFilterFactory: TGUID = '{70bdde00-c18e-11d0-a9ce-006097942311}';
  164.  
  165. // Originally (in the .h) these were enumeration types
  166. type
  167.   TBindVerb = ULONG;
  168.   TBindInfoF = ULONG;
  169.   TBindF = ULONG;
  170.   TBSCF = ULONG;
  171.   TBindStatus = ULONG;
  172.   TCIPStatus = ULONG;
  173.   TBindString = ULONG;
  174.   TPiFlags = ULONG;
  175.   TOIBdgFlags = ULONG;
  176.   TParseAction = ULONG;
  177.   TPSUAction = ULONG;
  178.   TQueryOption = ULONG;
  179.   TPUAF = ULONG;
  180.   TSZMFlags = ULONG;
  181.   TUrlZone = ULONG;
  182.   TUrlTemplate = ULONG;
  183.   TZAFlags = ULONG;
  184.   TUrlZoneReg = ULONG;
  185.  
  186. const
  187.   // URLMON-specific defines for UrlMkSetSessionOption
  188.   {$EXTERNALSYM URLMON_OPTION_USERAGENT}
  189.   URLMON_OPTION_USERAGENT         = $10000001;
  190.   {$EXTERNALSYM URLMON_OPTION_USERAGENT_REFRESH}
  191.   URLMON_OPTION_USERAGENT_REFRESH = $10000002;
  192.  
  193.   {$EXTERNALSYM CF_NULL}
  194.   CF_NULL = 0;
  195.  
  196.   {$EXTERNALSYM CFSTR_MIME_NULL}
  197.   CFSTR_MIME_NULL        = 0;
  198.   {$EXTERNALSYM CFSTR_MIME_TEXT}
  199.   CFSTR_MIME_TEXT        = 'text/plain';
  200.   {$EXTERNALSYM CFSTR_MIME_RICHTEXT}
  201.   CFSTR_MIME_RICHTEXT    = 'text/richtext';
  202.   {$EXTERNALSYM CFSTR_MIME_X_BITMAP}
  203.   CFSTR_MIME_X_BITMAP    = 'image/x-xbitmap';
  204.   {$EXTERNALSYM CFSTR_MIME_POSTSCRIPT}
  205.   CFSTR_MIME_POSTSCRIPT  = 'application/postscript';
  206.   {$EXTERNALSYM CFSTR_MIME_AIFF}
  207.   CFSTR_MIME_AIFF        = 'audio/aiff';
  208.   {$EXTERNALSYM CFSTR_MIME_BASICAUDIO}
  209.   CFSTR_MIME_BASICAUDIO  = 'audio/basic';
  210.   {$EXTERNALSYM CFSTR_MIME_WAV}
  211.   CFSTR_MIME_WAV         = 'audio/wav';
  212.   {$EXTERNALSYM CFSTR_MIME_X_WAV}
  213.   CFSTR_MIME_X_WAV       = 'audio/x-wav';
  214.   {$EXTERNALSYM CFSTR_MIME_GIF}
  215.   CFSTR_MIME_GIF         = 'image/gif';
  216.   {$EXTERNALSYM CFSTR_MIME_PJPEG}
  217.   CFSTR_MIME_PJPEG       = 'image/pjpeg';
  218.   {$EXTERNALSYM CFSTR_MIME_JPEG}
  219.   CFSTR_MIME_JPEG        = 'image/jpeg';
  220.   {$EXTERNALSYM CFSTR_MIME_TIFF}
  221.   CFSTR_MIME_TIFF        = 'image/tiff';
  222.   {$EXTERNALSYM CFSTR_MIME_X_PNG}
  223.   CFSTR_MIME_X_PNG       = 'image/x-png';
  224.   {$EXTERNALSYM CFSTR_MIME_BMP}
  225.   CFSTR_MIME_BMP         = 'image/bmp';
  226.   {$EXTERNALSYM CFSTR_MIME_X_ART}
  227.   CFSTR_MIME_X_ART       = 'image/x-jg';
  228.   {$EXTERNALSYM CFSTR_MIME_X_EMF}
  229.   CFSTR_MIME_X_EMF       = 'image/x-emf';
  230.   {$EXTERNALSYM CFSTR_MIME_X_WMF}
  231.   CFSTR_MIME_X_WMF       = 'image/x-wmf';
  232.   {$EXTERNALSYM CFSTR_MIME_AVI}
  233.   CFSTR_MIME_AVI         = 'video/avi';
  234.   {$EXTERNALSYM CFSTR_MIME_MPEG}
  235.   CFSTR_MIME_MPEG        = 'video/mpeg';
  236.   {$EXTERNALSYM CFSTR_MIME_FRACTALS}
  237.   CFSTR_MIME_FRACTALS    = 'application/fractals';
  238.   {$EXTERNALSYM CFSTR_MIME_RAWDATA}
  239.   CFSTR_MIME_RAWDATA     = 'application/octet-stream';
  240.   {$EXTERNALSYM CFSTR_MIME_RAWDATASTRM}
  241.   CFSTR_MIME_RAWDATASTRM = 'application/octet-stream';
  242.   {$EXTERNALSYM CFSTR_MIME_PDF}
  243.   CFSTR_MIME_PDF         = 'application/pdf';
  244.   {$EXTERNALSYM CFSTR_MIME_X_AIFF}
  245.   CFSTR_MIME_X_AIFF      = 'audio/x-aiff';
  246.   {$EXTERNALSYM CFSTR_MIME_X_REALAUDIO}
  247.   CFSTR_MIME_X_REALAUDIO = 'audio/x-pn-realaudio';
  248.   {$EXTERNALSYM CFSTR_MIME_XBM}
  249.   CFSTR_MIME_XBM         = 'image/xbm';
  250.   {$EXTERNALSYM CFSTR_MIME_QUICKTIME}
  251.   CFSTR_MIME_QUICKTIME   = 'video/quicktime';
  252.   {$EXTERNALSYM CFSTR_MIME_X_MSVIDEO}
  253.   CFSTR_MIME_X_MSVIDEO   = 'video/x-msvideo';
  254.   {$EXTERNALSYM CFSTR_MIME_X_SGI_MOVIE}
  255.   CFSTR_MIME_X_SGI_MOVIE = 'video/x-sgi-movie';
  256.   {$EXTERNALSYM CFSTR_MIME_HTML}
  257.   CFSTR_MIME_HTML        = 'text/html';
  258.  
  259. // MessageId: MK_S_ASYNCHRONOUS
  260. // MessageText: Operation is successful, but will complete asynchronously.
  261.  
  262.   {$EXTERNALSYM MK_S_ASYNCHRONOUS}
  263.   MK_S_ASYNCHRONOUS = $000401E8;
  264.   {$EXTERNALSYM S_ASYNCHRONOUS}
  265.   S_ASYNCHRONOUS    = MK_S_ASYNCHRONOUS;
  266.  
  267.   {$EXTERNALSYM E_PENDING}
  268.   E_PENDING = $8000000A;
  269.  
  270. // WinINet and protocol specific errors are mapped to one of the following
  271. // error which are returned in IBSC.OnStopBinding
  272. //
  273. // Note: FACILITY C is split into ranges of 1k
  274. // C0000 - C03FF  INET_E_ (URLMON's original hresult)
  275. // C0400 - C07FF  INET_E_CLIENT_xxx
  276. // C0800 - C0BFF  INET_E_SERVER_xxx
  277. // C0C00 - C0FFF  INET_E_????
  278. // C1000 - C13FF  INET_E_AGENT_xxx (info delivery agents)
  279.  
  280. // $$$ Original Borland translation:
  281. // INET_E_INVALID_URL: HResult = $800C0002;
  282. // This is not a direct copy of the .h
  283.  
  284. const
  285.   {$EXTERNALSYM INET_E_INVALID_URL}
  286.   INET_E_INVALID_URL                 = HResult($800C0002);
  287.   {$EXTERNALSYM INET_E_NO_SESSION}
  288.   INET_E_NO_SESSION                  = HResult($800C0003);
  289.   {$EXTERNALSYM INET_E_CANNOT_CONNECT}
  290.   INET_E_CANNOT_CONNECT              = HResult($800C0004);
  291.   {$EXTERNALSYM INET_E_RESOURCE_NOT_FOUND}
  292.   INET_E_RESOURCE_NOT_FOUND          = HResult($800C0005);
  293.   {$EXTERNALSYM INET_E_OBJECT_NOT_FOUND}
  294.   INET_E_OBJECT_NOT_FOUND            = HResult($800C0006);
  295.   {$EXTERNALSYM INET_E_DATA_NOT_AVAILABLE}
  296.   INET_E_DATA_NOT_AVAILABLE          = HResult($800C0007);
  297.   {$EXTERNALSYM INET_E_DOWNLOAD_FAILURE}
  298.   INET_E_DOWNLOAD_FAILURE            = HResult($800C0008);
  299.   {$EXTERNALSYM INET_E_AUTHENTICATION_REQUIRED}
  300.   INET_E_AUTHENTICATION_REQUIRED     = HResult($800C0009);
  301.   {$EXTERNALSYM INET_E_NO_VALID_MEDIA}
  302.   INET_E_NO_VALID_MEDIA              = HResult($800C000A);
  303.   {$EXTERNALSYM INET_E_CONNECTION_TIMEOUT}
  304.   INET_E_CONNECTION_TIMEOUT          = HResult($800C000B);
  305.   {$EXTERNALSYM INET_E_INVALID_REQUEST}
  306.   INET_E_INVALID_REQUEST             = HResult($800C000C);
  307.   {$EXTERNALSYM INET_E_UNKNOWN_PROTOCOL}
  308.   INET_E_UNKNOWN_PROTOCOL            = HResult($800C000D);
  309.   {$EXTERNALSYM INET_E_SECURITY_PROBLEM}
  310.   INET_E_SECURITY_PROBLEM            = HResult($800C000E);
  311.   {$EXTERNALSYM INET_E_CANNOT_LOAD_DATA}
  312.   INET_E_CANNOT_LOAD_DATA            = HResult($800C000F);
  313.   {$EXTERNALSYM INET_E_CANNOT_INSTANTIATE_OBJECT}
  314.   INET_E_CANNOT_INSTANTIATE_OBJECT   = HResult($800C0010);
  315.   {$EXTERNALSYM INET_E_REDIRECT_FAILED}
  316.   INET_E_REDIRECT_FAILED             = HResult($800C0014);
  317.   {$EXTERNALSYM INET_E_REDIRECT_TO_DIR}
  318.   INET_E_REDIRECT_TO_DIR             = HResult($800C0015);
  319.   {$EXTERNALSYM INET_E_CANNOT_LOCK_REQUEST}
  320.   INET_E_CANNOT_LOCK_REQUEST         = HResult($800C0016);
  321.   {$EXTERNALSYM INET_E_ERROR_FIRST}
  322.   INET_E_ERROR_FIRST                 = HResult($800C0002);
  323.   {$EXTERNALSYM INET_E_ERROR_LAST}
  324.   INET_E_ERROR_LAST                  = INET_E_REDIRECT_TO_DIR;
  325.  
  326.  
  327. type
  328.   IBinding = interface; // forward
  329.  
  330.   {$EXTERNALSYM IPersistMoniker}
  331.   IPersistMoniker = interface
  332.     ['{79eac9c9-baf9-11ce-8c82-00aa004ba90b}']
  333.     function GetClassID(out ClassID: TCLSID): HResult; stdcall;
  334.     function IsDirty: HResult; stdcall;
  335.     function Load(fFullyAvailable: BOOL; pimkName: IMoniker; pibc: IBindCtx;
  336.       grfMode: DWORD): HResult; stdcall;
  337.     function Save(pimkName: IMoniker; pbc: IBindCtx; fRemember: BOOL): HResult; stdcall;
  338.     function SaveCompleted(pimkName: IMoniker; pibc: IBindCtx): HResult; stdcall;
  339.     function GetCurMoniker(ppimkName: IMoniker): HResult; stdcall;
  340.    end;
  341.  
  342.   {$EXTERNALSYM IBindProtocol}
  343.   IBindProtocol = interface
  344.     ['{79eac9cd-baf9-11ce-8c82-00aa004ba90b}']
  345.     function CreateBinding(szUrl: LPCWSTR; pbc: IBindCtx;
  346.       out ppb: IBinding): HResult; stdcall;
  347.   end;
  348.  
  349.   {$EXTERNALSYM IBinding}
  350.   IBinding = interface
  351.     ['{79eac9c0-baf9-11ce-8c82-00aa004ba90b}']
  352.     function Abort: HResult; stdcall;
  353.     function Suspend: HResult; stdcall;
  354.     function Resume: HResult; stdcall;
  355.     function SetPriority(nPriority: Longint): HResult; stdcall;
  356.     function GetPriority(out nPriority: Longint): HResult; stdcall;
  357.     function GetBindResult(out clsidProtocol: TCLSID; out dwResult: DWORD;
  358.       out szResult: POLEStr; dwReserved: DWORD): HResult; stdcall;
  359.   end;
  360.  
  361. const
  362.   {$EXTERNALSYM BINDVERB_GET}
  363.   BINDVERB_GET    = $00000000;
  364.   {$EXTERNALSYM BINDVERB_POST}
  365.   BINDVERB_POST   = $00000001;
  366.   {$EXTERNALSYM BINDVERB_PUT}
  367.   BINDVERB_PUT    = $00000002;
  368.   {$EXTERNALSYM BINDVERB_CUSTOM}
  369.   BINDVERB_CUSTOM = $00000003;
  370.  
  371.   {$EXTERNALSYM BINDINFOF_URLENCODESTGMEDDATA}
  372.   BINDINFOF_URLENCODESTGMEDDATA  = $00000001;
  373.   {$EXTERNALSYM BINDINFOF_URLENCODEDEXTRAINFO}
  374.   BINDINFOF_URLENCODEDEXTRAINFO  = $00000002;
  375.  
  376.   {$EXTERNALSYM BINDF_ASYNCHRONOUS}
  377.   BINDF_ASYNCHRONOUS             = $00000001;
  378.   {$EXTERNALSYM BINDF_ASYNCSTORAGE}
  379.   BINDF_ASYNCSTORAGE             = $00000002;
  380.   {$EXTERNALSYM BINDF_NOPROGRESSIVERENDERING}
  381.   BINDF_NOPROGRESSIVERENDERING   = $00000004;
  382.   {$EXTERNALSYM BINDF_OFFLINEOPERATION}
  383.   BINDF_OFFLINEOPERATION         = $00000008;
  384.   {$EXTERNALSYM BINDF_GETNEWESTVERSION}
  385.   BINDF_GETNEWESTVERSION         = $00000010;
  386.   {$EXTERNALSYM BINDF_NOWRITECACHE}
  387.   BINDF_NOWRITECACHE             = $00000020;
  388.   {$EXTERNALSYM BINDF_NEEDFILE}
  389.   BINDF_NEEDFILE                 = $00000040;
  390.   {$EXTERNALSYM BINDF_PULLDATA}
  391.   BINDF_PULLDATA                 = $00000080;
  392.   {$EXTERNALSYM BINDF_IGNORESECURITYPROBLEM}
  393.   BINDF_IGNORESECURITYPROBLEM    = $00000100;
  394.   {$EXTERNALSYM BINDF_RESYNCHRONIZE}
  395.   BINDF_RESYNCHRONIZE            = $00000200;
  396.   {$EXTERNALSYM BINDF_HYPERLINK}
  397.   BINDF_HYPERLINK                = $00000400;
  398.   {$EXTERNALSYM BINDF_NO_UI}
  399.   BINDF_NO_UI                    = $00000800;
  400.   {$EXTERNALSYM BINDF_SILENTOPERATION}
  401.   BINDF_SILENTOPERATION          = $00001000;
  402.   {$EXTERNALSYM BINDF_PRAGMA_NO_CACHE}
  403.   BINDF_PRAGMA_NO_CACHE          = $00002000;
  404.   {$EXTERNALSYM BINDF_FREE_THREADED}
  405.   BINDF_FREE_THREADED            = $00010000;
  406.   {$EXTERNALSYM BINDF_DIRECT_READ}
  407.   BINDF_DIRECT_READ              = $00020000;
  408.   {$EXTERNALSYM BINDF_FORMS_SUBMIT}
  409.   BINDF_FORMS_SUBMIT             = $00040000;
  410.   {$EXTERNALSYM BINDF_GETFROMCACHE_IF_NET_FAIL}
  411.   BINDF_GETFROMCACHE_IF_NET_FAIL = $00080000;
  412.   
  413.   // These are for backwards compatibility with previous URLMON versions 
  414.   {$EXTERNALSYM BINDF_DONTUSECACHE}
  415.   BINDF_DONTUSECACHE             = BINDF_GETNEWESTVERSION;
  416.   {$EXTERNALSYM BINDF_DONTPUTINCACHE}
  417.   BINDF_DONTPUTINCACHE           = BINDF_NOWRITECACHE;
  418.   {$EXTERNALSYM BINDF_NOCOPYDATA}
  419.   BINDF_NOCOPYDATA               = BINDF_PULLDATA;
  420.  
  421.   {$EXTERNALSYM BSCF_FIRSTDATANOTIFICATION}
  422.   BSCF_FIRSTDATANOTIFICATION        = $00000001;
  423.   {$EXTERNALSYM BSCF_INTERMEDIATEDATANOTIFICATION}
  424.   BSCF_INTERMEDIATEDATANOTIFICATION = $00000002;
  425.   {$EXTERNALSYM BSCF_LASTDATANOTIFICATION}
  426.   BSCF_LASTDATANOTIFICATION         = $00000004;
  427.   {$EXTERNALSYM BSCF_DATAFULLYAVAILABLE}
  428.   BSCF_DATAFULLYAVAILABLE           = $00000008;
  429.   {$EXTERNALSYM BSCF_AVAILABLEDATASIZEUNKNOWN}
  430.   BSCF_AVAILABLEDATASIZEUNKNOWN     = $00000010;
  431.  
  432.   {$EXTERNALSYM BINDSTATUS_FINDINGRESOURCE}
  433.   BINDSTATUS_FINDINGRESOURCE           = 1;
  434.   {$EXTERNALSYM BINDSTATUS_CONNECTING}
  435.   BINDSTATUS_CONNECTING                = BINDSTATUS_FINDINGRESOURCE + 1;
  436.   {$EXTERNALSYM BINDSTATUS_REDIRECTING}
  437.   BINDSTATUS_REDIRECTING               = BINDSTATUS_CONNECTING + 1;
  438.   {$EXTERNALSYM BINDSTATUS_BEGINDOWNLOADDATA}
  439.   BINDSTATUS_BEGINDOWNLOADDATA         = BINDSTATUS_REDIRECTING + 1;
  440.   {$EXTERNALSYM BINDSTATUS_DOWNLOADINGDATA}
  441.   BINDSTATUS_DOWNLOADINGDATA           = BINDSTATUS_BEGINDOWNLOADDATA + 1;
  442.   {$EXTERNALSYM BINDSTATUS_ENDDOWNLOADDATA}
  443.   BINDSTATUS_ENDDOWNLOADDATA           = BINDSTATUS_DOWNLOADINGDATA + 1;
  444.   {$EXTERNALSYM BINDSTATUS_BEGINDOWNLOADCOMPONENTS}
  445.   BINDSTATUS_BEGINDOWNLOADCOMPONENTS   = BINDSTATUS_ENDDOWNLOADDATA + 1;
  446.   {$EXTERNALSYM BINDSTATUS_INSTALLINGCOMPONENTS}
  447.   BINDSTATUS_INSTALLINGCOMPONENTS      = BINDSTATUS_BEGINDOWNLOADCOMPONENTS + 1;
  448.   {$EXTERNALSYM BINDSTATUS_ENDDOWNLOADCOMPONENTS}
  449.   BINDSTATUS_ENDDOWNLOADCOMPONENTS     = BINDSTATUS_INSTALLINGCOMPONENTS + 1;
  450.   {$EXTERNALSYM BINDSTATUS_USINGCACHEDCOPY}
  451.   BINDSTATUS_USINGCACHEDCOPY           = BINDSTATUS_ENDDOWNLOADCOMPONENTS + 1;
  452.   {$EXTERNALSYM BINDSTATUS_SENDINGREQUEST}
  453.   BINDSTATUS_SENDINGREQUEST            = BINDSTATUS_USINGCACHEDCOPY + 1;
  454.   {$EXTERNALSYM BINDSTATUS_CLASSIDAVAILABLE}
  455.   BINDSTATUS_CLASSIDAVAILABLE          = BINDSTATUS_SENDINGREQUEST + 1;
  456.   {$EXTERNALSYM BINDSTATUS_MIMETYPEAVAILABLE}
  457.   BINDSTATUS_MIMETYPEAVAILABLE         = BINDSTATUS_CLASSIDAVAILABLE + 1;
  458.   {$EXTERNALSYM BINDSTATUS_CACHEFILENAMEAVAILABLE}
  459.   BINDSTATUS_CACHEFILENAMEAVAILABLE    = BINDSTATUS_MIMETYPEAVAILABLE + 1;
  460.   {$EXTERNALSYM BINDSTATUS_BEGINSYNCOPERATION}
  461.   BINDSTATUS_BEGINSYNCOPERATION        = BINDSTATUS_CACHEFILENAMEAVAILABLE + 1;
  462.   {$EXTERNALSYM BINDSTATUS_ENDSYNCOPERATION}
  463.   BINDSTATUS_ENDSYNCOPERATION          = BINDSTATUS_BEGINSYNCOPERATION + 1;
  464.   {$EXTERNALSYM BINDSTATUS_BEGINUPLOADDATA}
  465.   BINDSTATUS_BEGINUPLOADDATA           = BINDSTATUS_ENDSYNCOPERATION + 1;
  466.   {$EXTERNALSYM BINDSTATUS_UPLOADINGDATA}
  467.   BINDSTATUS_UPLOADINGDATA             = BINDSTATUS_BEGINUPLOADDATA + 1;
  468.   {$EXTERNALSYM BINDSTATUS_ENDUPLOADDATA}
  469.   BINDSTATUS_ENDUPLOADDATA             = BINDSTATUS_UPLOADINGDATA + 1;
  470.   {$EXTERNALSYM BINDSTATUS_PROTOCOLCLASSID}
  471.   BINDSTATUS_PROTOCOLCLASSID           = BINDSTATUS_ENDUPLOADDATA + 1;
  472.   {$EXTERNALSYM BINDSTATUS_ENCODING}
  473.   BINDSTATUS_ENCODING                  = BINDSTATUS_PROTOCOLCLASSID + 1;
  474.   {$EXTERNALSYM BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE}
  475.   BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE = BINDSTATUS_ENCODING + 1;
  476.   {$EXTERNALSYM BINDSTATUS_CLASSINSTALLLOCATION}
  477.   BINDSTATUS_CLASSINSTALLLOCATION      = BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE + 1;
  478.   {$EXTERNALSYM BINDSTATUS_DECODING}
  479.   BINDSTATUS_DECODING                  = BINDSTATUS_CLASSINSTALLLOCATION + 1;
  480.   {$EXTERNALSYM BINDSTATUS_LOADINGMIMEHANDLER}
  481.   BINDSTATUS_LOADINGMIMEHANDLER        = BINDSTATUS_DECODING + 1;
  482.  
  483. type
  484.   PBindInfo = ^TBindInfo;
  485.   {$EXTERNALSYM _tagBINDINFO}
  486.   _tagBINDINFO = packed record
  487.     cbSize: ULONG;
  488.     szExtraInfo: LPWSTR;
  489.     stgmedData: TStgMedium;
  490.     grfBindInfoF: DWORD;
  491.     dwBindVerb: DWORD;
  492.     szCustomVerb: LPWSTR;
  493.     cbstgmedData: DWORD;
  494.     dwOptions: DWORD;
  495.     dwOptionsFlags: DWORD;
  496.     dwCodePage: DWORD;
  497.     securityAttributes: TSecurityAttributes;
  498.     iid: TGUID;
  499.     pUnk: IUnknown;
  500.     dwReserved: DWORD;
  501.   end;
  502.   TBindInfo = _tagBINDINFO;
  503.   {$EXTERNALSYM BINDINFO}
  504.   BINDINFO = _tagBINDINFO;
  505.  
  506.   PRemSecurityAttributes = ^TRemSecurityAttributes;
  507.   {$EXTERNALSYM _REMSECURITY_ATTRIBUTES}
  508.   _REMSECURITY_ATTRIBUTES = packed record
  509.     nLength: DWORD;
  510.     lpSecurityDescriptor: DWORD;
  511.     bInheritHandle: BOOL;
  512.   end;
  513.   TRemSecurityAttributes = _REMSECURITY_ATTRIBUTES;
  514.   {$EXTERNALSYM REMSECURITY_ATTRIBUTES}
  515.   REMSECURITY_ATTRIBUTES = _REMSECURITY_ATTRIBUTES;
  516.  
  517.   PRemBindInfo = ^TRemBindInfo;
  518.   {$EXTERNALSYM _tagRemBINDINFO}
  519.   _tagRemBINDINFO = packed record
  520.     cbSize: ULONG;
  521.     szExtraInfo: LPWSTR;
  522.     grfBindInfoF: DWORD;
  523.     dwBindVerb: DWORD;
  524.     szCustomVerb: LPWSTR;
  525.     cbstgmedData: DWORD;
  526.     dwOptions: DWORD;
  527.     dwOptionsFlags: DWORD;
  528.     dwCodePage: DWORD;
  529.     securityAttributes: TRemSecurityAttributes;
  530.     iid: TGUID;
  531.     pUnk: IUnknown;
  532.     dwReserved: DWORD;
  533.   end;
  534.   TRemBindInfo = _tagRemBINDINFO; 
  535.   {$EXTERNALSYM RemBINDINFO}
  536.   RemBINDINFO = _tagRemBINDINFO;
  537.   
  538.   PRemFormatEtc = ^TRemFormatEtc;
  539.   {$EXTERNALSYM tagRemFORMATETC}
  540.   tagRemFORMATETC = packed record
  541.     cfFormat: DWORD;
  542.     ptd: DWORD;
  543.     dwAspect: DWORD;
  544.     lindex: Longint;
  545.     tymed: DWORD;
  546.   end;
  547.   TRemFormatEtc = tagRemFORMATETC;
  548.   {$EXTERNALSYM RemFORMATETC}
  549.   RemFORMATETC = tagRemFORMATETC;
  550.  
  551.   {$EXTERNALSYM IBindStatusCallback}
  552.   IBindStatusCallback = interface
  553.     ['{79eac9c1-baf9-11ce-8c82-00aa004ba90b}']
  554.     function OnStartBinding(dwReserved: DWORD; pib: IBinding): HResult; stdcall;
  555.     function GetPriority(out nPriority): HResult; stdcall;
  556.     function OnLowResource(reserved: DWORD): HResult; stdcall;
  557.     function OnProgress(ulProgress, ulProgressMax, ulStatusCode: ULONG;
  558.       szStatusText: LPCWSTR): HResult; stdcall;
  559.     function OnStopBinding(hresult: HResult; szError: LPCWSTR): HResult; stdcall;
  560.     function GetBindInfo(out grfBINDF: DWORD; var bindinfo: TBindInfo): HResult; stdcall;
  561.     function OnDataAvailable(grfBSCF: DWORD; dwSize: DWORD; formatetc: PFormatEtc;
  562.       stgmed: PStgMedium): HResult; stdcall;
  563.     function OnObjectAvailable(const iid: TGUID; punk: IUnknown): HResult; stdcall;
  564.   end;
  565.  
  566.   {$EXTERNALSYM IAuthenticate}
  567.   IAuthenticate = interface
  568.     ['{79eac9d0-baf9-11ce-8c82-00aa004ba90b}']
  569.     function Authenticate(var hwnd: HWnd; var szUserName, szPassWord: LPWSTR): HResult; stdcall;
  570.   end;
  571.  
  572.   {$EXTERNALSYM IHttpNegotiate}
  573.   IHttpNegotiate = interface
  574.     ['{79eac9d2-baf9-11ce-8c82-00aa004ba90b}']
  575.     function BeginningTransaction(szURL, szHeaders: LPCWSTR; dwReserved: DWORD;
  576.       out szAdditionalHeaders: LPWSTR): HResult; stdcall;
  577.     function OnResponse(dwResponseCode: DWORD; szResponseHeaders, szRequestHeaders: LPCWSTR;
  578.       out szAdditionalRequestHeaders: LPWSTR): HResult; stdcall;
  579.   end;
  580.  
  581.   {$EXTERNALSYM IWindowForBindingUI}
  582.   IWindowForBindingUI = interface
  583.     ['{79eac9d5-bafa-11ce-8c82-00aa004ba90b}']
  584.     function GetWindow(const guidReason: TGUID; out hwnd): HResult; stdcall;
  585.   end;
  586.  
  587. const
  588.   {$EXTERNALSYM CIP_DISK_FULL}
  589.   CIP_DISK_FULL                            = 0;
  590.   {$EXTERNALSYM CIP_ACCESS_DENIED}
  591.   CIP_ACCESS_DENIED                        = CIP_DISK_FULL + 1;
  592.   {$EXTERNALSYM CIP_NEWER_VERSION_EXISTS}
  593.   CIP_NEWER_VERSION_EXISTS                 = CIP_ACCESS_DENIED + 1;
  594.   {$EXTERNALSYM CIP_OLDER_VERSION_EXISTS}
  595.   CIP_OLDER_VERSION_EXISTS                 = CIP_NEWER_VERSION_EXISTS + 1;
  596.   {$EXTERNALSYM CIP_NAME_CONFLICT}
  597.   CIP_NAME_CONFLICT                        = CIP_OLDER_VERSION_EXISTS + 1;
  598.   {$EXTERNALSYM CIP_TRUST_VERIFICATION_COMPONENT_MISSING}
  599.   CIP_TRUST_VERIFICATION_COMPONENT_MISSING = CIP_NAME_CONFLICT + 1;
  600.   {$EXTERNALSYM CIP_EXE_SELF_REGISTERATION_TIMEOUT}
  601.   CIP_EXE_SELF_REGISTERATION_TIMEOUT       = CIP_TRUST_VERIFICATION_COMPONENT_MISSING + 1;
  602.   {$EXTERNALSYM CIP_UNSAFE_TO_ABORT}
  603.   CIP_UNSAFE_TO_ABORT                      = CIP_EXE_SELF_REGISTERATION_TIMEOUT + 1;
  604.   {$EXTERNALSYM CIP_NEED_REBOOT}
  605.   CIP_NEED_REBOOT                          = CIP_UNSAFE_TO_ABORT + 1;
  606.  
  607. type
  608.   {$EXTERNALSYM ICodeInstall}
  609.   ICodeInstall = interface(IWindowForBindingUI)
  610.     ['{79eac9d1-baf9-11ce-8c82-00aa004ba90b}']
  611.     function OnCodeInstallProblem(ulStatusCode: ULONG; szDestination, szSource: LPCWSTR;
  612.       dwReserved: DWORD): HResult; stdcall;
  613.   end;
  614.  
  615.   {$EXTERNALSYM IWinInetInfo}
  616.   IWinInetInfo = interface
  617.     ['{79eac9d6-bafa-11ce-8c82-00aa004ba90b}']
  618.     function QueryOption(dwOption: DWORD; Buffer: Pointer; var cbBuf: DWORD): HResult; stdcall;
  619.   end;
  620.  
  621. const
  622.   {$EXTERNALSYM WININETINFO_OPTION_LOCK_HANDLE}
  623.   WININETINFO_OPTION_LOCK_HANDLE   = 65534;
  624.  
  625. type
  626.   {$EXTERNALSYM IHttpSecurity}
  627.   IHttpSecurity = interface(IWindowForBindingUI)
  628.     ['{79eac9d7-bafa-11ce-8c82-00aa004ba90b}']
  629.     function OnSecurityProblem(dwProblem: DWORD): HResult; stdcall;
  630.   end;
  631.  
  632.   {$EXTERNALSYM IWinInetHttpInfo}
  633.   IWinInetHttpInfo = interface(IWinInetInfo)
  634.     ['{79eac9d8-bafa-11ce-8c82-00aa004ba90b}']
  635.     function QueryInfo(dwOption: DWORD; Buffer: Pointer;
  636.       var cbBuf, dwFlags, dwReserved: DWORD): HResult; stdcall;
  637.   end;
  638.  
  639.   {$EXTERNALSYM IBindHost}
  640.   IBindHost = interface
  641.     ['{fc4801a1-2ba9-11cf-a229-00aa003d7352}']
  642.     function CreateMoniker(szName: POLEStr; BC: IBindCtx; out mk: IMoniker; dwReserved: DWORD): HResult; stdcall;
  643.     function MonikerBindToStorage(Mk: IMoniker; BC: IBindCtx; BSC: IBindStatusCallback;
  644.       const iid: TGUID; out pvObj: Pointer): HResult; stdcall;
  645.     function MonikerBindToObject(Mk: IMoniker; BC: IBindCtx; BSC: IBindStatusCallback;
  646.       const iid: TGUID; out pvObj: Pointer): HResult; stdcall;
  647.   end;
  648.  
  649. const
  650.   {$EXTERNALSYM URLOSTRM_USECACHEDCOPY_ONLY}
  651.   URLOSTRM_USECACHEDCOPY_ONLY = $00000001;      // Only get from cache
  652.   {$EXTERNALSYM URLOSTRM_USECACHEDCOPY}
  653.   URLOSTRM_USECACHEDCOPY      = $00000002;      // Get from cache if available else download
  654.   {$EXTERNALSYM URLOSTRM_GETNEWESTVERSION}
  655.   URLOSTRM_GETNEWESTVERSION   = $00000003;      // Get new version only. But put it in cache too
  656.  
  657.  
  658. {$EXTERNALSYM HlinkSimpleNavigateToString}
  659. function HlinkSimpleNavigateToString(
  660.   szTarget,                           // required - target document - null if local jump w/in doc
  661.   szLocation,                         // optional, for navigation into middle of a doc
  662.   szTargetFrameName: LPCWSTR;         // optional, for targeting frame-sets
  663.   Unk: IUnknown;                      // required - we'll search this for other necessary interfaces
  664.   pbc: IBindCtx;                      // optional. caller may register an IBSC in this
  665.   BSC: IBindStatusCallback;
  666.   grfHLNF,                            // flags
  667.   dwReserved: DWORD): HResult; stdcall;
  668.  
  669. {$EXTERNALSYM HlinkSimpleNavigateToMoniker}
  670. function HlinkSimpleNavigateToMoniker(
  671.   mkTarget: Imoniker;                 // required - target document - (may be null
  672.   szLocation,                         // optional, for navigation into middle of a doc
  673.   szTargetFrameName: LPCWSTR;         // optional, for targeting frame-sets
  674.   Unk: IUnknown;                      // required - we'll search this for other necessary interfaces
  675.   bc: IBindCtx;                       // optional. caller may register an IBSC in this
  676.   BSC: IBindStatusCallback;
  677.   grfHLNF,                            // flags
  678.   dwReserved: DWORD): HResult; stdcall;
  679.  
  680. {$EXTERNALSYM CreateURLMoniker}
  681. function CreateURLMoniker(MkCtx: IMoniker; szURL: LPCWSTR; out mk: IMoniker): HResult; stdcall;
  682. {$EXTERNALSYM GetClassURL}
  683. function GetClassURL(szURL: LPCWSTR; const ClsID: TCLSID): HResult; stdcall;
  684. {$EXTERNALSYM CreateAsyncBindCtx}
  685. function CreateAsyncBindCtx(reserved: DWORD; pBSCb: IBindStatusCallback; pEFetc: IEnumFORMATETC;
  686.   out ppBC: IBindCtx): HResult; stdcall;
  687. {$EXTERNALSYM CreateAsyncBindCtxEx}
  688. function CreateAsyncBindCtxEx(pbc: IBindCtx; dwOptions: DWORD; BSCb: IBindStatusCallback; Enum: IEnumFORMATETC;
  689.   out ppBC: IBindCtx; reserved: DWORD): HResult; stdcall;
  690. {$EXTERNALSYM MkParseDisplayNameEx}
  691. function MkParseDisplayNameEx(pbc: IBindCtx; szDisplayName: LPCWSTR; out pchEaten: ULONG;
  692.   out ppmk: IMoniker): HResult; stdcall;
  693. {$EXTERNALSYM RegisterBindStatusCallback}
  694. function RegisterBindStatusCallback(pBC: IBindCtx; pBSCb: IBindStatusCallback;
  695.   out ppBSCBPrev: IBindStatusCallback; dwReserved: DWORD): HResult; stdcall;
  696. {$EXTERNALSYM RevokeBindStatusCallback}
  697. function RevokeBindStatusCallback(pBC: IBindCtx; pBSCb: IBindStatusCallback): HResult; stdcall;
  698. {$EXTERNALSYM GetClassFileOrMime}
  699. function GetClassFileOrMime(pBC: IBindCtx; szFilename: LPCWSTR; pBuffer: Pointer; cbSize: DWORD;
  700.   szMime: LPCWSTR; dwReserved: DWORD; out pclsid: TCLSID): HResult; stdcall;
  701. {$EXTERNALSYM IsValidURL}
  702. function IsValidURL(pBC: IBindCtx; szURL: LPCWSTR; dwReserved: DWORD): HResult; stdcall;
  703. {$EXTERNALSYM CoGetClassObjectFromURL}
  704. function CoGetClassObjectFromURL(const rCLASSID: TCLSID; szCODE: LPCWSTR;
  705.   dwFileVersionMS, dwFileVersionLS: DWORD; szTYPE: LPCWSTR; pBindCtx: IBindCtx; dwClsContext: DWORD;
  706.   pvReserved: Pointer; const riid: TGUID; out ppv): HResult; stdcall;
  707.  
  708. //helper apis
  709. {$EXTERNALSYM IsAsyncMoniker}
  710. function IsAsyncMoniker(pmk: IMoniker): HResult; stdcall;
  711. {$EXTERNALSYM CreateURLBinding}
  712. function CreateURLBinding(lpszUrl: LPCWSTR; pbc: IBindCtx; out ppBdg: IBinding): HResult; stdcall;
  713.  
  714. {$EXTERNALSYM RegisterMediaTypes}
  715. function RegisterMediaTypes(ctypes: UINT; const rgszTypes: LPCSTR; const rgcfTypes: TClipFormat): HResult; stdcall;
  716. {$EXTERNALSYM FindMediaType}
  717. function FindMediaType(rgszTypes: LPCSTR; rgcfTypes: PClipFormat): HResult; stdcall;
  718. {$EXTERNALSYM CreateFormatEnumerator}
  719. function CreateFormatEnumerator(cfmtetc: UINT; const rgfmtetc: TFormatEtc; out ppenumfmtetc: IEnumFormatEtc): HResult; stdcall;
  720. {$EXTERNALSYM RegisterFormatEnumerator}
  721. function RegisterFormatEnumerator(pBC: IBindCtx; pEFetc: IEnumFormatEtc; reserved: DWORD): HResult; stdcall;
  722. {$EXTERNALSYM RevokeFormatEnumerator}
  723. function RevokeFormatEnumerator(pBC: IBindCtx; pEFetc: IEnumFormatEtc): HResult; stdcall;
  724. {$EXTERNALSYM RegisterMediaTypeClass}
  725. function RegisterMediaTypeClass(pBC: IBindCtx; ctypes: UINT; const rgszTypes: LPCSTR; rgclsID: PCLSID; reserved: DWORD): HResult; stdcall;
  726. {$EXTERNALSYM FindMediaTypeClass}
  727. function FindMediaTypeClass(pBC: IBindCtx; szType: LPCSTR; const pclsID: TCLSID; reserved: DWORD): HResult; stdcall;
  728. {$EXTERNALSYM UrlMkSetSessionOption}
  729. function UrlMkSetSessionOption(dwOption: DWORD; pBuffer: Pointer; dwBufferLength, dwReserved: DWORD): HResult; stdcall;
  730. {$EXTERNALSYM UrlMkGetSessionOption}
  731. function UrlMkGetSessionOption(dwOption: DWORD; pBuffer: Pointer; dwBufferLength: DWORD; out pdwBufferLength: DWORD; dwReserved: DWORD): HResult; stdcall;
  732. {$EXTERNALSYM FindMimeFromData}
  733. function FindMimeFromData(
  734.     pBC: IBindCtx;                      // bind context - can be nil
  735.     pwzUrl: LPCWSTR;                    // url - can be nil
  736.     pBuffer: Pointer;                   // buffer with data to sniff - can be nil (pwzUrl must be valid)
  737.     cbSize: DWORD;                      // size of buffer
  738.     pwzMimeProposed: LPCWSTR;           // proposed mime if - can be nil
  739.     dwMimeFlags: DWORD;                 // will be defined
  740.     out ppwzMimeOut: LPWSTR;            // the suggested mime
  741.     dwReserved: DWORD                   // must be 0
  742.   ): HResult; stdcall;
  743. {$EXTERNALSYM ObtainUserAgentString}
  744. function ObtainUserAgentString(dwOption: DWORD; pszUAOut: LPSTR; var cbSize: DWORD): HResult; stdcall;
  745.  
  746. {$EXTERNALSYM URLOpenStreamA}
  747. function URLOpenStreamA(p1: IUnknown; p2: PAnsiChar; p3: DWORD; p4: IBindStatusCallback): HResult; stdcall;
  748. {$EXTERNALSYM URLOpenStreamW}
  749. function URLOpenStreamW(p1: IUnknown; p2: PWideChar; p3: DWORD; p4: IBindStatusCallback): HResult; stdcall;
  750. {$EXTERNALSYM URLOpenStream}
  751. function URLOpenStream(p1: IUnknown; p2: PChar; p3: DWORD; p4: IBindStatusCallback): HResult; stdcall;
  752. {$EXTERNALSYM URLOpenPullStreamA}
  753. function URLOpenPullStreamA(p1: IUnknown; p2: PAnsiChar; p3: DWORD; BSC: IBindStatusCallback): HResult; stdcall;
  754. {$EXTERNALSYM URLOpenPullStreamW}
  755. function URLOpenPullStreamW(p1: IUnknown; p2: PWideChar; p3: DWORD; BSC: IBindStatusCallback): HResult; stdcall;
  756. {$EXTERNALSYM URLOpenPullStream}
  757. function URLOpenPullStream(p1: IUnknown; p2: PChar; p3: DWORD; BSC: IBindStatusCallback): HResult; stdcall;
  758. {$EXTERNALSYM URLDownloadToFileA}
  759. function URLDownloadToFileA(p1: IUnknown; p2: PAnsiChar; p3: PAnsiChar; p4: DWORD; p5: IBindStatusCallback): HResult; stdcall;
  760. {$EXTERNALSYM URLDownloadToFileW}
  761. function URLDownloadToFileW(p1: IUnknown; p2: PWideChar; p3: PWideChar; p4: DWORD; p5: IBindStatusCallback): HResult; stdcall;
  762. {$EXTERNALSYM URLDownloadToFile}
  763. function URLDownloadToFile(p1: IUnknown; p2: PChar; p3: PChar; p4: DWORD; p5: IBindStatusCallback): HResult; stdcall;
  764. {$EXTERNALSYM URLDownloadToCacheFileA}
  765. function URLDownloadToCacheFileA(p1: IUnknown; p2: PAnsiChar; p3: PAnsiChar; p4: DWORD; p5: DWORD; p6: IBindStatusCallback): HResult; stdcall;
  766. {$EXTERNALSYM URLDownloadToCacheFileW}
  767. function URLDownloadToCacheFileW(p1: IUnknown; p2: PWideChar; p3: PWideChar; p4: DWORD; p5: DWORD; p6: IBindStatusCallback): HResult; stdcall;
  768. {$EXTERNALSYM URLDownloadToCacheFile}
  769. function URLDownloadToCacheFile(p1: IUnknown; p2: PChar; p3: PChar; p4: DWORD; p5: DWORD; p6: IBindStatusCallback): HResult; stdcall;
  770. {$EXTERNALSYM URLOpenBlockingStreamA}
  771. function URLOpenBlockingStreamA(p1: IUnknown; p2: PAnsiChar; p3: IStream; p4: DWORD; p5: IBindStatusCallback): HResult; stdcall;
  772. {$EXTERNALSYM URLOpenBlockingStreamW}
  773. function URLOpenBlockingStreamW(p1: IUnknown; p2: PWideChar; p3: IStream; p4: DWORD; p5: IBindStatusCallback): HResult; stdcall;
  774. {$EXTERNALSYM URLOpenBlockingStream}
  775. function URLOpenBlockingStream(p1: IUnknown; p2: PChar; p3: IStream; p4: DWORD; p5: IBindStatusCallback): HResult; stdcall;
  776.  
  777. {$EXTERNALSYM HlinkGoBack}
  778. function HlinkGoBack(unk: IUnknown): HResult; stdcall;
  779. {$EXTERNALSYM HlinkGoForward}
  780. function HlinkGoForward(unk: IUnknown): HResult; stdcall;
  781. {$EXTERNALSYM HlinkNavigateString}
  782. function HlinkNavigateString(unk: IUnknown; szTarget: LPCWSTR): HResult; stdcall;
  783. {$EXTERNALSYM HlinkNavigateMoniker}
  784. function HlinkNavigateMoniker(Unk: IUnknown; mkTarget: IMoniker): HResult; stdcall;
  785.  
  786. type
  787.   {$EXTERNALSYM IInternet}
  788.   IInternet = interface
  789.     ['{79eac9e0-baf9-11ce-8c82-00aa004ba90b}']
  790.   end;
  791.  
  792. const
  793.   {$EXTERNALSYM BINDSTRING_HEADERS}
  794.   BINDSTRING_HEADERS          = 1;
  795.   {$EXTERNALSYM BINDSTRING_ACCEPT_MIMES}
  796.   BINDSTRING_ACCEPT_MIMES     = BINDSTRING_HEADERS + 1;
  797.   {$EXTERNALSYM BINDSTRING_EXTRA_URL}
  798.   BINDSTRING_EXTRA_URL        = BINDSTRING_ACCEPT_MIMES + 1;
  799.   {$EXTERNALSYM BINDSTRING_LANGUAGE}
  800.   BINDSTRING_LANGUAGE         = BINDSTRING_EXTRA_URL + 1;
  801.   {$EXTERNALSYM BINDSTRING_USERNAME}
  802.   BINDSTRING_USERNAME         = BINDSTRING_LANGUAGE + 1;
  803.   {$EXTERNALSYM BINDSTRING_PASSWORD}
  804.   BINDSTRING_PASSWORD         = BINDSTRING_USERNAME + 1;
  805.   {$EXTERNALSYM BINDSTRING_UA_PIXELS}
  806.   BINDSTRING_UA_PIXELS        = BINDSTRING_PASSWORD + 1;
  807.   {$EXTERNALSYM BINDSTRING_UA_COLOR}
  808.   BINDSTRING_UA_COLOR         = BINDSTRING_UA_PIXELS + 1;
  809.   {$EXTERNALSYM BINDSTRING_OS}
  810.   BINDSTRING_OS               = BINDSTRING_UA_COLOR + 1;
  811.   {$EXTERNALSYM BINDSTRING_USER_AGENT}
  812.   BINDSTRING_USER_AGENT       = BINDSTRING_OS + 1;
  813.   {$EXTERNALSYM BINDSTRING_ACCEPT_ENCODINGS}
  814.   BINDSTRING_ACCEPT_ENCODINGS = BINDSTRING_USER_AGENT + 1;
  815.   {$EXTERNALSYM BINDSTRING_POST_COOKIE}
  816.   BINDSTRING_POST_COOKIE      = BINDSTRING_ACCEPT_ENCODINGS + 1;
  817.   {$EXTERNALSYM BINDSTRING_POST_DATA_MIME}
  818.   BINDSTRING_POST_DATA_MIME   = BINDSTRING_POST_COOKIE + 1;
  819.   {$EXTERNALSYM BINDSTRING_URL}
  820.   BINDSTRING_URL              = BINDSTRING_POST_DATA_MIME + 1;
  821.  
  822. type
  823.   {$NODEFINE POLEStrArray}
  824.   POLEStrArray = ^TOLESTRArray;
  825.   {$NODEFINE TOLEStrArray}
  826.   TOLEStrArray = array[0..MaxLongint div SizeOf(POLEStr) - 1] of POLEStr;
  827.  
  828.   {$EXTERNALSYM IInternetBindInfo}
  829.   IInternetBindInfo = interface
  830.     ['{79eac9e1-baf9-11ce-8c82-00aa004ba90b}']
  831.     function GetBindInfo(out grfBINDF: DWORD; var bindinfo: TBindInfo): HResult; stdcall;
  832.     function GetBindString(ulStringType: ULONG; wzStr: POLEStrArray; cEl: ULONG;
  833.       var cElFetched: ULONG): HResult; stdcall;
  834.   end;
  835.  
  836. const
  837.   {$EXTERNALSYM PI_PARSE_URL}
  838.   PI_PARSE_URL                = $00000001;
  839.   {$EXTERNALSYM PI_FILTER_MODE}
  840.   PI_FILTER_MODE              = $00000002;
  841.   {$EXTERNALSYM PI_FORCE_ASYNC}
  842.   PI_FORCE_ASYNC              = $00000004;
  843.   {$EXTERNALSYM PI_USE_WORKERTHREAD}
  844.   PI_USE_WORKERTHREAD         = $00000008;
  845.   {$EXTERNALSYM PI_MIMEVERIFICATION}
  846.   PI_MIMEVERIFICATION         = $00000010;
  847.   {$EXTERNALSYM PI_CLSIDLOOKUP}
  848.   PI_CLSIDLOOKUP              = $00000020;
  849.   {$EXTERNALSYM PI_DATAPROGRESS}
  850.   PI_DATAPROGRESS             = $00000040;
  851.   {$EXTERNALSYM PI_SYNCHRONOUS}
  852.   PI_SYNCHRONOUS              = $00000080;
  853.   {$EXTERNALSYM PI_APARTMENTTHREADED}
  854.   PI_APARTMENTTHREADED        = $00000100;
  855.   {$EXTERNALSYM PI_CLASSINSTALL}
  856.   PI_CLASSINSTALL             = $00000200;
  857.   {$EXTERNALSYM PD_FORCE_SWITCH}
  858.   PD_FORCE_SWITCH             = $00010000;
  859.  
  860.   {$EXTERNALSYM PI_DOCFILECLSIDLOOKUP}
  861.   PI_DOCFILECLSIDLOOKUP       = PI_CLSIDLOOKUP;
  862.  
  863. type
  864.   PProtocolData = ^TProtocolData;
  865.   {$EXTERNALSYM _tagPROTOCOLDATA}
  866.   _tagPROTOCOLDATA = packed record
  867.     grfFlags: DWORD;
  868.     dwState: DWORD;
  869.     pData: Pointer;
  870.     cbData: ULONG;
  871.   end;
  872.   TProtocolData = _tagPROTOCOLDATA;
  873.   {$EXTERNALSYM _tagPROTOCOLDATA}
  874.   PROTOCOLDATA = _tagPROTOCOLDATA;
  875.   
  876.   {$EXTERNALSYM IInternetProtocolSink}
  877.   IInternetProtocolSink = interface; // forward
  878.  
  879.   {$EXTERNALSYM IInternetProtocolRoot}
  880.   IInternetProtocolRoot = interface
  881.     ['{79eac9e3-baf9-11ce-8c82-00aa004ba90b}']
  882.     function Start(szUrl: LPCWSTR; OIProtSink: IInternetProtocolSink;
  883.       OIBindInfo: IInternetBindInfo; grfPI, dwReserved: DWORD): HResult; stdcall;
  884.     function Continue(const ProtocolData: TProtocolData): HResult; stdcall;
  885.     function Abort(hrReason: HResult; dwOptions: DWORD): HResult; stdcall;
  886.     function Terminate(dwOptions: DWORD): HResult; stdcall;
  887.     function Suspend: HResult; stdcall;
  888.     function Resume: HResult; stdcall;
  889.   end;
  890.  
  891.   {$EXTERNALSYM IInternetProtocol}
  892.   IInternetProtocol = interface(IInternetProtocolRoot)
  893.     ['{79eac9e4-baf9-11ce-8c82-00aa004ba90b}']
  894.     function Read(pv: Pointer; cb: ULONG; out cbRead: ULONG): HResult; stdcall;
  895.     function Seek(dlibMove: LARGE_INTEGER; dwOrigin: DWORD; out libNewPosition: ULARGE_INTEGER): HResult; stdcall;
  896.     function LockRequest(dwOptions: DWORD): HResult; stdcall;
  897.     function UnlockRequest: HResult; stdcall;
  898.   end;
  899.  
  900.   {$EXTERNALSYM IInternetProtocolSink}
  901.   IInternetProtocolSink = interface
  902.     ['{79eac9e5-baf9-11ce-8c82-00aa004ba90b}']
  903.     function Switch(const ProtocolData: TProtocolData): HResult; stdcall;
  904.     function ReportProgress(ulStatusCode: ULONG; szStatusText: LPCWSTR): HResult; stdcall;
  905.     function ReportData(grfBSCF: DWORD; ulProgress, ulProgressMax: ULONG): HResult; stdcall;
  906.     function ReportResult(hrResult: HResult; dwError: DWORD; szResult: LPCWSTR): HResult; stdcall;
  907.   end;
  908.  
  909. const
  910.   {$EXTERNALSYM OIBDG_APARTMENTTHREADED}
  911.   OIBDG_APARTMENTTHREADED     = $00000100;
  912.  
  913. type
  914.   {$NODEFINE TLPCWSTRArray}
  915.   TLPCWSTRArray = array[0..MaxLongInt div SizeOf(LPCWSTR) - 1] of LPCWSTR;
  916.   {$NODEFINE PLPCWSTRArray}
  917.   PLPCWSTRArray = ^TLPCWSTRArray;
  918.  
  919.   {$EXTERNALSYM IInternetSession}
  920.   IInternetSession = interface
  921.     ['{79eac9e7-baf9-11ce-8c82-00aa004ba90b}']
  922.     function RegisterNameSpace(CF: IClassFactory; const clsid: TCLSID; pwzProtocol: LPCWSTR;
  923.       cPatterns: ULONG; const pwzPatterns: PLPCWSTRArray; dwReserved: DWORD): HResult; stdcall;
  924.     function UnregisterNameSpace(CF: IClassFactory; pszProtocol: LPCWSTR): HResult; stdcall;
  925.     function RegisterMimeFilter(CF: IClassFactory; const rclsid: TCLSID;
  926.       pwzType: LPCWSTR): HResult; stdcall;
  927.     function UnregisterMimeFilter(CF: IClassFactory; pwzType: LPCWSTR): HResult; stdcall;
  928.     function CreateBinding(BC: IBindCtx; szUrl: LPCWSTR; UnkOuter: IUnknown; out Unk: IUnknown;
  929.       out OINetProt: IInternetProtocol; dwOption: DWORD): HResult; stdcall;
  930.     function SetSessionOption(dwOption: DWORD; pBuffer: Pointer; dwBufferLength: DWORD;
  931.       dwReserved: DWORD): HResult; stdcall;
  932.     function GetSessionOption(dwOption: DWORD; pBuffer: Pointer; var dwBufferLength: DWORD;
  933.       dwReserved: DWORD): HResult; stdcall;
  934.   end;
  935.  
  936.   {$EXTERNALSYM IInternetThreadSwitch}
  937.   IInternetThreadSwitch = interface
  938.     ['{79eac9e8-baf9-11ce-8c82-00aa004ba90b}']
  939.     function Prepare: HResult; stdcall;
  940.     function Continue: HResult; stdcall;
  941.   end;
  942.  
  943.   {$EXTERNALSYM IInternetPriority}
  944.   IInternetPriority = interface
  945.     ['{79eac9eb-baf9-11ce-8c82-00aa004ba90b}']
  946.     function SetPriority(nPriority: Longint): HResult; stdcall;
  947.     function GetPriority(out nPriority: Longint): HResult; stdcall;
  948.   end;
  949.  
  950. const
  951.   {$EXTERNALSYM PARSE_CANONICALIZE}
  952.   PARSE_CANONICALIZE    = 1;
  953.   {$EXTERNALSYM PARSE_FRIENDLY}
  954.   PARSE_FRIENDLY        = PARSE_CANONICALIZE + 1;
  955.   {$EXTERNALSYM PARSE_SECURITY_URL}
  956.   PARSE_SECURITY_URL    = PARSE_FRIENDLY + 1;
  957.   {$EXTERNALSYM PARSE_ROOTDOCUMENT}
  958.   PARSE_ROOTDOCUMENT    = PARSE_SECURITY_URL + 1;
  959.   {$EXTERNALSYM PARSE_DOCUMENT}
  960.   PARSE_DOCUMENT        = PARSE_ROOTDOCUMENT + 1;
  961.   {$EXTERNALSYM PARSE_ANCHOR}
  962.   PARSE_ANCHOR          = PARSE_DOCUMENT + 1;
  963.   {$EXTERNALSYM PARSE_ENCODE}
  964.   PARSE_ENCODE          = PARSE_ANCHOR + 1;
  965.   {$EXTERNALSYM PARSE_DECODE}
  966.   PARSE_DECODE          = PARSE_ENCODE + 1;
  967.   {$EXTERNALSYM PARSE_PATH_FROM_URL}
  968.   PARSE_PATH_FROM_URL   = PARSE_DECODE + 1;
  969.   {$EXTERNALSYM PARSE_URL_FROM_PATH}
  970.   PARSE_URL_FROM_PATH   = PARSE_PATH_FROM_URL + 1;
  971.   {$EXTERNALSYM PARSE_MIME}
  972.   PARSE_MIME            = PARSE_URL_FROM_PATH + 1;
  973.   {$EXTERNALSYM PARSE_SERVER}
  974.   PARSE_SERVER          = PARSE_MIME + 1;
  975.   {$EXTERNALSYM PARSE_SCHEMA}
  976.   PARSE_SCHEMA          = PARSE_SERVER + 1;
  977.   {$EXTERNALSYM PARSE_SITE}
  978.   PARSE_SITE            = PARSE_SCHEMA + 1;
  979.   {$EXTERNALSYM PARSE_DOMAIN}
  980.   PARSE_DOMAIN          = PARSE_SITE + 1;
  981.   {$EXTERNALSYM PARSE_LOCATION}
  982.   PARSE_LOCATION        = PARSE_DOMAIN + 1;
  983.   {$EXTERNALSYM PARSE_SECURITY_DOMAIN}
  984.   PARSE_SECURITY_DOMAIN = PARSE_LOCATION + 1;
  985.  
  986.   {$EXTERNALSYM PSU_DEFAULT}
  987.   PSU_DEFAULT           = 1;
  988.   {$EXTERNALSYM PSU_SECURITY_URL_ONLY}
  989.   PSU_SECURITY_URL_ONLY = PSU_DEFAULT + 1;
  990.  
  991.   {$EXTERNALSYM QUERY_EXPIRATION_DATE}
  992.   QUERY_EXPIRATION_DATE     = 1;
  993.   {$EXTERNALSYM QUERY_TIME_OF_LAST_CHANGE}
  994.   QUERY_TIME_OF_LAST_CHANGE = QUERY_EXPIRATION_DATE + 1;
  995.   {$EXTERNALSYM QUERY_CONTENT_ENCODING}
  996.   QUERY_CONTENT_ENCODING    = QUERY_TIME_OF_LAST_CHANGE + 1;
  997.   {$EXTERNALSYM QUERY_CONTENT_TYPE}
  998.   QUERY_CONTENT_TYPE        = QUERY_CONTENT_ENCODING + 1;
  999.   {$EXTERNALSYM QUERY_REFRESH}
  1000.   QUERY_REFRESH             = QUERY_CONTENT_TYPE + 1;
  1001.   {$EXTERNALSYM QUERY_RECOMBINE}
  1002.   QUERY_RECOMBINE           = QUERY_REFRESH + 1;
  1003.   {$EXTERNALSYM QUERY_CAN_NAVIGATE}
  1004.   QUERY_CAN_NAVIGATE        = QUERY_RECOMBINE + 1;
  1005.   {$EXTERNALSYM QUERY_USES_NETWORK}
  1006.   QUERY_USES_NETWORK        = QUERY_CAN_NAVIGATE + 1;
  1007.   {$EXTERNALSYM QUERY_IS_CACHED}
  1008.   QUERY_IS_CACHED           = QUERY_USES_NETWORK + 1;
  1009.   {$EXTERNALSYM QUERY_IS_INSTALLEDENTRY}
  1010.   QUERY_IS_INSTALLEDENTRY   = QUERY_IS_CACHED + 1;
  1011.   {$EXTERNALSYM QUERY_IS_CACHED_OR_MAPPED}
  1012.   QUERY_IS_CACHED_OR_MAPPED = QUERY_IS_INSTALLEDENTRY + 1;
  1013.   {$EXTERNALSYM QUERY_USES_CACHE}
  1014.   QUERY_USES_CACHE          = QUERY_IS_CACHED_OR_MAPPED + 1;
  1015.  
  1016. type
  1017.   {$EXTERNALSYM IInternetProtocolInfo}
  1018.   IInternetProtocolInfo = interface
  1019.     ['{79eac9ec-baf9-11ce-8c82-00aa004ba90b}']
  1020.     function ParseUrl(pwzUrl: LPCWSTR; ParseAction: TParseAction; dwParseFlags: DWORD;
  1021.       pwzResult: LPWSTR; cchResult: DWORD; pcchResult: DWORD;
  1022.       dwReserved: DWORD): HResult; stdcall;
  1023.     function CombineUrl(pwzBaseUrl, pwzRelativeUrl: LPCWSTR; dwCombineFlags: DWORD;
  1024.       pwzResult: LPWSTR; cchResult: DWORD; out pcchResult: DWORD;
  1025.       dwReserved: DWORD): HResult; stdcall;
  1026.     function CompareUrl(pwzUrl1, pwzUrl2: LPCWSTR; dwCompareFlags: DWORD): HResult; stdcall;
  1027.     function QueryInfo(pwzUrl: LPCWSTR; QueryOption: TQueryOption; dwQueryFlags: DWORD;
  1028.       pBuffer: Pointer; cbBuffer: DWORD; var cbBuf: DWORD; dwReserved: DWORD): HResult; stdcall;
  1029.   end;
  1030.  
  1031. type
  1032.   {$EXTERNALSYM IOInet}
  1033.   IOInet =               IInternet;
  1034.   {$EXTERNALSYM IOInetBindInfo}
  1035.   IOInetBindInfo =       IInternetBindInfo;
  1036.   {$EXTERNALSYM IOInetProtocolRoot}
  1037.   IOInetProtocolRoot =   IInternetProtocolRoot;
  1038.   {$EXTERNALSYM IOInetProtocol}
  1039.   IOInetProtocol =       IInternetProtocol;
  1040.   {$EXTERNALSYM IOInetProtocolSink}
  1041.   IOInetProtocolSink =   IInternetProtocolSink;
  1042.   {$EXTERNALSYM IOInetProtocolInfo}
  1043.   IOInetProtocolInfo =   IInternetProtocolInfo;
  1044.   {$EXTERNALSYM IOInetSession}
  1045.   IOInetSession =        IInternetSession;
  1046.   {$EXTERNALSYM IOInetPriority}
  1047.   IOInetPriority =       IInternetPriority;
  1048.   {$EXTERNALSYM IOInetThreadSwitch}
  1049.   IOInetThreadSwitch =   IInternetThreadSwitch;
  1050.  
  1051. {$EXTERNALSYM CoInternetParseUrl}
  1052. function CoInternetParseUrl(pwzUrl: LPCWSTR; ParseAction: TParseAction;
  1053.   dwFlags: DWORD; pszResult: LPWSTR; cchResult: DWORD; var pcchResult: DWORD;
  1054.   dwReserved: DWORD): HResult; stdcall;
  1055. {$EXTERNALSYM CoInternetCombineUrl}
  1056. function CoInternetCombineUrl(pwzBaseUrl, pwzRelativeUrl: LPCWSTR;
  1057.   dwCombineFlags: DWORD; pszResult: LPWSTR; cchResult: DWORD;
  1058.   var pcchResult: DWORD; dwReserved: DWORD): HResult ; stdcall;
  1059. {$EXTERNALSYM CoInternetCompareUrl}
  1060. function CoInternetCompareUrl(pwzUrl1, pwzUrl2: LPCWSTR; dwFlags: DWORD): HResult; stdcall;
  1061. {$EXTERNALSYM CoInternetGetProtocolFlags}
  1062. function CoInternetGetProtocolFlags(pwzUrl: LPCWSTR; var dwFlags: DWORD;
  1063.   dwReserved: DWORD): HResult; stdcall;
  1064. {$EXTERNALSYM CoInternetQueryInfo}
  1065. function CoInternetQueryInfo(pwzUrl: LPCWSTR; QueryOptions: TQueryOption; dwQueryFlags: DWORD;
  1066.   pvBuffer: Pointer; cbBuffer: DWORD; var pcbBuffer: DWORD; dwReserved: DWORD): HResult; stdcall;
  1067. {$EXTERNALSYM CoInternetGetSession}
  1068. function CoInternetGetSession(dwSessionMode: DWORD; var pIInternetSession: IInternetSession;
  1069.   dwReserved: DWORD): HResult; stdcall;
  1070. {$EXTERNALSYM CoInternetGetSecurityUrl}
  1071. function CoInternetGetSecurityUrl(pwzUrl: LPCWSTR; var pwzSecUrl: LPWSTR; psuAction: TPSUAction;
  1072.   dwReserved: DWORD): HResult; stdcall;
  1073.  
  1074. // OInetXXX are synonyms for the previous functions
  1075. {$EXTERNALSYM OInetParseUrl}
  1076. function OInetParseUrl(pwzUrl: LPCWSTR; ParseAction: TParseAction; dwFlags: DWORD;
  1077.   pszResult: LPWSTR; cchResult: DWORD; var pcchResult: DWORD;
  1078.   dwReserved: DWORD): HResult; stdcall;
  1079. {$EXTERNALSYM OInetCombineUrl}
  1080. function OInetCombineUrl(pwzBaseUrl, pwzRelativeUrl: LPCWSTR; dwCombineFlags: DWORD;
  1081.   pszResult: LPWSTR; cchResult: DWORD; var pcchResult: DWORD;
  1082.   dwReserved: DWORD): HResult ; stdcall;
  1083. {$EXTERNALSYM OInetCompareUrl}
  1084. function OInetCompareUrl(pwzUrl1, pwzUrl2: LPCWSTR; dwFlags: DWORD): Hresult; stdcall;
  1085. {$EXTERNALSYM OInetGetProtocolFlags}
  1086. function OInetGetProtocolFlags(pwzUrl: LPCWSTR; var dwFlags: DWORD;
  1087.   dwReserved: DWORD): HResult; stdcall;
  1088. {$EXTERNALSYM OInetQueryInfo}
  1089. function OInetQueryInfo(pwzUrl: LPCWSTR; QueryOptions: TQueryOption; dwQueryFlags: DWORD;
  1090.   pvBuffer: Pointer; cbBuffer: DWORD; var pcbBuffer: DWORD; dwReserved: DWORD): HResult; stdcall;
  1091. {$EXTERNALSYM OInetGetSession}
  1092. function OInetGetSession(dwSessionMode: DWORD; var pIInternetSession: IInternetSession;
  1093.   dwReserved: DWORD): HResult; stdcall;
  1094. {$EXTERNALSYM OInetGetSecurityUrl}
  1095. function OInetGetSecurityUrl(pwzUrl: LPCWSTR; var pwzSecUrl: LPWSTR; psuAction: TPSUAction;
  1096.   dwReserved: DWORD): HResult; stdcall;
  1097.  
  1098. {$EXTERNALSYM CopyStgMedium}
  1099. function CopyStgMedium(const cstgmedSrc: TStgMedium; var stgmedDest: TStgMedium): HResult; stdcall;
  1100. {$EXTERNALSYM CopyBindInfo}
  1101. function CopyBindInfo(const cbiSrc: TBindInfo; var biDest: TBindInfo): HResult; stdcall;
  1102. {$EXTERNALSYM ReleaseBindInfo}
  1103. procedure ReleaseBindInfo(const bindinfo: TBindInfo); stdcall;
  1104.  
  1105. const
  1106.   {$EXTERNALSYM INET_E_USE_DEFAULT_PROTOCOLHANDLER}
  1107.   INET_E_USE_DEFAULT_PROTOCOLHANDLER = HResult($800C0011);
  1108.   {$EXTERNALSYM INET_E_USE_DEFAULT_SETTING}
  1109.   INET_E_USE_DEFAULT_SETTING         = HResult($800C0012);
  1110.   {$EXTERNALSYM INET_E_DEFAULT_ACTION}
  1111.   INET_E_DEFAULT_ACTION              = HResult($800C0011);
  1112.   {$EXTERNALSYM INET_E_QUERYOPTION_UNKNOWN}
  1113.   INET_E_QUERYOPTION_UNKNOWN         = HResult($800C0013);
  1114.   {$EXTERNALSYM INET_E_REDIRECTING}
  1115.   INET_E_REDIRECTING                 = HResult($800C0014);
  1116.  
  1117.   {$EXTERNALSYM PROTOCOLFLAG_NO_PICS_CHECK}
  1118.   PROTOCOLFLAG_NO_PICS_CHECK     = $00000001;
  1119.  
  1120. type
  1121.   {$EXTERNALSYM IInternetSecurityMgrSite}
  1122.   IInternetSecurityMgrSite = interface
  1123.     ['{79eac9ed-baf9-11ce-8c82-00aa004ba90b}']
  1124.     function GetWindow(out hwnd: HWnd): HResult; stdcall;
  1125.     function EnableModeless(fEnable: BOOL): HResult; stdcall;
  1126.   end;
  1127.  
  1128. const
  1129.   {$EXTERNALSYM MAX_SIZE_SECURITY_ID}
  1130.   MAX_SIZE_SECURITY_ID    = 512; // bytes;
  1131.  
  1132.   // MapUrlToZone returns the zone index given a URL
  1133.   {$EXTERNALSYM PUAF_DEFAULT}
  1134.   PUAF_DEFAULT            = $00000000;
  1135.   {$EXTERNALSYM PUAF_NOUI}
  1136.   PUAF_NOUI               = $00000001;
  1137.   {$EXTERNALSYM PUAF_ISFILE}
  1138.   PUAF_ISFILE             = $00000002;
  1139.   {$EXTERNALSYM PUAF_WARN_IF_DENIED}
  1140.   PUAF_WARN_IF_DENIED     = $00000004;
  1141.   {$EXTERNALSYM PUAF_FORCEUI_FOREGROUND}
  1142.   PUAF_FORCEUI_FOREGROUND = $00000008;
  1143.   {$EXTERNALSYM PUAF_CHECK_TIFS}
  1144.   PUAF_CHECK_TIFS         = $00000010;
  1145.  
  1146. // This is the wrapper function that most clients will use.
  1147. // It figures out the current Policy for the passed in Action,
  1148. // and puts up UI if the current Policy indicates that the user
  1149. // should be queried. It returns back the Policy which the caller
  1150. // will use to determine if the action should be allowed
  1151. // This is the wrapper function to conveniently read a custom policy.
  1152.  
  1153. // SetZoneMapping
  1154. //    lpszPattern: string denoting a URL pattern
  1155. //        Examples of valid patterns:
  1156. //            *://*.msn.com
  1157. //            http://*.sony.co.jp
  1158. //            *://et.msn.com
  1159. //            ftp://157.54.23.41/
  1160. //            https://localsvr
  1161. //            file:\localsvr\share
  1162. //            *://157.54.100-200.*
  1163. //        Examples of invalid patterns:
  1164. //            http://*.lcs.mit.edu
  1165. //            ftp://*
  1166. //    dwFlags: SZM_FLAGS values
  1167.  
  1168.   {$EXTERNALSYM SZM_CREATE}
  1169.   SZM_CREATE= $00000000;
  1170.   {$EXTERNALSYM SZM_DELETE}
  1171.   SZM_DELETE= $00000001;
  1172.  
  1173. type  
  1174.   {$EXTERNALSYM IInternetSecurityManager}
  1175.   IInternetSecurityManager = interface
  1176.     ['{79eac9ee-baf9-11ce-8c82-00aa004ba90b}']
  1177.     function SetSecuritySite(Site: IInternetSecurityMgrSite): HResult; stdcall;
  1178.     function GetSecuritySite(out Site: IInternetSecurityMgrSite): HResult; stdcall;
  1179.     function MapUrlToZone(pwszUrl: LPCWSTR; out dwZone: DWORD;
  1180.       dwFlags: DWORD): HResult; stdcall;
  1181.     function GetSecurityId(pwszUrl: LPCWSTR; pbSecurityId: Pointer;
  1182.       var cbSecurityId: DWORD; dwReserved: DWORD): HResult; stdcall;
  1183.     function ProcessUrlAction(pwszUrl: LPCWSTR; dwAction: DWORD;
  1184.       pPolicy: Pointer; cbPolicy: DWORD; pContext: Pointer; cbContext: DWORD;
  1185.       dwFlags, dwReserved: DWORD): HResult; stdcall;
  1186.     function QueryCustomPolicy(pwszUrl: LPCWSTR; const guidKey: TGUID;
  1187.       out pPolicy: Pointer; out cbPolicy: DWORD; pContext: Pointer; cbContext: DWORD;
  1188.       dwReserved: DWORD): HResult; stdcall;
  1189.     function SetZoneMapping(dwZone: DWORD; lpszPattern: LPCWSTR;
  1190.       dwFlags: DWORD): HResult; stdcall;
  1191.     function GetZoneMappings(dwZone: DWORD; out enumString: IEnumString;
  1192.       dwFlags: DWORD): HResult; stdcall;
  1193.   end;
  1194.  
  1195.   {$EXTERNALSYM IInternetHostSecurityManager}
  1196.   IInternetHostSecurityManager = interface
  1197.     ['{3af280b6-cb3f-11d0-891e-00c04fb6bfc4}']
  1198.     function GetSecurityId(pbSecurityId: Pointer; var cbSecurityId: DWORD;
  1199.       dwReserved: DWORD): HResult; stdcall;
  1200.     function ProcessUrlAction(dwAction: DWORD; pPolicy: Pointer; cbPolicy: DWORD;
  1201.       pContext: Pointer; cbContext, dwFlags, dwReserved: DWORD): HResult; stdcall;
  1202.     function QueryCustomPolicy(const guidKey: TGUID; out pPolicy: Pointer; out cbPolicy: DWORD;
  1203.       pContext: Pointer; cbContext, dwReserved: DWORD): HResult; stdcall;
  1204.   end;
  1205.  
  1206. const
  1207.   {$EXTERNALSYM URLACTION_MIN}
  1208.   URLACTION_MIN                                = $00001000;
  1209.  
  1210.   {$EXTERNALSYM URLACTION_DOWNLOAD_MIN}
  1211.   URLACTION_DOWNLOAD_MIN                       = $00001000;
  1212.   {$EXTERNALSYM URLACTION_DOWNLOAD_SIGNED_ACTIVEX}
  1213.   URLACTION_DOWNLOAD_SIGNED_ACTIVEX            = $00001001;
  1214.   {$EXTERNALSYM URLACTION_DOWNLOAD_UNSIGNED_ACTIVEX}
  1215.   URLACTION_DOWNLOAD_UNSIGNED_ACTIVEX          = $00001004;
  1216.   {$EXTERNALSYM URLACTION_DOWNLOAD_CURR_MAX}
  1217.   URLACTION_DOWNLOAD_CURR_MAX                  = $00001004;
  1218.   {$EXTERNALSYM URLACTION_DOWNLOAD_MAX}
  1219.   URLACTION_DOWNLOAD_MAX                       = $000011FF;
  1220.  
  1221.   {$EXTERNALSYM URLACTION_ACTIVEX_MIN}
  1222.   URLACTION_ACTIVEX_MIN                        = $00001200;
  1223.   {$EXTERNALSYM URLACTION_ACTIVEX_RUN}
  1224.   URLACTION_ACTIVEX_RUN                        = $00001200;
  1225.   {$EXTERNALSYM URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY}
  1226.   URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY     = $00001201; // aggregate next four
  1227.   {$EXTERNALSYM URLACTION_ACTIVEX_OVERRIDE_DATA_SAFETY}
  1228.   URLACTION_ACTIVEX_OVERRIDE_DATA_SAFETY       = $00001202; //
  1229.   {$EXTERNALSYM URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY}
  1230.   URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY     = $00001203; //
  1231.   {$EXTERNALSYM URLACTION_SCRIPT_OVERRIDE_SAFETY}
  1232.   URLACTION_SCRIPT_OVERRIDE_SAFETY             = $00001401; //
  1233.   {$EXTERNALSYM URLACTION_ACTIVEX_CONFIRM_NOOBJECTSAFETY}
  1234.   URLACTION_ACTIVEX_CONFIRM_NOOBJECTSAFETY     = $00001204; //
  1235.   {$EXTERNALSYM URLACTION_ACTIVEX_TREATASUNTRUSTED}
  1236.   URLACTION_ACTIVEX_TREATASUNTRUSTED           = $00001205;
  1237.   {$EXTERNALSYM URLACTION_ACTIVEX_CURR_MAX}
  1238.   URLACTION_ACTIVEX_CURR_MAX                   = $00001205;
  1239.   {$EXTERNALSYM URLACTION_ACTIVEX_MAX}
  1240.   URLACTION_ACTIVEX_MAX                        = $000013FF;
  1241.  
  1242.   {$EXTERNALSYM URLACTION_SCRIPT_MIN}
  1243.   URLACTION_SCRIPT_MIN                         = $00001400;
  1244.   {$EXTERNALSYM URLACTION_SCRIPT_RUN}
  1245.   URLACTION_SCRIPT_RUN                         = $00001400;
  1246.   {$EXTERNALSYM URLACTION_SCRIPT_JAVA_USE}
  1247.   URLACTION_SCRIPT_JAVA_USE                    = $00001402;
  1248.   {$EXTERNALSYM URLACTION_SCRIPT_SAFE_ACTIVEX}
  1249.   URLACTION_SCRIPT_SAFE_ACTIVEX                = $00001405;
  1250.   {$EXTERNALSYM URLACTION_SCRIPT_CURR_MAX}
  1251.   URLACTION_SCRIPT_CURR_MAX                    = $00001405;
  1252.   {$EXTERNALSYM URLACTION_SCRIPT_MAX}
  1253.   URLACTION_SCRIPT_MAX                         = $000015FF;
  1254.  
  1255.   {$EXTERNALSYM URLACTION_HTML_MIN}
  1256.   URLACTION_HTML_MIN                           = $00001600;
  1257.   {$EXTERNALSYM URLACTION_HTML_SUBMIT_FORMS}
  1258.   URLACTION_HTML_SUBMIT_FORMS                  = $00001601; // aggregate next two
  1259.   {$EXTERNALSYM URLACTION_HTML_SUBMIT_FORMS_FROM}
  1260.   URLACTION_HTML_SUBMIT_FORMS_FROM             = $00001602; //
  1261.   {$EXTERNALSYM URLACTION_HTML_SUBMIT_FORMS_TO}
  1262.   URLACTION_HTML_SUBMIT_FORMS_TO               = $00001603; //
  1263.   {$EXTERNALSYM URLACTION_HTML_FONT_DOWNLOAD}
  1264.   URLACTION_HTML_FONT_DOWNLOAD                 = $00001604;
  1265.   {$EXTERNALSYM URLACTION_HTML_JAVA_RUN}
  1266.   URLACTION_HTML_JAVA_RUN                      = $00001605; // derive from Java custom policy;
  1267.   {$EXTERNALSYM URLACTION_HTML_CURR_MAX}
  1268.   URLACTION_HTML_CURR_MAX                      = $00001605;
  1269.   {$EXTERNALSYM URLACTION_HTML_MAX}
  1270.   URLACTION_HTML_MAX                           = $000017FF;
  1271.  
  1272.   {$EXTERNALSYM URLACTION_SHELL_MIN}
  1273.   URLACTION_SHELL_MIN                          = $00001800;
  1274.   {$EXTERNALSYM URLACTION_SHELL_INSTALL_DTITEMS}
  1275.   URLACTION_SHELL_INSTALL_DTITEMS              = $00001800;
  1276.   {$EXTERNALSYM URLACTION_SHELL_MOVE_OR_COPY}
  1277.   URLACTION_SHELL_MOVE_OR_COPY                 = $00001802;
  1278.   {$EXTERNALSYM URLACTION_SHELL_FILE_DOWNLOAD}
  1279.   URLACTION_SHELL_FILE_DOWNLOAD                = $00001803;
  1280.   {$EXTERNALSYM URLACTION_SHELL_VERB}
  1281.   URLACTION_SHELL_VERB                         = $00001804;
  1282.   {$EXTERNALSYM URLACTION_SHELL_WEBVIEW_VERB}
  1283.   URLACTION_SHELL_WEBVIEW_VERB                 = $00001805;
  1284.   {$EXTERNALSYM URLACTION_SHELL_CURR_MAX}
  1285.   URLACTION_SHELL_CURR_MAX                     = $00001805;
  1286.   {$EXTERNALSYM URLACTION_SHELL_MAX}
  1287.   URLACTION_SHELL_MAX                          = $000019ff;
  1288.  
  1289.   {$EXTERNALSYM URLACTION_NETWORK_MIN}
  1290.   URLACTION_NETWORK_MIN                        = $00001A00;
  1291.  
  1292.   {$EXTERNALSYM URLACTION_CREDENTIALS_USE}
  1293.   URLACTION_CREDENTIALS_USE                    = $00001A00;
  1294.   {$EXTERNALSYM URLPOLICY_CREDENTIALS_SILENT_LOGON_OK}
  1295.   URLPOLICY_CREDENTIALS_SILENT_LOGON_OK        = $00000000;
  1296.   {$EXTERNALSYM URLPOLICY_CREDENTIALS_MUST_PROMPT_USER}
  1297.   URLPOLICY_CREDENTIALS_MUST_PROMPT_USER       = $00010000;
  1298.   {$EXTERNALSYM URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT}
  1299.   URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT     = $00020000;
  1300.   {$EXTERNALSYM URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY}
  1301.   URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY         = $00030000;
  1302.  
  1303.   {$EXTERNALSYM URLACTION_AUTHENTICATE_CLIENT}
  1304.   URLACTION_AUTHENTICATE_CLIENT                = $00001A01;
  1305.   {$EXTERNALSYM URLPOLICY_AUTHENTICATE_CLEARTEXT_OK}
  1306.   URLPOLICY_AUTHENTICATE_CLEARTEXT_OK          = $00000000;
  1307.   {$EXTERNALSYM URLPOLICY_AUTHENTICATE_CHALLENGE_RESPONSE}
  1308.   URLPOLICY_AUTHENTICATE_CHALLENGE_RESPONSE    = $00010000;
  1309.   {$EXTERNALSYM URLPOLICY_AUTHENTICATE_MUTUAL_ONLY}
  1310.   URLPOLICY_AUTHENTICATE_MUTUAL_ONLY           = $00030000;
  1311.  
  1312.   {$EXTERNALSYM URLACTION_NETWORK_CURR_MAX}
  1313.   URLACTION_NETWORK_CURR_MAX                   = $00001A01;
  1314.   {$EXTERNALSYM URLACTION_NETWORK_MAX}
  1315.   URLACTION_NETWORK_MAX                        = $00001BFF;
  1316.  
  1317.   {$EXTERNALSYM URLACTION_JAVA_MIN}
  1318.   URLACTION_JAVA_MIN                           = $00001C00;
  1319.   {$EXTERNALSYM URLACTION_JAVA_PERMISSIONS}
  1320.   URLACTION_JAVA_PERMISSIONS                   = $00001C00;
  1321.   {$EXTERNALSYM URLPOLICY_JAVA_PROHIBIT}
  1322.   URLPOLICY_JAVA_PROHIBIT                      = $00000000;
  1323.   {$EXTERNALSYM URLPOLICY_JAVA_HIGH}
  1324.   URLPOLICY_JAVA_HIGH                          = $00010000;
  1325.   {$EXTERNALSYM URLPOLICY_JAVA_MEDIUM}
  1326.   URLPOLICY_JAVA_MEDIUM                        = $00020000;
  1327.   {$EXTERNALSYM URLPOLICY_JAVA_LOW}
  1328.   URLPOLICY_JAVA_LOW                           = $00030000;
  1329.   {$EXTERNALSYM URLPOLICY_JAVA_CUSTOM}
  1330.   URLPOLICY_JAVA_CUSTOM                        = $00800000;
  1331.   {$EXTERNALSYM URLACTION_JAVA_CURR_MAX}
  1332.   URLACTION_JAVA_CURR_MAX                      = $00001C00;
  1333.   {$EXTERNALSYM URLACTION_JAVA_MAX}
  1334.   URLACTION_JAVA_MAX                           = $00001CFF;
  1335.  
  1336. // The following Infodelivery actions should have no default policies
  1337. // in the registry.  They assume that no default policy means fall
  1338. // back to the global restriction.  If an admin sets a policy per
  1339. // zone, then it overrides the global restriction.
  1340.  
  1341.   {$EXTERNALSYM URLACTION_INFODELIVERY_MIN}
  1342.   URLACTION_INFODELIVERY_MIN                       = $00001D00;
  1343.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_ADDING_CHANNELS}
  1344.   URLACTION_INFODELIVERY_NO_ADDING_CHANNELS        = $00001D00;
  1345.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_EDITING_CHANNELS}
  1346.   URLACTION_INFODELIVERY_NO_EDITING_CHANNELS       = $00001D01;
  1347.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_REMOVING_CHANNELS}
  1348.   URLACTION_INFODELIVERY_NO_REMOVING_CHANNELS      = $00001D02;
  1349.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_ADDING_SUBSCRIPTIONS}
  1350.   URLACTION_INFODELIVERY_NO_ADDING_SUBSCRIPTIONS   = $00001D03;
  1351.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_EDITING_SUBSCRIPTIONS}
  1352.   URLACTION_INFODELIVERY_NO_EDITING_SUBSCRIPTIONS  = $00001D04;
  1353.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_REMOVING_SUBSCRIPTIONS}
  1354.   URLACTION_INFODELIVERY_NO_REMOVING_SUBSCRIPTIONS = $00001D05;
  1355.   {$EXTERNALSYM URLACTION_INFODELIVERY_NO_CHANNEL_LOGGING}
  1356.   URLACTION_INFODELIVERY_NO_CHANNEL_LOGGING        = $00001D06;
  1357.   {$EXTERNALSYM URLACTION_INFODELIVERY_CURR_MAX}
  1358.   URLACTION_INFODELIVERY_CURR_MAX                  = $00001D06;
  1359.   {$EXTERNALSYM URLACTION_INFODELIVERY_MAX}
  1360.   URLACTION_INFODELIVERY_MAX                       = $00001Dff;
  1361.   {$EXTERNALSYM URLACTION_CHANNEL_SOFTDIST_MIN}
  1362.   URLACTION_CHANNEL_SOFTDIST_MIN                   = $00001E00;
  1363.   {$EXTERNALSYM URLACTION_CHANNEL_SOFTDIST_PERMISSIONS}
  1364.   URLACTION_CHANNEL_SOFTDIST_PERMISSIONS           = $00001E05;
  1365.   {$EXTERNALSYM URLPOLICY_CHANNEL_SOFTDIST_PROHIBIT}
  1366.   URLPOLICY_CHANNEL_SOFTDIST_PROHIBIT              = $00010000;
  1367.   {$EXTERNALSYM URLPOLICY_CHANNEL_SOFTDIST_PRECACHE}
  1368.   URLPOLICY_CHANNEL_SOFTDIST_PRECACHE              = $00020000;
  1369.   {$EXTERNALSYM URLPOLICY_CHANNEL_SOFTDIST_AUTOINSTALL}
  1370.   URLPOLICY_CHANNEL_SOFTDIST_AUTOINSTALL           = $00030000;
  1371.   {$EXTERNALSYM URLACTION_CHANNEL_SOFTDIST_MAX}
  1372.   URLACTION_CHANNEL_SOFTDIST_MAX                   = $00001EFF;
  1373.  
  1374. // For each action specified above the system maintains
  1375. // a set of policies for the action.
  1376. // The only policies supported currently are permissions (i.e. is something allowed)
  1377. // and logging status.
  1378. // IMPORTANT: If you are defining your own policies don't overload the meaning of the
  1379. // loword of the policy. You can use the hiword to store any policy bits which are only
  1380. // meaningful to your action.
  1381. // For an example of how to do this look at the URLPOLICY_JAVA above
  1382.  
  1383. // Permissions
  1384.   {$EXTERNALSYM URLPOLICY_ALLOW}
  1385.   URLPOLICY_ALLOW                = $00;
  1386.   {$EXTERNALSYM URLPOLICY_QUERY}
  1387.   URLPOLICY_QUERY                = $01;
  1388.   {$EXTERNALSYM URLPOLICY_DISALLOW}
  1389.   URLPOLICY_DISALLOW             = $03;
  1390.  
  1391. // Notifications are not done when user already queried.
  1392.   {$EXTERNALSYM URLPOLICY_NOTIFY_ON_ALLOW}
  1393.   URLPOLICY_NOTIFY_ON_ALLOW      = $10;
  1394.   {$EXTERNALSYM URLPOLICY_NOTIFY_ON_DISALLOW}
  1395.   URLPOLICY_NOTIFY_ON_DISALLOW   = $20;
  1396.  
  1397. // Logging is done regardless of whether user was queried.
  1398.   {$EXTERNALSYM URLPOLICY_LOG_ON_ALLOW}
  1399.   URLPOLICY_LOG_ON_ALLOW         = $40;
  1400.   {$EXTERNALSYM URLPOLICY_LOG_ON_DISALLOW}
  1401.   URLPOLICY_LOG_ON_DISALLOW      = $80;
  1402.  
  1403.   {$EXTERNALSYM URLPOLICY_MASK_PERMISSIONS}
  1404.   URLPOLICY_MASK_PERMISSIONS     = $0f;
  1405.  
  1406. {$EXTERNALSYM GetUrlPolicyPermissions}
  1407. function GetUrlPolicyPermissions(dw: DWORD): DWORD;
  1408. {$EXTERNALSYM SetUrlPolicyPermissions}
  1409. function SetUrlPolicyPermissions(dw, dw2: DWORD): DWORD;
  1410.  
  1411. // The ordinal #'s that define the predefined zones internet explorer knows about.
  1412. // When we support user-defined zones their zone numbers should be between
  1413. // URLZONE_USER_MIN and URLZONE_USER_MAX
  1414.   
  1415. const  
  1416.   {$EXTERNALSYM URLZONE_PREDEFINED_MIN}
  1417.   URLZONE_PREDEFINED_MIN =     0;
  1418.   {$EXTERNALSYM URLZONE_LOCAL_MACHINE}
  1419.   URLZONE_LOCAL_MACHINE  =     0;
  1420.   {$EXTERNALSYM URLZONE_INTRANET}
  1421.   URLZONE_INTRANET       = URLZONE_LOCAL_MACHINE + 1;
  1422.   {$EXTERNALSYM URLZONE_TRUSTED}
  1423.   URLZONE_TRUSTED        = URLZONE_INTRANET + 1;
  1424.   {$EXTERNALSYM URLZONE_INTERNET}
  1425.   URLZONE_INTERNET       = URLZONE_TRUSTED + 1;
  1426.   {$EXTERNALSYM URLZONE_UNTRUSTED}
  1427.   URLZONE_UNTRUSTED      = URLZONE_INTERNET + 1;
  1428.   {$EXTERNALSYM URLZONE_PREDEFINED_MAX}
  1429.   URLZONE_PREDEFINED_MAX =   999;
  1430.   {$EXTERNALSYM URLZONE_USER_MIN}
  1431.   URLZONE_USER_MIN       =  1000;
  1432.   {$EXTERNALSYM URLZONE_USER_MAX}
  1433.   URLZONE_USER_MAX       = 10000;
  1434.  
  1435.   {$EXTERNALSYM URLTEMPLATE_CUSTOM}
  1436.   URLTEMPLATE_CUSTOM         = $00000000;
  1437.   {$EXTERNALSYM URLTEMPLATE_PREDEFINED_MIN}
  1438.   URLTEMPLATE_PREDEFINED_MIN = $00010000;
  1439.   {$EXTERNALSYM URLTEMPLATE_LOW}
  1440.   URLTEMPLATE_LOW            = $00010000;
  1441.   {$EXTERNALSYM URLTEMPLATE_MEDIUM}
  1442.   URLTEMPLATE_MEDIUM         = $00011000;
  1443.   {$EXTERNALSYM URLTEMPLATE_HIGH}
  1444.   URLTEMPLATE_HIGH           = $00012000;
  1445.   {$EXTERNALSYM URLTEMPLATE_PREDEFINED_MAX}
  1446.   URLTEMPLATE_PREDEFINED_MAX = $00020000;
  1447.  
  1448.   {$EXTERNALSYM MAX_ZONE_PATH}
  1449.   MAX_ZONE_PATH              = 260;
  1450.   {$EXTERNALSYM MAX_ZONE_DESCRIPTION}
  1451.   MAX_ZONE_DESCRIPTION       = 200;
  1452.  
  1453.   {$EXTERNALSYM ZAFLAGS_CUSTOM_EDIT}
  1454.   ZAFLAGS_CUSTOM_EDIT            = $00000001;
  1455.   {$EXTERNALSYM ZAFLAGS_ADD_SITES}
  1456.   ZAFLAGS_ADD_SITES              = $00000002;
  1457.   {$EXTERNALSYM ZAFLAGS_REQUIRE_VERIFICATION}
  1458.   ZAFLAGS_REQUIRE_VERIFICATION   = $00000004;
  1459.   {$EXTERNALSYM ZAFLAGS_INCLUDE_PROXY_OVERRIDE}
  1460.   ZAFLAGS_INCLUDE_PROXY_OVERRIDE = $00000008;
  1461.   {$EXTERNALSYM ZAFLAGS_INCLUDE_INTRANET_SITES}
  1462.   ZAFLAGS_INCLUDE_INTRANET_SITES = $00000010;
  1463.   {$EXTERNALSYM ZAFLAGS_NO_UI}
  1464.   ZAFLAGS_NO_UI                  = $00000020;
  1465.   {$EXTERNALSYM ZAFLAGS_SUPPORTS_VERIFICATION}
  1466.   ZAFLAGS_SUPPORTS_VERIFICATION  = $00000040;
  1467.   {$EXTERNALSYM ZAFLAGS_UNC_AS_INTRANET}
  1468.   ZAFLAGS_UNC_AS_INTRANET        = $00000080;
  1469.   
  1470. type
  1471.   PZoneAttributes = ^TZoneAttributes;
  1472.   {$EXTERNALSYM _ZONEATTRIBUTES}
  1473.   _ZONEATTRIBUTES = packed record
  1474.     cbSize: ULONG;
  1475.     szDisplayName: array [0..260 - 1] of WideChar;
  1476.     szDescription: array [0..200 - 1] of WideChar;
  1477.     szIconPath: array [0..260 - 1] of WideChar;
  1478.     dwTemplateMinLevel: DWORD;
  1479.     dwTemplateRecommended: DWORD;
  1480.     dwTemplateCurrentLevel: DWORD;
  1481.     dwFlags: DWORD;
  1482.   end;
  1483.   TZoneAttributes = _ZONEATTRIBUTES;
  1484.   {$EXTERNALSYM ZONEATTRIBUTES}
  1485.   ZONEATTRIBUTES = _ZONEATTRIBUTES;
  1486.  
  1487. // Gets the zone attributes (information in registry other than actual security 
  1488. // policies associated with the zone).  Zone attributes are fixed as: 
  1489. // Sets the zone attributes (information in registry other than actual security 
  1490. // policies associated with the zone).  Zone attributes as above. 
  1491. // Returns S_OK or ??? if failed to write the zone attributes. 
  1492. {  Registry Flags 
  1493.  
  1494.     When reading, default behavior is: 
  1495.         If HKLM allows override and HKCU value exists 
  1496.             Then use HKCU value 
  1497.             Else use HKLM value 
  1498.     When writing, default behavior is same as HKCU 
  1499.         If HKLM allows override 
  1500.            Then Write to HKCU 
  1501.            Else Fail 
  1502.  
  1503. const
  1504.   {$EXTERNALSYM URLZONEREG_DEFAULT}
  1505.   URLZONEREG_DEFAULT = 0;
  1506.   {$EXTERNALSYM URLZONEREG_HKLM}
  1507.   URLZONEREG_HKLM    = URLZONEREG_DEFAULT + 1;
  1508.   {$EXTERNALSYM URLZONEREG_HKCU}
  1509.   URLZONEREG_HKCU    = URLZONEREG_HKLM + 1;
  1510.  
  1511. // Gets a named custom policy associated with a zone; 
  1512. // e.g. the Java VM settings can be defined with a unique key such as 'Java'. 
  1513. // Custom policy support is intended to allow extensibility from the predefined 
  1514. // set of policies that IE4 has built in. 
  1515. //  
  1516. // pwszKey is the string name designating the custom policy.  Components are 
  1517. //   responsible for having unique names.
  1518. // ppPolicy is the callee allocated buffer for the policy byte blob; caller is
  1519. //   responsible for freeing this buffer eventually. 
  1520. // pcbPolicy is the size of the byte blob returned. 
  1521. // dwRegFlags determines how registry is accessed (see above). 
  1522. // Returns S_OK if key is found and buffer allocated; ??? if key is not found (no buffer alloced). 
  1523. // Sets a named custom policy associated with a zone;
  1524. // e.g. the Java VM settings can be defined with a unique key such as 'Java'. 
  1525. // Custom policy support is intended to allow extensibility from the predefined 
  1526. // set of policies that IE4 has built in.   
  1527. //  
  1528. // pwszKey is the string name designating the custom policy.  Components are 
  1529. //   responsible for having unique names. 
  1530. // ppPolicy is the caller allocated buffer for the policy byte blob. 
  1531. // pcbPolicy is the size of the byte blob to be set. 
  1532. // dwRegFlags determines if HTCU or HKLM is set. 
  1533. // Returns S_OK or ??? if failed to write the zone custom policy. 
  1534. // Gets action policy associated with a zone, the builtin, fixed-length policies info. 
  1535.  
  1536. // dwAction is the action code for the action as defined above. 
  1537. // pPolicy is the caller allocated buffer for the policy data. 
  1538. // cbPolicy is the size of the caller allocated buffer. 
  1539. // dwRegFlags determines how registry is accessed (see above). 
  1540. // Returns S_OK if action is valid; ??? if action is not valid. 
  1541.  
  1542. type
  1543.   {$EXTERNALSYM IInternetZoneManager}
  1544.   IInternetZoneManager = interface
  1545.     ['{79eac9ef-baf9-11ce-8c82-00aa004ba90b}']
  1546.  
  1547.     // Gets the zone attributes (information in registry other than actual security
  1548.     // policies associated with the zone).  Zone attributes are fixed as:
  1549.     function GetZoneAttributes(dwZone: DWORD;
  1550.       var ZoneAttributes: TZoneAttributes): HResult; stdcall;
  1551.  
  1552.     // Sets the zone attributes (information in registry other than actual security
  1553.     // policies associated with the zone).  Zone attributes as above.
  1554.     // Returns S_OK or ??? if failed to write the zone attributes.
  1555.     function SetZoneAttributes(dwZone: DWORD;
  1556.       const ZoneAttributes: TZoneAttributes): HResult; stdcall;
  1557.     function GetZoneCustomPolicy(dwZone: DWORD; const guidKey: TGUID; out pPolicy: Pointer;
  1558.       out cbPolicy: DWORD; urlZoneReg: TUrlZoneReg): HResult; stdcall;
  1559.     function SetZoneCustomPolicy(dwZone: DWORD; const guidKey: TGUID; pPolicy: Pointer;
  1560.       cbPolicy: DWORD; urlZoneReg: TUrlZoneReg): HResult; stdcall;
  1561.     function GetZoneActionPolicy(dwZone, dwAction: DWORD; pPolicy: Pointer;
  1562.       cbPolicy: DWORD; urlZoneReg: TUrlZoneReg): HResult; stdcall;
  1563.     function SetZoneActionPolicy(dwZone, dwAction: DWORD; pPolicy: Pointer;
  1564.       cbPolicy: DWORD; urlZoneReg: TUrlZoneReg): HResult; stdcall;
  1565.     function PromptAction(dwAction: DWORD; hwndParent: HWnd; pwszUrl, pwszText: LPCWSTR;
  1566.       dwPromptFlags: DWORD): HResult; stdcall;
  1567.     function LogAction(dwAction: DWORD; pwszUrl, pwszText: LPCWSTR;
  1568.       dwLogFlags: DWORD): HResult; stdcall;
  1569.     function CreateZoneEnumerator(out dwEnum, dwCount: DWORD;
  1570.       dwFlags: DWORD): HResult; stdcall;
  1571.     function GetZoneAt(dwEnum, dwIndex: DWORD; out dwZone: DWORD): HResult; stdcall;
  1572.     function DestroyZoneEnumerator(dwEnum: DWORD): HResult; stdcall;
  1573.     function CopyTemplatePoliciesToZone(dwTemplate, dwZone, dwReserved: DWORD): HResult; stdcall;
  1574.   end;
  1575.  
  1576. // Creates the security manager object. The first argument is the Service provider
  1577. // to allow for delegation
  1578. {$EXTERNALSYM CoInternetCreateSecurityManager}
  1579. function CoInternetCreateSecurityManager(SP: IServiceProvider; var SM: IInternetSecurityManager;
  1580.   dwReserved: DWORD): HResult; stdcall;
  1581. {$EXTERNALSYM CoInternetCreateZoneManager}
  1582. function CoInternetCreateZoneManager(SP: IServiceProvider; var ZM: IInternetZoneManager;
  1583.   dwReserved: DWORD): HResult; stdcall;
  1584.  
  1585. const
  1586.   {$EXTERNALSYM SOFTDIST_FLAG_USAGE_EMAIL}
  1587.   SOFTDIST_FLAG_USAGE_EMAIL         = $00000001;
  1588.   {$EXTERNALSYM SOFTDIST_FLAG_USAGE_PRECACHE}
  1589.   SOFTDIST_FLAG_USAGE_PRECACHE      = $00000002;
  1590.   {$EXTERNALSYM SOFTDIST_FLAG_USAGE_AUTOINSTALL}
  1591.   SOFTDIST_FLAG_USAGE_AUTOINSTALL   = $00000004;
  1592.   {$EXTERNALSYM SOFTDIST_FLAG_DELETE_SUBSCRIPTION}
  1593.   SOFTDIST_FLAG_DELETE_SUBSCRIPTION = $00000008;
  1594.  
  1595.   {$EXTERNALSYM SOFTDIST_ADSTATE_NONE}
  1596.   SOFTDIST_ADSTATE_NONE             = $00000000;
  1597.   {$EXTERNALSYM SOFTDIST_ADSTATE_AVAILABLE}
  1598.   SOFTDIST_ADSTATE_AVAILABLE        = $00000001;
  1599.   {$EXTERNALSYM SOFTDIST_ADSTATE_DOWNLOADED}
  1600.   SOFTDIST_ADSTATE_DOWNLOADED       = $00000002;
  1601.   {$EXTERNALSYM SOFTDIST_ADSTATE_INSTALLED}
  1602.   SOFTDIST_ADSTATE_INSTALLED        = $00000003;
  1603.  
  1604. type
  1605.   PCodeBaseHold = ^TCodeBaseHold;
  1606.   {$EXTERNALSYM _tagCODEBASEHOLD}
  1607.   _tagCODEBASEHOLD = packed record
  1608.     cbSize: ULONG;
  1609.     szDistUnit: LPWSTR;
  1610.     szCodeBase: LPWSTR;
  1611.     dwVersionMS: DWORD;
  1612.     dwVersionLS: DWORD;
  1613.     dwStyle: DWORD;
  1614.   end;
  1615.   TCodeBaseHold = _tagCODEBASEHOLD;
  1616.   {$EXTERNALSYM CODEBASEHOLD}
  1617.   CODEBASEHOLD = _tagCODEBASEHOLD;
  1618.  
  1619.   PSoftDistInfo = ^TSoftDistInfo;
  1620.   {$EXTERNALSYM _tagSOFTDISTINFO}
  1621.   _tagSOFTDISTINFO = packed record
  1622.     cbSize: ULONG;
  1623.     dwFlags: DWORD;
  1624.     dwAdState: DWORD;
  1625.     szTitle: LPWSTR;
  1626.     szAbstract: LPWSTR;
  1627.     szHREF: LPWSTR;
  1628.     dwInstalledVersionMS: DWORD;
  1629.     dwInstalledVersionLS: DWORD;
  1630.     dwUpdateVersionMS: DWORD;
  1631.     dwUpdateVersionLS: DWORD;
  1632.     dwAdvertisedVersionMS: DWORD;
  1633.     dwAdvertisedVersionLS: DWORD;
  1634.     dwReserved: DWORD;
  1635.   end;
  1636.   TSoftDistInfo = _tagSOFTDISTINFO;
  1637.   {$EXTERNALSYM SOFTDISTINFO}
  1638.   SOFTDISTINFO = _tagSOFTDISTINFO;
  1639.  
  1640.   {$EXTERNALSYM ISoftDistExt}
  1641.   ISoftDistExt = interface
  1642.     ['{B15B8DC1-C7E1-11d0-8680-00AA00BDCB71}']
  1643.     function ProcessSoftDist(szCDFURL: LPCWSTR; SoftDistElement: Pointer {IXMLElement};
  1644.       var lpdsi: TSoftDistInfo): HResult; stdcall;
  1645.     function GetFirstCodeBase(var szCodeBase: LPWSTR;
  1646.       const dwMaxSize: DWORD): HResult; stdcall;
  1647.     function GetNextCodeBase(var szCodeBase: LPWSTR;
  1648.       const dwMaxSize: DWORD): HResult; stdcall;
  1649.     function AsyncInstallDistributionUnit(bc: IBindCtx; pvReserved: Pointer;
  1650.       flags: DWORD; const cbh: TCodeBaseHold): HResult; stdcall;
  1651.   end;
  1652.  
  1653. {$EXTERNALSYM GetSoftwareUpdateInfo}
  1654. function GetSoftwareUpdateInfo(szDistUnit: LPCWSTR; var dsi: TSoftDistInfo): HResult; stdcall;
  1655. {$EXTERNALSYM SetSoftwareUpdateAdvertisementState}
  1656. function SetSoftwareUpdateAdvertisementState(szDistUnit: LPCWSTR;
  1657.   dwAdState, dwAdvertisedVersionMS, dwAdvertisedVersionLS: DWORD): HResult; stdcall;
  1658.  
  1659. type
  1660.   {$EXTERNALSYM IDataFilter}
  1661.   IDataFilter = interface
  1662.     ['{69d14c80-c18e-11d0-a9ce-006097942311}']
  1663.     function DoEncode(dwFlags: DWORD; lInBufferSize: Longint; pbInBuffer: Pointer;
  1664.       lOutBufferSize: Longint; pbOutBuffer: Pointer; lInBytesAvailable: Longint;
  1665.       out lInBytesRead, lOutBytesWritten: Longint; dwReserved: DWORD): HResult; stdcall;
  1666.     function DoDecode(dwFlags: DWORD; lInBufferSize: Longint; pbInBuffer: Pointer;
  1667.       lOutBufferSize: Longint; pbOutBuffer: Pointer; lInBytesAvailable: Longint;
  1668.       out lInBytesRead, lOutBytesWritten: Longint; dwReserved: DWORD): HResult; stdcall;
  1669.     function SetEncodingLevel(dwEncLevel: DWORD): HResult; stdcall;
  1670.   end;
  1671.  
  1672.   PProtocolFilterData = ^TProtocolFilterData;
  1673.   {$EXTERNALSYM _tagPROTOCOLFILTERDATA}
  1674.   _tagPROTOCOLFILTERDATA = packed record
  1675.     cbSize: DWORD;
  1676.     ProtocolSink: IInternetProtocolSink;
  1677.     Protocol: IInternetProtocol;
  1678.     Unk: IUnknown;
  1679.     dwFilterFlags: DWORD;
  1680.   end;
  1681.   TProtocolFilterData = _tagPROTOCOLFILTERDATA;
  1682.   {$EXTERNALSYM PROTOCOLFILTERDATA}
  1683.   PROTOCOLFILTERDATA = _tagPROTOCOLFILTERDATA;
  1684.   
  1685.   PDataInfo = ^TDataInfo;
  1686.   {$EXTERNALSYM _tagDATAINFO}
  1687.   _tagDATAINFO = packed record
  1688.     ulTotalSize: ULONG;
  1689.     ulavrPacketSize: ULONG;
  1690.     ulConnectSpeed: ULONG;
  1691.     ulProcessorSpeed: ULONG;
  1692.   end;
  1693.   TDataInfo = _tagDATAINFO;
  1694.   {$EXTERNALSYM DATAINFO}
  1695.   DATAINFO = _tagDATAINFO;
  1696.  
  1697.   {$EXTERNALSYM IEncodingFilterFactory}
  1698.   IEncodingFilterFactory = interface
  1699.     ['{70bdde00-c18e-11d0-a9ce-006097942311}']
  1700.     function FindBestFilter(pwzCodeIn, pwzCodeOut: LPCWSTR; info: TDataInfo;
  1701.       out DF: IDataFilter): HResult; stdcall;
  1702.     function GetDefaultFilter(pwzCodeIn, pwzCodeOut: LPCWSTR; info: TDataInfo;
  1703.       out DF: IDataFilter): HResult; stdcall;
  1704.   end;
  1705.  
  1706. // Logging-specific apis
  1707. {$EXTERNALSYM IsLoggingEnabledA}
  1708. function IsLoggingEnabledA(pszUrl: PAnsiChar): BOOL; stdcall;
  1709. {$EXTERNALSYM IsLoggingEnabledW}
  1710. function IsLoggingEnabledW(pszUrl: PWideChar): BOOL; stdcall;
  1711. {$EXTERNALSYM IsLoggingEnabled}
  1712. function IsLoggingEnabled(pszUrl: PChar): BOOL; stdcall;
  1713.  
  1714. type
  1715.   PHitLoggingInfo = ^THitLoggingInfo;
  1716.   {$EXTERNALSYM _tagHIT_LOGGING_INFO}
  1717.   _tagHIT_LOGGING_INFO = packed record
  1718.     dwStructSize: DWORD;
  1719.     lpszLoggedUrlName: LPSTR;
  1720.     StartTime: TSystemTime;
  1721.     EndTime: TSystemTime;
  1722.     lpszExtendedInfo: LPSTR;
  1723.   end;
  1724.   THitLoggingInfo = _tagHIT_LOGGING_INFO;
  1725.   {$EXTERNALSYM HIT_LOGGING_INFO}
  1726.   HIT_LOGGING_INFO = _tagHIT_LOGGING_INFO;
  1727.  
  1728. {$EXTERNALSYM WriteHitLogging}
  1729. function WriteHitLogging(const Logginginfo: THitLoggingInfo): BOOL; stdcall;
  1730.  
  1731. implementation
  1732.  
  1733. const
  1734.   UrlMonLib = 'URLMON.DLL';
  1735.  
  1736. // Macro implementations
  1737. function GetUrlPolicyPermissions(dw: DWORD): DWORD;
  1738. begin
  1739.   Result := dw and URLPOLICY_MASK_PERMISSIONS;
  1740. end;
  1741.  
  1742. function SetUrlPolicyPermissions(dw, dw2: DWORD): DWORD;
  1743. begin
  1744.   dw := (dw and not (URLPOLICY_MASK_PERMISSIONS)) or dw2;
  1745.   Result := dw;
  1746. end;
  1747.  
  1748. function CreateURLMoniker;                external UrlMonLib name 'CreateURLMoniker';
  1749. function GetClassURL;                     external UrlMonLib name 'GetClassURL';
  1750. function CreateAsyncBindCtx;              external UrlMonLib name 'CreateAsyncBindCtx';
  1751. function CreateAsyncBindCtxEx;            external UrlMonLib name 'CreateAsyncBindCtxEx';
  1752. function MkParseDisplayNameEx;            external UrlMonLib name 'MkParseDisplayNameEx';
  1753. function RegisterBindStatusCallback;      external UrlMonLib name 'RegisterBindStatusCallback';
  1754. function RevokeBindStatusCallback;        external UrlMonLib name 'RevokeBindStatusCallback';
  1755. function GetClassFileOrMime;              external UrlMonLib name 'GetClassFileOrMime';
  1756. function IsValidURL;                      external UrlMonLib name 'IsValidURL';
  1757. function CoGetClassObjectFromURL;         external UrlMonLib name 'CoGetClassObjectFromURL';
  1758. function IsAsyncMoniker;                  external UrlMonLib name 'IsAsyncMoniker';
  1759. function CreateURLBinding;                external UrlMonLib name 'CreateURLBinding';
  1760. function RegisterMediaTypes;              external UrlMonLib name 'RegisterMediaTypes';
  1761. function FindMediaType;                   external UrlMonLib name 'FindMediaType';
  1762. function CreateFormatEnumerator;          external UrlMonLib name 'CreateFormatEnumerator';
  1763. function RegisterFormatEnumerator;        external UrlMonLib name 'RegisterFormatEnumerator';
  1764. function RevokeFormatEnumerator;          external UrlMonLib name 'RevokeFormatEnumerator';
  1765. function RegisterMediaTypeClass;          external UrlMonLib name 'RegisterMediaTypeClass';
  1766. function FindMediaTypeClass;              external UrlMonLib name 'FindMediaTypeClass';
  1767. function UrlMkSetSessionOption;           external UrlMonLib name 'UrlMkSetSessionOption';
  1768. function UrlMkGetSessionOption;           external UrlMonLib name 'UrlMkGetSessionOption';
  1769. function FindMimeFromData;                external UrlMonLib name 'FindMimeFromData';
  1770. function ObtainUserAgentString;           external UrlMonLib name 'ObtainUserAgentString';
  1771. function HlinkSimpleNavigateToString;     external UrlMonLib name 'HlinkSimpleNavigateToString';
  1772. function HlinkSimpleNavigateToMoniker;    external UrlMonLib name 'HlinkSimpleNavigateToMoniker';
  1773. function URLOpenStreamA;                  external UrlMonLib name 'URLOpenStreamA';
  1774. function URLOpenStreamW;                  external UrlMonLib name 'URLOpenStreamW';
  1775. function URLOpenStream;                  external UrlMonLib name 'URLOpenStreamA';
  1776. function URLOpenPullStreamA;              external UrlMonLib name 'URLOpenPullStreamA';
  1777. function URLOpenPullStreamW;              external UrlMonLib name 'URLOpenPullStreamW';
  1778. function URLOpenPullStream;              external UrlMonLib name 'URLOpenPullStreamA';
  1779. function URLDownloadToFileA;              external UrlMonLib name 'URLDownloadToFileA';
  1780. function URLDownloadToFileW;              external UrlMonLib name 'URLDownloadToFileW';
  1781. function URLDownloadToFile;              external UrlMonLib name 'URLDownloadToFileA';
  1782. function URLDownloadToCacheFileA;         external UrlMonLib name 'URLDownloadToCacheFileA';
  1783. function URLDownloadToCacheFileW;         external UrlMonLib name 'URLDownloadToCacheFileW';
  1784. function URLDownloadToCacheFile;         external UrlMonLib name 'URLDownloadToCacheFileA';
  1785. function URLOpenBlockingStreamA;          external UrlMonLib name 'URLOpenBlockingStreamA';
  1786. function URLOpenBlockingStreamW;          external UrlMonLib name 'URLOpenBlockingStreamW';
  1787. function URLOpenBlockingStream;          external UrlMonLib name 'URLOpenBlockingStreamA';
  1788. function HlinkGoBack;                     external UrlMonLib name 'HlinkGoBack';
  1789. function HlinkGoForward;                  external UrlMonLib name 'HlinkGoForward';
  1790. function HlinkNavigateString;             external UrlMonLib name 'HlinkNavigateString';
  1791. function HlinkNavigateMoniker;            external UrlMonLib name 'HlinkNavigateMoniker';
  1792. function CoInternetParseUrl;              external UrlMonLib name 'CoInternetParseUrl';
  1793. function CoInternetCombineUrl;            external UrlMonLib name 'CoInternetCombineUrl';
  1794. function CoInternetCompareUrl;            external UrlMonLib name 'CoInternetCompareUrl';
  1795. function CoInternetGetProtocolFlags;      external UrlMonLib name 'CoInternetGetProtocolFlags';
  1796. function CoInternetQueryInfo;             external UrlMonLib name 'CoInternetQueryInfo';
  1797. function CoInternetGetSession;            external UrlMonLib name 'CoInternetGetSession';
  1798. function CoInternetGetSecurityUrl;        external UrlMonLib name 'CoInternetGetSecurityUrl';
  1799. function OInetParseUrl;                   external UrlMonLib name 'CoInternetParseUrl';
  1800. function OInetCombineUrl;                 external UrlMonLib name 'CoInternetCombineUrl';
  1801. function OInetCompareUrl;                 external UrlMonLib name 'CoInternetCompareUrl';
  1802. function OInetQueryInfo;                  external UrlMonLib name 'CoInternetQueryInfo';
  1803. function OInetGetSession;                 external UrlMonLib name 'CoInternetGetSession';
  1804. function OInetGetProtocolFlags;           external UrlMonLib name 'OInetGetProtocolFlags';
  1805. function OInetGetSecurityUrl;             external UrlMonLib name 'OInetGetSecurityUrl';
  1806. function CopyStgMedium;                   external UrlMonLib name 'CopyStgMedium';
  1807. function CopyBindInfo;                    external UrlMonLib name 'CopyBindInfo';
  1808. procedure ReleaseBindInfo;                external UrlMonLib name 'ReleaseBindInfo';
  1809. function CoInternetCreateSecurityManager; external UrlMonLib name 'CoInternetCreateSecurityManager';
  1810. function CoInternetCreateZoneManager;     external UrlMonLib name 'CoInternetCreateZoneManager';
  1811. function GetSoftwareUpdateInfo;           external UrlMonLib name 'GetSoftwareUpdateInfo';
  1812. function IsLoggingEnabledA;               external UrlMonLib name 'IsLoggingEnabledA';
  1813. function IsLoggingEnabledW;               external UrlMonLib name 'IsLoggingEnabledW';
  1814. function IsLoggingEnabled;               external UrlMonLib name 'IsLoggingEnabledA';
  1815. function WriteHitLogging;                 external UrlMonLib name 'WriteHitLogging';
  1816. function SetSoftwareUpdateAdvertisementState; external UrlMonLib name 'SetSoftwareUpdateAdvertisementState';
  1817.  
  1818. end.
  1819.