Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

255 lines
16 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. inethttp.h
  5. Abstract:
  6. This header maps some wininet API to winhttp
  7. --*/
  8. // API mappings
  9. #define InternetTimeFromSystemTime WinHttpTimeFromSystemTime
  10. #define InternetTimeToSystemTime WinHttpTimeToSystemTime
  11. #define InternetCrackUrl WinHttpCrackUrl
  12. #define InternetCreateUrl WinHttpCreateUrl
  13. #define InternetOpen WinHttpOpen
  14. #define InternetSetStatusCallback(h, pcb)\
  15. WinHttpSetStatusCallback(h, pcb, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0)
  16. #define InternetSetOption WinHttpSetOption
  17. #define InternetQueryOption WinHttpQueryOption
  18. #define InternetConnect(h,s,port,user,pass,svc,flag,ctx) \
  19. WinHttpConnect(h,s,port,flag,ctx)
  20. #define HttpOpenRequest WinHttpOpenRequest
  21. #define HttpAddRequestHeaders WinHttpAddRequestHeaders
  22. #define HttpSendRequest(h,ph,cbh,pr,cbr)\
  23. WinHttpSendRequest(h,ph,cbh,pr,cbr,cbr,0)
  24. #define HttpSendRequestEx(h,pbi,pbo,dw,c)\
  25. WinHttpSendRequest(h, \
  26. (pbi)->lpcszHeader, \
  27. (pbi)->dwHeadersLength, \
  28. (pbi)->lpvBuffer, \
  29. (pbi)->dwBufferLength, \
  30. (pbi)->dwBufferTotal, \
  31. 0)
  32. #define InternetWriteFile(h,p,cb,pcb)\
  33. WinHttpWriteData(h,p,cb,pcb,0)
  34. #define HttpEndRequest WinHttpReceiveResponse
  35. #define HttpQueryInfo(h,dw,pb,pcb,ndx)\
  36. WinHttpQueryHeaders(h,dw,((LPCWSTR) pb),pb,pcb,ndx)
  37. #define InternetQueryDataAvailable WinHttpQueryDataAvailable
  38. #define InternetReadFile(h,p,cb,pcb)\
  39. WinHttpReadData(h,p,cb,pcb,0)
  40. #define InternetCloseHandle WinHttpCloseHandle
  41. #define InternetOpenUrl WinHttpOpenUrl
  42. // InternetSetOption values
  43. #define INTERNET_FIRST_OPTION WINHTTP_FIRST_OPTION
  44. #define INTERNET_OPTION_CALLBACK WINHTTP_OPTION_CALLBACK
  45. #define INTERNET_OPTION_RESOLVE_TIMEOUT WINHTTP_OPTION_RESOLVE_TIMEOUT
  46. #define INTERNET_OPTION_CONNECT_TIMEOUT WINHTTP_OPTION_CONNECT_TIMEOUT
  47. #define INTERNET_OPTION_CONNECT_RETRIES WINHTTP_OPTION_CONNECT_RETRIES
  48. #define INTERNET_OPTION_SEND_TIMEOUT WINHTTP_OPTION_SEND_TIMEOUT
  49. #define INTERNET_OPTION_RECEIVE_TIMEOUT WINHTTP_OPTION_RECEIVE_TIMEOUT
  50. #define INTERNET_OPTION_RECEIVE_RESPONSE_TIMEOUT WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT
  51. #define INTERNET_OPTION_HANDLE_TYPE WINHTTP_OPTION_HANDLE_TYPE
  52. #define INTERNET_OPTION_READ_BUFFER_SIZE WINHTTP_OPTION_READ_BUFFER_SIZE
  53. #define INTERNET_OPTION_WRITE_BUFFER_SIZE WINHTTP_OPTION_WRITE_BUFFER_SIZE
  54. #define INTERNET_OPTION_PARENT_HANDLE WINHTTP_OPTION_PARENT_HANDLE
  55. #define INTERNET_OPTION_REQUEST_FLAGS WINHTTP_OPTION_REQUEST_FLAGS
  56. #define INTERNET_OPTION_EXTENDED_ERROR WINHTTP_OPTION_EXTENDED_ERROR
  57. #define INTERNET_OPTION_SECURITY_FLAGS WINHTTP_OPTION_SECURITY_FLAGS
  58. #define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT
  59. #define INTERNET_OPTION_URL WINHTTP_OPTION_URL
  60. #define INTERNET_OPTION_SECURITY_KEY_BITNESS WINHTTP_OPTION_SECURITY_KEY_BITNESS
  61. #define INTERNET_OPTION_PROXY WINHTTP_OPTION_PROXY
  62. #define INTERNET_OPTION_VERSION WINHTTP_OPTION_VERSION
  63. #define INTERNET_OPTION_USER_AGENT WINHTTP_OPTION_USER_AGENT
  64. #define INTERNET_OPTION_CONTEXT_VALUE WINHTTP_OPTION_CONTEXT_VALUE
  65. #define INTERNET_OPTION_CLIENT_CERT_CONTEXT WINHTTP_OPTION_CLIENT_CERT_CONTEXT
  66. #define INTERNET_OPTION_POLICY WINHTTP_OPTION_POLICY
  67. #define INTERNET_OPTION_REQUEST_PRIORITY WINHTTP_OPTION_REQUEST_PRIORITY
  68. #define INTERNET_OPTION_HTTP_VERSION WINHTTP_OPTION_HTTP_VERSION
  69. #define INTERNET_OPTION_ERROR_MASK WINHTTP_OPTION_ERROR_MASK
  70. #define INTERNET_OPTION_CONTROL_SEND_TIMEOUT WINHTTP_OPTION_SEND_TIMEOUT
  71. #define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT WINHTTP_OPTION_RECEIVE_TIMEOUT
  72. #define INTERNET_OPTION_DATA_SEND_TIMEOUT WINHTTP_OPTION_SEND_TIMEOUT
  73. #define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT WINHTTP_OPTION_RECEIVE_TIMEOUT
  74. #define INTERNET_OPTION_CODEPAGE WINHTTP_OPTION_CODEPAGE
  75. #define INTERNET_OPTION_MAX_CONNS_PER_SERVER WINHTTP_OPTION_MAX_CONNS_PER_SERVER
  76. #define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER
  77. // status callback
  78. #define INTERNET_ASYNC_RESULT WINHTTP_ASYNC_RESULT
  79. #define LPINTERNET_ASYNC_RESULT LPWINHTTP_ASYNC_RESULT
  80. #define INTERNET_STATUS_RESOLVING_NAME WINHTTP_STATUS_RESOLVING_NAME
  81. #define INTERNET_STATUS_NAME_RESOLVED WINHTTP_STATUS_NAME_RESOLVED
  82. #define INTERNET_STATUS_CONNECTING_TO_SERVER WINHTTP_STATUS_CONNECTING_TO_SERVER
  83. #define INTERNET_STATUS_CONNECTED_TO_SERVER WINHTTP_STATUS_CONNECTED_TO_SERVER
  84. #define INTERNET_STATUS_SENDING_REQUEST WINHTTP_STATUS_SENDING_REQUEST
  85. #define INTERNET_STATUS_REQUEST_SENT WINHTTP_STATUS_REQUEST_SENT
  86. #define INTERNET_STATUS_RECEIVING_RESPONSE WINHTTP_STATUS_RECEIVING_RESPONSE
  87. #define INTERNET_STATUS_RESPONSE_RECEIVED WINHTTP_STATUS_RESPONSE_RECEIVED
  88. #define INTERNET_STATUS_CLOSING_CONNECTION WINHTTP_STATUS_CLOSING_CONNECTION
  89. #define INTERNET_STATUS_CONNECTION_CLOSED WINHTTP_STATUS_CONNECTION_CLOSED
  90. #define INTERNET_STATUS_HANDLE_CREATED WINHTTP_STATUS_HANDLE_CREATED
  91. #define INTERNET_STATUS_HANDLE_CLOSING WINHTTP_STATUS_HANDLE_CLOSING
  92. #define INTERNET_STATUS_DETECTING_PROXY WINHTTP_STATUS_DETECTING_PROXY
  93. #define INTERNET_STATUS_REQUEST_COMPLETE WINHTTP_STATUS_REQUEST_COMPLETE
  94. #define INTERNET_STATUS_REDIRECT WINHTTP_STATUS_REDIRECT
  95. #define INTERNET_STATUS_INTERMEDIATE_RESPONSE WINHTTP_STATUS_INTERMEDIATE_RESPONSE
  96. #define INTERNET_STATUS_CALLBACK WINHTTP_STATUS_CALLBACK
  97. #define LPINTERNET_STATUS_CALLBACK LPWINHTTP_STATUS_CALLBACK
  98. #define INTERNET_INVALID_STATUS_CALLBACK WINHTTP_INVALID_STATUS_CALLBACK
  99. #define INTERNET_NO_CALLBACK 0
  100. // flags
  101. #define INTERNET_FLAG_RELOAD WINHTTP_FLAG_REFRESH
  102. #define INTERNET_FLAG_RESYNCHRONIZE WINHTTP_FLAG_REFRESH
  103. #define INTERNET_FLAG_PRAGMA_NO_CACHE WINHTTP_FLAG_BYPASS_CACHE
  104. #define INTERNET_FLAG_NO_CACHE_WRITE 0
  105. #define INTERNET_FLAG_DONT_CACHE 0
  106. #define INTERNET_FLAG_MAKE_PERSISTENT 0
  107. #define INTERNET_FLAG_READ_PREFETCH 0
  108. #define INTERNET_FLAG_CACHE_IF_NET_FAIL 0
  109. #define INTERNET_FLAG_CACHE_ASYNC 0
  110. #define INTERNET_FLAG_BGUPDATE 0
  111. #define INTERNET_FLAG_HYPERLINK 0
  112. #define INTERNET_FLAG_FWD_BACK 0
  113. #define INTERNET_FLAG_NO_UI 0
  114. #define INTERNET_FLAG_KEEP_CONNECTION 0
  115. // handle types
  116. #define INTERNET_HANDLE_TYPE_INTERNET WINHTTP_HANDLE_TYPE_SESSION
  117. #define INTERNET_HANDLE_TYPE_CONNECT_HTTP WINHTTP_HANDLE_TYPE_CONNECT
  118. #define INTERNET_HANDLE_TYPE_HTTP_REQUEST WINHTTP_HANDLE_TYPE_REQUEST
  119. #define HTTP_ADDREQ_INDEX_MASK WINHTTP_ADDREQ_INDEX_MASK
  120. #define HTTP_ADDREQ_FLAGS_MASK WINHTTP_ADDREQ_FLAGS_MASK
  121. #define HTTP_ADDREQ_FLAG_ADD_IF_NEW WINHTTP_ADDREQ_FLAG_ADD_IF_NEW
  122. #define HTTP_ADDREQ_FLAG_ADD WINHTTP_ADDREQ_FLAG_ADD
  123. #define HTTP_ADDREQ_FLAG_REPLACE WINHTTP_ADDREQ_FLAG_REPLACE
  124. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
  125. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON
  126. #define HTTP_ADDREQ_FLAG_COALESCE WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
  127. #define HTTP_QUERY_MIME_VERSION WINHTTP_QUERY_MIME_VERSION
  128. #define HTTP_QUERY_CONTENT_TYPE WINHTTP_QUERY_CONTENT_TYPE
  129. #define HTTP_QUERY_CONTENT_TRANSFER_ENCODING WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING
  130. #define HTTP_QUERY_CONTENT_ID WINHTTP_QUERY_CONTENT_ID
  131. #define HTTP_QUERY_CONTENT_DESCRIPTION WINHTTP_QUERY_CONTENT_DESCRIPTION
  132. #define HTTP_QUERY_CONTENT_LENGTH WINHTTP_QUERY_CONTENT_LENGTH
  133. #define HTTP_QUERY_CONTENT_LANGUAGE WINHTTP_QUERY_CONTENT_LANGUAGE
  134. #define HTTP_QUERY_ALLOW WINHTTP_QUERY_ALLOW
  135. #define HTTP_QUERY_PUBLIC WINHTTP_QUERY_PUBLIC
  136. #define HTTP_QUERY_DATE WINHTTP_QUERY_DATE
  137. #define HTTP_QUERY_EXPIRES WINHTTP_QUERY_EXPIRES
  138. #define HTTP_QUERY_LAST_MODIFIED WINHTTP_QUERY_LAST_MODIFIED
  139. #define HTTP_QUERY_MESSAGE_ID WINHTTP_QUERY_MESSAGE_ID
  140. #define HTTP_QUERY_URI WINHTTP_QUERY_URI
  141. #define HTTP_QUERY_DERIVED_FROM WINHTTP_QUERY_DERIVED_FROM
  142. #define HTTP_QUERY_COST WINHTTP_QUERY_COST
  143. #define HTTP_QUERY_LINK WINHTTP_QUERY_LINK
  144. #define HTTP_QUERY_PRAGMA WINHTTP_QUERY_PRAGMA
  145. #define HTTP_QUERY_VERSION WINHTTP_QUERY_VERSION
  146. #define HTTP_QUERY_STATUS_CODE WINHTTP_QUERY_STATUS_CODE
  147. #define HTTP_QUERY_STATUS_TEXT WINHTTP_QUERY_STATUS_TEXT
  148. #define HTTP_QUERY_RAW_HEADERS WINHTTP_QUERY_RAW_HEADERS
  149. #define HTTP_QUERY_RAW_HEADERS_CRLF WINHTTP_QUERY_RAW_HEADERS_CRLF
  150. #define HTTP_QUERY_CONNECTION WINHTTP_QUERY_CONNECTION
  151. #define HTTP_QUERY_ACCEPT WINHTTP_QUERY_ACCEPT
  152. #define HTTP_QUERY_ACCEPT_CHARSET WINHTTP_QUERY_ACCEPT_CHARSET
  153. #define HTTP_QUERY_ACCEPT_ENCODING WINHTTP_QUERY_ACCEPT_ENCODING
  154. #define HTTP_QUERY_ACCEPT_LANGUAGE WINHTTP_QUERY_ACCEPT_LANGUAGE
  155. #define HTTP_QUERY_AUTHORIZATION WINHTTP_QUERY_AUTHORIZATION
  156. #define HTTP_QUERY_CONTENT_ENCODING WINHTTP_QUERY_CONTENT_ENCODING
  157. #define HTTP_QUERY_FORWARDED WINHTTP_QUERY_FORWARDED
  158. #define HTTP_QUERY_FROM WINHTTP_QUERY_FROM
  159. #define HTTP_QUERY_IF_MODIFIED_SINCE WINHTTP_QUERY_IF_MODIFIED_SINCE
  160. #define HTTP_QUERY_LOCATION WINHTTP_QUERY_LOCATION
  161. #define HTTP_QUERY_ORIG_URI WINHTTP_QUERY_ORIG_URI
  162. #define HTTP_QUERY_REFERER WINHTTP_QUERY_REFERER
  163. #define HTTP_QUERY_RETRY_AFTER WINHTTP_QUERY_RETRY_AFTER
  164. #define HTTP_QUERY_SERVER WINHTTP_QUERY_SERVER
  165. #define HTTP_QUERY_TITLE WINHTTP_QUERY_TITLE
  166. #define HTTP_QUERY_USER_AGENT WINHTTP_QUERY_USER_AGENT
  167. #define HTTP_QUERY_WWW_AUTHENTICATE WINHTTP_QUERY_WWW_AUTHENTICATE
  168. #define HTTP_QUERY_PROXY_AUTHENTICATE WINHTTP_QUERY_PROXY_AUTHENTICATE
  169. #define HTTP_QUERY_ACCEPT_RANGES WINHTTP_QUERY_ACCEPT_RANGES
  170. #define HTTP_QUERY_SET_COOKIE WINHTTP_QUERY_SET_COOKIE
  171. #define HTTP_QUERY_COOKIE WINHTTP_QUERY_COOKIE
  172. #define HTTP_QUERY_REQUEST_METHOD WINHTTP_QUERY_REQUEST_METHOD
  173. #define HTTP_QUERY_REFRESH WINHTTP_QUERY_REFRESH
  174. #define HTTP_QUERY_CONTENT_DISPOSITION WINHTTP_QUERY_CONTENT_DISPOSITION
  175. #define HTTP_QUERY_AGE WINHTTP_QUERY_AGE
  176. #define HTTP_QUERY_CACHE_CONTROL WINHTTP_QUERY_CACHE_CONTROL
  177. #define HTTP_QUERY_CONTENT_BASE WINHTTP_QUERY_CONTENT_BASE
  178. #define HTTP_QUERY_CONTENT_LOCATION WINHTTP_QUERY_CONTENT_LOCATION
  179. #define HTTP_QUERY_CONTENT_MD5 WINHTTP_QUERY_CONTENT_MD5
  180. #define HTTP_QUERY_CONTENT_RANGE WINHTTP_QUERY_CONTENT_RANGE
  181. #define HTTP_QUERY_ETAG WINHTTP_QUERY_ETAG
  182. #define HTTP_QUERY_HOST WINHTTP_QUERY_HOST
  183. #define HTTP_QUERY_IF_MATCH WINHTTP_QUERY_IF_MATCH
  184. #define HTTP_QUERY_IF_NONE_MATCH WINHTTP_QUERY_IF_NONE_MATCH
  185. #define HTTP_QUERY_IF_RANGE WINHTTP_QUERY_IF_RANGE
  186. #define HTTP_QUERY_IF_UNMODIFIED_SINCE WINHTTP_QUERY_IF_UNMODIFIED_SINCE
  187. #define HTTP_QUERY_MAX_FORWARDS WINHTTP_QUERY_MAX_FORWARDS
  188. #define HTTP_QUERY_PROXY_AUTHORIZATION WINHTTP_QUERY_PROXY_AUTHORIZATION
  189. #define HTTP_QUERY_RANGE WINHTTP_QUERY_RANGE
  190. #define HTTP_QUERY_TRANSFER_ENCODING WINHTTP_QUERY_TRANSFER_ENCODING
  191. #define HTTP_QUERY_UPGRADE WINHTTP_QUERY_UPGRADE
  192. #define HTTP_QUERY_VARY WINHTTP_QUERY_VARY
  193. #define HTTP_QUERY_VIA WINHTTP_QUERY_VIA
  194. #define HTTP_QUERY_WARNING WINHTTP_QUERY_WARNING
  195. #define HTTP_QUERY_EXPECT WINHTTP_QUERY_EXPECT
  196. #define HTTP_QUERY_PROXY_CONNECTION WINHTTP_QUERY_PROXY_CONNECTION
  197. #define HTTP_QUERY_UNLESS_MODIFIED_SINCE WINHTTP_QUERY_UNLESS_MODIFIED_SINCE
  198. #define HTTP_QUERY_ECHO_REQUEST WINHTTP_QUERY_ECHO_REQUEST
  199. #define HTTP_QUERY_ECHO_REPLY WINHTTP_QUERY_ECHO_REPLY
  200. #define HTTP_QUERY_ECHO_HEADERS WINHTTP_QUERY_ECHO_HEADERS
  201. #define HTTP_QUERY_ECHO_HEADERS_CRLF WINHTTP_QUERY_ECHO_HEADERS_CRLF
  202. #define HTTP_QUERY_PROXY_SUPPORT WINHTTP_QUERY_PROXY_SUPPORT
  203. #define HTTP_QUERY_AUTHENTICATION_INFO WINHTTP_QUERY_AUTHENTICATION_INFO
  204. #define HTTP_QUERY_MAX WINHTTP_QUERY_MAX
  205. #define HTTP_QUERY_CUSTOM WINHTTP_QUERY_CUSTOM
  206. #define HTTP_QUERY_FLAG_REQUEST_HEADERS WINHTTP_QUERY_FLAG_REQUEST_HEADERS
  207. #define HTTP_QUERY_FLAG_SYSTEMTIME WINHTTP_QUERY_FLAG_SYSTEMTIME
  208. #define HTTP_QUERY_FLAG_NUMBER WINHTTP_QUERY_FLAG_NUMBER
  209. #define ERROR_INTERNET_FORCE_RETRY WINHTTP_ERROR_RESEND_REQUEST