WinInet.h 127 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802
  1. /*++
  2. Copyright (c) 1995-1999 Microsoft Corporation
  3. Module Name:
  4. wininet.h
  5. Abstract:
  6. Contains manifests, macros, types and prototypes for Microsoft Windows
  7. Internet Extensions
  8. --*/
  9. #if !defined(_WININET_)
  10. #include <SpecStrings.h>
  11. #define _WININET_
  12. /*
  13. * Set up Structure Packing to be 4 bytes
  14. * for all wininet structures
  15. */
  16. #if defined(_WIN64)
  17. #include <pshpack8.h>
  18. #else
  19. #include <pshpack4.h>
  20. #endif
  21. #if defined(__cplusplus)
  22. extern "C" {
  23. #endif
  24. #if !defined(_WINX32_)
  25. #define INTERNETAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  26. #define INTERNETAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  27. #define URLCACHEAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  28. #define URLCACHEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  29. #else
  30. #define INTERNETAPI EXTERN_C HRESULT STDAPICALLTYPE
  31. #define INTERNETAPI_(type) EXTERN_C type STDAPICALLTYPE
  32. #define URLCACHEAPI EXTERN_C HRESULT STDAPICALLTYPE
  33. #define URLCACHEAPI_(type) EXTERN_C type STDAPICALLTYPE
  34. #endif
  35. #define BOOLAPI INTERNETAPI_(BOOL)
  36. //
  37. // internet types
  38. //
  39. typedef LPVOID HINTERNET;
  40. typedef HINTERNET * LPHINTERNET;
  41. typedef WORD INTERNET_PORT;
  42. typedef INTERNET_PORT * LPINTERNET_PORT;
  43. //
  44. // Internet APIs
  45. //
  46. //
  47. // manifests
  48. //
  49. #define INTERNET_INVALID_PORT_NUMBER 0 // use the protocol-specific default
  50. #define INTERNET_DEFAULT_FTP_PORT 21 // default for FTP servers
  51. #define INTERNET_DEFAULT_GOPHER_PORT 70 // " " gopher "
  52. #define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP "
  53. #define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS "
  54. #define INTERNET_DEFAULT_SOCKS_PORT 1080 // default for SOCKS firewall servers.
  55. //
  56. // maximum field lengths (arbitrary)
  57. //
  58. #define INTERNET_MAX_HOST_NAME_LENGTH 256
  59. #define INTERNET_MAX_USER_NAME_LENGTH 128
  60. #define INTERNET_MAX_PASSWORD_LENGTH 128
  61. #define INTERNET_MAX_PORT_NUMBER_LENGTH 5 // INTERNET_PORT is unsigned short
  62. #define INTERNET_MAX_PORT_NUMBER_VALUE 65535 // maximum unsigned short value
  63. #define INTERNET_MAX_PATH_LENGTH 2048
  64. #define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length
  65. #define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH \
  66. + sizeof("://") \
  67. + INTERNET_MAX_PATH_LENGTH)
  68. //
  69. // values returned by InternetQueryOption() with INTERNET_OPTION_KEEP_CONNECTION:
  70. //
  71. #define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1)
  72. #define INTERNET_KEEP_ALIVE_ENABLED 1
  73. #define INTERNET_KEEP_ALIVE_DISABLED 0
  74. //
  75. // flags returned by InternetQueryOption() with INTERNET_OPTION_REQUEST_FLAGS
  76. //
  77. #define INTERNET_REQFLAG_FROM_CACHE 0x00000001 // response came from cache
  78. #define INTERNET_REQFLAG_ASYNC 0x00000002 // request was made asynchronously
  79. #define INTERNET_REQFLAG_VIA_PROXY 0x00000004 // request was made via a proxy
  80. #define INTERNET_REQFLAG_NO_HEADERS 0x00000008 // orginal response contained no headers
  81. #define INTERNET_REQFLAG_PASSIVE 0x00000010 // FTP: passive-mode connection
  82. #define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040 // HTTPS: this request not cacheable
  83. #define INTERNET_REQFLAG_NET_TIMEOUT 0x00000080 // w/ _FROM_CACHE: net request timed out
  84. //
  85. // flags common to open functions (not InternetOpen()):
  86. //
  87. #define INTERNET_FLAG_RELOAD 0x80000000 // retrieve the original item
  88. //
  89. // flags for InternetOpenUrl():
  90. //
  91. #define INTERNET_FLAG_RAW_DATA 0x40000000 // FTP/gopher find: receive the item as raw (structured) data
  92. #define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 // FTP: use existing InternetConnect handle for server if possible
  93. //
  94. // flags for InternetOpen():
  95. //
  96. #define INTERNET_FLAG_ASYNC 0x10000000 // this request is asynchronous (where supported)
  97. //
  98. // protocol-specific flags:
  99. //
  100. #define INTERNET_FLAG_PASSIVE 0x08000000 // used for FTP connections
  101. //
  102. // additional cache flags
  103. //
  104. #define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 // don't write this item to the cache
  105. #define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE
  106. #define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 // make this item persistent in cache
  107. #define INTERNET_FLAG_FROM_CACHE 0x01000000 // use offline semantics
  108. #define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE
  109. //
  110. // additional flags
  111. //
  112. #define INTERNET_FLAG_SECURE 0x00800000 // use PCT/SSL if applicable (HTTP)
  113. #define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 // use keep-alive semantics
  114. #define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 // don't handle redirections automatically
  115. #define INTERNET_FLAG_READ_PREFETCH 0x00100000 // do background read prefetch
  116. #define INTERNET_FLAG_NO_COOKIES 0x00080000 // no automatic cookie handling
  117. #define INTERNET_FLAG_NO_AUTH 0x00040000 // no automatic authentication handling
  118. #define INTERNET_FLAG_RESTRICTED_ZONE 0x00020000 // apply restricted zone policies for cookies, auth
  119. #define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000 // return cache file if net request fails
  120. //
  121. // Security Ignore Flags, Allow HttpOpenRequest to overide
  122. // Secure Channel (SSL/PCT) failures of the following types.
  123. //
  124. #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 // ex: https:// to http://
  125. #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 // ex: http:// to https://
  126. #define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 // expired X509 Cert.
  127. #define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 // bad common name in X509 Cert.
  128. //
  129. // more caching flags
  130. //
  131. #define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 // asking wininet to update an item if it is newer
  132. #define INTERNET_FLAG_HYPERLINK 0x00000400 // asking wininet to do hyperlinking semantic which works right for scripts
  133. #define INTERNET_FLAG_NO_UI 0x00000200 // no cookie popup
  134. #define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 // asking wininet to add "pragma: no-cache"
  135. #define INTERNET_FLAG_CACHE_ASYNC 0x00000080 // ok to perform lazy cache-write
  136. #define INTERNET_FLAG_FORMS_SUBMIT 0x00000040 // this is a forms submit
  137. #define INTERNET_FLAG_FWD_BACK 0x00000020 // fwd-back button op
  138. #define INTERNET_FLAG_NEED_FILE 0x00000010 // need a file for this request
  139. #define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE
  140. //
  141. // flags for FTP
  142. //
  143. #define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII // 0x00000001
  144. #define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY // 0x00000002
  145. //
  146. // flags field masks
  147. //
  148. #define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID | \
  149. INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | \
  150. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | \
  151. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP )
  152. #define INTERNET_FLAGS_MASK (INTERNET_FLAG_RELOAD \
  153. | INTERNET_FLAG_RAW_DATA \
  154. | INTERNET_FLAG_EXISTING_CONNECT \
  155. | INTERNET_FLAG_ASYNC \
  156. | INTERNET_FLAG_PASSIVE \
  157. | INTERNET_FLAG_NO_CACHE_WRITE \
  158. | INTERNET_FLAG_MAKE_PERSISTENT \
  159. | INTERNET_FLAG_FROM_CACHE \
  160. | INTERNET_FLAG_SECURE \
  161. | INTERNET_FLAG_KEEP_CONNECTION \
  162. | INTERNET_FLAG_NO_AUTO_REDIRECT \
  163. | INTERNET_FLAG_READ_PREFETCH \
  164. | INTERNET_FLAG_NO_COOKIES \
  165. | INTERNET_FLAG_NO_AUTH \
  166. | INTERNET_FLAG_CACHE_IF_NET_FAIL \
  167. | SECURITY_INTERNET_MASK \
  168. | INTERNET_FLAG_RESYNCHRONIZE \
  169. | INTERNET_FLAG_HYPERLINK \
  170. | INTERNET_FLAG_NO_UI \
  171. | INTERNET_FLAG_PRAGMA_NOCACHE \
  172. | INTERNET_FLAG_CACHE_ASYNC \
  173. | INTERNET_FLAG_FORMS_SUBMIT \
  174. | INTERNET_FLAG_NEED_FILE \
  175. | INTERNET_FLAG_RESTRICTED_ZONE \
  176. | INTERNET_FLAG_TRANSFER_BINARY \
  177. | INTERNET_FLAG_TRANSFER_ASCII \
  178. | INTERNET_FLAG_FWD_BACK \
  179. | INTERNET_FLAG_BGUPDATE \
  180. )
  181. #define INTERNET_ERROR_MASK_INSERT_CDROM 0x1
  182. #define INTERNET_ERROR_MASK_COMBINED_SEC_CERT 0x2
  183. #define INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG 0X4
  184. #define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY 0x8
  185. #define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK)
  186. //
  187. // common per-API flags (new APIs)
  188. //
  189. #define WININET_API_FLAG_ASYNC 0x00000001 // force async operation
  190. #define WININET_API_FLAG_SYNC 0x00000004 // force sync operation
  191. #define WININET_API_FLAG_USE_CONTEXT 0x00000008 // use value supplied in dwContext (even if 0)
  192. //
  193. // INTERNET_NO_CALLBACK - if this value is presented as the dwContext parameter
  194. // then no call-backs will be made for that API
  195. //
  196. #define INTERNET_NO_CALLBACK 0
  197. //
  198. // structures/types
  199. //
  200. //
  201. // INTERNET_SCHEME - enumerated URL scheme type
  202. //
  203. typedef enum {
  204. INTERNET_SCHEME_PARTIAL = -2,
  205. INTERNET_SCHEME_UNKNOWN = -1,
  206. INTERNET_SCHEME_DEFAULT = 0,
  207. INTERNET_SCHEME_FTP,
  208. INTERNET_SCHEME_GOPHER,
  209. INTERNET_SCHEME_HTTP,
  210. INTERNET_SCHEME_HTTPS,
  211. INTERNET_SCHEME_FILE,
  212. INTERNET_SCHEME_NEWS,
  213. INTERNET_SCHEME_MAILTO,
  214. INTERNET_SCHEME_SOCKS,
  215. INTERNET_SCHEME_JAVASCRIPT,
  216. INTERNET_SCHEME_VBSCRIPT,
  217. INTERNET_SCHEME_RES,
  218. INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
  219. INTERNET_SCHEME_LAST = INTERNET_SCHEME_RES
  220. } INTERNET_SCHEME, * LPINTERNET_SCHEME;
  221. //
  222. // INTERNET_ASYNC_RESULT - this structure is returned to the application via
  223. // the callback with INTERNET_STATUS_REQUEST_COMPLETE. It is not sufficient to
  224. // just return the result of the async operation. If the API failed then the
  225. // app cannot call GetLastError() because the thread context will be incorrect.
  226. // Both the value returned by the async API and any resultant error code are
  227. // made available. The app need not check dwError if dwResult indicates that
  228. // the API succeeded (in this case dwError will be ERROR_SUCCESS)
  229. //
  230. typedef struct {
  231. //
  232. // dwResult - the HINTERNET, DWORD or BOOL return code from an async API
  233. //
  234. DWORD_PTR dwResult;
  235. //
  236. // dwError - the error code if the API failed
  237. //
  238. DWORD dwError;
  239. } INTERNET_ASYNC_RESULT, * LPINTERNET_ASYNC_RESULT;
  240. //
  241. // INTERNET_DIAGNOSTIC_SOCKET_INFO - info about the socket in use
  242. //
  243. typedef struct {
  244. DWORD_PTR Socket;
  245. DWORD SourcePort;
  246. DWORD DestPort;
  247. DWORD Flags;
  248. } INTERNET_DIAGNOSTIC_SOCKET_INFO, * LPINTERNET_DIAGNOSTIC_SOCKET_INFO;
  249. //
  250. // INTERNET_DIAGNOSTIC_SOCKET_INFO.Flags definitions
  251. //
  252. #define IDSI_FLAG_KEEP_ALIVE 0x00000001 // set if from keep-alive pool
  253. #define IDSI_FLAG_SECURE 0x00000002 // set if secure connection
  254. #define IDSI_FLAG_PROXY 0x00000004 // set if using proxy
  255. #define IDSI_FLAG_TUNNEL 0x00000008 // set if tunnelling through proxy
  256. //
  257. // INTERNET_PROXY_INFO - structure supplied with INTERNET_OPTION_PROXY to get/
  258. // set proxy information on a InternetOpen() handle
  259. //
  260. typedef struct {
  261. //
  262. // dwAccessType - INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PROXY, or
  263. // INTERNET_OPEN_TYPE_PRECONFIG (set only)
  264. //
  265. DWORD dwAccessType;
  266. //
  267. // lpszProxy - proxy server list
  268. //
  269. LPCTSTR lpszProxy;
  270. //
  271. // lpszProxyBypass - proxy bypass list
  272. //
  273. LPCTSTR lpszProxyBypass;
  274. } INTERNET_PROXY_INFO, * LPINTERNET_PROXY_INFO;
  275. //
  276. // INTERNET_PER_CONN_OPTION_LIST - set per-connection options such as proxy
  277. // and autoconfig info
  278. //
  279. // Set and queried using Internet[Set|Query]Option with
  280. // INTERNET_OPTION_PER_CONNECTION_OPTION
  281. //
  282. typedef struct {
  283. DWORD dwOption; // option to be queried or set
  284. union {
  285. DWORD dwValue; // dword value for the option
  286. LPSTR pszValue; // pointer to string value for the option
  287. FILETIME ftValue; // file-time value for the option
  288. } Value;
  289. } INTERNET_PER_CONN_OPTIONA, * LPINTERNET_PER_CONN_OPTIONA;
  290. typedef struct {
  291. DWORD dwOption; // option to be queried or set
  292. union {
  293. DWORD dwValue; // dword value for the option
  294. LPWSTR pszValue; // pointer to string value for the option
  295. FILETIME ftValue; // file-time value for the option
  296. } Value;
  297. } INTERNET_PER_CONN_OPTIONW, * LPINTERNET_PER_CONN_OPTIONW;
  298. #ifdef UNICODE
  299. typedef INTERNET_PER_CONN_OPTIONW INTERNET_PER_CONN_OPTION;
  300. typedef LPINTERNET_PER_CONN_OPTIONW LPINTERNET_PER_CONN_OPTION;
  301. #else
  302. typedef INTERNET_PER_CONN_OPTIONA INTERNET_PER_CONN_OPTION;
  303. typedef LPINTERNET_PER_CONN_OPTIONA LPINTERNET_PER_CONN_OPTION;
  304. #endif // UNICODE
  305. typedef struct {
  306. DWORD dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
  307. LPSTR pszConnection; // connection name to set/query options
  308. DWORD dwOptionCount; // number of options to set/query
  309. DWORD dwOptionError; // on error, which option failed
  310. LPINTERNET_PER_CONN_OPTIONA pOptions;
  311. // array of options to set/query
  312. } INTERNET_PER_CONN_OPTION_LISTA, * LPINTERNET_PER_CONN_OPTION_LISTA;
  313. typedef struct {
  314. DWORD dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
  315. LPWSTR pszConnection; // connection name to set/query options
  316. DWORD dwOptionCount; // number of options to set/query
  317. DWORD dwOptionError; // on error, which option failed
  318. LPINTERNET_PER_CONN_OPTIONW pOptions;
  319. // array of options to set/query
  320. } INTERNET_PER_CONN_OPTION_LISTW, * LPINTERNET_PER_CONN_OPTION_LISTW;
  321. #ifdef UNICODE
  322. typedef INTERNET_PER_CONN_OPTION_LISTW INTERNET_PER_CONN_OPTION_LIST;
  323. typedef LPINTERNET_PER_CONN_OPTION_LISTW LPINTERNET_PER_CONN_OPTION_LIST;
  324. #else
  325. typedef INTERNET_PER_CONN_OPTION_LISTA INTERNET_PER_CONN_OPTION_LIST;
  326. typedef LPINTERNET_PER_CONN_OPTION_LISTA LPINTERNET_PER_CONN_OPTION_LIST;
  327. #endif // UNICODE
  328. //
  329. // Options used in INTERNET_PER_CONN_OPTON struct
  330. //
  331. #define INTERNET_PER_CONN_FLAGS 1
  332. #define INTERNET_PER_CONN_PROXY_SERVER 2
  333. #define INTERNET_PER_CONN_PROXY_BYPASS 3
  334. #define INTERNET_PER_CONN_AUTOCONFIG_URL 4
  335. #define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS 5
  336. #define INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL 6
  337. #define INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS 7
  338. #define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME 8
  339. #define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL 9
  340. //
  341. // PER_CONN_FLAGS
  342. //
  343. #define PROXY_TYPE_DIRECT 0x00000001 // direct to net
  344. #define PROXY_TYPE_PROXY 0x00000002 // via named proxy
  345. #define PROXY_TYPE_AUTO_PROXY_URL 0x00000004 // autoproxy URL
  346. #define PROXY_TYPE_AUTO_DETECT 0x00000008 // use autoproxy detection
  347. //
  348. // PER_CONN_AUTODISCOVERY_FLAGS
  349. //
  350. #define AUTO_PROXY_FLAG_USER_SET 0x00000001 // user changed this setting
  351. #define AUTO_PROXY_FLAG_ALWAYS_DETECT 0x00000002 // force detection even when its not needed
  352. #define AUTO_PROXY_FLAG_DETECTION_RUN 0x00000004 // detection has been run
  353. #define AUTO_PROXY_FLAG_MIGRATED 0x00000008 // migration has just been done
  354. #define AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT 0x00000010 // don't cache result of host=proxy name
  355. #define AUTO_PROXY_FLAG_CACHE_INIT_RUN 0x00000020 // don't initalize and run unless URL expired
  356. #define AUTO_PROXY_FLAG_DETECTION_SUSPECT 0x00000040 // if we're on a LAN & Modem, with only one IP, bad?!?
  357. //
  358. // INTERNET_VERSION_INFO - version information returned via
  359. // InternetQueryOption(..., INTERNET_OPTION_VERSION, ...)
  360. //
  361. typedef struct {
  362. DWORD dwMajorVersion;
  363. DWORD dwMinorVersion;
  364. } INTERNET_VERSION_INFO, * LPINTERNET_VERSION_INFO;
  365. //
  366. // HTTP_VERSION_INFO - query or set global HTTP version (1.0 or 1.1)
  367. //
  368. typedef struct {
  369. DWORD dwMajorVersion;
  370. DWORD dwMinorVersion;
  371. } HTTP_VERSION_INFO, * LPHTTP_VERSION_INFO;
  372. //
  373. // INTERNET_CONNECTED_INFO - information used to set the global connected state
  374. //
  375. typedef struct {
  376. //
  377. // dwConnectedState - new connected/disconnected state.
  378. // See INTERNET_STATE_CONNECTED, etc.
  379. //
  380. DWORD dwConnectedState;
  381. //
  382. // dwFlags - flags controlling connected->disconnected (or disconnected->
  383. // connected) transition. See below
  384. //
  385. DWORD dwFlags;
  386. } INTERNET_CONNECTED_INFO, * LPINTERNET_CONNECTED_INFO;
  387. //
  388. // flags for INTERNET_CONNECTED_INFO dwFlags
  389. //
  390. //
  391. // ISO_FORCE_DISCONNECTED - if set when putting Wininet into disconnected mode,
  392. // all outstanding requests will be aborted with a cancelled error
  393. //
  394. #define ISO_FORCE_DISCONNECTED 0x00000001
  395. //
  396. // URL_COMPONENTS - the constituent parts of an URL. Used in InternetCrackUrl()
  397. // and InternetCreateUrl()
  398. //
  399. // For InternetCrackUrl(), if a pointer field and its corresponding length field
  400. // are both 0 then that component is not returned. If the pointer field is NULL
  401. // but the length field is not zero, then both the pointer and length fields are
  402. // returned if both pointer and corresponding length fields are non-zero then
  403. // the pointer field points to a buffer where the component is copied. The
  404. // component may be un-escaped, depending on dwFlags
  405. //
  406. // For InternetCreateUrl(), the pointer fields should be NULL if the component
  407. // is not required. If the corresponding length field is zero then the pointer
  408. // field is the address of a zero-terminated string. If the length field is not
  409. // zero then it is the string length of the corresponding pointer field
  410. //
  411. #pragma warning( disable : 4121 ) // disable alignment warning
  412. typedef struct {
  413. DWORD dwStructSize; // size of this structure. Used in version check
  414. LPSTR lpszScheme; // pointer to scheme name
  415. DWORD dwSchemeLength; // length of scheme name
  416. INTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  417. LPSTR lpszHostName; // pointer to host name
  418. DWORD dwHostNameLength; // length of host name
  419. INTERNET_PORT nPort; // converted port number
  420. LPSTR lpszUserName; // pointer to user name
  421. DWORD dwUserNameLength; // length of user name
  422. LPSTR lpszPassword; // pointer to password
  423. DWORD dwPasswordLength; // length of password
  424. LPSTR lpszUrlPath; // pointer to URL-path
  425. DWORD dwUrlPathLength; // length of URL-path
  426. LPSTR lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  427. DWORD dwExtraInfoLength; // length of extra information
  428. } URL_COMPONENTSA, * LPURL_COMPONENTSA;
  429. typedef struct {
  430. DWORD dwStructSize; // size of this structure. Used in version check
  431. LPWSTR lpszScheme; // pointer to scheme name
  432. DWORD dwSchemeLength; // length of scheme name
  433. INTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  434. LPWSTR lpszHostName; // pointer to host name
  435. DWORD dwHostNameLength; // length of host name
  436. INTERNET_PORT nPort; // converted port number
  437. LPWSTR lpszUserName; // pointer to user name
  438. DWORD dwUserNameLength; // length of user name
  439. LPWSTR lpszPassword; // pointer to password
  440. DWORD dwPasswordLength; // length of password
  441. LPWSTR lpszUrlPath; // pointer to URL-path
  442. DWORD dwUrlPathLength; // length of URL-path
  443. LPWSTR lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  444. DWORD dwExtraInfoLength; // length of extra information
  445. } URL_COMPONENTSW, * LPURL_COMPONENTSW;
  446. #ifdef UNICODE
  447. typedef URL_COMPONENTSW URL_COMPONENTS;
  448. typedef LPURL_COMPONENTSW LPURL_COMPONENTS;
  449. #else
  450. typedef URL_COMPONENTSA URL_COMPONENTS;
  451. typedef LPURL_COMPONENTSA LPURL_COMPONENTS;
  452. #endif // UNICODE
  453. #pragma warning( default : 4121 ) // restore alignment warning
  454. //
  455. // INTERNET_CERTIFICATE_INFO lpBuffer - contains the certificate returned from
  456. // the server
  457. //
  458. typedef struct {
  459. //
  460. // ftExpiry - date the certificate expires.
  461. //
  462. FILETIME ftExpiry;
  463. //
  464. // ftStart - date the certificate becomes valid.
  465. //
  466. FILETIME ftStart;
  467. //
  468. // lpszSubjectInfo - the name of organization, site, and server
  469. // the cert. was issued for.
  470. //
  471. LPTSTR lpszSubjectInfo;
  472. //
  473. // lpszIssuerInfo - the name of orgainzation, site, and server
  474. // the cert was issues by.
  475. //
  476. LPTSTR lpszIssuerInfo;
  477. //
  478. // lpszProtocolName - the name of the protocol used to provide the secure
  479. // connection.
  480. //
  481. LPTSTR lpszProtocolName;
  482. //
  483. // lpszSignatureAlgName - the name of the algorithm used for signing
  484. // the certificate.
  485. //
  486. LPTSTR lpszSignatureAlgName;
  487. //
  488. // lpszEncryptionAlgName - the name of the algorithm used for
  489. // doing encryption over the secure channel (SSL/PCT) connection.
  490. //
  491. LPTSTR lpszEncryptionAlgName;
  492. //
  493. // dwKeySize - size of the key.
  494. //
  495. DWORD dwKeySize;
  496. } INTERNET_CERTIFICATE_INFO, * LPINTERNET_CERTIFICATE_INFO;
  497. //
  498. // INTERNET_BUFFERS - combines headers and data. May be chained for e.g. file
  499. // upload or scatter/gather operations. For chunked read/write, lpcszHeader
  500. // contains the chunked-ext
  501. //
  502. typedef struct _INTERNET_BUFFERSA {
  503. DWORD dwStructSize; // used for API versioning. Set to sizeof(INTERNET_BUFFERS)
  504. struct _INTERNET_BUFFERSA * Next; // chain of buffers
  505. LPCSTR lpcszHeader; // pointer to headers (may be NULL)
  506. DWORD dwHeadersLength; // length of headers if not NULL
  507. DWORD dwHeadersTotal; // size of headers if not enough buffer
  508. LPVOID lpvBuffer; // pointer to data buffer (may be NULL)
  509. DWORD dwBufferLength; // length of data buffer if not NULL
  510. DWORD dwBufferTotal; // total size of chunk, or content-length if not chunked
  511. DWORD dwOffsetLow; // used for read-ranges (only used in HttpSendRequest2)
  512. DWORD dwOffsetHigh;
  513. } INTERNET_BUFFERSA, * LPINTERNET_BUFFERSA;
  514. typedef struct _INTERNET_BUFFERSW {
  515. DWORD dwStructSize; // used for API versioning. Set to sizeof(INTERNET_BUFFERS)
  516. struct _INTERNET_BUFFERSW * Next; // chain of buffers
  517. LPCWSTR lpcszHeader; // pointer to headers (may be NULL)
  518. DWORD dwHeadersLength; // length of headers if not NULL
  519. DWORD dwHeadersTotal; // size of headers if not enough buffer
  520. LPVOID lpvBuffer; // pointer to data buffer (may be NULL)
  521. DWORD dwBufferLength; // length of data buffer if not NULL
  522. DWORD dwBufferTotal; // total size of chunk, or content-length if not chunked
  523. DWORD dwOffsetLow; // used for read-ranges (only used in HttpSendRequest2)
  524. DWORD dwOffsetHigh;
  525. } INTERNET_BUFFERSW, * LPINTERNET_BUFFERSW;
  526. #ifdef UNICODE
  527. typedef INTERNET_BUFFERSW INTERNET_BUFFERS;
  528. typedef LPINTERNET_BUFFERSW LPINTERNET_BUFFERS;
  529. #else
  530. typedef INTERNET_BUFFERSA INTERNET_BUFFERS;
  531. typedef LPINTERNET_BUFFERSA LPINTERNET_BUFFERS;
  532. #endif // UNICODE
  533. //
  534. // prototypes
  535. //
  536. BOOLAPI InternetTimeFromSystemTimeA(
  537. __in CONST SYSTEMTIME *pst, // input GMT time
  538. __in DWORD dwRFC, // RFC format
  539. __out_bcount(cbTime) LPSTR lpszTime, // output string buffer
  540. __in DWORD cbTime // output buffer size
  541. );
  542. BOOLAPI InternetTimeFromSystemTimeW(
  543. __in CONST SYSTEMTIME *pst, // input GMT time
  544. __in DWORD dwRFC, // RFC format
  545. __out_bcount(cbTime) LPWSTR lpszTime, // output string buffer
  546. __in DWORD cbTime // output buffer size
  547. );
  548. #ifdef UNICODE
  549. #define InternetTimeFromSystemTime InternetTimeFromSystemTimeW
  550. #else
  551. #ifdef _WINX32_
  552. #define InternetTimeFromSystemTime InternetTimeFromSystemTimeA
  553. #else
  554. BOOLAPI InternetTimeFromSystemTime(
  555. __in CONST SYSTEMTIME *pst, // input GMT time
  556. __in DWORD dwRFC, // RFC format
  557. __out_bcount(cbTime) LPSTR lpszTime, // output string buffer
  558. __in DWORD cbTime // output buffer size
  559. );
  560. #endif // _WINX32_
  561. #endif // !UNICODE
  562. //
  563. // constants for InternetTimeFromSystemTime
  564. //
  565. #define INTERNET_RFC1123_FORMAT 0
  566. #define INTERNET_RFC1123_BUFSIZE 30
  567. BOOLAPI InternetTimeToSystemTimeA(
  568. __in LPCSTR lpszTime, // NULL terminated string
  569. __out SYSTEMTIME *pst, // output in GMT time
  570. __null DWORD dwReserved
  571. );
  572. BOOLAPI InternetTimeToSystemTimeW(
  573. __in LPCWSTR lpszTime, // NULL terminated string
  574. __out SYSTEMTIME *pst, // output in GMT time
  575. __null DWORD dwReserved
  576. );
  577. #ifdef UNICODE
  578. #define InternetTimeToSystemTime InternetTimeToSystemTimeW
  579. #else
  580. #ifdef _WINX32_
  581. #define InternetTimeToSystemTime InternetTimeToSystemTimeA
  582. #else
  583. BOOLAPI InternetTimeToSystemTime(
  584. __in LPCSTR lpszTime, // NULL terminated string
  585. __out SYSTEMTIME *pst, // output in GMT time
  586. __null DWORD dwReserved
  587. );
  588. #endif // _WINX32_
  589. #endif // !UNICODE
  590. BOOLAPI InternetCrackUrlA(
  591. __in_ecount(dwUrlLength) LPCSTR lpszUrl,
  592. __in DWORD dwUrlLength,
  593. __in DWORD dwFlags,
  594. __inout LPURL_COMPONENTSA lpUrlComponents
  595. );
  596. BOOLAPI InternetCrackUrlW(
  597. __in_ecount(dwUrlLength) LPCWSTR lpszUrl,
  598. __in DWORD dwUrlLength,
  599. __in DWORD dwFlags,
  600. __inout LPURL_COMPONENTSW lpUrlComponents
  601. );
  602. #ifdef UNICODE
  603. #define InternetCrackUrl InternetCrackUrlW
  604. #else
  605. #define InternetCrackUrl InternetCrackUrlA
  606. #endif // !UNICODE
  607. BOOLAPI InternetCreateUrlA(
  608. __in LPURL_COMPONENTSA lpUrlComponents,
  609. __in DWORD dwFlags,
  610. __out_ecount(*lpdwUrlLength) __opt LPSTR lpszUrl,
  611. __inout LPDWORD lpdwUrlLength
  612. );
  613. BOOLAPI InternetCreateUrlW(
  614. __in LPURL_COMPONENTSW lpUrlComponents,
  615. __in DWORD dwFlags,
  616. __out_ecount(*lpdwUrlLength) __opt LPWSTR lpszUrl,
  617. __inout LPDWORD lpdwUrlLength
  618. );
  619. #ifdef UNICODE
  620. #define InternetCreateUrl InternetCreateUrlW
  621. #else
  622. #define InternetCreateUrl InternetCreateUrlA
  623. #endif // !UNICODE
  624. BOOLAPI InternetCanonicalizeUrlA(
  625. __in LPCSTR lpszUrl,
  626. __out_ecount(*lpdwBufferLength) LPSTR lpszBuffer,
  627. __inout LPDWORD lpdwBufferLength,
  628. __in DWORD dwFlags
  629. );
  630. BOOLAPI InternetCanonicalizeUrlW(
  631. __in LPCWSTR lpszUrl,
  632. __out_ecount(*lpdwBufferLength) LPWSTR lpszBuffer,
  633. __inout LPDWORD lpdwBufferLength,
  634. __in DWORD dwFlags
  635. );
  636. #ifdef UNICODE
  637. #define InternetCanonicalizeUrl InternetCanonicalizeUrlW
  638. #else
  639. #define InternetCanonicalizeUrl InternetCanonicalizeUrlA
  640. #endif // !UNICODE
  641. BOOLAPI InternetCombineUrlA(
  642. __in LPCSTR lpszBaseUrl,
  643. __in LPCSTR lpszRelativeUrl,
  644. __out_ecount(*lpdwBufferLength) LPSTR lpszBuffer,
  645. __inout LPDWORD lpdwBufferLength,
  646. __in DWORD dwFlags
  647. );
  648. BOOLAPI InternetCombineUrlW(
  649. __in LPCWSTR lpszBaseUrl,
  650. __in LPCWSTR lpszRelativeUrl,
  651. __out_ecount(*lpdwBufferLength) LPWSTR lpszBuffer,
  652. __inout LPDWORD lpdwBufferLength,
  653. __in DWORD dwFlags
  654. );
  655. #ifdef UNICODE
  656. #define InternetCombineUrl InternetCombineUrlW
  657. #else
  658. #define InternetCombineUrl InternetCombineUrlA
  659. #endif // !UNICODE
  660. //
  661. // flags for InternetCrackUrl() and InternetCreateUrl()
  662. //
  663. #define ICU_ESCAPE 0x80000000 // (un)escape URL characters
  664. #define ICU_USERNAME 0x40000000 // use internal username & password
  665. //
  666. // flags for InternetCanonicalizeUrl() and InternetCombineUrl()
  667. //
  668. #define ICU_NO_ENCODE 0x20000000 // Don't convert unsafe characters to escape sequence
  669. #define ICU_DECODE 0x10000000 // Convert %XX escape sequences to characters
  670. #define ICU_NO_META 0x08000000 // Don't convert .. etc. meta path sequences
  671. #define ICU_ENCODE_SPACES_ONLY 0x04000000 // Encode spaces only
  672. #define ICU_BROWSER_MODE 0x02000000 // Special encode/decode rules for browser
  673. #define ICU_ENCODE_PERCENT 0x00001000 // Encode any percent (ASCII25)
  674. // signs encountered, default is to not encode percent.
  675. INTERNETAPI_(HINTERNET) InternetOpenA(
  676. __in __opt LPCSTR lpszAgent,
  677. __in DWORD dwAccessType,
  678. __in __opt LPCSTR lpszProxy,
  679. __in __opt LPCSTR lpszProxyBypass,
  680. __in DWORD dwFlags
  681. );
  682. INTERNETAPI_(HINTERNET) InternetOpenW(
  683. __in __opt LPCWSTR lpszAgent,
  684. __in DWORD dwAccessType,
  685. __in __opt LPCWSTR lpszProxy,
  686. __in __opt LPCWSTR lpszProxyBypass,
  687. __in DWORD dwFlags
  688. );
  689. #ifdef UNICODE
  690. #define InternetOpen InternetOpenW
  691. #else
  692. #define InternetOpen InternetOpenA
  693. #endif // !UNICODE
  694. //
  695. // access types for InternetOpen()
  696. //
  697. #define INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration
  698. #define INTERNET_OPEN_TYPE_DIRECT 1 // direct to net
  699. #define INTERNET_OPEN_TYPE_PROXY 3 // via named proxy
  700. #define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS
  701. //
  702. // old names for access types
  703. //
  704. #define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG
  705. #define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT
  706. #define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY
  707. BOOLAPI InternetCloseHandle(
  708. __in HINTERNET hInternet
  709. );
  710. INTERNETAPI_(HINTERNET) InternetConnectA(
  711. __in HINTERNET hInternet,
  712. __in LPCSTR lpszServerName,
  713. __in INTERNET_PORT nServerPort,
  714. __in __opt LPCSTR lpszUserName,
  715. __in __opt LPCSTR lpszPassword,
  716. __in DWORD dwService,
  717. __in DWORD dwFlags,
  718. __in __opt DWORD_PTR dwContext
  719. );
  720. INTERNETAPI_(HINTERNET) InternetConnectW(
  721. __in HINTERNET hInternet,
  722. __in LPCWSTR lpszServerName,
  723. __in INTERNET_PORT nServerPort,
  724. __in __opt LPCWSTR lpszUserName,
  725. __in __opt LPCWSTR lpszPassword,
  726. __in DWORD dwService,
  727. __in DWORD dwFlags,
  728. __in __opt DWORD_PTR dwContext
  729. );
  730. #ifdef UNICODE
  731. #define InternetConnect InternetConnectW
  732. #else
  733. #define InternetConnect InternetConnectA
  734. #endif // !UNICODE
  735. //
  736. // service types for InternetConnect()
  737. //
  738. #define INTERNET_SERVICE_FTP 1
  739. #define INTERNET_SERVICE_GOPHER 2
  740. #define INTERNET_SERVICE_HTTP 3
  741. INTERNETAPI_(HINTERNET) InternetOpenUrlA(
  742. __in HINTERNET hInternet,
  743. __in LPCSTR lpszUrl,
  744. __in_ecount(dwHeadersLength) __opt LPCSTR lpszHeaders,
  745. __in DWORD dwHeadersLength,
  746. __in DWORD dwFlags,
  747. __in __opt DWORD_PTR dwContext
  748. );
  749. INTERNETAPI_(HINTERNET) InternetOpenUrlW(
  750. __in HINTERNET hInternet,
  751. __in LPCWSTR lpszUrl,
  752. __in_ecount(dwHeadersLength) __opt LPCWSTR lpszHeaders,
  753. __in DWORD dwHeadersLength,
  754. __in DWORD dwFlags,
  755. __in __opt DWORD_PTR dwContext
  756. );
  757. #ifdef UNICODE
  758. #define InternetOpenUrl InternetOpenUrlW
  759. #else
  760. #define InternetOpenUrl InternetOpenUrlA
  761. #endif // !UNICODE
  762. BOOLAPI InternetReadFile(
  763. __in HINTERNET hFile,
  764. __out_bcount(dwNumberOfBytesToRead) LPVOID lpBuffer,
  765. __in DWORD dwNumberOfBytesToRead,
  766. __out LPDWORD lpdwNumberOfBytesRead
  767. );
  768. INTERNETAPI_(BOOL) InternetReadFileExA(
  769. __in HINTERNET hFile,
  770. __out LPINTERNET_BUFFERSA lpBuffersOut,
  771. __in DWORD dwFlags,
  772. __in __opt DWORD_PTR dwContext
  773. );
  774. INTERNETAPI_(BOOL) InternetReadFileExW(
  775. __in HINTERNET hFile,
  776. __out LPINTERNET_BUFFERSW lpBuffersOut,
  777. __in DWORD dwFlags,
  778. __in __opt DWORD_PTR dwContext
  779. );
  780. #ifdef UNICODE
  781. #define InternetReadFileEx InternetReadFileExW
  782. #else
  783. #define InternetReadFileEx InternetReadFileExA
  784. #endif // !UNICODE
  785. //
  786. // flags for InternetReadFileEx()
  787. //
  788. #define IRF_ASYNC WININET_API_FLAG_ASYNC
  789. #define IRF_SYNC WININET_API_FLAG_SYNC
  790. #define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT
  791. #define IRF_NO_WAIT 0x00000008
  792. INTERNETAPI_(DWORD) InternetSetFilePointer(
  793. __in HINTERNET hFile,
  794. __in LONG lDistanceToMove,
  795. __null PVOID pReserved,
  796. __in DWORD dwMoveMethod,
  797. __null DWORD_PTR dwContext
  798. );
  799. BOOLAPI InternetWriteFile(
  800. __in HINTERNET hFile,
  801. __in_bcount(dwNumberOfBytesToWrite) LPCVOID lpBuffer,
  802. __in DWORD dwNumberOfBytesToWrite,
  803. __out LPDWORD lpdwNumberOfBytesWritten
  804. );
  805. BOOLAPI InternetQueryDataAvailable(
  806. __in HINTERNET hFile,
  807. __out __opt LPDWORD lpdwNumberOfBytesAvailable,
  808. __in DWORD dwFlags,
  809. __in __opt DWORD_PTR dwContext
  810. );
  811. BOOLAPI InternetFindNextFileA(
  812. __in HINTERNET hFind,
  813. __out LPVOID lpvFindData
  814. );
  815. BOOLAPI InternetFindNextFileW(
  816. __in HINTERNET hFind,
  817. __out LPVOID lpvFindData
  818. );
  819. #ifdef UNICODE
  820. #define InternetFindNextFile InternetFindNextFileW
  821. #else
  822. #define InternetFindNextFile InternetFindNextFileA
  823. #endif // !UNICODE
  824. BOOLAPI InternetQueryOptionA(
  825. __in __opt HINTERNET hInternet,
  826. __in DWORD dwOption,
  827. __out_bcount(*lpdwBufferLength) __opt LPVOID lpBuffer,
  828. __inout LPDWORD lpdwBufferLength
  829. );
  830. BOOLAPI InternetQueryOptionW(
  831. __in __opt HINTERNET hInternet,
  832. __in DWORD dwOption,
  833. __out_bcount(*lpdwBufferLength) __opt LPVOID lpBuffer,
  834. __inout LPDWORD lpdwBufferLength
  835. );
  836. #ifdef UNICODE
  837. #define InternetQueryOption InternetQueryOptionW
  838. #else
  839. #define InternetQueryOption InternetQueryOptionA
  840. #endif // !UNICODE
  841. BOOLAPI InternetSetOptionA(
  842. __in __opt HINTERNET hInternet,
  843. __in DWORD dwOption,
  844. __in __opt LPVOID lpBuffer,
  845. __in DWORD dwBufferLength
  846. );
  847. BOOLAPI InternetSetOptionW(
  848. __in __opt HINTERNET hInternet,
  849. __in DWORD dwOption,
  850. __in __opt LPVOID lpBuffer,
  851. __in DWORD dwBufferLength
  852. );
  853. #ifdef UNICODE
  854. #define InternetSetOption InternetSetOptionW
  855. #else
  856. #define InternetSetOption InternetSetOptionA
  857. #endif // !UNICODE
  858. BOOLAPI InternetSetOptionExA(
  859. __in __opt HINTERNET hInternet,
  860. __in DWORD dwOption,
  861. __in __opt LPVOID lpBuffer,
  862. __in DWORD dwBufferLength,
  863. __in DWORD dwFlags
  864. );
  865. BOOLAPI InternetSetOptionExW(
  866. __in __opt HINTERNET hInternet,
  867. __in DWORD dwOption,
  868. __in __opt LPVOID lpBuffer,
  869. __in DWORD dwBufferLength,
  870. __in DWORD dwFlags
  871. );
  872. #ifdef UNICODE
  873. #define InternetSetOptionEx InternetSetOptionExW
  874. #else
  875. #define InternetSetOptionEx InternetSetOptionExA
  876. #endif // !UNICODE
  877. BOOLAPI InternetLockRequestFile(
  878. __in HINTERNET hInternet,
  879. __out HANDLE * lphLockRequestInfo
  880. );
  881. BOOLAPI InternetUnlockRequestFile(
  882. __in HANDLE hLockRequestInfo
  883. );
  884. //
  885. // flags for InternetSetOptionEx()
  886. //
  887. #define ISO_GLOBAL 0x00000001 // modify option globally
  888. #define ISO_REGISTRY 0x00000002 // write option to registry (where applicable)
  889. #define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY)
  890. //
  891. // options manifests for Internet{Query|Set}Option
  892. //
  893. #define INTERNET_OPTION_CALLBACK 1
  894. #define INTERNET_OPTION_CONNECT_TIMEOUT 2
  895. #define INTERNET_OPTION_CONNECT_RETRIES 3
  896. #define INTERNET_OPTION_CONNECT_BACKOFF 4
  897. #define INTERNET_OPTION_SEND_TIMEOUT 5
  898. #define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT
  899. #define INTERNET_OPTION_RECEIVE_TIMEOUT 6
  900. #define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT
  901. #define INTERNET_OPTION_DATA_SEND_TIMEOUT 7
  902. #define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8
  903. #define INTERNET_OPTION_HANDLE_TYPE 9
  904. #define INTERNET_OPTION_LISTEN_TIMEOUT 11
  905. #define INTERNET_OPTION_READ_BUFFER_SIZE 12
  906. #define INTERNET_OPTION_WRITE_BUFFER_SIZE 13
  907. #define INTERNET_OPTION_ASYNC_ID 15
  908. #define INTERNET_OPTION_ASYNC_PRIORITY 16
  909. #define INTERNET_OPTION_PARENT_HANDLE 21
  910. #define INTERNET_OPTION_KEEP_CONNECTION 22
  911. #define INTERNET_OPTION_REQUEST_FLAGS 23
  912. #define INTERNET_OPTION_EXTENDED_ERROR 24
  913. #define INTERNET_OPTION_OFFLINE_MODE 26
  914. #define INTERNET_OPTION_CACHE_STREAM_HANDLE 27
  915. #define INTERNET_OPTION_USERNAME 28
  916. #define INTERNET_OPTION_PASSWORD 29
  917. #define INTERNET_OPTION_ASYNC 30
  918. #define INTERNET_OPTION_SECURITY_FLAGS 31
  919. #define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT 32
  920. #define INTERNET_OPTION_DATAFILE_NAME 33
  921. #define INTERNET_OPTION_URL 34
  922. #define INTERNET_OPTION_SECURITY_CERTIFICATE 35
  923. #define INTERNET_OPTION_SECURITY_KEY_BITNESS 36
  924. #define INTERNET_OPTION_REFRESH 37
  925. #define INTERNET_OPTION_PROXY 38
  926. #define INTERNET_OPTION_SETTINGS_CHANGED 39
  927. #define INTERNET_OPTION_VERSION 40
  928. #define INTERNET_OPTION_USER_AGENT 41
  929. #define INTERNET_OPTION_END_BROWSER_SESSION 42
  930. #define INTERNET_OPTION_PROXY_USERNAME 43
  931. #define INTERNET_OPTION_PROXY_PASSWORD 44
  932. #define INTERNET_OPTION_CONTEXT_VALUE 45
  933. #define INTERNET_OPTION_CONNECT_LIMIT 46
  934. #define INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT 47
  935. #define INTERNET_OPTION_POLICY 48
  936. #define INTERNET_OPTION_DISCONNECTED_TIMEOUT 49
  937. #define INTERNET_OPTION_CONNECTED_STATE 50
  938. #define INTERNET_OPTION_IDLE_STATE 51
  939. #define INTERNET_OPTION_OFFLINE_SEMANTICS 52
  940. #define INTERNET_OPTION_SECONDARY_CACHE_KEY 53
  941. #define INTERNET_OPTION_CALLBACK_FILTER 54
  942. #define INTERNET_OPTION_CONNECT_TIME 55
  943. #define INTERNET_OPTION_SEND_THROUGHPUT 56
  944. #define INTERNET_OPTION_RECEIVE_THROUGHPUT 57
  945. #define INTERNET_OPTION_REQUEST_PRIORITY 58
  946. #define INTERNET_OPTION_HTTP_VERSION 59
  947. #define INTERNET_OPTION_RESET_URLCACHE_SESSION 60
  948. #define INTERNET_OPTION_ERROR_MASK 62
  949. #define INTERNET_OPTION_FROM_CACHE_TIMEOUT 63
  950. #define INTERNET_OPTION_BYPASS_EDITED_ENTRY 64
  951. #define INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO 67
  952. #define INTERNET_OPTION_CODEPAGE 68
  953. #define INTERNET_OPTION_CACHE_TIMESTAMPS 69
  954. #define INTERNET_OPTION_DISABLE_AUTODIAL 70
  955. #define INTERNET_OPTION_MAX_CONNS_PER_SERVER 73
  956. #define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 74
  957. #define INTERNET_OPTION_PER_CONNECTION_OPTION 75
  958. #define INTERNET_OPTION_DIGEST_AUTH_UNLOAD 76
  959. #define INTERNET_OPTION_IGNORE_OFFLINE 77
  960. #define INTERNET_OPTION_IDENTITY 78
  961. #define INTERNET_OPTION_REMOVE_IDENTITY 79
  962. #define INTERNET_OPTION_ALTER_IDENTITY 80
  963. #define INTERNET_OPTION_SUPPRESS_BEHAVIOR 81
  964. #define INTERNET_OPTION_AUTODIAL_MODE 82
  965. #define INTERNET_OPTION_AUTODIAL_CONNECTION 83
  966. #define INTERNET_OPTION_CLIENT_CERT_CONTEXT 84
  967. #define INTERNET_OPTION_AUTH_FLAGS 85
  968. #define INTERNET_OPTION_COOKIES_3RD_PARTY 86
  969. #define INTERNET_OPTION_DISABLE_PASSPORT_AUTH 87
  970. #define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY 88
  971. #define INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT 89
  972. #define INTERNET_OPTION_ENABLE_PASSPORT_AUTH 90
  973. #define INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS 91
  974. #define INTERNET_OPTION_ACTIVATE_WORKER_THREADS 92
  975. #define INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS 93
  976. #define INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH 94
  977. #define INTERNET_OPTION_PROXY_SETTINGS_CHANGED 95
  978. #define INTERNET_OPTION_DATAFILE_EXT 96
  979. #define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK
  980. #define INTERNET_LAST_OPTION INTERNET_OPTION_DATAFILE_EXT
  981. //
  982. // values for INTERNET_OPTION_PRIORITY
  983. //
  984. #define INTERNET_PRIORITY_FOREGROUND 1000
  985. //
  986. // handle types
  987. //
  988. #define INTERNET_HANDLE_TYPE_INTERNET 1
  989. #define INTERNET_HANDLE_TYPE_CONNECT_FTP 2
  990. #define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3
  991. #define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4
  992. #define INTERNET_HANDLE_TYPE_FTP_FIND 5
  993. #define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6
  994. #define INTERNET_HANDLE_TYPE_FTP_FILE 7
  995. #define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8
  996. #define INTERNET_HANDLE_TYPE_GOPHER_FIND 9
  997. #define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10
  998. #define INTERNET_HANDLE_TYPE_GOPHER_FILE 11
  999. #define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12
  1000. #define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13
  1001. #define INTERNET_HANDLE_TYPE_FILE_REQUEST 14
  1002. //
  1003. // values for INTERNET_OPTION_AUTH_FLAGS
  1004. //
  1005. #define AUTH_FLAG_DISABLE_NEGOTIATE 0x00000001
  1006. #define AUTH_FLAG_ENABLE_NEGOTIATE 0x00000002
  1007. #define AUTH_FLAG_DISABLE_BASIC_CLEARCHANNEL 0x00000004
  1008. //
  1009. // values for INTERNET_OPTION_SECURITY_FLAGS
  1010. //
  1011. // query only
  1012. #define SECURITY_FLAG_SECURE 0x00000001 // can query only
  1013. #define SECURITY_FLAG_STRENGTH_WEAK 0x10000000
  1014. #define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000
  1015. #define SECURITY_FLAG_STRENGTH_STRONG 0x20000000
  1016. #define SECURITY_FLAG_UNKNOWNBIT 0x80000000
  1017. #define SECURITY_FLAG_FORTEZZA 0x08000000
  1018. #define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_STRENGTH_WEAK
  1019. // The following are unused
  1020. #define SECURITY_FLAG_SSL 0x00000002
  1021. #define SECURITY_FLAG_SSL3 0x00000004
  1022. #define SECURITY_FLAG_PCT 0x00000008
  1023. #define SECURITY_FLAG_PCT4 0x00000010
  1024. #define SECURITY_FLAG_IETFSSL4 0x00000020
  1025. // The following are for backwards compatability only.
  1026. #define SECURITY_FLAG_40BIT SECURITY_FLAG_STRENGTH_WEAK
  1027. #define SECURITY_FLAG_128BIT SECURITY_FLAG_STRENGTH_STRONG
  1028. #define SECURITY_FLAG_56BIT SECURITY_FLAG_STRENGTH_MEDIUM
  1029. // setable flags
  1030. #define SECURITY_FLAG_IGNORE_REVOCATION 0x00000080
  1031. #define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100
  1032. #define SECURITY_FLAG_IGNORE_WRONG_USAGE 0x00000200
  1033. #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID
  1034. #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
  1035. #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
  1036. #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
  1037. #define SECURITY_SET_MASK (SECURITY_FLAG_IGNORE_REVOCATION |\
  1038. SECURITY_FLAG_IGNORE_UNKNOWN_CA |\
  1039. SECURITY_FLAG_IGNORE_CERT_CN_INVALID |\
  1040. SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |\
  1041. SECURITY_FLAG_IGNORE_WRONG_USAGE)
  1042. // valid autodial modes
  1043. #define AUTODIAL_MODE_NEVER 1
  1044. #define AUTODIAL_MODE_ALWAYS 2
  1045. #define AUTODIAL_MODE_NO_NETWORK_PRESENT 4
  1046. BOOLAPI InternetGetLastResponseInfoA(
  1047. __out LPDWORD lpdwError,
  1048. __out_ecount(*lpdwBufferLength) __opt LPSTR lpszBuffer,
  1049. __inout LPDWORD lpdwBufferLength
  1050. );
  1051. BOOLAPI InternetGetLastResponseInfoW(
  1052. __out LPDWORD lpdwError,
  1053. __out_ecount(*lpdwBufferLength) __opt LPWSTR lpszBuffer,
  1054. __inout LPDWORD lpdwBufferLength
  1055. );
  1056. #ifdef UNICODE
  1057. #define InternetGetLastResponseInfo InternetGetLastResponseInfoW
  1058. #else
  1059. #define InternetGetLastResponseInfo InternetGetLastResponseInfoA
  1060. #endif // !UNICODE
  1061. //
  1062. // callback function for InternetSetStatusCallback
  1063. //
  1064. typedef
  1065. VOID
  1066. (CALLBACK * INTERNET_STATUS_CALLBACK)(
  1067. __in HINTERNET hInternet,
  1068. __in __opt DWORD_PTR dwContext,
  1069. __in DWORD dwInternetStatus,
  1070. __in __opt LPVOID lpvStatusInformation,
  1071. __in DWORD dwStatusInformationLength
  1072. );
  1073. typedef INTERNET_STATUS_CALLBACK * LPINTERNET_STATUS_CALLBACK;
  1074. INTERNETAPI_(INTERNET_STATUS_CALLBACK) InternetSetStatusCallbackA(
  1075. __in HINTERNET hInternet,
  1076. __in __opt INTERNET_STATUS_CALLBACK lpfnInternetCallback
  1077. );
  1078. INTERNETAPI_(INTERNET_STATUS_CALLBACK) InternetSetStatusCallbackW(
  1079. __in HINTERNET hInternet,
  1080. __in __opt INTERNET_STATUS_CALLBACK lpfnInternetCallback
  1081. );
  1082. #ifdef UNICODE
  1083. #define InternetSetStatusCallback InternetSetStatusCallbackW
  1084. #else
  1085. #ifdef _WINX32_
  1086. #define InternetSetStatusCallback InternetSetStatusCallbackA
  1087. #else
  1088. INTERNETAPI_(INTERNET_STATUS_CALLBACK) InternetSetStatusCallback(
  1089. __in HINTERNET hInternet,
  1090. __in __opt INTERNET_STATUS_CALLBACK lpfnInternetCallback
  1091. );
  1092. #endif // _WINX32_
  1093. #endif // !UNICODE
  1094. //
  1095. // status manifests for Internet status callback
  1096. //
  1097. #define INTERNET_STATUS_RESOLVING_NAME 10
  1098. #define INTERNET_STATUS_NAME_RESOLVED 11
  1099. #define INTERNET_STATUS_CONNECTING_TO_SERVER 20
  1100. #define INTERNET_STATUS_CONNECTED_TO_SERVER 21
  1101. #define INTERNET_STATUS_SENDING_REQUEST 30
  1102. #define INTERNET_STATUS_REQUEST_SENT 31
  1103. #define INTERNET_STATUS_RECEIVING_RESPONSE 40
  1104. #define INTERNET_STATUS_RESPONSE_RECEIVED 41
  1105. #define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42
  1106. #define INTERNET_STATUS_PREFETCH 43
  1107. #define INTERNET_STATUS_CLOSING_CONNECTION 50
  1108. #define INTERNET_STATUS_CONNECTION_CLOSED 51
  1109. #define INTERNET_STATUS_HANDLE_CREATED 60
  1110. #define INTERNET_STATUS_HANDLE_CLOSING 70
  1111. #define INTERNET_STATUS_DETECTING_PROXY 80
  1112. #define INTERNET_STATUS_REQUEST_COMPLETE 100
  1113. #define INTERNET_STATUS_REDIRECT 110
  1114. #define INTERNET_STATUS_INTERMEDIATE_RESPONSE 120
  1115. #define INTERNET_STATUS_USER_INPUT_REQUIRED 140
  1116. #define INTERNET_STATUS_STATE_CHANGE 200
  1117. #define INTERNET_STATUS_COOKIE_SENT 320
  1118. #define INTERNET_STATUS_COOKIE_RECEIVED 321
  1119. #define INTERNET_STATUS_PRIVACY_IMPACTED 324
  1120. #define INTERNET_STATUS_P3P_HEADER 325
  1121. #define INTERNET_STATUS_P3P_POLICYREF 326
  1122. #define INTERNET_STATUS_COOKIE_HISTORY 327
  1123. //
  1124. // the following can be indicated in a state change notification:
  1125. //
  1126. #define INTERNET_STATE_CONNECTED 0x00000001 // connected state (mutually exclusive with disconnected)
  1127. #define INTERNET_STATE_DISCONNECTED 0x00000002 // disconnected from network
  1128. #define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010 // disconnected by user request
  1129. #define INTERNET_STATE_IDLE 0x00000100 // no network requests being made (by Wininet)
  1130. #define INTERNET_STATE_BUSY 0x00000200 // network requests being made (by Wininet)
  1131. //
  1132. // the following values are used for cookie state:
  1133. //
  1134. typedef enum {
  1135. COOKIE_STATE_UNKNOWN = 0x0,
  1136. COOKIE_STATE_ACCEPT = 0x1,
  1137. COOKIE_STATE_PROMPT = 0x2,
  1138. COOKIE_STATE_LEASH = 0x3,
  1139. COOKIE_STATE_DOWNGRADE = 0x4,
  1140. COOKIE_STATE_REJECT = 0x5,
  1141. COOKIE_STATE_MAX = COOKIE_STATE_REJECT,
  1142. }
  1143. InternetCookieState;
  1144. typedef struct {
  1145. int cSession; // Session cookies received
  1146. int cPersistent; // Persistent cookies received
  1147. int cAccepted; // Number of cookies accepted
  1148. int cLeashed; // ... leashed
  1149. int cDowngraded; // ... converted to session-cookies
  1150. int cBlocked; // ... rejected
  1151. const char *pszLocation; // Optional: URL associated with reported cookie events
  1152. // This can be used to override request URL
  1153. }
  1154. IncomingCookieState;
  1155. typedef struct {
  1156. int cSent;
  1157. int cSuppressed;
  1158. const char *pszLocation; // Optional: URL associated with reported cookie events
  1159. // This can be used to override request URL
  1160. }
  1161. OutgoingCookieState;
  1162. typedef struct {
  1163. BOOL fAccepted;
  1164. BOOL fLeashed;
  1165. BOOL fDowngraded;
  1166. BOOL fRejected;
  1167. }
  1168. InternetCookieHistory;
  1169. typedef struct {
  1170. DWORD dwCookieState;
  1171. BOOL fAllowSession;
  1172. }
  1173. CookieDecision;
  1174. //
  1175. // if the following value is returned by InternetSetStatusCallback, then
  1176. // probably an invalid (non-code) address was supplied for the callback
  1177. //
  1178. #define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L))
  1179. //
  1180. // FTP
  1181. //
  1182. //
  1183. // manifests
  1184. //
  1185. #define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000
  1186. #define FTP_TRANSFER_TYPE_ASCII 0x00000001
  1187. #define FTP_TRANSFER_TYPE_BINARY 0x00000002
  1188. #define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY)
  1189. //
  1190. // prototypes
  1191. //
  1192. INTERNETAPI_(HINTERNET) FtpFindFirstFileA(
  1193. __in HINTERNET hConnect,
  1194. __in __opt LPCSTR lpszSearchFile,
  1195. __out __opt LPWIN32_FIND_DATAA lpFindFileData,
  1196. __in DWORD dwFlags,
  1197. __in __opt DWORD_PTR dwContext
  1198. );
  1199. INTERNETAPI_(HINTERNET) FtpFindFirstFileW(
  1200. __in HINTERNET hConnect,
  1201. __in __opt LPCWSTR lpszSearchFile,
  1202. __out __opt LPWIN32_FIND_DATAW lpFindFileData,
  1203. __in DWORD dwFlags,
  1204. __in __opt DWORD_PTR dwContext
  1205. );
  1206. #ifdef UNICODE
  1207. #define FtpFindFirstFile FtpFindFirstFileW
  1208. #else
  1209. #define FtpFindFirstFile FtpFindFirstFileA
  1210. #endif // !UNICODE
  1211. BOOLAPI FtpGetFileA(
  1212. __in HINTERNET hConnect,
  1213. __in LPCSTR lpszRemoteFile,
  1214. __in LPCSTR lpszNewFile,
  1215. __in BOOL fFailIfExists,
  1216. __in DWORD dwFlagsAndAttributes,
  1217. __in DWORD dwFlags,
  1218. __in __opt DWORD_PTR dwContext
  1219. );
  1220. BOOLAPI FtpGetFileW(
  1221. __in HINTERNET hConnect,
  1222. __in LPCWSTR lpszRemoteFile,
  1223. __in LPCWSTR lpszNewFile,
  1224. __in BOOL fFailIfExists,
  1225. __in DWORD dwFlagsAndAttributes,
  1226. __in DWORD dwFlags,
  1227. __in __opt DWORD_PTR dwContext
  1228. );
  1229. #ifdef UNICODE
  1230. #define FtpGetFile FtpGetFileW
  1231. #else
  1232. #define FtpGetFile FtpGetFileA
  1233. #endif // !UNICODE
  1234. BOOLAPI FtpPutFileA(
  1235. __in HINTERNET hConnect,
  1236. __in LPCSTR lpszLocalFile,
  1237. __in LPCSTR lpszNewRemoteFile,
  1238. __in DWORD dwFlags,
  1239. __in __opt DWORD_PTR dwContext
  1240. );
  1241. BOOLAPI FtpPutFileW(
  1242. __in HINTERNET hConnect,
  1243. __in LPCWSTR lpszLocalFile,
  1244. __in LPCWSTR lpszNewRemoteFile,
  1245. __in DWORD dwFlags,
  1246. __in __opt DWORD_PTR dwContext
  1247. );
  1248. #ifdef UNICODE
  1249. #define FtpPutFile FtpPutFileW
  1250. #else
  1251. #define FtpPutFile FtpPutFileA
  1252. #endif // !UNICODE
  1253. BOOLAPI FtpGetFileEx(
  1254. __in HINTERNET hFtpSession,
  1255. __in LPCSTR lpszRemoteFile,
  1256. __in LPCWSTR lpszNewFile,
  1257. __in BOOL fFailIfExists,
  1258. __in DWORD dwFlagsAndAttributes,
  1259. __in DWORD dwFlags,
  1260. __in __opt DWORD_PTR dwContext
  1261. );
  1262. BOOLAPI FtpPutFileEx(
  1263. __in HINTERNET hFtpSession,
  1264. __in LPCWSTR lpszLocalFile,
  1265. __in LPCSTR lpszNewRemoteFile,
  1266. __in DWORD dwFlags,
  1267. __in __opt DWORD_PTR dwContext
  1268. );
  1269. BOOLAPI FtpDeleteFileA(
  1270. __in HINTERNET hConnect,
  1271. __in LPCSTR lpszFileName
  1272. );
  1273. BOOLAPI FtpDeleteFileW(
  1274. __in HINTERNET hConnect,
  1275. __in LPCWSTR lpszFileName
  1276. );
  1277. #ifdef UNICODE
  1278. #define FtpDeleteFile FtpDeleteFileW
  1279. #else
  1280. #define FtpDeleteFile FtpDeleteFileA
  1281. #endif // !UNICODE
  1282. BOOLAPI FtpRenameFileA(
  1283. __in HINTERNET hConnect,
  1284. __in LPCSTR lpszExisting,
  1285. __in LPCSTR lpszNew
  1286. );
  1287. BOOLAPI FtpRenameFileW(
  1288. __in HINTERNET hConnect,
  1289. __in LPCWSTR lpszExisting,
  1290. __in LPCWSTR lpszNew
  1291. );
  1292. #ifdef UNICODE
  1293. #define FtpRenameFile FtpRenameFileW
  1294. #else
  1295. #define FtpRenameFile FtpRenameFileA
  1296. #endif // !UNICODE
  1297. INTERNETAPI_(HINTERNET) FtpOpenFileA(
  1298. __in HINTERNET hConnect,
  1299. __in LPCSTR lpszFileName,
  1300. __in DWORD dwAccess,
  1301. __in DWORD dwFlags,
  1302. __in __opt DWORD_PTR dwContext
  1303. );
  1304. INTERNETAPI_(HINTERNET) FtpOpenFileW(
  1305. __in HINTERNET hConnect,
  1306. __in LPCWSTR lpszFileName,
  1307. __in DWORD dwAccess,
  1308. __in DWORD dwFlags,
  1309. __in __opt DWORD_PTR dwContext
  1310. );
  1311. #ifdef UNICODE
  1312. #define FtpOpenFile FtpOpenFileW
  1313. #else
  1314. #define FtpOpenFile FtpOpenFileA
  1315. #endif // !UNICODE
  1316. BOOLAPI FtpCreateDirectoryA(
  1317. __in HINTERNET hConnect,
  1318. __in LPCSTR lpszDirectory
  1319. );
  1320. BOOLAPI FtpCreateDirectoryW(
  1321. __in HINTERNET hConnect,
  1322. __in LPCWSTR lpszDirectory
  1323. );
  1324. #ifdef UNICODE
  1325. #define FtpCreateDirectory FtpCreateDirectoryW
  1326. #else
  1327. #define FtpCreateDirectory FtpCreateDirectoryA
  1328. #endif // !UNICODE
  1329. BOOLAPI FtpRemoveDirectoryA(
  1330. __in HINTERNET hConnect,
  1331. __in LPCSTR lpszDirectory
  1332. );
  1333. BOOLAPI FtpRemoveDirectoryW(
  1334. __in HINTERNET hConnect,
  1335. __in LPCWSTR lpszDirectory
  1336. );
  1337. #ifdef UNICODE
  1338. #define FtpRemoveDirectory FtpRemoveDirectoryW
  1339. #else
  1340. #define FtpRemoveDirectory FtpRemoveDirectoryA
  1341. #endif // !UNICODE
  1342. BOOLAPI FtpSetCurrentDirectoryA(
  1343. __in HINTERNET hConnect,
  1344. __in LPCSTR lpszDirectory
  1345. );
  1346. BOOLAPI FtpSetCurrentDirectoryW(
  1347. __in HINTERNET hConnect,
  1348. __in LPCWSTR lpszDirectory
  1349. );
  1350. #ifdef UNICODE
  1351. #define FtpSetCurrentDirectory FtpSetCurrentDirectoryW
  1352. #else
  1353. #define FtpSetCurrentDirectory FtpSetCurrentDirectoryA
  1354. #endif // !UNICODE
  1355. BOOLAPI FtpGetCurrentDirectoryA(
  1356. __in HINTERNET hConnect,
  1357. __out_ecount(*lpdwCurrentDirectory) LPSTR lpszCurrentDirectory,
  1358. __inout LPDWORD lpdwCurrentDirectory
  1359. );
  1360. BOOLAPI FtpGetCurrentDirectoryW(
  1361. __in HINTERNET hConnect,
  1362. __out_ecount(*lpdwCurrentDirectory) LPWSTR lpszCurrentDirectory,
  1363. __inout LPDWORD lpdwCurrentDirectory
  1364. );
  1365. #ifdef UNICODE
  1366. #define FtpGetCurrentDirectory FtpGetCurrentDirectoryW
  1367. #else
  1368. #define FtpGetCurrentDirectory FtpGetCurrentDirectoryA
  1369. #endif // !UNICODE
  1370. BOOLAPI FtpCommandA(
  1371. __in HINTERNET hConnect,
  1372. __in BOOL fExpectResponse,
  1373. __in DWORD dwFlags,
  1374. __in LPCSTR lpszCommand,
  1375. __in __opt DWORD_PTR dwContext,
  1376. __out __opt HINTERNET *phFtpCommand
  1377. );
  1378. BOOLAPI FtpCommandW(
  1379. __in HINTERNET hConnect,
  1380. __in BOOL fExpectResponse,
  1381. __in DWORD dwFlags,
  1382. __in LPCWSTR lpszCommand,
  1383. __in __opt DWORD_PTR dwContext,
  1384. __out __opt HINTERNET *phFtpCommand
  1385. );
  1386. #ifdef UNICODE
  1387. #define FtpCommand FtpCommandW
  1388. #else
  1389. #define FtpCommand FtpCommandA
  1390. #endif // !UNICODE
  1391. INTERNETAPI_(DWORD) FtpGetFileSize(
  1392. __in HINTERNET hFile,
  1393. __out __opt LPDWORD lpdwFileSizeHigh
  1394. );
  1395. //
  1396. // Gopher
  1397. //
  1398. //
  1399. // manifests
  1400. //
  1401. //
  1402. // string field lengths (in characters, not bytes)
  1403. //
  1404. #define MAX_GOPHER_DISPLAY_TEXT 128
  1405. #define MAX_GOPHER_SELECTOR_TEXT 256
  1406. #define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH
  1407. #define MAX_GOPHER_LOCATOR_LENGTH (1 \
  1408. + MAX_GOPHER_DISPLAY_TEXT \
  1409. + 1 \
  1410. + MAX_GOPHER_SELECTOR_TEXT \
  1411. + 1 \
  1412. + MAX_GOPHER_HOST_NAME \
  1413. + 1 \
  1414. + INTERNET_MAX_PORT_NUMBER_LENGTH \
  1415. + 1 \
  1416. + 1 \
  1417. + 2 \
  1418. )
  1419. //
  1420. // structures/types
  1421. //
  1422. //
  1423. // GOPHER_FIND_DATA - returns the results of a GopherFindFirstFile()/
  1424. // InternetFindNextFile() request
  1425. //
  1426. typedef struct {
  1427. CHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
  1428. DWORD GopherType; // GOPHER_TYPE_, if known
  1429. DWORD SizeLow;
  1430. DWORD SizeHigh;
  1431. FILETIME LastModificationTime;
  1432. CHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
  1433. } GOPHER_FIND_DATAA, * LPGOPHER_FIND_DATAA;
  1434. typedef struct {
  1435. WCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
  1436. DWORD GopherType; // GOPHER_TYPE_, if known
  1437. DWORD SizeLow;
  1438. DWORD SizeHigh;
  1439. FILETIME LastModificationTime;
  1440. WCHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
  1441. } GOPHER_FIND_DATAW, * LPGOPHER_FIND_DATAW;
  1442. #ifdef UNICODE
  1443. typedef GOPHER_FIND_DATAW GOPHER_FIND_DATA;
  1444. typedef LPGOPHER_FIND_DATAW LPGOPHER_FIND_DATA;
  1445. #else
  1446. typedef GOPHER_FIND_DATAA GOPHER_FIND_DATA;
  1447. typedef LPGOPHER_FIND_DATAA LPGOPHER_FIND_DATA;
  1448. #endif // UNICODE
  1449. //
  1450. // manifests for GopherType
  1451. //
  1452. #define GOPHER_TYPE_TEXT_FILE 0x00000001
  1453. #define GOPHER_TYPE_DIRECTORY 0x00000002
  1454. #define GOPHER_TYPE_CSO 0x00000004
  1455. #define GOPHER_TYPE_ERROR 0x00000008
  1456. #define GOPHER_TYPE_MAC_BINHEX 0x00000010
  1457. #define GOPHER_TYPE_DOS_ARCHIVE 0x00000020
  1458. #define GOPHER_TYPE_UNIX_UUENCODED 0x00000040
  1459. #define GOPHER_TYPE_INDEX_SERVER 0x00000080
  1460. #define GOPHER_TYPE_TELNET 0x00000100
  1461. #define GOPHER_TYPE_BINARY 0x00000200
  1462. #define GOPHER_TYPE_REDUNDANT 0x00000400
  1463. #define GOPHER_TYPE_TN3270 0x00000800
  1464. #define GOPHER_TYPE_GIF 0x00001000
  1465. #define GOPHER_TYPE_IMAGE 0x00002000
  1466. #define GOPHER_TYPE_BITMAP 0x00004000
  1467. #define GOPHER_TYPE_MOVIE 0x00008000
  1468. #define GOPHER_TYPE_SOUND 0x00010000
  1469. #define GOPHER_TYPE_HTML 0x00020000
  1470. #define GOPHER_TYPE_PDF 0x00040000
  1471. #define GOPHER_TYPE_CALENDAR 0x00080000
  1472. #define GOPHER_TYPE_INLINE 0x00100000
  1473. #define GOPHER_TYPE_UNKNOWN 0x20000000
  1474. #define GOPHER_TYPE_ASK 0x40000000
  1475. #define GOPHER_TYPE_GOPHER_PLUS 0x80000000
  1476. //
  1477. // gopher type macros
  1478. //
  1479. #define IS_GOPHER_FILE(type) (BOOL)(((type) & GOPHER_TYPE_FILE_MASK) ? TRUE : FALSE)
  1480. #define IS_GOPHER_DIRECTORY(type) (BOOL)(((type) & GOPHER_TYPE_DIRECTORY) ? TRUE : FALSE)
  1481. #define IS_GOPHER_PHONE_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_CSO) ? TRUE : FALSE)
  1482. #define IS_GOPHER_ERROR(type) (BOOL)(((type) & GOPHER_TYPE_ERROR) ? TRUE : FALSE)
  1483. #define IS_GOPHER_INDEX_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_INDEX_SERVER) ? TRUE : FALSE)
  1484. #define IS_GOPHER_TELNET_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TELNET) ? TRUE : FALSE)
  1485. #define IS_GOPHER_BACKUP_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_REDUNDANT) ? TRUE : FALSE)
  1486. #define IS_GOPHER_TN3270_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TN3270) ? TRUE : FALSE)
  1487. #define IS_GOPHER_ASK(type) (BOOL)(((type) & GOPHER_TYPE_ASK) ? TRUE : FALSE)
  1488. #define IS_GOPHER_PLUS(type) (BOOL)(((type) & GOPHER_TYPE_GOPHER_PLUS) ? TRUE : FALSE)
  1489. #define IS_GOPHER_TYPE_KNOWN(type) (BOOL)(((type) & GOPHER_TYPE_UNKNOWN) ? FALSE : TRUE)
  1490. //
  1491. // GOPHER_TYPE_FILE_MASK - use this to determine if a locator identifies a
  1492. // (known) file type
  1493. //
  1494. #define GOPHER_TYPE_FILE_MASK (GOPHER_TYPE_TEXT_FILE \
  1495. | GOPHER_TYPE_MAC_BINHEX \
  1496. | GOPHER_TYPE_DOS_ARCHIVE \
  1497. | GOPHER_TYPE_UNIX_UUENCODED \
  1498. | GOPHER_TYPE_BINARY \
  1499. | GOPHER_TYPE_GIF \
  1500. | GOPHER_TYPE_IMAGE \
  1501. | GOPHER_TYPE_BITMAP \
  1502. | GOPHER_TYPE_MOVIE \
  1503. | GOPHER_TYPE_SOUND \
  1504. | GOPHER_TYPE_HTML \
  1505. | GOPHER_TYPE_PDF \
  1506. | GOPHER_TYPE_CALENDAR \
  1507. | GOPHER_TYPE_INLINE \
  1508. )
  1509. //
  1510. // structured gopher attributes (as defined in gopher+ protocol document)
  1511. //
  1512. typedef struct {
  1513. LPCTSTR Comment;
  1514. LPCTSTR EmailAddress;
  1515. } GOPHER_ADMIN_ATTRIBUTE_TYPE, * LPGOPHER_ADMIN_ATTRIBUTE_TYPE;
  1516. typedef struct {
  1517. FILETIME DateAndTime;
  1518. } GOPHER_MOD_DATE_ATTRIBUTE_TYPE, * LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE;
  1519. typedef struct {
  1520. DWORD Ttl;
  1521. } GOPHER_TTL_ATTRIBUTE_TYPE, * LPGOPHER_TTL_ATTRIBUTE_TYPE;
  1522. typedef struct {
  1523. INT Score;
  1524. } GOPHER_SCORE_ATTRIBUTE_TYPE, * LPGOPHER_SCORE_ATTRIBUTE_TYPE;
  1525. typedef struct {
  1526. INT LowerBound;
  1527. INT UpperBound;
  1528. } GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, * LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
  1529. typedef struct {
  1530. LPCTSTR Site;
  1531. } GOPHER_SITE_ATTRIBUTE_TYPE, * LPGOPHER_SITE_ATTRIBUTE_TYPE;
  1532. typedef struct {
  1533. LPCTSTR Organization;
  1534. } GOPHER_ORGANIZATION_ATTRIBUTE_TYPE, * LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
  1535. typedef struct {
  1536. LPCTSTR Location;
  1537. } GOPHER_LOCATION_ATTRIBUTE_TYPE, * LPGOPHER_LOCATION_ATTRIBUTE_TYPE;
  1538. typedef struct {
  1539. INT DegreesNorth;
  1540. INT MinutesNorth;
  1541. INT SecondsNorth;
  1542. INT DegreesEast;
  1543. INT MinutesEast;
  1544. INT SecondsEast;
  1545. } GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, * LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
  1546. typedef struct {
  1547. INT Zone;
  1548. } GOPHER_TIMEZONE_ATTRIBUTE_TYPE, * LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE;
  1549. typedef struct {
  1550. LPCTSTR Provider;
  1551. } GOPHER_PROVIDER_ATTRIBUTE_TYPE, * LPGOPHER_PROVIDER_ATTRIBUTE_TYPE;
  1552. typedef struct {
  1553. LPCTSTR Version;
  1554. } GOPHER_VERSION_ATTRIBUTE_TYPE, * LPGOPHER_VERSION_ATTRIBUTE_TYPE;
  1555. typedef struct {
  1556. LPCTSTR ShortAbstract;
  1557. LPCTSTR AbstractFile;
  1558. } GOPHER_ABSTRACT_ATTRIBUTE_TYPE, * LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE;
  1559. typedef struct {
  1560. LPCTSTR ContentType;
  1561. LPCTSTR Language;
  1562. DWORD Size;
  1563. } GOPHER_VIEW_ATTRIBUTE_TYPE, * LPGOPHER_VIEW_ATTRIBUTE_TYPE;
  1564. typedef struct {
  1565. BOOL TreeWalk;
  1566. } GOPHER_VERONICA_ATTRIBUTE_TYPE, * LPGOPHER_VERONICA_ATTRIBUTE_TYPE;
  1567. typedef struct {
  1568. LPCTSTR QuestionType;
  1569. LPCTSTR QuestionText;
  1570. } GOPHER_ASK_ATTRIBUTE_TYPE, * LPGOPHER_ASK_ATTRIBUTE_TYPE;
  1571. //
  1572. // GOPHER_UNKNOWN_ATTRIBUTE_TYPE - this is returned if we retrieve an attribute
  1573. // that is not specified in the current gopher/gopher+ documentation. It is up
  1574. // to the application to parse the information
  1575. //
  1576. typedef struct {
  1577. LPCTSTR Text;
  1578. } GOPHER_UNKNOWN_ATTRIBUTE_TYPE, * LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE;
  1579. //
  1580. // GOPHER_ATTRIBUTE_TYPE - returned in the user's buffer when an enumerated
  1581. // GopherGetAttribute call is made
  1582. //
  1583. typedef struct {
  1584. DWORD CategoryId; // e.g. GOPHER_CATEGORY_ID_ADMIN
  1585. DWORD AttributeId; // e.g. GOPHER_ATTRIBUTE_ID_ADMIN
  1586. union {
  1587. GOPHER_ADMIN_ATTRIBUTE_TYPE Admin;
  1588. GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate;
  1589. GOPHER_TTL_ATTRIBUTE_TYPE Ttl;
  1590. GOPHER_SCORE_ATTRIBUTE_TYPE Score;
  1591. GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange;
  1592. GOPHER_SITE_ATTRIBUTE_TYPE Site;
  1593. GOPHER_ORGANIZATION_ATTRIBUTE_TYPE Organization;
  1594. GOPHER_LOCATION_ATTRIBUTE_TYPE Location;
  1595. GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
  1596. GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone;
  1597. GOPHER_PROVIDER_ATTRIBUTE_TYPE Provider;
  1598. GOPHER_VERSION_ATTRIBUTE_TYPE Version;
  1599. GOPHER_ABSTRACT_ATTRIBUTE_TYPE Abstract;
  1600. GOPHER_VIEW_ATTRIBUTE_TYPE View;
  1601. GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica;
  1602. GOPHER_ASK_ATTRIBUTE_TYPE Ask;
  1603. GOPHER_UNKNOWN_ATTRIBUTE_TYPE Unknown;
  1604. } AttributeType;
  1605. } GOPHER_ATTRIBUTE_TYPE, * LPGOPHER_ATTRIBUTE_TYPE;
  1606. #define MAX_GOPHER_CATEGORY_NAME 128 // arbitrary
  1607. #define MAX_GOPHER_ATTRIBUTE_NAME 128 // "
  1608. #define MIN_GOPHER_ATTRIBUTE_LENGTH 256 // "
  1609. //
  1610. // known gopher attribute categories. See below for ordinals
  1611. //
  1612. #define GOPHER_INFO_CATEGORY TEXT("+INFO")
  1613. #define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN")
  1614. #define GOPHER_VIEWS_CATEGORY TEXT("+VIEWS")
  1615. #define GOPHER_ABSTRACT_CATEGORY TEXT("+ABSTRACT")
  1616. #define GOPHER_VERONICA_CATEGORY TEXT("+VERONICA")
  1617. //
  1618. // known gopher attributes. These are the attribute names as defined in the
  1619. // gopher+ protocol document
  1620. //
  1621. #define GOPHER_ADMIN_ATTRIBUTE TEXT("Admin")
  1622. #define GOPHER_MOD_DATE_ATTRIBUTE TEXT("Mod-Date")
  1623. #define GOPHER_TTL_ATTRIBUTE TEXT("TTL")
  1624. #define GOPHER_SCORE_ATTRIBUTE TEXT("Score")
  1625. #define GOPHER_RANGE_ATTRIBUTE TEXT("Score-range")
  1626. #define GOPHER_SITE_ATTRIBUTE TEXT("Site")
  1627. #define GOPHER_ORG_ATTRIBUTE TEXT("Org")
  1628. #define GOPHER_LOCATION_ATTRIBUTE TEXT("Loc")
  1629. #define GOPHER_GEOG_ATTRIBUTE TEXT("Geog")
  1630. #define GOPHER_TIMEZONE_ATTRIBUTE TEXT("TZ")
  1631. #define GOPHER_PROVIDER_ATTRIBUTE TEXT("Provider")
  1632. #define GOPHER_VERSION_ATTRIBUTE TEXT("Version")
  1633. #define GOPHER_ABSTRACT_ATTRIBUTE TEXT("Abstract")
  1634. #define GOPHER_VIEW_ATTRIBUTE TEXT("View")
  1635. #define GOPHER_TREEWALK_ATTRIBUTE TEXT("treewalk")
  1636. //
  1637. // identifiers for attribute strings
  1638. //
  1639. #define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00
  1640. #define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 1)
  1641. #define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE + 2)
  1642. #define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 3)
  1643. #define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE + 4)
  1644. #define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 5)
  1645. #define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE + 6)
  1646. #define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE + 7)
  1647. #define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 8)
  1648. #define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 9)
  1649. #define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 10)
  1650. #define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE + 11)
  1651. #define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE + 12)
  1652. #define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE + 13)
  1653. #define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE + 14)
  1654. #define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE + 15)
  1655. #define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE + 16)
  1656. #define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE + 17)
  1657. #define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE + 18)
  1658. #define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE + 19)
  1659. #define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE + 20)
  1660. #define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE + 21)
  1661. #define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 22)
  1662. #define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE + 23)
  1663. #define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24)
  1664. #define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25)
  1665. //
  1666. // prototypes
  1667. //
  1668. BOOLAPI GopherCreateLocatorA(
  1669. __in LPCSTR lpszHost,
  1670. __in INTERNET_PORT nServerPort,
  1671. __in __opt LPCSTR lpszDisplayString,
  1672. __in __opt LPCSTR lpszSelectorString,
  1673. __in DWORD dwGopherType,
  1674. __out_ecount(*lpdwBufferLength) __opt LPSTR lpszLocator,
  1675. __inout LPDWORD lpdwBufferLength
  1676. );
  1677. BOOLAPI GopherCreateLocatorW(
  1678. __in LPCWSTR lpszHost,
  1679. __in INTERNET_PORT nServerPort,
  1680. __in __opt LPCWSTR lpszDisplayString,
  1681. __in __opt LPCWSTR lpszSelectorString,
  1682. __in DWORD dwGopherType,
  1683. __out_ecount(*lpdwBufferLength) __opt LPWSTR lpszLocator,
  1684. __inout LPDWORD lpdwBufferLength
  1685. );
  1686. #ifdef UNICODE
  1687. #define GopherCreateLocator GopherCreateLocatorW
  1688. #else
  1689. #define GopherCreateLocator GopherCreateLocatorA
  1690. #endif // !UNICODE
  1691. BOOLAPI GopherGetLocatorTypeA(
  1692. __in LPCSTR lpszLocator,
  1693. __out LPDWORD lpdwGopherType
  1694. );
  1695. BOOLAPI GopherGetLocatorTypeW(
  1696. __in LPCWSTR lpszLocator,
  1697. __out LPDWORD lpdwGopherType
  1698. );
  1699. #ifdef UNICODE
  1700. #define GopherGetLocatorType GopherGetLocatorTypeW
  1701. #else
  1702. #define GopherGetLocatorType GopherGetLocatorTypeA
  1703. #endif // !UNICODE
  1704. INTERNETAPI_(HINTERNET) GopherFindFirstFileA(
  1705. __in HINTERNET hConnect,
  1706. __in __opt LPCSTR lpszLocator,
  1707. __in __opt LPCSTR lpszSearchString,
  1708. __out __opt LPGOPHER_FIND_DATAA lpFindData,
  1709. __in DWORD dwFlags,
  1710. __in __opt DWORD_PTR dwContext
  1711. );
  1712. INTERNETAPI_(HINTERNET) GopherFindFirstFileW(
  1713. __in HINTERNET hConnect,
  1714. __in __opt LPCWSTR lpszLocator,
  1715. __in __opt LPCWSTR lpszSearchString,
  1716. __out __opt LPGOPHER_FIND_DATAW lpFindData,
  1717. __in DWORD dwFlags,
  1718. __in __opt DWORD_PTR dwContext
  1719. );
  1720. #ifdef UNICODE
  1721. #define GopherFindFirstFile GopherFindFirstFileW
  1722. #else
  1723. #define GopherFindFirstFile GopherFindFirstFileA
  1724. #endif // !UNICODE
  1725. INTERNETAPI_(HINTERNET) GopherOpenFileA(
  1726. __in HINTERNET hConnect,
  1727. __in LPCSTR lpszLocator,
  1728. __in __opt LPCSTR lpszView,
  1729. __in DWORD dwFlags,
  1730. __in __opt DWORD_PTR dwContext
  1731. );
  1732. INTERNETAPI_(HINTERNET) GopherOpenFileW(
  1733. __in HINTERNET hConnect,
  1734. __in LPCWSTR lpszLocator,
  1735. __in __opt LPCWSTR lpszView,
  1736. __in DWORD dwFlags,
  1737. __in __opt DWORD_PTR dwContext
  1738. );
  1739. #ifdef UNICODE
  1740. #define GopherOpenFile GopherOpenFileW
  1741. #else
  1742. #define GopherOpenFile GopherOpenFileA
  1743. #endif // !UNICODE
  1744. typedef BOOL (CALLBACK * GOPHER_ATTRIBUTE_ENUMERATOR)(
  1745. __in LPGOPHER_ATTRIBUTE_TYPE lpAttributeInfo,
  1746. __in DWORD dwError
  1747. );
  1748. BOOLAPI GopherGetAttributeA(
  1749. __in HINTERNET hConnect,
  1750. __in LPCSTR lpszLocator,
  1751. __in __opt LPCSTR lpszAttributeName,
  1752. __out_ecount(dwBufferLength) __typefix(LPTSTR) LPBYTE lpBuffer,
  1753. __in DWORD dwBufferLength,
  1754. __out LPDWORD lpdwCharactersReturned,
  1755. __in __opt GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator,
  1756. __in __opt DWORD_PTR dwContext
  1757. );
  1758. BOOLAPI GopherGetAttributeW(
  1759. __in HINTERNET hConnect,
  1760. __in LPCWSTR lpszLocator,
  1761. __in __opt LPCWSTR lpszAttributeName,
  1762. __out_ecount(dwBufferLength) __typefix(LPTSTR) LPBYTE lpBuffer,
  1763. __in DWORD dwBufferLength,
  1764. __out LPDWORD lpdwCharactersReturned,
  1765. __in __opt GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator,
  1766. __in __opt DWORD_PTR dwContext
  1767. );
  1768. #ifdef UNICODE
  1769. #define GopherGetAttribute GopherGetAttributeW
  1770. #else
  1771. #define GopherGetAttribute GopherGetAttributeA
  1772. #endif // !UNICODE
  1773. //
  1774. // HTTP
  1775. //
  1776. //
  1777. // manifests
  1778. //
  1779. //
  1780. // the default major/minor HTTP version numbers
  1781. //
  1782. #define HTTP_MAJOR_VERSION 1
  1783. #define HTTP_MINOR_VERSION 0
  1784. #define HTTP_VERSIONA "HTTP/1.0"
  1785. #define HTTP_VERSIONW L"HTTP/1.0"
  1786. #ifdef UNICODE
  1787. #define HTTP_VERSION HTTP_VERSIONW
  1788. #else
  1789. #define HTTP_VERSION HTTP_VERSIONA
  1790. #endif
  1791. //
  1792. // HttpQueryInfo info levels. Generally, there is one info level
  1793. // for each potential RFC822/HTTP/MIME header that an HTTP server
  1794. // may send as part of a request response.
  1795. //
  1796. // The HTTP_QUERY_RAW_HEADERS info level is provided for clients
  1797. // that choose to perform their own header parsing.
  1798. //
  1799. #define HTTP_QUERY_MIME_VERSION 0
  1800. #define HTTP_QUERY_CONTENT_TYPE 1
  1801. #define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2
  1802. #define HTTP_QUERY_CONTENT_ID 3
  1803. #define HTTP_QUERY_CONTENT_DESCRIPTION 4
  1804. #define HTTP_QUERY_CONTENT_LENGTH 5
  1805. #define HTTP_QUERY_CONTENT_LANGUAGE 6
  1806. #define HTTP_QUERY_ALLOW 7
  1807. #define HTTP_QUERY_PUBLIC 8
  1808. #define HTTP_QUERY_DATE 9
  1809. #define HTTP_QUERY_EXPIRES 10
  1810. #define HTTP_QUERY_LAST_MODIFIED 11
  1811. #define HTTP_QUERY_MESSAGE_ID 12
  1812. #define HTTP_QUERY_URI 13
  1813. #define HTTP_QUERY_DERIVED_FROM 14
  1814. #define HTTP_QUERY_COST 15
  1815. #define HTTP_QUERY_LINK 16
  1816. #define HTTP_QUERY_PRAGMA 17
  1817. #define HTTP_QUERY_VERSION 18 // special: part of status line
  1818. #define HTTP_QUERY_STATUS_CODE 19 // special: part of status line
  1819. #define HTTP_QUERY_STATUS_TEXT 20 // special: part of status line
  1820. #define HTTP_QUERY_RAW_HEADERS 21 // special: all headers as ASCIIZ
  1821. #define HTTP_QUERY_RAW_HEADERS_CRLF 22 // special: all headers
  1822. #define HTTP_QUERY_CONNECTION 23
  1823. #define HTTP_QUERY_ACCEPT 24
  1824. #define HTTP_QUERY_ACCEPT_CHARSET 25
  1825. #define HTTP_QUERY_ACCEPT_ENCODING 26
  1826. #define HTTP_QUERY_ACCEPT_LANGUAGE 27
  1827. #define HTTP_QUERY_AUTHORIZATION 28
  1828. #define HTTP_QUERY_CONTENT_ENCODING 29
  1829. #define HTTP_QUERY_FORWARDED 30
  1830. #define HTTP_QUERY_FROM 31
  1831. #define HTTP_QUERY_IF_MODIFIED_SINCE 32
  1832. #define HTTP_QUERY_LOCATION 33
  1833. #define HTTP_QUERY_ORIG_URI 34
  1834. #define HTTP_QUERY_REFERER 35
  1835. #define HTTP_QUERY_RETRY_AFTER 36
  1836. #define HTTP_QUERY_SERVER 37
  1837. #define HTTP_QUERY_TITLE 38
  1838. #define HTTP_QUERY_USER_AGENT 39
  1839. #define HTTP_QUERY_WWW_AUTHENTICATE 40
  1840. #define HTTP_QUERY_PROXY_AUTHENTICATE 41
  1841. #define HTTP_QUERY_ACCEPT_RANGES 42
  1842. #define HTTP_QUERY_SET_COOKIE 43
  1843. #define HTTP_QUERY_COOKIE 44
  1844. #define HTTP_QUERY_REQUEST_METHOD 45 // special: GET/POST etc.
  1845. #define HTTP_QUERY_REFRESH 46
  1846. #define HTTP_QUERY_CONTENT_DISPOSITION 47
  1847. //
  1848. // HTTP 1.1 defined headers
  1849. //
  1850. #define HTTP_QUERY_AGE 48
  1851. #define HTTP_QUERY_CACHE_CONTROL 49
  1852. #define HTTP_QUERY_CONTENT_BASE 50
  1853. #define HTTP_QUERY_CONTENT_LOCATION 51
  1854. #define HTTP_QUERY_CONTENT_MD5 52
  1855. #define HTTP_QUERY_CONTENT_RANGE 53
  1856. #define HTTP_QUERY_ETAG 54
  1857. #define HTTP_QUERY_HOST 55
  1858. #define HTTP_QUERY_IF_MATCH 56
  1859. #define HTTP_QUERY_IF_NONE_MATCH 57
  1860. #define HTTP_QUERY_IF_RANGE 58
  1861. #define HTTP_QUERY_IF_UNMODIFIED_SINCE 59
  1862. #define HTTP_QUERY_MAX_FORWARDS 60
  1863. #define HTTP_QUERY_PROXY_AUTHORIZATION 61
  1864. #define HTTP_QUERY_RANGE 62
  1865. #define HTTP_QUERY_TRANSFER_ENCODING 63
  1866. #define HTTP_QUERY_UPGRADE 64
  1867. #define HTTP_QUERY_VARY 65
  1868. #define HTTP_QUERY_VIA 66
  1869. #define HTTP_QUERY_WARNING 67
  1870. #define HTTP_QUERY_EXPECT 68
  1871. #define HTTP_QUERY_PROXY_CONNECTION 69
  1872. #define HTTP_QUERY_UNLESS_MODIFIED_SINCE 70
  1873. #define HTTP_QUERY_ECHO_REQUEST 71
  1874. #define HTTP_QUERY_ECHO_REPLY 72
  1875. // These are the set of headers that should be added back to a request when
  1876. // re-doing a request after a RETRY_WITH response.
  1877. #define HTTP_QUERY_ECHO_HEADERS 73
  1878. #define HTTP_QUERY_ECHO_HEADERS_CRLF 74
  1879. #define HTTP_QUERY_PROXY_SUPPORT 75
  1880. #define HTTP_QUERY_AUTHENTICATION_INFO 76
  1881. #define HTTP_QUERY_PASSPORT_URLS 77
  1882. #define HTTP_QUERY_PASSPORT_CONFIG 78
  1883. #define HTTP_QUERY_MAX 78
  1884. //
  1885. // HTTP_QUERY_CUSTOM - if this special value is supplied as the dwInfoLevel
  1886. // parameter of HttpQueryInfo() then the lpBuffer parameter contains the name
  1887. // of the header we are to query
  1888. //
  1889. #define HTTP_QUERY_CUSTOM 65535
  1890. //
  1891. // HTTP_QUERY_FLAG_REQUEST_HEADERS - if this bit is set in the dwInfoLevel
  1892. // parameter of HttpQueryInfo() then the request headers will be queried for the
  1893. // request information
  1894. //
  1895. #define HTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000
  1896. //
  1897. // HTTP_QUERY_FLAG_SYSTEMTIME - if this bit is set in the dwInfoLevel parameter
  1898. // of HttpQueryInfo() AND the header being queried contains date information,
  1899. // e.g. the "Expires:" header then lpBuffer will contain a SYSTEMTIME structure
  1900. // containing the date and time information converted from the header string
  1901. //
  1902. #define HTTP_QUERY_FLAG_SYSTEMTIME 0x40000000
  1903. //
  1904. // HTTP_QUERY_FLAG_NUMBER - if this bit is set in the dwInfoLevel parameter of
  1905. // HttpQueryInfo(), then the value of the header will be converted to a number
  1906. // before being returned to the caller, if applicable
  1907. //
  1908. #define HTTP_QUERY_FLAG_NUMBER 0x20000000
  1909. //
  1910. // HTTP_QUERY_FLAG_COALESCE - combine the values from several headers of the
  1911. // same name into the output buffer
  1912. //
  1913. #define HTTP_QUERY_FLAG_COALESCE 0x10000000
  1914. #define HTTP_QUERY_MODIFIER_FLAGS_MASK (HTTP_QUERY_FLAG_REQUEST_HEADERS \
  1915. | HTTP_QUERY_FLAG_SYSTEMTIME \
  1916. | HTTP_QUERY_FLAG_NUMBER \
  1917. | HTTP_QUERY_FLAG_COALESCE \
  1918. )
  1919. #define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK)
  1920. //
  1921. // HTTP Response Status Codes:
  1922. //
  1923. #define HTTP_STATUS_CONTINUE 100 // OK to continue with request
  1924. #define HTTP_STATUS_SWITCH_PROTOCOLS 101 // server has switched protocols in upgrade header
  1925. #define HTTP_STATUS_OK 200 // request completed
  1926. #define HTTP_STATUS_CREATED 201 // object created, reason = new URI
  1927. #define HTTP_STATUS_ACCEPTED 202 // async completion (TBS)
  1928. #define HTTP_STATUS_PARTIAL 203 // partial completion
  1929. #define HTTP_STATUS_NO_CONTENT 204 // no info to return
  1930. #define HTTP_STATUS_RESET_CONTENT 205 // request completed, but clear form
  1931. #define HTTP_STATUS_PARTIAL_CONTENT 206 // partial GET furfilled
  1932. #define HTTP_STATUS_AMBIGUOUS 300 // server couldn't decide what to return
  1933. #define HTTP_STATUS_MOVED 301 // object permanently moved
  1934. #define HTTP_STATUS_REDIRECT 302 // object temporarily moved
  1935. #define HTTP_STATUS_REDIRECT_METHOD 303 // redirection w/ new access method
  1936. #define HTTP_STATUS_NOT_MODIFIED 304 // if-modified-since was not modified
  1937. #define HTTP_STATUS_USE_PROXY 305 // redirection to proxy, location header specifies proxy to use
  1938. #define HTTP_STATUS_REDIRECT_KEEP_VERB 307 // HTTP/1.1: keep same verb
  1939. #define HTTP_STATUS_BAD_REQUEST 400 // invalid syntax
  1940. #define HTTP_STATUS_DENIED 401 // access denied
  1941. #define HTTP_STATUS_PAYMENT_REQ 402 // payment required
  1942. #define HTTP_STATUS_FORBIDDEN 403 // request forbidden
  1943. #define HTTP_STATUS_NOT_FOUND 404 // object not found
  1944. #define HTTP_STATUS_BAD_METHOD 405 // method is not allowed
  1945. #define HTTP_STATUS_NONE_ACCEPTABLE 406 // no response acceptable to client found
  1946. #define HTTP_STATUS_PROXY_AUTH_REQ 407 // proxy authentication required
  1947. #define HTTP_STATUS_REQUEST_TIMEOUT 408 // server timed out waiting for request
  1948. #define HTTP_STATUS_CONFLICT 409 // user should resubmit with more info
  1949. #define HTTP_STATUS_GONE 410 // the resource is no longer available
  1950. #define HTTP_STATUS_LENGTH_REQUIRED 411 // the server refused to accept request w/o a length
  1951. #define HTTP_STATUS_PRECOND_FAILED 412 // precondition given in request failed
  1952. #define HTTP_STATUS_REQUEST_TOO_LARGE 413 // request entity was too large
  1953. #define HTTP_STATUS_URI_TOO_LONG 414 // request URI too long
  1954. #define HTTP_STATUS_UNSUPPORTED_MEDIA 415 // unsupported media type
  1955. #define HTTP_STATUS_RETRY_WITH 449 // retry after doing the appropriate action.
  1956. #define HTTP_STATUS_SERVER_ERROR 500 // internal server error
  1957. #define HTTP_STATUS_NOT_SUPPORTED 501 // required not supported
  1958. #define HTTP_STATUS_BAD_GATEWAY 502 // error response received from gateway
  1959. #define HTTP_STATUS_SERVICE_UNAVAIL 503 // temporarily overloaded
  1960. #define HTTP_STATUS_GATEWAY_TIMEOUT 504 // timed out waiting for gateway
  1961. #define HTTP_STATUS_VERSION_NOT_SUP 505 // HTTP version not supported
  1962. #define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE
  1963. #define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP
  1964. //
  1965. // prototypes
  1966. //
  1967. INTERNETAPI_(HINTERNET) HttpOpenRequestA(
  1968. __in HINTERNET hConnect,
  1969. __in __opt LPCSTR lpszVerb,
  1970. __in __opt LPCSTR lpszObjectName,
  1971. __in __opt LPCSTR lpszVersion,
  1972. __in __opt LPCSTR lpszReferrer,
  1973. __in __opt LPCSTR FAR * lplpszAcceptTypes,
  1974. __in DWORD dwFlags,
  1975. __in __opt DWORD_PTR dwContext
  1976. );
  1977. INTERNETAPI_(HINTERNET) HttpOpenRequestW(
  1978. __in HINTERNET hConnect,
  1979. __in __opt LPCWSTR lpszVerb,
  1980. __in __opt LPCWSTR lpszObjectName,
  1981. __in __opt LPCWSTR lpszVersion,
  1982. __in __opt LPCWSTR lpszReferrer,
  1983. __in __opt LPCWSTR FAR * lplpszAcceptTypes,
  1984. __in DWORD dwFlags,
  1985. __in __opt DWORD_PTR dwContext
  1986. );
  1987. #ifdef UNICODE
  1988. #define HttpOpenRequest HttpOpenRequestW
  1989. #else
  1990. #define HttpOpenRequest HttpOpenRequestA
  1991. #endif // !UNICODE
  1992. BOOLAPI HttpAddRequestHeadersA(
  1993. __in HINTERNET hRequest,
  1994. __in_ecount(dwHeadersLength) LPCSTR lpszHeaders,
  1995. __in DWORD dwHeadersLength,
  1996. __in DWORD dwModifiers
  1997. );
  1998. BOOLAPI HttpAddRequestHeadersW(
  1999. __in HINTERNET hRequest,
  2000. __in_ecount(dwHeadersLength) LPCWSTR lpszHeaders,
  2001. __in DWORD dwHeadersLength,
  2002. __in DWORD dwModifiers
  2003. );
  2004. #ifdef UNICODE
  2005. #define HttpAddRequestHeaders HttpAddRequestHeadersW
  2006. #else
  2007. #define HttpAddRequestHeaders HttpAddRequestHeadersA
  2008. #endif // !UNICODE
  2009. //
  2010. // values for dwModifiers parameter of HttpAddRequestHeaders()
  2011. //
  2012. #define HTTP_ADDREQ_INDEX_MASK 0x0000FFFF
  2013. #define HTTP_ADDREQ_FLAGS_MASK 0xFFFF0000
  2014. //
  2015. // HTTP_ADDREQ_FLAG_ADD_IF_NEW - the header will only be added if it doesn't
  2016. // already exist
  2017. //
  2018. #define HTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000
  2019. //
  2020. // HTTP_ADDREQ_FLAG_ADD - if HTTP_ADDREQ_FLAG_REPLACE is set but the header is
  2021. // not found then if this flag is set, the header is added anyway, so long as
  2022. // there is a valid header-value
  2023. //
  2024. #define HTTP_ADDREQ_FLAG_ADD 0x20000000
  2025. //
  2026. // HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g.
  2027. // "Accept: text/*" and "Accept: audio/*" with this flag results in a single
  2028. // header: "Accept: text/*, audio/*"
  2029. //
  2030. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000
  2031. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000
  2032. #define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
  2033. //
  2034. // HTTP_ADDREQ_FLAG_REPLACE - replaces the specified header. Only one header can
  2035. // be supplied in the buffer. If the header to be replaced is not the first
  2036. // in a list of headers with the same name, then the relative index should be
  2037. // supplied in the low 8 bits of the dwModifiers parameter. If the header-value
  2038. // part is missing, then the header is removed
  2039. //
  2040. #define HTTP_ADDREQ_FLAG_REPLACE 0x80000000
  2041. BOOLAPI HttpSendRequestA(
  2042. __in HINTERNET hRequest,
  2043. __in_ecount(dwHeadersLength) __opt LPCSTR lpszHeaders,
  2044. __in DWORD dwHeadersLength,
  2045. __in_bcount(dwOptionalLength) __opt LPVOID lpOptional,
  2046. __in DWORD dwOptionalLength
  2047. );
  2048. BOOLAPI HttpSendRequestW(
  2049. __in HINTERNET hRequest,
  2050. __in_ecount(dwHeadersLength) __opt LPCWSTR lpszHeaders,
  2051. __in DWORD dwHeadersLength,
  2052. __in_bcount(dwOptionalLength) __opt LPVOID lpOptional,
  2053. __in DWORD dwOptionalLength
  2054. );
  2055. #ifdef UNICODE
  2056. #define HttpSendRequest HttpSendRequestW
  2057. #else
  2058. #define HttpSendRequest HttpSendRequestA
  2059. #endif // !UNICODE
  2060. INTERNETAPI_(BOOL) HttpSendRequestExA(
  2061. __in HINTERNET hRequest,
  2062. __in __opt LPINTERNET_BUFFERSA lpBuffersIn,
  2063. __out __opt LPINTERNET_BUFFERSA lpBuffersOut,
  2064. __in DWORD dwFlags,
  2065. __in __opt DWORD_PTR dwContext
  2066. );
  2067. INTERNETAPI_(BOOL) HttpSendRequestExW(
  2068. __in HINTERNET hRequest,
  2069. __in __opt LPINTERNET_BUFFERSW lpBuffersIn,
  2070. __out __opt LPINTERNET_BUFFERSW lpBuffersOut,
  2071. __in DWORD dwFlags,
  2072. __in __opt DWORD_PTR dwContext
  2073. );
  2074. #ifdef UNICODE
  2075. #define HttpSendRequestEx HttpSendRequestExW
  2076. #else
  2077. #define HttpSendRequestEx HttpSendRequestExA
  2078. #endif // !UNICODE
  2079. //
  2080. // flags for HttpSendRequestEx(), HttpEndRequest()
  2081. //
  2082. #define HSR_ASYNC WININET_API_FLAG_ASYNC // force async
  2083. #define HSR_SYNC WININET_API_FLAG_SYNC // force sync
  2084. #define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT // use dwContext value
  2085. #define HSR_INITIATE 0x00000008 // iterative operation (completed by HttpEndRequest)
  2086. #define HSR_DOWNLOAD 0x00000010 // download to file
  2087. #define HSR_CHUNKED 0x00000020 // operation is send of chunked data
  2088. INTERNETAPI_(BOOL) HttpEndRequestA(
  2089. __in HINTERNET hRequest,
  2090. __out __opt LPINTERNET_BUFFERSA lpBuffersOut,
  2091. __in DWORD dwFlags,
  2092. __in __opt DWORD_PTR dwContext
  2093. );
  2094. INTERNETAPI_(BOOL) HttpEndRequestW(
  2095. __in HINTERNET hRequest,
  2096. __out __opt LPINTERNET_BUFFERSW lpBuffersOut,
  2097. __in DWORD dwFlags,
  2098. __in __opt DWORD_PTR dwContext
  2099. );
  2100. #ifdef UNICODE
  2101. #define HttpEndRequest HttpEndRequestW
  2102. #else
  2103. #define HttpEndRequest HttpEndRequestA
  2104. #endif // !UNICODE
  2105. BOOLAPI HttpQueryInfoA(
  2106. __in HINTERNET hRequest,
  2107. __in DWORD dwInfoLevel,
  2108. __inout_bcount(*lpdwBufferLength) __opt LPVOID lpBuffer,
  2109. __inout LPDWORD lpdwBufferLength,
  2110. __inout __opt LPDWORD lpdwIndex
  2111. );
  2112. BOOLAPI HttpQueryInfoW(
  2113. __in HINTERNET hRequest,
  2114. __in DWORD dwInfoLevel,
  2115. __inout_bcount(*lpdwBufferLength) __opt LPVOID lpBuffer,
  2116. __inout LPDWORD lpdwBufferLength,
  2117. __inout __opt LPDWORD lpdwIndex
  2118. );
  2119. #ifdef UNICODE
  2120. #define HttpQueryInfo HttpQueryInfoW
  2121. #else
  2122. #define HttpQueryInfo HttpQueryInfoA
  2123. #endif // !UNICODE
  2124. //
  2125. // Cookie APIs
  2126. //
  2127. #define INTERNET_COOKIE_IS_SECURE 0x01
  2128. #define INTERNET_COOKIE_IS_SESSION 0x02
  2129. #define INTERNET_COOKIE_THIRD_PARTY 0x10
  2130. #define INTERNET_COOKIE_PROMPT_REQUIRED 0x20
  2131. #define INTERNET_COOKIE_EVALUATE_P3P 0x40
  2132. #define INTERNET_COOKIE_APPLY_P3P 0x80
  2133. #define INTERNET_COOKIE_P3P_ENABLED 0x100
  2134. #define INTERNET_COOKIE_IS_RESTRICTED 0x200
  2135. #define INTERNET_COOKIE_IE6 0x400
  2136. #define INTERNET_COOKIE_IS_LEGACY 0x800
  2137. BOOLAPI InternetSetCookieA(
  2138. __in LPCSTR lpszUrl,
  2139. __in __opt LPCSTR lpszCookieName,
  2140. __in LPCSTR lpszCookieData
  2141. );
  2142. BOOLAPI InternetSetCookieW(
  2143. __in LPCWSTR lpszUrl,
  2144. __in __opt LPCWSTR lpszCookieName,
  2145. __in LPCWSTR lpszCookieData
  2146. );
  2147. #ifdef UNICODE
  2148. #define InternetSetCookie InternetSetCookieW
  2149. #else
  2150. #define InternetSetCookie InternetSetCookieA
  2151. #endif // !UNICODE
  2152. BOOLAPI InternetGetCookieA(
  2153. __in LPCSTR lpszUrl,
  2154. __in __opt LPCSTR lpszCookieName,
  2155. __out_ecount(*lpdwSize) __opt LPSTR lpCookieData,
  2156. __inout LPDWORD lpdwSize
  2157. );
  2158. BOOLAPI InternetGetCookieW(
  2159. __in LPCWSTR lpszUrl,
  2160. __in __opt LPCWSTR lpszCookieName,
  2161. __out_ecount(*lpdwSize) __opt LPWSTR lpCookieData,
  2162. __inout LPDWORD lpdwSize
  2163. );
  2164. #ifdef UNICODE
  2165. #define InternetGetCookie InternetGetCookieW
  2166. #else
  2167. #define InternetGetCookie InternetGetCookieA
  2168. #endif // !UNICODE
  2169. INTERNETAPI_(DWORD) InternetSetCookieExA(
  2170. __in LPCSTR lpszUrl,
  2171. __in __opt LPCSTR lpszCookieName,
  2172. __in LPCSTR lpszCookieData,
  2173. __in DWORD dwFlags,
  2174. __null DWORD_PTR dwReserved
  2175. );
  2176. INTERNETAPI_(DWORD) InternetSetCookieExW(
  2177. __in LPCWSTR lpszUrl,
  2178. __in __opt LPCWSTR lpszCookieName,
  2179. __in LPCWSTR lpszCookieData,
  2180. __in DWORD dwFlags,
  2181. __null DWORD_PTR dwReserved
  2182. );
  2183. #ifdef UNICODE
  2184. #define InternetSetCookieEx InternetSetCookieExW
  2185. #else
  2186. #define InternetSetCookieEx InternetSetCookieExA
  2187. #endif // !UNICODE
  2188. BOOLAPI InternetGetCookieExA(
  2189. __in LPCSTR pchURL,
  2190. __in __opt LPCSTR pchCookieName,
  2191. __in_ecount(*pcchCookieData) __opt LPSTR pchCookieData,
  2192. __inout __opt LPDWORD pcchCookieData,
  2193. __in DWORD dwFlags,
  2194. __null LPVOID lpReserved
  2195. );
  2196. BOOLAPI InternetGetCookieExW(
  2197. __in LPCWSTR pchURL,
  2198. __in __opt LPCWSTR pchCookieName,
  2199. __in_ecount(*pcchCookieData) __opt LPWSTR pchCookieData,
  2200. __inout __opt LPDWORD pcchCookieData,
  2201. __in DWORD dwFlags,
  2202. __null LPVOID lpReserved
  2203. );
  2204. #ifdef UNICODE
  2205. #define InternetGetCookieEx InternetGetCookieExW
  2206. #else
  2207. #define InternetGetCookieEx InternetGetCookieExA
  2208. #endif // !UNICODE
  2209. //
  2210. // offline browsing
  2211. //
  2212. INTERNETAPI_(DWORD) InternetAttemptConnect(
  2213. __null DWORD dwReserved
  2214. );
  2215. BOOLAPI InternetCheckConnectionA(
  2216. __in LPCSTR lpszUrl,
  2217. __in DWORD dwFlags,
  2218. __null DWORD dwReserved
  2219. );
  2220. BOOLAPI InternetCheckConnectionW(
  2221. __in LPCWSTR lpszUrl,
  2222. __in DWORD dwFlags,
  2223. __null DWORD dwReserved
  2224. );
  2225. #ifdef UNICODE
  2226. #define InternetCheckConnection InternetCheckConnectionW
  2227. #else
  2228. #define InternetCheckConnection InternetCheckConnectionA
  2229. #endif // !UNICODE
  2230. #define FLAG_ICC_FORCE_CONNECTION 0x00000001
  2231. //
  2232. // Internet UI
  2233. //
  2234. //
  2235. // InternetErrorDlg - Provides UI for certain Errors.
  2236. //
  2237. #define FLAGS_ERROR_UI_FILTER_FOR_ERRORS 0x01
  2238. #define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS 0x02
  2239. #define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA 0x04
  2240. #define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08
  2241. #define FLAGS_ERROR_UI_SERIALIZE_DIALOGS 0x10
  2242. //
  2243. // If SERIALIZE_DIALOGS flag set, client should implement thread-safe non-blocking callback...
  2244. //
  2245. DWORD InternetAuthNotifyCallback
  2246. (
  2247. DWORD_PTR dwContext, // as passed to InternetErrorDlg
  2248. DWORD dwReturn, // error code: success, resend, or cancel
  2249. LPVOID lpReserved // reserved: will be set to null
  2250. );
  2251. typedef DWORD (CALLBACK * PFN_AUTH_NOTIFY) (DWORD_PTR, DWORD, LPVOID);
  2252. //
  2253. // ... and last parameter of InternetErrorDlg should point to...
  2254. //
  2255. typedef struct
  2256. {
  2257. DWORD cbStruct; // size of this structure
  2258. DWORD dwOptions; // reserved: must set to 0
  2259. PFN_AUTH_NOTIFY pfnNotify; // notification callback to retry InternetErrorDlg
  2260. DWORD_PTR dwContext; // context to pass to to notification function
  2261. }
  2262. INTERNET_AUTH_NOTIFY_DATA;
  2263. INTERNETAPI_(BOOL) ResumeSuspendedDownload(
  2264. __in HINTERNET hRequest,
  2265. __in DWORD dwResultCode
  2266. );
  2267. INTERNETAPI_(DWORD) InternetErrorDlg(
  2268. __in HWND hWnd,
  2269. __inout HINTERNET hRequest,
  2270. __in DWORD dwError,
  2271. __in DWORD dwFlags,
  2272. __inout __opt LPVOID * lppvData
  2273. );
  2274. INTERNETAPI_(DWORD) InternetConfirmZoneCrossingA(
  2275. __in HWND hWnd,
  2276. __in LPSTR szUrlPrev,
  2277. __in LPSTR szUrlNew,
  2278. __in BOOL bPost
  2279. );
  2280. INTERNETAPI_(DWORD) InternetConfirmZoneCrossingW(
  2281. __in HWND hWnd,
  2282. __in LPWSTR szUrlPrev,
  2283. __in LPWSTR szUrlNew,
  2284. __in BOOL bPost
  2285. );
  2286. #ifdef UNICODE
  2287. #define InternetConfirmZoneCrossing InternetConfirmZoneCrossingW
  2288. #else
  2289. #ifdef _WINX32_
  2290. #define InternetConfirmZoneCrossing InternetConfirmZoneCrossingA
  2291. #else
  2292. INTERNETAPI_(DWORD) InternetConfirmZoneCrossing(
  2293. __in HWND hWnd,
  2294. __in LPSTR szUrlPrev,
  2295. __in LPSTR szUrlNew,
  2296. __in BOOL bPost
  2297. );
  2298. #endif // _WINX32_
  2299. #endif // !UNICODE
  2300. //#if !defined(_WINERROR_)
  2301. //
  2302. // Internet API error returns
  2303. //
  2304. #define INTERNET_ERROR_BASE 12000
  2305. #define ERROR_INTERNET_OUT_OF_HANDLES (INTERNET_ERROR_BASE + 1)
  2306. #define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE + 2)
  2307. #define ERROR_INTERNET_EXTENDED_ERROR (INTERNET_ERROR_BASE + 3)
  2308. #define ERROR_INTERNET_INTERNAL_ERROR (INTERNET_ERROR_BASE + 4)
  2309. #define ERROR_INTERNET_INVALID_URL (INTERNET_ERROR_BASE + 5)
  2310. #define ERROR_INTERNET_UNRECOGNIZED_SCHEME (INTERNET_ERROR_BASE + 6)
  2311. #define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE + 7)
  2312. #define ERROR_INTERNET_PROTOCOL_NOT_FOUND (INTERNET_ERROR_BASE + 8)
  2313. #define ERROR_INTERNET_INVALID_OPTION (INTERNET_ERROR_BASE + 9)
  2314. #define ERROR_INTERNET_BAD_OPTION_LENGTH (INTERNET_ERROR_BASE + 10)
  2315. #define ERROR_INTERNET_OPTION_NOT_SETTABLE (INTERNET_ERROR_BASE + 11)
  2316. #define ERROR_INTERNET_SHUTDOWN (INTERNET_ERROR_BASE + 12)
  2317. #define ERROR_INTERNET_INCORRECT_USER_NAME (INTERNET_ERROR_BASE + 13)
  2318. #define ERROR_INTERNET_INCORRECT_PASSWORD (INTERNET_ERROR_BASE + 14)
  2319. #define ERROR_INTERNET_LOGIN_FAILURE (INTERNET_ERROR_BASE + 15)
  2320. #define ERROR_INTERNET_INVALID_OPERATION (INTERNET_ERROR_BASE + 16)
  2321. #define ERROR_INTERNET_OPERATION_CANCELLED (INTERNET_ERROR_BASE + 17)
  2322. #define ERROR_INTERNET_INCORRECT_HANDLE_TYPE (INTERNET_ERROR_BASE + 18)
  2323. #define ERROR_INTERNET_INCORRECT_HANDLE_STATE (INTERNET_ERROR_BASE + 19)
  2324. #define ERROR_INTERNET_NOT_PROXY_REQUEST (INTERNET_ERROR_BASE + 20)
  2325. #define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE + 21)
  2326. #define ERROR_INTERNET_BAD_REGISTRY_PARAMETER (INTERNET_ERROR_BASE + 22)
  2327. #define ERROR_INTERNET_NO_DIRECT_ACCESS (INTERNET_ERROR_BASE + 23)
  2328. #define ERROR_INTERNET_NO_CONTEXT (INTERNET_ERROR_BASE + 24)
  2329. #define ERROR_INTERNET_NO_CALLBACK (INTERNET_ERROR_BASE + 25)
  2330. #define ERROR_INTERNET_REQUEST_PENDING (INTERNET_ERROR_BASE + 26)
  2331. #define ERROR_INTERNET_INCORRECT_FORMAT (INTERNET_ERROR_BASE + 27)
  2332. #define ERROR_INTERNET_ITEM_NOT_FOUND (INTERNET_ERROR_BASE + 28)
  2333. #define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE + 29)
  2334. #define ERROR_INTERNET_CONNECTION_ABORTED (INTERNET_ERROR_BASE + 30)
  2335. #define ERROR_INTERNET_CONNECTION_RESET (INTERNET_ERROR_BASE + 31)
  2336. #define ERROR_INTERNET_FORCE_RETRY (INTERNET_ERROR_BASE + 32)
  2337. #define ERROR_INTERNET_INVALID_PROXY_REQUEST (INTERNET_ERROR_BASE + 33)
  2338. #define ERROR_INTERNET_NEED_UI (INTERNET_ERROR_BASE + 34)
  2339. #define ERROR_INTERNET_HANDLE_EXISTS (INTERNET_ERROR_BASE + 36)
  2340. #define ERROR_INTERNET_SEC_CERT_DATE_INVALID (INTERNET_ERROR_BASE + 37)
  2341. #define ERROR_INTERNET_SEC_CERT_CN_INVALID (INTERNET_ERROR_BASE + 38)
  2342. #define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR (INTERNET_ERROR_BASE + 39)
  2343. #define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR (INTERNET_ERROR_BASE + 40)
  2344. #define ERROR_INTERNET_MIXED_SECURITY (INTERNET_ERROR_BASE + 41)
  2345. #define ERROR_INTERNET_CHG_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 42)
  2346. #define ERROR_INTERNET_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 43)
  2347. #define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (INTERNET_ERROR_BASE + 44)
  2348. #define ERROR_INTERNET_INVALID_CA (INTERNET_ERROR_BASE + 45)
  2349. #define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP (INTERNET_ERROR_BASE + 46)
  2350. #define ERROR_INTERNET_ASYNC_THREAD_FAILED (INTERNET_ERROR_BASE + 47)
  2351. #define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE (INTERNET_ERROR_BASE + 48)
  2352. #define ERROR_INTERNET_DIALOG_PENDING (INTERNET_ERROR_BASE + 49)
  2353. #define ERROR_INTERNET_RETRY_DIALOG (INTERNET_ERROR_BASE + 50)
  2354. #define ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR (INTERNET_ERROR_BASE + 52)
  2355. #define ERROR_INTERNET_INSERT_CDROM (INTERNET_ERROR_BASE + 53)
  2356. #define ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED (INTERNET_ERROR_BASE + 54)
  2357. #define ERROR_INTERNET_SEC_CERT_ERRORS (INTERNET_ERROR_BASE + 55)
  2358. #define ERROR_INTERNET_SEC_CERT_NO_REV (INTERNET_ERROR_BASE + 56)
  2359. #define ERROR_INTERNET_SEC_CERT_REV_FAILED (INTERNET_ERROR_BASE + 57)
  2360. //
  2361. // FTP API errors
  2362. //
  2363. #define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE + 110)
  2364. #define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE + 111)
  2365. #define ERROR_FTP_NO_PASSIVE_MODE (INTERNET_ERROR_BASE + 112)
  2366. //
  2367. // gopher API errors
  2368. //
  2369. #define ERROR_GOPHER_PROTOCOL_ERROR (INTERNET_ERROR_BASE + 130)
  2370. #define ERROR_GOPHER_NOT_FILE (INTERNET_ERROR_BASE + 131)
  2371. #define ERROR_GOPHER_DATA_ERROR (INTERNET_ERROR_BASE + 132)
  2372. #define ERROR_GOPHER_END_OF_DATA (INTERNET_ERROR_BASE + 133)
  2373. #define ERROR_GOPHER_INVALID_LOCATOR (INTERNET_ERROR_BASE + 134)
  2374. #define ERROR_GOPHER_INCORRECT_LOCATOR_TYPE (INTERNET_ERROR_BASE + 135)
  2375. #define ERROR_GOPHER_NOT_GOPHER_PLUS (INTERNET_ERROR_BASE + 136)
  2376. #define ERROR_GOPHER_ATTRIBUTE_NOT_FOUND (INTERNET_ERROR_BASE + 137)
  2377. #define ERROR_GOPHER_UNKNOWN_LOCATOR (INTERNET_ERROR_BASE + 138)
  2378. //
  2379. // HTTP API errors
  2380. //
  2381. #define ERROR_HTTP_HEADER_NOT_FOUND (INTERNET_ERROR_BASE + 150)
  2382. #define ERROR_HTTP_DOWNLEVEL_SERVER (INTERNET_ERROR_BASE + 151)
  2383. #define ERROR_HTTP_INVALID_SERVER_RESPONSE (INTERNET_ERROR_BASE + 152)
  2384. #define ERROR_HTTP_INVALID_HEADER (INTERNET_ERROR_BASE + 153)
  2385. #define ERROR_HTTP_INVALID_QUERY_REQUEST (INTERNET_ERROR_BASE + 154)
  2386. #define ERROR_HTTP_HEADER_ALREADY_EXISTS (INTERNET_ERROR_BASE + 155)
  2387. #define ERROR_HTTP_REDIRECT_FAILED (INTERNET_ERROR_BASE + 156)
  2388. #define ERROR_HTTP_NOT_REDIRECTED (INTERNET_ERROR_BASE + 160)
  2389. #define ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 161)
  2390. #define ERROR_HTTP_COOKIE_DECLINED (INTERNET_ERROR_BASE + 162)
  2391. #define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 168)
  2392. //
  2393. // additional Internet API error codes
  2394. //
  2395. #define ERROR_INTERNET_SECURITY_CHANNEL_ERROR (INTERNET_ERROR_BASE + 157)
  2396. #define ERROR_INTERNET_UNABLE_TO_CACHE_FILE (INTERNET_ERROR_BASE + 158)
  2397. #define ERROR_INTERNET_TCPIP_NOT_INSTALLED (INTERNET_ERROR_BASE + 159)
  2398. #define ERROR_INTERNET_DISCONNECTED (INTERNET_ERROR_BASE + 163)
  2399. #define ERROR_INTERNET_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 164)
  2400. #define ERROR_INTERNET_PROXY_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 165)
  2401. #define ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT (INTERNET_ERROR_BASE + 166)
  2402. #define ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT (INTERNET_ERROR_BASE + 167)
  2403. #define ERROR_INTERNET_SEC_INVALID_CERT (INTERNET_ERROR_BASE + 169)
  2404. #define ERROR_INTERNET_SEC_CERT_REVOKED (INTERNET_ERROR_BASE + 170)
  2405. // InternetAutodial specific errors
  2406. #define ERROR_INTERNET_FAILED_DUETOSECURITYCHECK (INTERNET_ERROR_BASE + 171)
  2407. #define ERROR_INTERNET_NOT_INITIALIZED (INTERNET_ERROR_BASE + 172)
  2408. #define ERROR_INTERNET_NEED_MSN_SSPI_PKG (INTERNET_ERROR_BASE + 173)
  2409. #define ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY (INTERNET_ERROR_BASE + 174)
  2410. #define INTERNET_ERROR_LAST ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY
  2411. //#endif // !defined(_WINERROR_)
  2412. //
  2413. // URLCACHE APIs
  2414. //
  2415. //
  2416. // datatype definitions.
  2417. //
  2418. //
  2419. // cache entry type flags.
  2420. //
  2421. #define NORMAL_CACHE_ENTRY 0x00000001
  2422. #define STICKY_CACHE_ENTRY 0x00000004
  2423. #define EDITED_CACHE_ENTRY 0x00000008
  2424. #define TRACK_OFFLINE_CACHE_ENTRY 0x00000010
  2425. #define TRACK_ONLINE_CACHE_ENTRY 0x00000020
  2426. #define SPARSE_CACHE_ENTRY 0x00010000
  2427. #define COOKIE_CACHE_ENTRY 0x00100000
  2428. #define URLHISTORY_CACHE_ENTRY 0x00200000
  2429. #define URLCACHE_FIND_DEFAULT_FILTER NORMAL_CACHE_ENTRY \
  2430. | COOKIE_CACHE_ENTRY \
  2431. | URLHISTORY_CACHE_ENTRY \
  2432. | TRACK_OFFLINE_CACHE_ENTRY \
  2433. | TRACK_ONLINE_CACHE_ENTRY \
  2434. | STICKY_CACHE_ENTRY
  2435. //
  2436. // INTERNET_CACHE_ENTRY_INFO -
  2437. //
  2438. #if _MSC_VER >= 1200
  2439. #pragma warning(push)
  2440. #endif
  2441. #pragma warning(disable:4201)
  2442. typedef struct _INTERNET_CACHE_ENTRY_INFOA {
  2443. DWORD dwStructSize; // version of cache system.
  2444. LPSTR lpszSourceUrlName; // embedded pointer to the URL name string.
  2445. LPSTR lpszLocalFileName; // embedded pointer to the local file name.
  2446. DWORD CacheEntryType; // cache type bit mask.
  2447. DWORD dwUseCount; // current users count of the cache entry.
  2448. DWORD dwHitRate; // num of times the cache entry was retrieved.
  2449. DWORD dwSizeLow; // low DWORD of the file size.
  2450. DWORD dwSizeHigh; // high DWORD of the file size.
  2451. FILETIME LastModifiedTime; // last modified time of the file in GMT format.
  2452. FILETIME ExpireTime; // expire time of the file in GMT format
  2453. FILETIME LastAccessTime; // last accessed time in GMT format
  2454. FILETIME LastSyncTime; // last time the URL was synchronized
  2455. // with the source
  2456. LPSTR lpHeaderInfo; // embedded pointer to the header info.
  2457. DWORD dwHeaderInfoSize; // size of the above header.
  2458. LPSTR lpszFileExtension; // File extension used to retrive the urldata as a file.
  2459. union { // Exemption delta from last access time.
  2460. DWORD dwReserved;
  2461. DWORD dwExemptDelta;
  2462. }; // Exemption delta from last access
  2463. } INTERNET_CACHE_ENTRY_INFOA, * LPINTERNET_CACHE_ENTRY_INFOA;
  2464. typedef struct _INTERNET_CACHE_ENTRY_INFOW {
  2465. DWORD dwStructSize; // version of cache system.
  2466. LPWSTR lpszSourceUrlName; // embedded pointer to the URL name string.
  2467. LPWSTR lpszLocalFileName; // embedded pointer to the local file name.
  2468. DWORD CacheEntryType; // cache type bit mask.
  2469. DWORD dwUseCount; // current users count of the cache entry.
  2470. DWORD dwHitRate; // num of times the cache entry was retrieved.
  2471. DWORD dwSizeLow; // low DWORD of the file size.
  2472. DWORD dwSizeHigh; // high DWORD of the file size.
  2473. FILETIME LastModifiedTime; // last modified time of the file in GMT format.
  2474. FILETIME ExpireTime; // expire time of the file in GMT format
  2475. FILETIME LastAccessTime; // last accessed time in GMT format
  2476. FILETIME LastSyncTime; // last time the URL was synchronized
  2477. // with the source
  2478. LPWSTR lpHeaderInfo; // embedded pointer to the header info.
  2479. DWORD dwHeaderInfoSize; // size of the above header.
  2480. LPWSTR lpszFileExtension; // File extension used to retrive the urldata as a file.
  2481. union { // Exemption delta from last access time.
  2482. DWORD dwReserved;
  2483. DWORD dwExemptDelta;
  2484. }; // Exemption delta from last access
  2485. } INTERNET_CACHE_ENTRY_INFOW, * LPINTERNET_CACHE_ENTRY_INFOW;
  2486. #ifdef UNICODE
  2487. typedef INTERNET_CACHE_ENTRY_INFOW INTERNET_CACHE_ENTRY_INFO;
  2488. typedef LPINTERNET_CACHE_ENTRY_INFOW LPINTERNET_CACHE_ENTRY_INFO;
  2489. #else
  2490. typedef INTERNET_CACHE_ENTRY_INFOA INTERNET_CACHE_ENTRY_INFO;
  2491. typedef LPINTERNET_CACHE_ENTRY_INFOA LPINTERNET_CACHE_ENTRY_INFO;
  2492. #endif // UNICODE
  2493. #if _MSC_VER >= 1200
  2494. #pragma warning(pop)
  2495. #else
  2496. #pragma warning(default:4201)
  2497. #endif
  2498. typedef struct _INTERNET_CACHE_TIMESTAMPS {
  2499. FILETIME ftExpires;
  2500. FILETIME ftLastModified;
  2501. } INTERNET_CACHE_TIMESTAMPS, *LPINTERNET_CACHE_TIMESTAMPS;
  2502. //
  2503. // Cache Group
  2504. //
  2505. typedef LONGLONG GROUPID;
  2506. //
  2507. // Cache Group Flags
  2508. //
  2509. #define CACHEGROUP_ATTRIBUTE_GET_ALL 0xffffffff
  2510. #define CACHEGROUP_ATTRIBUTE_BASIC 0x00000001
  2511. #define CACHEGROUP_ATTRIBUTE_FLAG 0x00000002
  2512. #define CACHEGROUP_ATTRIBUTE_TYPE 0x00000004
  2513. #define CACHEGROUP_ATTRIBUTE_QUOTA 0x00000008
  2514. #define CACHEGROUP_ATTRIBUTE_GROUPNAME 0x00000010
  2515. #define CACHEGROUP_ATTRIBUTE_STORAGE 0x00000020
  2516. #define CACHEGROUP_FLAG_NONPURGEABLE 0x00000001
  2517. #define CACHEGROUP_FLAG_GIDONLY 0x00000004
  2518. #define CACHEGROUP_FLAG_FLUSHURL_ONDELETE 0x00000002
  2519. #define CACHEGROUP_SEARCH_ALL 0x00000000
  2520. #define CACHEGROUP_SEARCH_BYURL 0x00000001
  2521. #define CACHEGROUP_TYPE_INVALID 0x00000001
  2522. //
  2523. // updatable cache group fields
  2524. //
  2525. #define CACHEGROUP_READWRITE_MASK \
  2526. CACHEGROUP_ATTRIBUTE_TYPE \
  2527. | CACHEGROUP_ATTRIBUTE_QUOTA \
  2528. | CACHEGROUP_ATTRIBUTE_GROUPNAME \
  2529. | CACHEGROUP_ATTRIBUTE_STORAGE
  2530. //
  2531. // INTERNET_CACHE_GROUP_INFO
  2532. //
  2533. #define GROUPNAME_MAX_LENGTH 120
  2534. #define GROUP_OWNER_STORAGE_SIZE 4
  2535. typedef struct _INTERNET_CACHE_GROUP_INFOA {
  2536. DWORD dwGroupSize;
  2537. DWORD dwGroupFlags;
  2538. DWORD dwGroupType;
  2539. DWORD dwDiskUsage; // in KB
  2540. DWORD dwDiskQuota; // in KB
  2541. DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
  2542. CHAR szGroupName[GROUPNAME_MAX_LENGTH];
  2543. } INTERNET_CACHE_GROUP_INFOA, * LPINTERNET_CACHE_GROUP_INFOA;
  2544. typedef struct _INTERNET_CACHE_GROUP_INFOW {
  2545. DWORD dwGroupSize;
  2546. DWORD dwGroupFlags;
  2547. DWORD dwGroupType;
  2548. DWORD dwDiskUsage; // in KB
  2549. DWORD dwDiskQuota; // in KB
  2550. DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
  2551. WCHAR szGroupName[GROUPNAME_MAX_LENGTH];
  2552. } INTERNET_CACHE_GROUP_INFOW, * LPINTERNET_CACHE_GROUP_INFOW;
  2553. #ifdef UNICODE
  2554. typedef INTERNET_CACHE_GROUP_INFOW INTERNET_CACHE_GROUP_INFO;
  2555. typedef LPINTERNET_CACHE_GROUP_INFOW LPINTERNET_CACHE_GROUP_INFO;
  2556. #else
  2557. typedef INTERNET_CACHE_GROUP_INFOA INTERNET_CACHE_GROUP_INFO;
  2558. typedef LPINTERNET_CACHE_GROUP_INFOA LPINTERNET_CACHE_GROUP_INFO;
  2559. #endif // UNICODE
  2560. //
  2561. // Cache APIs
  2562. //
  2563. BOOLAPI CreateUrlCacheEntryA(
  2564. __in LPCSTR lpszUrlName,
  2565. __in DWORD dwExpectedFileSize,
  2566. __in __opt LPCSTR lpszFileExtension,
  2567. __out LPSTR lpszFileName,
  2568. __null DWORD dwReserved
  2569. );
  2570. BOOLAPI CreateUrlCacheEntryW(
  2571. __in LPCWSTR lpszUrlName,
  2572. __in DWORD dwExpectedFileSize,
  2573. __in __opt LPCWSTR lpszFileExtension,
  2574. __out LPWSTR lpszFileName,
  2575. __null DWORD dwReserved
  2576. );
  2577. #ifdef UNICODE
  2578. #define CreateUrlCacheEntry CreateUrlCacheEntryW
  2579. #else
  2580. #define CreateUrlCacheEntry CreateUrlCacheEntryA
  2581. #endif // !UNICODE
  2582. #ifndef USE_FIXED_COMMIT_URL_CACHE_ENTRY
  2583. // Temporary state of affairs until we reconcile our apis.
  2584. // Why are we doing this? HeaderInfo _should_ be string data.
  2585. // However, one group is passing binary data instead. For the
  2586. // unicode api, we've decided to disallow this, but this
  2587. // brings up an inconsistency between the u and a apis, which
  2588. // is undesirable.
  2589. // For Beta 1, we'll go with this behaviour, but in future releases
  2590. // we want to make these apis consistent.
  2591. BOOLAPI CommitUrlCacheEntryA(
  2592. __in LPCSTR lpszUrlName,
  2593. __in __opt LPCSTR lpszLocalFileName,
  2594. __in FILETIME ExpireTime,
  2595. __in FILETIME LastModifiedTime,
  2596. __in DWORD CacheEntryType,
  2597. __in_ecount(dwHeaderSize) __opt LPBYTE lpHeaderInfo,
  2598. __in __opt DWORD dwHeaderSize,
  2599. __null LPCSTR lpszFileExtension,
  2600. __in __opt LPCSTR lpszOriginalUrl
  2601. );
  2602. BOOLAPI CommitUrlCacheEntryW(
  2603. __in LPCWSTR lpszUrlName,
  2604. __in __opt LPCWSTR lpszLocalFileName,
  2605. __in FILETIME ExpireTime,
  2606. __in FILETIME LastModifiedTime,
  2607. __in DWORD CacheEntryType,
  2608. __in_ecount(dwHeaderSize) __opt LPWSTR lpHeaderInfo,
  2609. __in DWORD dwHeaderSize,
  2610. __null LPCWSTR lpszFileExtension,
  2611. __in __opt LPCWSTR lpszOriginalUrl
  2612. );
  2613. #ifdef UNICODE
  2614. #define CommitUrlCacheEntry CommitUrlCacheEntryW
  2615. #else
  2616. #define CommitUrlCacheEntry CommitUrlCacheEntryA
  2617. #endif
  2618. #else
  2619. CommitUrlCacheEntryA(
  2620. __in LPCSTR lpszUrlName,
  2621. __in __opt LPCSTR lpszLocalFileName,
  2622. __in FILETIME ExpireTime,
  2623. __in FILETIME LastModifiedTime,
  2624. __in DWORD CacheEntryType,
  2625. __in_ecount(dwHeaderSize) __opt LPCSTR lpHeaderInfo,
  2626. __in DWORD dwHeaderSize,
  2627. __null LPCSTR lpszFileExtension,
  2628. __in __opt LPCSTR lpszOriginalUrl
  2629. );
  2630. CommitUrlCacheEntryW(
  2631. __in LPCWSTR lpszUrlName,
  2632. __in __opt LPCWSTR lpszLocalFileName,
  2633. __in FILETIME ExpireTime,
  2634. __in FILETIME LastModifiedTime,
  2635. __in DWORD CacheEntryType,
  2636. __in_ecount(dwHeaderSize) __opt LPCWSTR lpHeaderInfo,
  2637. __in DWORD dwHeaderSize,
  2638. __null LPCWSTR lpszFileExtension,
  2639. __in __opt LPCWSTR lpszOriginalUrl
  2640. );
  2641. #ifdef UNICODE
  2642. #define CommitUrlCacheEntry CommitUrlCacheEntryW
  2643. #else
  2644. #define CommitUrlCacheEntry CommitUrlCacheEntryA
  2645. #endif // !UNICODE
  2646. #endif
  2647. BOOLAPI RetrieveUrlCacheEntryFileA(
  2648. __in LPCSTR lpszUrlName,
  2649. __out_bcount(*lpdwCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2650. __inout LPDWORD lpdwCacheEntryInfoBufferSize,
  2651. __null DWORD dwReserved
  2652. );
  2653. BOOLAPI RetrieveUrlCacheEntryFileW(
  2654. __in LPCWSTR lpszUrlName,
  2655. __out_bcount(*lpdwCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2656. __inout LPDWORD lpdwCacheEntryInfoBufferSize,
  2657. __null DWORD dwReserved
  2658. );
  2659. #ifdef UNICODE
  2660. #define RetrieveUrlCacheEntryFile RetrieveUrlCacheEntryFileW
  2661. #else
  2662. #define RetrieveUrlCacheEntryFile RetrieveUrlCacheEntryFileA
  2663. #endif // !UNICODE
  2664. BOOLAPI UnlockUrlCacheEntryFileA(
  2665. __in LPCSTR lpszUrlName,
  2666. __null DWORD dwReserved
  2667. );
  2668. BOOLAPI UnlockUrlCacheEntryFileW(
  2669. __in LPCWSTR lpszUrlName,
  2670. __null DWORD dwReserved
  2671. );
  2672. #ifdef UNICODE
  2673. #define UnlockUrlCacheEntryFile UnlockUrlCacheEntryFileW
  2674. #else
  2675. #ifdef _WINX32_
  2676. #define UnlockUrlCacheEntryFile UnlockUrlCacheEntryFileA
  2677. #else
  2678. BOOLAPI UnlockUrlCacheEntryFile(
  2679. __in LPCSTR lpszUrlName,
  2680. __null DWORD dwReserved
  2681. );
  2682. #endif // _WINX32_
  2683. #endif // !UNICODE
  2684. INTERNETAPI_(HANDLE) RetrieveUrlCacheEntryStreamA(
  2685. __in LPCSTR lpszUrlName,
  2686. __out_bcount(*lpdwCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2687. __inout LPDWORD lpdwCacheEntryInfoBufferSize,
  2688. __in BOOL fRandomRead,
  2689. __null DWORD dwReserved
  2690. );
  2691. INTERNETAPI_(HANDLE) RetrieveUrlCacheEntryStreamW(
  2692. __in LPCWSTR lpszUrlName,
  2693. __out_bcount(*lpdwCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2694. __inout LPDWORD lpdwCacheEntryInfoBufferSize,
  2695. __in BOOL fRandomRead,
  2696. __null DWORD dwReserved
  2697. );
  2698. #ifdef UNICODE
  2699. #define RetrieveUrlCacheEntryStream RetrieveUrlCacheEntryStreamW
  2700. #else
  2701. #define RetrieveUrlCacheEntryStream RetrieveUrlCacheEntryStreamA
  2702. #endif // !UNICODE
  2703. BOOLAPI ReadUrlCacheEntryStream(
  2704. __in HANDLE hUrlCacheStream,
  2705. __in DWORD dwLocation,
  2706. __out_bcount(*lpdwLen) LPVOID lpBuffer,
  2707. __inout LPDWORD lpdwLen,
  2708. __null DWORD Reserved
  2709. );
  2710. BOOLAPI UnlockUrlCacheEntryStream(
  2711. __in HANDLE hUrlCacheStream,
  2712. __null DWORD Reserved
  2713. );
  2714. URLCACHEAPI_(BOOL) GetUrlCacheEntryInfoA(
  2715. __in LPCSTR lpszUrlName,
  2716. __out_bcount(*lpdwCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2717. __inout __opt LPDWORD lpdwCacheEntryInfoBufferSize
  2718. );
  2719. URLCACHEAPI_(BOOL) GetUrlCacheEntryInfoW(
  2720. __in LPCWSTR lpszUrlName,
  2721. __out_bcount(*lpdwCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2722. __inout __opt LPDWORD lpdwCacheEntryInfoBufferSize
  2723. );
  2724. #ifdef UNICODE
  2725. #define GetUrlCacheEntryInfo GetUrlCacheEntryInfoW
  2726. #else
  2727. #define GetUrlCacheEntryInfo GetUrlCacheEntryInfoA
  2728. #endif // !UNICODE
  2729. URLCACHEAPI_(HANDLE) FindFirstUrlCacheGroup(
  2730. __in DWORD dwFlags,
  2731. __in DWORD dwFilter,
  2732. __null LPVOID lpSearchCondition,
  2733. __in DWORD dwSearchCondition,
  2734. __out GROUPID* lpGroupId,
  2735. __null LPVOID lpReserved
  2736. );
  2737. URLCACHEAPI_(BOOL) FindNextUrlCacheGroup(
  2738. __in HANDLE hFind,
  2739. __out GROUPID* lpGroupId,
  2740. __null LPVOID lpReserved
  2741. );
  2742. URLCACHEAPI_(BOOL) GetUrlCacheGroupAttributeA(
  2743. __in GROUPID gid,
  2744. __null DWORD dwFlags,
  2745. __in DWORD dwAttributes,
  2746. __out_bcount(*lpdwGroupInfo) LPINTERNET_CACHE_GROUP_INFOA lpGroupInfo,
  2747. __inout LPDWORD lpdwGroupInfo,
  2748. __null LPVOID lpReserved
  2749. );
  2750. URLCACHEAPI_(BOOL) GetUrlCacheGroupAttributeW(
  2751. __in GROUPID gid,
  2752. __null DWORD dwFlags,
  2753. __in DWORD dwAttributes,
  2754. __out_bcount(*lpdwGroupInfo) LPINTERNET_CACHE_GROUP_INFOW lpGroupInfo,
  2755. __inout LPDWORD lpdwGroupInfo,
  2756. __null LPVOID lpReserved
  2757. );
  2758. #ifdef UNICODE
  2759. #define GetUrlCacheGroupAttribute GetUrlCacheGroupAttributeW
  2760. #else
  2761. #define GetUrlCacheGroupAttribute GetUrlCacheGroupAttributeA
  2762. #endif // !UNICODE
  2763. URLCACHEAPI_(BOOL) SetUrlCacheGroupAttributeA(
  2764. __in GROUPID gid,
  2765. __null DWORD dwFlags,
  2766. __in DWORD dwAttributes,
  2767. __in LPINTERNET_CACHE_GROUP_INFOA lpGroupInfo,
  2768. __null LPVOID lpReserved
  2769. );
  2770. URLCACHEAPI_(BOOL) SetUrlCacheGroupAttributeW(
  2771. __in GROUPID gid,
  2772. __null DWORD dwFlags,
  2773. __in DWORD dwAttributes,
  2774. __in LPINTERNET_CACHE_GROUP_INFOW lpGroupInfo,
  2775. __null LPVOID lpReserved
  2776. );
  2777. #ifdef UNICODE
  2778. #define SetUrlCacheGroupAttribute SetUrlCacheGroupAttributeW
  2779. #else
  2780. #define SetUrlCacheGroupAttribute SetUrlCacheGroupAttributeA
  2781. #endif // !UNICODE
  2782. INTERNETAPI_(GROUPID) CreateUrlCacheGroup(
  2783. __in DWORD dwFlags,
  2784. __null LPVOID lpReserved
  2785. );
  2786. BOOLAPI DeleteUrlCacheGroup(
  2787. __in GROUPID GroupId,
  2788. __in DWORD dwFlags,
  2789. __null LPVOID lpReserved
  2790. );
  2791. BOOLAPI GetUrlCacheEntryInfoExA(
  2792. __in LPCSTR lpszUrl,
  2793. __out_bcount(*lpdwCacheEntryInfoBufSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2794. __inout __opt LPDWORD lpdwCacheEntryInfoBufSize,
  2795. __null LPSTR lpszReserved,
  2796. __null LPDWORD lpdwReserved,
  2797. __null LPVOID lpReserved,
  2798. __null DWORD dwFlags
  2799. );
  2800. BOOLAPI GetUrlCacheEntryInfoExW(
  2801. __in LPCWSTR lpszUrl,
  2802. __out_bcount(*lpdwCacheEntryInfoBufSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2803. __inout __opt LPDWORD lpdwCacheEntryInfoBufSize,
  2804. __null LPWSTR lpszReserved,
  2805. __null LPDWORD lpdwReserved,
  2806. __null LPVOID lpReserved,
  2807. __null DWORD dwFlags
  2808. );
  2809. #ifdef UNICODE
  2810. #define GetUrlCacheEntryInfoEx GetUrlCacheEntryInfoExW
  2811. #else
  2812. #define GetUrlCacheEntryInfoEx GetUrlCacheEntryInfoExA
  2813. #endif // !UNICODE
  2814. #define CACHE_ENTRY_ATTRIBUTE_FC 0x00000004
  2815. #define CACHE_ENTRY_HITRATE_FC 0x00000010
  2816. #define CACHE_ENTRY_MODTIME_FC 0x00000040
  2817. #define CACHE_ENTRY_EXPTIME_FC 0x00000080
  2818. #define CACHE_ENTRY_ACCTIME_FC 0x00000100
  2819. #define CACHE_ENTRY_SYNCTIME_FC 0x00000200
  2820. #define CACHE_ENTRY_HEADERINFO_FC 0x00000400
  2821. #define CACHE_ENTRY_EXEMPT_DELTA_FC 0x00000800
  2822. BOOLAPI SetUrlCacheEntryInfoA(
  2823. __in LPCSTR lpszUrlName,
  2824. __in LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2825. __in DWORD dwFieldControl
  2826. );
  2827. BOOLAPI SetUrlCacheEntryInfoW(
  2828. __in LPCWSTR lpszUrlName,
  2829. __in LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2830. __in DWORD dwFieldControl
  2831. );
  2832. #ifdef UNICODE
  2833. #define SetUrlCacheEntryInfo SetUrlCacheEntryInfoW
  2834. #else
  2835. #define SetUrlCacheEntryInfo SetUrlCacheEntryInfoA
  2836. #endif // !UNICODE
  2837. //
  2838. // Cache Group Functions
  2839. //
  2840. INTERNETAPI_(GROUPID) CreateUrlCacheGroup(
  2841. __in DWORD dwFlags,
  2842. __null LPVOID lpReserved // must pass NULL
  2843. );
  2844. BOOLAPI DeleteUrlCacheGroup(
  2845. __in GROUPID GroupId,
  2846. __in DWORD dwFlags, // must pass 0
  2847. __null LPVOID lpReserved // must pass NULL
  2848. );
  2849. // Flags for SetUrlCacheEntryGroup
  2850. #define INTERNET_CACHE_GROUP_ADD 0
  2851. #define INTERNET_CACHE_GROUP_REMOVE 1
  2852. BOOLAPI SetUrlCacheEntryGroupA(
  2853. __in LPCSTR lpszUrlName,
  2854. __in DWORD dwFlags,
  2855. __in GROUPID GroupId,
  2856. __null LPBYTE pbGroupAttributes, // must pass NULL
  2857. __null DWORD cbGroupAttributes, // must pass 0
  2858. __null LPVOID lpReserved // must pass NULL
  2859. );
  2860. BOOLAPI SetUrlCacheEntryGroupW(
  2861. __in LPCWSTR lpszUrlName,
  2862. __in DWORD dwFlags,
  2863. __in GROUPID GroupId,
  2864. __null LPBYTE pbGroupAttributes, // must pass NULL
  2865. __null DWORD cbGroupAttributes, // must pass 0
  2866. __null LPVOID lpReserved // must pass NULL
  2867. );
  2868. #ifdef UNICODE
  2869. #define SetUrlCacheEntryGroup SetUrlCacheEntryGroupW
  2870. #else
  2871. #ifdef _WINX32_
  2872. #define SetUrlCacheEntryGroup SetUrlCacheEntryGroupA
  2873. #else
  2874. BOOLAPI SetUrlCacheEntryGroup(
  2875. __in LPCSTR lpszUrlName,
  2876. __in DWORD dwFlags,
  2877. __in GROUPID GroupId,
  2878. __null LPBYTE pbGroupAttributes, // must pass NULL
  2879. __null DWORD cbGroupAttributes, // must pass 0
  2880. __null LPVOID lpReserved // must pass NULL
  2881. );
  2882. #endif // _WINX32_
  2883. #endif // !UNICODE
  2884. INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryExA(
  2885. __in __opt LPCSTR lpszUrlSearchPattern,
  2886. __in DWORD dwFlags,
  2887. __in DWORD dwFilter,
  2888. __in GROUPID GroupId,
  2889. __out_bcount(*lpdwFirstCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  2890. __inout LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  2891. __null LPVOID lpReserved, // must pass NULL
  2892. __null LPDWORD pcbReserved2, // must pass NULL
  2893. __null LPVOID lpReserved3 // must pass NULL
  2894. );
  2895. INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryExW(
  2896. __in __opt LPCWSTR lpszUrlSearchPattern,
  2897. __in DWORD dwFlags,
  2898. __in DWORD dwFilter,
  2899. __in GROUPID GroupId,
  2900. __out_bcount(*lpdwFirstCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  2901. __inout LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  2902. __null LPVOID lpReserved, // must pass NULL
  2903. __null LPDWORD pcbReserved2, // must pass NULL
  2904. __null LPVOID lpReserved3 // must pass NULL
  2905. );
  2906. #ifdef UNICODE
  2907. #define FindFirstUrlCacheEntryEx FindFirstUrlCacheEntryExW
  2908. #else
  2909. #define FindFirstUrlCacheEntryEx FindFirstUrlCacheEntryExA
  2910. #endif // !UNICODE
  2911. BOOLAPI FindNextUrlCacheEntryExA(
  2912. __in HANDLE hEnumHandle,
  2913. __out_bcount(lpdwFirstCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  2914. __inout LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  2915. __null LPVOID lpReserved, // must pass NULL
  2916. __null LPDWORD pcbReserved2, // must pass NULL
  2917. __null LPVOID lpReserved3 // must pass NULL
  2918. );
  2919. BOOLAPI FindNextUrlCacheEntryExW(
  2920. __in HANDLE hEnumHandle,
  2921. __out_bcount(lpdwFirstCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  2922. __inout LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  2923. __null LPVOID lpReserved, // must pass NULL
  2924. __null LPDWORD pcbReserved2, // must pass NULL
  2925. __null LPVOID lpReserved3 // must pass NULL
  2926. );
  2927. #ifdef UNICODE
  2928. #define FindNextUrlCacheEntryEx FindNextUrlCacheEntryExW
  2929. #else
  2930. #define FindNextUrlCacheEntryEx FindNextUrlCacheEntryExA
  2931. #endif // !UNICODE
  2932. INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryA(
  2933. __in __opt LPCSTR lpszUrlSearchPattern,
  2934. __out_bcount(*lpdwFirstCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  2935. __inout LPDWORD lpdwFirstCacheEntryInfoBufferSize
  2936. );
  2937. INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryW(
  2938. __in __opt LPCWSTR lpszUrlSearchPattern,
  2939. __out_bcount(*lpdwFirstCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  2940. __inout LPDWORD lpdwFirstCacheEntryInfoBufferSize
  2941. );
  2942. #ifdef UNICODE
  2943. #define FindFirstUrlCacheEntry FindFirstUrlCacheEntryW
  2944. #else
  2945. #define FindFirstUrlCacheEntry FindFirstUrlCacheEntryA
  2946. #endif // !UNICODE
  2947. BOOLAPI FindNextUrlCacheEntryA(
  2948. __in HANDLE hEnumHandle,
  2949. __out_bcount(*lpdwNextCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,
  2950. __inout LPDWORD lpdwNextCacheEntryInfoBufferSize
  2951. );
  2952. BOOLAPI FindNextUrlCacheEntryW(
  2953. __in HANDLE hEnumHandle,
  2954. __out_bcount(*lpdwNextCacheEntryInfoBufferSize) __opt LPINTERNET_CACHE_ENTRY_INFOW lpNextCacheEntryInfo,
  2955. __inout LPDWORD lpdwNextCacheEntryInfoBufferSize
  2956. );
  2957. #ifdef UNICODE
  2958. #define FindNextUrlCacheEntry FindNextUrlCacheEntryW
  2959. #else
  2960. #define FindNextUrlCacheEntry FindNextUrlCacheEntryA
  2961. #endif // !UNICODE
  2962. BOOLAPI FindCloseUrlCache(
  2963. __in HANDLE hEnumHandle
  2964. );
  2965. BOOLAPI DeleteUrlCacheEntryA(
  2966. __in LPCSTR lpszUrlName
  2967. );
  2968. BOOLAPI DeleteUrlCacheEntryW(
  2969. __in LPCWSTR lpszUrlName
  2970. );
  2971. #ifdef UNICODE
  2972. #define DeleteUrlCacheEntry DeleteUrlCacheEntryW
  2973. #else
  2974. #ifdef _WINX32_
  2975. #define DeleteUrlCacheEntry DeleteUrlCacheEntryA
  2976. #else
  2977. BOOLAPI DeleteUrlCacheEntry(
  2978. __in LPCSTR lpszUrlName
  2979. );
  2980. #endif // _WINX32_
  2981. #endif // !UNICODE
  2982. //
  2983. // Autodial APIs
  2984. //
  2985. INTERNETAPI_(DWORD) InternetDialA(
  2986. __in HWND hwndParent,
  2987. __in LPSTR lpszConnectoid,
  2988. __in DWORD dwFlags,
  2989. __out DWORD_PTR *lpdwConnection,
  2990. __null DWORD dwReserved
  2991. );
  2992. INTERNETAPI_(DWORD) InternetDialW(
  2993. __in HWND hwndParent,
  2994. __in LPWSTR lpszConnectoid,
  2995. __in DWORD dwFlags,
  2996. __out DWORD_PTR *lpdwConnection,
  2997. __null DWORD dwReserved
  2998. );
  2999. #ifdef UNICODE
  3000. #define InternetDial InternetDialW
  3001. #else
  3002. #ifdef _WINX32_
  3003. #define InternetDial InternetDialA
  3004. #else
  3005. INTERNETAPI_(DWORD) InternetDial(
  3006. __in HWND hwndParent,
  3007. __in LPSTR lpszConnectoid,
  3008. __in DWORD dwFlags,
  3009. __out LPDWORD lpdwConnection,
  3010. __null DWORD dwReserved
  3011. );
  3012. #endif // _WINX32_
  3013. #endif // !UNICODE
  3014. // Flags for InternetDial - must not conflict with InternetAutodial flags
  3015. // as they are valid here also.
  3016. #define INTERNET_DIAL_FORCE_PROMPT 0x2000
  3017. #define INTERNET_DIAL_SHOW_OFFLINE 0x4000
  3018. #define INTERNET_DIAL_UNATTENDED 0x8000
  3019. INTERNETAPI_(DWORD) InternetHangUp(
  3020. __in DWORD_PTR dwConnection,
  3021. __null DWORD dwReserved);
  3022. #define INTERENT_GOONLINE_REFRESH 0x00000001
  3023. #define INTERENT_GOONLINE_MASK 0x00000001
  3024. INTERNETAPI_(BOOL) InternetGoOnlineA(
  3025. __in LPSTR lpszURL,
  3026. __in HWND hwndParent,
  3027. __in DWORD dwFlags
  3028. );
  3029. INTERNETAPI_(BOOL) InternetGoOnlineW(
  3030. __in LPWSTR lpszURL,
  3031. __in HWND hwndParent,
  3032. __in DWORD dwFlags
  3033. );
  3034. #ifdef UNICODE
  3035. #define InternetGoOnline InternetGoOnlineW
  3036. #else
  3037. #ifdef _WINX32_
  3038. #define InternetGoOnline InternetGoOnlineA
  3039. #else
  3040. INTERNETAPI_(BOOL) InternetGoOnline(
  3041. __in LPSTR lpszURL,
  3042. __in HWND hwndParent,
  3043. __in DWORD dwFlags
  3044. );
  3045. #endif // _WINX32_
  3046. #endif // !UNICODE
  3047. INTERNETAPI_(BOOL) InternetAutodial(
  3048. __in DWORD dwFlags,
  3049. __in __opt HWND hwndParent);
  3050. // Flags for InternetAutodial
  3051. #define INTERNET_AUTODIAL_FORCE_ONLINE 1
  3052. #define INTERNET_AUTODIAL_FORCE_UNATTENDED 2
  3053. #define INTERNET_AUTODIAL_FAILIFSECURITYCHECK 4
  3054. #define INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT 8
  3055. #define INTERNET_AUTODIAL_FLAGS_MASK (INTERNET_AUTODIAL_FORCE_ONLINE | INTERNET_AUTODIAL_FORCE_UNATTENDED | INTERNET_AUTODIAL_FAILIFSECURITYCHECK | INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT)
  3056. INTERNETAPI_(BOOL) InternetAutodialHangup(
  3057. __null DWORD dwReserved);
  3058. INTERNETAPI_(BOOL) InternetGetConnectedState(
  3059. __out LPDWORD lpdwFlags,
  3060. __null DWORD dwReserved);
  3061. INTERNETAPI_(BOOL) InternetGetConnectedStateExA(
  3062. __out __opt LPDWORD lpdwFlags,
  3063. __out_ecount(dwNameLen) __opt LPSTR lpszConnectionName,
  3064. __in DWORD dwNameLen,
  3065. __null DWORD dwReserved
  3066. );
  3067. INTERNETAPI_(BOOL) InternetGetConnectedStateExW(
  3068. __out __opt LPDWORD lpdwFlags,
  3069. __out_ecount(dwNameLen) __opt LPWSTR lpszConnectionName,
  3070. __in DWORD dwNameLen,
  3071. __null DWORD dwReserved
  3072. );
  3073. INTERNETAPI_(BOOL) InternetInitializeAutoProxyDll(
  3074. __null DWORD dwReserved
  3075. );
  3076. INTERNETAPI_(BOOL) InternetDeInitializeAutoProxyDll(
  3077. __in LPSTR lpszMime,
  3078. __null DWORD dwReserved
  3079. );
  3080. INTERNETAPI_(BOOL) InternetGetProxyInfo(
  3081. __in_ecount(dwUrlLength) LPCSTR lpszUrl,
  3082. __in DWORD dwUrlLength,
  3083. __in_ecount(dwUrlHostNameLength) LPSTR lpszUrlHostName,
  3084. __in DWORD dwUrlHostNameLength,
  3085. __out LPSTR * lplpszProxyHostName,
  3086. __out LPDWORD lpdwProxyHostNameLength
  3087. );
  3088. INTERNETAPI_(BOOL) DetectAutoProxyUrl(
  3089. __out_ecount(dwAutoProxyUrlLength) LPSTR lpszAutoProxyUrl,
  3090. __in DWORD dwAutoProxyUrlLength,
  3091. __in DWORD dwDetectFlags
  3092. );
  3093. INTERNETAPI_(BOOL) CreateMD5SSOHash (
  3094. __in PWSTR pszChallengeInfo,
  3095. __in PWSTR pwszRealm,
  3096. __in PWSTR pwszTarget,
  3097. __out PBYTE pbHexHash
  3098. );
  3099. #ifdef UNICODE
  3100. #define InternetGetConnectedStateEx InternetGetConnectedStateExW
  3101. #else
  3102. #ifdef _WINX32_
  3103. #define InternetGetConnectedStateEx InternetGetConnectedStateExA
  3104. #else
  3105. INTERNETAPI_(BOOL) InternetGetConnectedStateEx(
  3106. __out LPDWORD lpdwFlags,
  3107. __out_ecount(dwNameLen) __opt LPSTR lpszConnectionName,
  3108. __in DWORD dwNameLen,
  3109. __null DWORD dwReserved
  3110. );
  3111. #endif // _WINX32_
  3112. #endif // !UNICODE
  3113. // Flags for InternetGetConnectedState and Ex
  3114. #define INTERNET_CONNECTION_MODEM 0x01
  3115. #define INTERNET_CONNECTION_LAN 0x02
  3116. #define INTERNET_CONNECTION_PROXY 0x04
  3117. #define INTERNET_CONNECTION_MODEM_BUSY 0x08 /* no longer used */
  3118. #define INTERNET_RAS_INSTALLED 0x10
  3119. #define INTERNET_CONNECTION_OFFLINE 0x20
  3120. #define INTERNET_CONNECTION_CONFIGURED 0x40
  3121. //
  3122. // Custom dial handler functions
  3123. //
  3124. // Custom dial handler prototype
  3125. typedef DWORD (CALLBACK * PFN_DIAL_HANDLER) (HWND, LPCSTR, DWORD, LPDWORD);
  3126. // Flags for custom dial handler
  3127. #define INTERNET_CUSTOMDIAL_CONNECT 0
  3128. #define INTERNET_CUSTOMDIAL_UNATTENDED 1
  3129. #define INTERNET_CUSTOMDIAL_DISCONNECT 2
  3130. #define INTERNET_CUSTOMDIAL_SHOWOFFLINE 4
  3131. // Custom dial handler supported functionality flags
  3132. #define INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED 1
  3133. #define INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE 2
  3134. #define INTERNET_CUSTOMDIAL_CAN_HANGUP 4
  3135. INTERNETAPI_(BOOL) InternetSetDialStateA(
  3136. __in LPCSTR lpszConnectoid,
  3137. __in DWORD dwState,
  3138. __null DWORD dwReserved
  3139. );
  3140. INTERNETAPI_(BOOL) InternetSetDialStateW(
  3141. __in LPCWSTR lpszConnectoid,
  3142. __in DWORD dwState,
  3143. __null DWORD dwReserved
  3144. );
  3145. #ifdef UNICODE
  3146. #define InternetSetDialState InternetSetDialStateW
  3147. #else
  3148. #ifdef _WINX32_
  3149. #define InternetSetDialState InternetSetDialStateA
  3150. #else
  3151. INTERNETAPI_(BOOL) InternetSetDialState(
  3152. __in LPCSTR lpszConnectoid,
  3153. __in DWORD dwState,
  3154. __null DWORD dwReserved
  3155. );
  3156. #endif // _WINX32_
  3157. #endif // !UNICODE
  3158. // States for InternetSetDialState
  3159. #define INTERNET_DIALSTATE_DISCONNECTED 1
  3160. INTERNETAPI_(BOOL) InternetSetPerSiteCookieDecisionA(
  3161. __in LPCSTR pchHostName,
  3162. __in DWORD dwDecision
  3163. );
  3164. INTERNETAPI_(BOOL) InternetSetPerSiteCookieDecisionW(
  3165. __in LPCWSTR pchHostName,
  3166. __in DWORD dwDecision
  3167. );
  3168. #ifdef UNICODE
  3169. #define InternetSetPerSiteCookieDecision InternetSetPerSiteCookieDecisionW
  3170. #else
  3171. #define InternetSetPerSiteCookieDecision InternetSetPerSiteCookieDecisionA
  3172. #endif // !UNICODE
  3173. INTERNETAPI_(BOOL) InternetGetPerSiteCookieDecisionA(
  3174. __in LPCSTR pchHostName,
  3175. __out unsigned long* pResult
  3176. );
  3177. INTERNETAPI_(BOOL) InternetGetPerSiteCookieDecisionW(
  3178. __in LPCWSTR pchHostName,
  3179. __out unsigned long* pResult
  3180. );
  3181. #ifdef UNICODE
  3182. #define InternetGetPerSiteCookieDecision InternetGetPerSiteCookieDecisionW
  3183. #else
  3184. #define InternetGetPerSiteCookieDecision InternetGetPerSiteCookieDecisionA
  3185. #endif // !UNICODE
  3186. INTERNETAPI_(BOOL) InternetClearAllPerSiteCookieDecisions();
  3187. INTERNETAPI_(BOOL) InternetEnumPerSiteCookieDecisionA(
  3188. __out_ecount(*pcSiteNameSize) LPSTR pszSiteName,
  3189. __inout unsigned long *pcSiteNameSize,
  3190. __out unsigned long *pdwDecision,
  3191. __in unsigned long dwIndex
  3192. );
  3193. INTERNETAPI_(BOOL) InternetEnumPerSiteCookieDecisionW(
  3194. __out_ecount(*pcSiteNameSize) LPWSTR pszSiteName,
  3195. __inout unsigned long *pcSiteNameSize,
  3196. __out unsigned long *pdwDecision,
  3197. __in unsigned long dwIndex
  3198. );
  3199. #ifdef UNICODE
  3200. #define InternetEnumPerSiteCookieDecision InternetEnumPerSiteCookieDecisionW
  3201. #else
  3202. #define InternetEnumPerSiteCookieDecision InternetEnumPerSiteCookieDecisionA
  3203. #endif // !UNICODE
  3204. #define INTERNET_IDENTITY_FLAG_PRIVATE_CACHE 0x01
  3205. #define INTERNET_IDENTITY_FLAG_SHARED_CACHE 0x02
  3206. #define INTERNET_IDENTITY_FLAG_CLEAR_DATA 0x04
  3207. #define INTERNET_IDENTITY_FLAG_CLEAR_COOKIES 0x08
  3208. #define INTERNET_IDENTITY_FLAG_CLEAR_HISTORY 0x10
  3209. #define INTERNET_IDENTITY_FLAG_CLEAR_CONTENT 0x20
  3210. #define INTERNET_SUPPRESS_RESET_ALL 0x00
  3211. #define INTERNET_SUPPRESS_COOKIE_POLICY 0x01
  3212. #define INTERNET_SUPPRESS_COOKIE_POLICY_RESET 0x02
  3213. //
  3214. // Privacy settings values and APIs
  3215. //
  3216. #define PRIVACY_TEMPLATE_NO_COOKIES 0
  3217. #define PRIVACY_TEMPLATE_HIGH 1
  3218. #define PRIVACY_TEMPLATE_MEDIUM_HIGH 2
  3219. #define PRIVACY_TEMPLATE_MEDIUM 3
  3220. #define PRIVACY_TEMPLATE_MEDIUM_LOW 4
  3221. #define PRIVACY_TEMPLATE_LOW 5
  3222. #define PRIVACY_TEMPLATE_CUSTOM 100
  3223. #define PRIVACY_TEMPLATE_ADVANCED 101
  3224. #define PRIVACY_TEMPLATE_MAX PRIVACY_TEMPLATE_LOW
  3225. #define PRIVACY_TYPE_FIRST_PARTY 0
  3226. #define PRIVACY_TYPE_THIRD_PARTY 1
  3227. INTERNETAPI_(DWORD)
  3228. PrivacySetZonePreferenceW(
  3229. __in DWORD dwZone,
  3230. __in DWORD dwType,
  3231. __in DWORD dwTemplate,
  3232. __in LPCWSTR pszPreference
  3233. );
  3234. INTERNETAPI_(DWORD)
  3235. PrivacyGetZonePreferenceW(
  3236. __in DWORD dwZone,
  3237. __in DWORD dwType,
  3238. __out __opt LPDWORD pdwTemplate,
  3239. __out_ecount(*pdwBufferLength) __opt LPWSTR pszBuffer,
  3240. __inout __opt LPDWORD pdwBufferLength
  3241. );
  3242. #if defined(__cplusplus)
  3243. }
  3244. #endif
  3245. /*
  3246. * Return packing to whatever it was before we
  3247. * entered this file
  3248. */
  3249. #include <poppack.h>
  3250. #endif // !defined(_WININET_)