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.

293 lines
9.1 KiB

  1. #if defined(_WIN64)
  2. #include <pshpack8.h>
  3. #else
  4. #include <pshpack4.h>
  5. #endif
  6. #if defined(__cplusplus)
  7. extern "C" {
  8. #endif
  9. typedef struct {
  10. DWORD dwOption; // option to be queried or set
  11. union {
  12. DWORD dwValue; // dword value for the option
  13. LPSTR pszValue; // pointer to string value for the option
  14. FILETIME ftValue; // file-time value for the option
  15. } Value;
  16. } INTERNET_PER_CONN_OPTIONA, * LPINTERNET_PER_CONN_OPTIONA;
  17. typedef INTERNET_PER_CONN_OPTIONA INTERNET_PER_CONN_OPTION;
  18. typedef LPINTERNET_PER_CONN_OPTIONA LPINTERNET_PER_CONN_OPTION;
  19. typedef struct {
  20. DWORD dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
  21. LPSTR pszConnection; // connection name to set/query options
  22. DWORD dwOptionCount; // number of options to set/query
  23. DWORD dwOptionError; // on error, which option failed
  24. LPINTERNET_PER_CONN_OPTIONA pOptions;
  25. // array of options to set/query
  26. } INTERNET_PER_CONN_OPTION_LISTA, * LPINTERNET_PER_CONN_OPTION_LISTA;
  27. typedef INTERNET_PER_CONN_OPTION_LISTA INTERNET_PER_CONN_OPTION_LIST;
  28. typedef LPINTERNET_PER_CONN_OPTION_LISTA LPINTERNET_PER_CONN_OPTION_LIST;
  29. typedef struct {
  30. DWORD dwStructSize; // size of this structure. Used in version check
  31. LPSTR lpszScheme; // pointer to scheme name
  32. DWORD dwSchemeLength; // length of scheme name
  33. INTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  34. LPSTR lpszHostName; // pointer to host name
  35. DWORD dwHostNameLength; // length of host name
  36. INTERNET_PORT nPort; // converted port number
  37. LPSTR lpszUserName; // pointer to user name
  38. DWORD dwUserNameLength; // length of user name
  39. LPSTR lpszPassword; // pointer to password
  40. DWORD dwPasswordLength; // length of password
  41. LPSTR lpszUrlPath; // pointer to URL-path
  42. DWORD dwUrlPathLength; // length of URL-path
  43. LPSTR lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  44. DWORD dwExtraInfoLength; // length of extra information
  45. } URL_COMPONENTSA, * LPURL_COMPONENTSA;
  46. typedef struct _INTERNET_BUFFERSA {
  47. DWORD dwStructSize; // used for API versioning. Set to sizeof(INTERNET_BUFFERS)
  48. struct _INTERNET_BUFFERSA * Next; // chain of buffers
  49. LPCSTR lpcszHeader; // pointer to headers (may be NULL)
  50. DWORD dwHeadersLength; // length of headers if not NULL
  51. DWORD dwHeadersTotal; // size of headers if not enough buffer
  52. LPVOID lpvBuffer; // pointer to data buffer (may be NULL)
  53. DWORD dwBufferLength; // length of data buffer if not NULL
  54. DWORD dwBufferTotal; // total size of chunk, or content-length if not chunked
  55. DWORD dwOffsetLow; // used for read-ranges (only used in HttpSendRequest2)
  56. DWORD dwOffsetHigh;
  57. } INTERNET_BUFFERSA, * LPINTERNET_BUFFERSA;
  58. typedef INTERNET_BUFFERSA INTERNET_BUFFERS;
  59. typedef LPINTERNET_BUFFERSA LPINTERNET_BUFFERS;
  60. BOOLAPI
  61. InternetTimeFromSystemTimeA(
  62. IN CONST SYSTEMTIME *pst, // input GMT time
  63. OUT LPSTR lpszTime // output string buffer
  64. );
  65. #define InternetTimeFromSystemTime InternetTimeFromSystemTimeA
  66. BOOLAPI
  67. InternetTimeToSystemTimeA(
  68. IN LPCSTR lpszTime, // NULL terminated string
  69. OUT SYSTEMTIME *pst, // output in GMT time
  70. IN DWORD dwReserved
  71. );
  72. #define InternetTimeToSystemTime InternetTimeToSystemTimeA
  73. typedef struct
  74. {
  75. DWORD dwAccessType; // see WINHTTP_ACCESS_* types below
  76. LPSTR lpszProxy; // proxy server list
  77. LPSTR lpszProxyBypass; // proxy bypass list
  78. } WINHTTP_PROXY_INFOA;
  79. typedef WINHTTP_PROXY_INFOA* LPINTERNET_PROXY_INFO;
  80. BOOLAPI
  81. WinHttpCrackUrlA(
  82. IN LPCSTR lpszUrl,
  83. IN DWORD dwUrlLength,
  84. IN DWORD dwFlags,
  85. IN OUT LPURL_COMPONENTSA lpUrlComponents
  86. );
  87. BOOLAPI
  88. WinHttpCreateUrlA(
  89. IN LPURL_COMPONENTSA lpUrlComponents,
  90. IN DWORD dwFlags,
  91. OUT LPSTR lpszUrl,
  92. IN OUT LPDWORD lpdwUrlLength
  93. );
  94. INTERNETAPI
  95. HINTERNET
  96. WINAPI
  97. InternetOpenA(
  98. IN LPCSTR lpszAgent,
  99. IN DWORD dwAccessType,
  100. IN LPCSTR lpszProxy OPTIONAL,
  101. IN LPCSTR lpszProxyBypass OPTIONAL,
  102. IN DWORD dwFlags
  103. );
  104. #define InternetOpen InternetOpenA
  105. INTERNETAPI
  106. HINTERNET
  107. WINAPI
  108. InternetConnectA(
  109. IN HINTERNET hInternet,
  110. IN LPCSTR lpszServerName,
  111. IN INTERNET_PORT nServerPort,
  112. IN DWORD dwFlags,
  113. IN DWORD_PTR dwContext
  114. );
  115. #define InternetConnect InternetConnectA
  116. INTERNETAPI
  117. HINTERNET
  118. WINAPI
  119. InternetOpenUrlA(
  120. IN HINTERNET hInternet,
  121. IN LPCSTR lpszUrl,
  122. IN LPCSTR lpszHeaders OPTIONAL,
  123. IN DWORD dwHeadersLength,
  124. IN DWORD dwFlags,
  125. IN DWORD_PTR dwContext
  126. );
  127. #define InternetOpenUrl InternetOpenUrlA
  128. INTERNETAPI
  129. BOOL
  130. WINAPI
  131. InternetReadFileExA(
  132. IN HINTERNET hFile,
  133. OUT LPINTERNET_BUFFERSA lpBuffersOut,
  134. IN DWORD dwFlags,
  135. IN DWORD_PTR dwContext
  136. );
  137. #define InternetReadFileEx InternetReadFileExA
  138. INTERNETAPI
  139. BOOL
  140. WINAPI
  141. InternetWriteFileExA(
  142. IN HINTERNET hFile,
  143. IN LPINTERNET_BUFFERSA lpBuffersIn,
  144. IN DWORD dwFlags,
  145. IN DWORD_PTR dwContext
  146. );
  147. #define InternetWriteFileEx InternetWriteFileExA
  148. BOOLAPI
  149. InternetQueryOptionA(
  150. IN HINTERNET hInternet OPTIONAL,
  151. IN DWORD dwOption,
  152. OUT LPVOID lpBuffer OPTIONAL,
  153. IN OUT LPDWORD lpdwBufferLength
  154. );
  155. #define InternetQueryOption InternetQueryOptionA
  156. BOOLAPI
  157. InternetSetOptionA(
  158. IN HINTERNET hInternet OPTIONAL,
  159. IN DWORD dwOption,
  160. IN LPVOID lpBuffer,
  161. IN DWORD dwBufferLength
  162. );
  163. #define InternetSetOption InternetSetOptionA
  164. BOOLAPI
  165. InternetGetLastResponseInfoA(
  166. OUT LPDWORD lpdwError,
  167. OUT LPSTR lpszBuffer OPTIONAL,
  168. IN OUT LPDWORD lpdwBufferLength
  169. );
  170. #define InternetGetLastResponseInfo InternetGetLastResponseInfoA
  171. INTERNETAPI
  172. WINHTTP_STATUS_CALLBACK
  173. WINAPI
  174. InternetSetStatusCallbackA(
  175. IN HINTERNET hInternet,
  176. IN WINHTTP_STATUS_CALLBACK lpfnInternetCallback
  177. );
  178. #define InternetSetStatusCallback InternetSetStatusCallbackA
  179. BOOLAPI
  180. HttpAddRequestHeadersA(
  181. IN HINTERNET hRequest,
  182. IN LPCSTR lpszHeaders,
  183. IN DWORD dwHeadersLength,
  184. IN DWORD dwModifiers
  185. );
  186. #define HttpAddRequestHeaders HttpAddRequestHeadersA
  187. #define HTTP_VERSIONA "HTTP/1.0"
  188. #define HTTP_VERSION HTTP_VERSIONA
  189. INTERNETAPI
  190. HINTERNET
  191. WINAPI
  192. HttpOpenRequestA(
  193. IN HINTERNET hConnect,
  194. IN LPCSTR lpszVerb,
  195. IN LPCSTR lpszObjectName,
  196. IN LPCSTR lpszVersion,
  197. IN LPCSTR lpszReferrer OPTIONAL,
  198. IN LPCSTR FAR * lplpszAcceptTypes OPTIONAL,
  199. IN DWORD dwFlags,
  200. IN DWORD_PTR dwContext
  201. );
  202. #define HttpOpenRequest HttpOpenRequestA
  203. BOOLAPI
  204. HttpSendRequestA(
  205. IN HINTERNET hRequest,
  206. IN LPCSTR lpszHeaders OPTIONAL,
  207. IN DWORD dwHeadersLength,
  208. IN LPVOID lpOptional OPTIONAL,
  209. IN DWORD dwOptionalLength
  210. );
  211. #define HttpSendRequest HttpSendRequestA
  212. BOOLAPI WinHttpSetCredentialsA (
  213. IN HINTERNET hRequest, // HINTERNET handle returned by HttpOpenRequest.
  214. IN DWORD AuthTargets, // Only WINHTTP_AUTH_TARGET_SERVER and
  215. // WINHTTP_AUTH_TARGET_PROXY are supported
  216. // in this version and they are mutually
  217. // exclusive
  218. IN DWORD AuthScheme, // must be one of the supported Auth Schemes
  219. // returned from HttpQueryAuthSchemes(), Apps
  220. // should use the Preferred Scheme returned
  221. IN LPCSTR pszUserName, // 1) NULL if default creds is to be used, in
  222. // which case pszPassword will be ignored
  223. IN LPCSTR pszPassword, // 1) "" == Blank Passowrd; 2)Parameter ignored
  224. // if pszUserName is NULL; 3) Invalid to pass in
  225. // NULL if pszUserName is not NULL
  226. IN LPVOID pAuthParams
  227. );
  228. #define HttpSetCredentials HttpSetCredentialsA
  229. INTERNETAPI
  230. BOOL
  231. WINAPI
  232. HttpSendRequestExA(
  233. IN HINTERNET hRequest,
  234. IN LPINTERNET_BUFFERSA lpBuffersIn OPTIONAL,
  235. OUT LPINTERNET_BUFFERSA lpBuffersOut OPTIONAL,
  236. IN DWORD dwFlags,
  237. IN DWORD_PTR dwContext
  238. );
  239. #define HttpSendRequestEx HttpSendRequestExA
  240. BOOLAPI
  241. HttpQueryInfoA(
  242. IN HINTERNET hRequest,
  243. IN DWORD dwInfoLevel,
  244. IN LPCSTR lpszName OPTIONAL,
  245. IN OUT LPVOID lpBuffer OPTIONAL,
  246. IN OUT LPDWORD lpdwBufferLength,
  247. IN OUT LPDWORD lpdwIndex OPTIONAL
  248. );
  249. #define HttpQueryInfo HttpQueryInfoA
  250. #if defined(__cplusplus)
  251. } // end extern "C" {
  252. #endif
  253. BOOL internalWinHttpGetDefaultProxyConfigurationA( IN OUT WINHTTP_PROXY_INFOA * pProxyInfo);
  254. BOOL internalWinHttpSetDefaultProxyConfigurationA( IN WINHTTP_PROXY_INFOA * pProxyInfo);