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.

292 lines
9.0 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 URL_COMPONENTSA URL_COMPONENTS;
  47. typedef LPURL_COMPONENTSA LPURL_COMPONENTS;
  48. typedef struct _INTERNET_BUFFERSA {
  49. DWORD dwStructSize; // used for API versioning. Set to sizeof(INTERNET_BUFFERS)
  50. struct _INTERNET_BUFFERSA * Next; // chain of buffers
  51. LPCSTR lpcszHeader; // pointer to headers (may be NULL)
  52. DWORD dwHeadersLength; // length of headers if not NULL
  53. DWORD dwHeadersTotal; // size of headers if not enough buffer
  54. LPVOID lpvBuffer; // pointer to data buffer (may be NULL)
  55. DWORD dwBufferLength; // length of data buffer if not NULL
  56. DWORD dwBufferTotal; // total size of chunk, or content-length if not chunked
  57. DWORD dwOffsetLow; // used for read-ranges (only used in HttpSendRequest2)
  58. DWORD dwOffsetHigh;
  59. } INTERNET_BUFFERSA, * LPINTERNET_BUFFERSA;
  60. typedef INTERNET_BUFFERSA INTERNET_BUFFERS;
  61. typedef LPINTERNET_BUFFERSA LPINTERNET_BUFFERS;
  62. BOOLAPI
  63. InternetTimeFromSystemTimeA(
  64. IN CONST SYSTEMTIME *pst, // input GMT time
  65. OUT LPSTR lpszTime // output string buffer
  66. );
  67. #define InternetTimeFromSystemTime InternetTimeFromSystemTimeA
  68. BOOLAPI
  69. InternetTimeToSystemTimeA(
  70. IN LPCSTR lpszTime, // NULL terminated string
  71. OUT SYSTEMTIME *pst, // output in GMT time
  72. IN DWORD dwReserved
  73. );
  74. #define InternetTimeToSystemTime InternetTimeToSystemTimeA
  75. typedef struct
  76. {
  77. DWORD dwAccessType; // see WINHTTP_ACCESS_* types below
  78. LPSTR lpszProxy; // proxy server list
  79. LPSTR lpszProxyBypass; // proxy bypass list
  80. } WINHTTP_PROXY_INFOA;
  81. typedef WINHTTP_PROXY_INFOA* LPINTERNET_PROXY_INFO;
  82. BOOLAPI
  83. WinHttpCrackUrlA(
  84. IN LPCSTR lpszUrl,
  85. IN DWORD dwUrlLength,
  86. IN DWORD dwFlags,
  87. IN OUT LPURL_COMPONENTSA lpUrlComponents
  88. );
  89. BOOLAPI
  90. WinHttpCreateUrlA(
  91. IN LPURL_COMPONENTSA lpUrlComponents,
  92. IN DWORD dwFlags,
  93. OUT LPSTR lpszUrl,
  94. IN OUT LPDWORD lpdwUrlLength
  95. );
  96. INTERNETAPI
  97. HINTERNET
  98. WINAPI
  99. InternetOpenA(
  100. IN LPCSTR lpszAgent,
  101. IN DWORD dwAccessType,
  102. IN LPCSTR lpszProxy OPTIONAL,
  103. IN LPCSTR lpszProxyBypass OPTIONAL,
  104. IN DWORD dwFlags
  105. );
  106. #define InternetOpen InternetOpenA
  107. INTERNETAPI
  108. HINTERNET
  109. WINAPI
  110. InternetConnectA(
  111. IN HINTERNET hInternet,
  112. IN LPCSTR lpszServerName,
  113. IN INTERNET_PORT nServerPort,
  114. IN DWORD dwFlags,
  115. IN DWORD_PTR dwContext
  116. );
  117. #define InternetConnect InternetConnectA
  118. INTERNETAPI
  119. HINTERNET
  120. WINAPI
  121. InternetOpenUrlA(
  122. IN HINTERNET hInternet,
  123. IN LPCSTR lpszUrl,
  124. IN LPCSTR lpszHeaders OPTIONAL,
  125. IN DWORD dwHeadersLength,
  126. IN DWORD dwFlags,
  127. IN DWORD_PTR dwContext
  128. );
  129. #define InternetOpenUrl InternetOpenUrlA
  130. INTERNETAPI
  131. BOOL
  132. WINAPI
  133. InternetReadFileExA(
  134. IN HINTERNET hFile,
  135. OUT LPINTERNET_BUFFERSA lpBuffersOut,
  136. IN DWORD dwFlags,
  137. IN DWORD_PTR dwContext
  138. );
  139. #define InternetReadFileEx InternetReadFileExA
  140. INTERNETAPI
  141. BOOL
  142. WINAPI
  143. InternetWriteFileExA(
  144. IN HINTERNET hFile,
  145. IN LPINTERNET_BUFFERSA lpBuffersIn,
  146. IN DWORD dwFlags,
  147. IN DWORD_PTR dwContext
  148. );
  149. #define InternetWriteFileEx InternetWriteFileExA
  150. BOOLAPI
  151. InternetQueryOptionA(
  152. IN HINTERNET hInternet OPTIONAL,
  153. IN DWORD dwOption,
  154. OUT LPVOID lpBuffer OPTIONAL,
  155. IN OUT LPDWORD lpdwBufferLength
  156. );
  157. #define InternetQueryOption InternetQueryOptionA
  158. BOOLAPI
  159. InternetSetOptionA(
  160. IN HINTERNET hInternet OPTIONAL,
  161. IN DWORD dwOption,
  162. IN LPVOID lpBuffer,
  163. IN DWORD dwBufferLength
  164. );
  165. #define InternetSetOption InternetSetOptionA
  166. BOOLAPI
  167. InternetGetLastResponseInfoA(
  168. OUT LPDWORD lpdwError,
  169. OUT LPSTR lpszBuffer OPTIONAL,
  170. IN OUT LPDWORD lpdwBufferLength
  171. );
  172. #define InternetGetLastResponseInfo InternetGetLastResponseInfoA
  173. INTERNETAPI
  174. WINHTTP_STATUS_CALLBACK
  175. WINAPI
  176. InternetSetStatusCallbackA(
  177. IN HINTERNET hInternet,
  178. IN WINHTTP_STATUS_CALLBACK lpfnInternetCallback
  179. );
  180. #define InternetSetStatusCallback InternetSetStatusCallbackA
  181. BOOLAPI
  182. HttpAddRequestHeadersA(
  183. IN HINTERNET hRequest,
  184. IN LPCSTR lpszHeaders,
  185. IN DWORD dwHeadersLength,
  186. IN DWORD dwModifiers
  187. );
  188. #define HttpAddRequestHeaders HttpAddRequestHeadersA
  189. #define HTTP_VERSIONA "HTTP/1.0"
  190. #define HTTP_VERSION HTTP_VERSIONA
  191. INTERNETAPI
  192. HINTERNET
  193. WINAPI
  194. HttpOpenRequestA(
  195. IN HINTERNET hConnect,
  196. IN LPCSTR lpszVerb,
  197. IN LPCSTR lpszObjectName,
  198. IN LPCSTR lpszVersion,
  199. IN LPCSTR lpszReferrer OPTIONAL,
  200. IN LPCSTR FAR * lplpszAcceptTypes OPTIONAL,
  201. IN DWORD dwFlags,
  202. IN DWORD_PTR dwContext
  203. );
  204. #define HttpOpenRequest HttpOpenRequestA
  205. BOOLAPI
  206. HttpSendRequestA(
  207. IN HINTERNET hRequest,
  208. IN LPCSTR lpszHeaders OPTIONAL,
  209. IN DWORD dwHeadersLength,
  210. IN LPVOID lpOptional OPTIONAL,
  211. IN DWORD dwOptionalLength
  212. );
  213. #define HttpSendRequest HttpSendRequestA
  214. BOOLAPI WinHttpSetCredentialsA (
  215. IN HINTERNET hRequest, // HINTERNET handle returned by HttpOpenRequest.
  216. IN DWORD AuthTargets, // Only WINHTTP_AUTH_TARGET_SERVER and
  217. // WINHTTP_AUTH_TARGET_PROXY are supported
  218. // in this version and they are mutually
  219. // exclusive
  220. IN DWORD AuthScheme, // must be one of the supported Auth Schemes
  221. // returned from HttpQueryAuthSchemes(), Apps
  222. // should use the Preferred Scheme returned
  223. IN LPCSTR pszUserName, // 1) NULL if default creds is to be used, in
  224. // which case pszPassword will be ignored
  225. IN LPCSTR pszPassword, // 1) "" == Blank Passowrd; 2)Parameter ignored
  226. // if pszUserName is NULL; 3) Invalid to pass in
  227. // NULL if pszUserName is not NULL
  228. IN LPVOID pAuthParams
  229. );
  230. #define HttpSetCredentials HttpSetCredentialsA
  231. INTERNETAPI
  232. BOOL
  233. WINAPI
  234. HttpSendRequestExA(
  235. IN HINTERNET hRequest,
  236. IN LPINTERNET_BUFFERSA lpBuffersIn OPTIONAL,
  237. OUT LPINTERNET_BUFFERSA lpBuffersOut OPTIONAL,
  238. IN DWORD dwFlags,
  239. IN DWORD_PTR dwContext
  240. );
  241. #define HttpSendRequestEx HttpSendRequestExA
  242. BOOLAPI
  243. HttpQueryInfoA(
  244. IN HINTERNET hRequest,
  245. IN DWORD dwInfoLevel,
  246. IN LPCSTR lpszName OPTIONAL,
  247. IN OUT LPVOID lpBuffer OPTIONAL,
  248. IN OUT LPDWORD lpdwBufferLength,
  249. IN OUT LPDWORD lpdwIndex OPTIONAL
  250. );
  251. #define HttpQueryInfo HttpQueryInfoA
  252. #if defined(__cplusplus)
  253. } // end extern "C" {
  254. #endif