Source code of Windows XP (NT5)
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.

209 lines
4.6 KiB

  1. /*
  2. File : AtkInternet.h
  3. Date :
  4. This is a wrapper function declaration for Winows Internet API.
  5. This Warpper is to handle the UNICODE as the present Windows Internet API does not support UNICODE
  6. */
  7. #ifndef __ASTRATEK_INTERNET_HEADER
  8. #define __ASTRATEK_INTERNET_HEADER
  9. #include <tchar.h>
  10. #include <windows.h>
  11. #include <wininet.h>
  12. #define USE_ASTRATEK_WRAPPER 1
  13. //
  14. // INTERNET_PROXY_INFO - structure supplied with INTERNET_OPTION_PROXY to get/
  15. // set proxy information on a InternetOpen() handle
  16. //
  17. typedef struct {
  18. // dwAccessType - INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PROXY, or
  19. // INTERNET_OPEN_TYPE_PRECONFIG (set only)
  20. DWORD dwAccessType;
  21. // lpszProxy - proxy server list
  22. LPCSTR lpszProxy;
  23. // lpszProxyBypass - proxy bypass list
  24. LPCSTR lpszProxyBypass;
  25. } ATK_INTERNET_PROXY_INFOW;
  26. #ifdef _UNICODE
  27. #ifdef USE_ASTRATEK_WRAPPER
  28. #define ATK_INTERNET_PROXY_INFO ATK_INTERNET_PROXY_INFOW
  29. #else
  30. #define ATK_INTERNET_PROXY_INFO INTERNET_PROXY_INFO
  31. #endif
  32. #else
  33. #define ATK_INTERNET_PROXY_INFO INTERNET_PROXY_INFO
  34. #endif // !UNICODE
  35. HINTERNET
  36. ATK_InternetOpenW(
  37. IN LPCWSTR lpszAgent,
  38. IN DWORD dwAccessType,
  39. IN LPCWSTR lpszProxy OPTIONAL,
  40. IN LPCWSTR lpszProxyBypass OPTIONAL,
  41. IN DWORD dwFlags
  42. );
  43. #ifdef _UNICODE
  44. #ifdef USE_ASTRATEK_WRAPPER
  45. #define ATK_InternetOpen ATK_InternetOpenW
  46. #else
  47. #define ATK_InternetOpen InternetOpen
  48. #endif
  49. #else
  50. #define ATK_InternetOpen InternetOpenA
  51. #endif // !UNICODE
  52. HINTERNET
  53. ATK_InternetConnectW(
  54. IN HINTERNET hInternet,
  55. IN LPCWSTR lpszServerName,
  56. IN INTERNET_PORT nServerPort,
  57. IN LPCWSTR lpszUserName OPTIONAL,
  58. IN LPCWSTR lpszPassword OPTIONAL,
  59. IN DWORD dwService,
  60. IN DWORD dwFlags,
  61. IN DWORD dwContext
  62. );
  63. #ifdef _UNICODE
  64. #ifdef USE_ASTRATEK_WRAPPER
  65. #define ATK_InternetConnect ATK_InternetConnectW
  66. #else
  67. #define ATK_InternetConnect InternetConnect
  68. #endif
  69. #else
  70. #define ATK_InternetConnect InternetConnectA
  71. #endif // !UNICODE
  72. HINTERNET
  73. ATK_HttpOpenRequestW(
  74. IN HINTERNET hConnect,
  75. IN LPCWSTR lpszVerb,
  76. IN LPCWSTR lpszObjectName,
  77. IN LPCWSTR lpszVersion,
  78. IN LPCWSTR lpszReferrer OPTIONAL,
  79. IN LPCWSTR FAR * lplpszAcceptTypes OPTIONAL,
  80. IN DWORD dwFlags,
  81. IN DWORD_PTR dwContext
  82. );
  83. #ifdef _UNICODE
  84. #ifdef USE_ASTRATEK_WRAPPER
  85. #define ATK_HttpOpenRequest ATK_HttpOpenRequestW
  86. #else
  87. #define ATK_HttpOpenRequest HttpOpenRequest
  88. #endif
  89. #else
  90. #define ATK_HttpOpenRequest HttpOpenRequestA
  91. #endif // !UNICODE
  92. BOOL
  93. ATK_HttpSendRequestW(
  94. IN HINTERNET hRequest,
  95. IN LPCWSTR lpszHeaders OPTIONAL,
  96. IN DWORD dwHeadersLength,
  97. IN LPVOID lpOptional OPTIONAL,
  98. IN DWORD dwOptionalLength
  99. );
  100. #ifdef _UNICODE
  101. #ifdef USE_ASTRATEK_WRAPPER
  102. #define ATK_HttpSendRequest ATK_HttpSendRequestW
  103. #else
  104. #define ATK_HttpSendRequest HttpSendRequest
  105. #endif
  106. #else
  107. #define ATK_HttpSendRequest HttpSendRequestA
  108. #endif // !UNICODE
  109. BOOL
  110. ATK_InternetGetLastResponseInfoW(
  111. OUT LPDWORD lpdwError,
  112. OUT LPWSTR lpszBuffer OPTIONAL,
  113. IN OUT LPDWORD lpdwBufferLength
  114. );
  115. #ifdef _UNICODE
  116. #ifdef USE_ASTRATEK_WRAPPER
  117. #define ATK_InternetGetLastResponseInfo ATK_InternetGetLastResponseInfoW
  118. #else
  119. #define ATK_InternetGetLastResponseInfo InternetGetLastResponseInfo
  120. #endif
  121. #else
  122. #define ATK_InternetGetLastResponseInfo InternetGetLastResponseInfoA
  123. #endif
  124. BOOL
  125. ATK_HttpQueryInfoW(
  126. IN HINTERNET hRequest,
  127. IN DWORD dwInfoLevel,
  128. IN OUT LPVOID lpBuffer OPTIONAL,
  129. IN OUT LPDWORD lpdwBufferLength,
  130. IN OUT LPDWORD lpdwIndex OPTIONAL
  131. );
  132. #ifdef _UNICODE
  133. #ifdef USE_ASTRATEK_WRAPPER
  134. #define ATK_HttpQueryInfo ATK_HttpQueryInfoW
  135. #else
  136. #define ATK_HttpQueryInfo HttpQueryInfo
  137. #endif
  138. #else
  139. #define ATK_HttpQueryInfo HttpQueryInfoA
  140. #endif
  141. //
  142. // In this functin declaration we have modified the first
  143. // parameter type as TCHAR to have uniformity in coding in tha APP
  144. //
  145. BOOL ATK_InternetGetCookieW(IN TCHAR *lpszUrl,
  146. IN TCHAR *lpszCookieName,
  147. OUT TCHAR *lpCookieData,
  148. OUT LPDWORD lpdwSize);
  149. #ifdef _UNICODE
  150. #ifdef USE_ASTRATEK_WRAPPER
  151. #define ATK_InternetGetCookie ATK_InternetGetCookieW
  152. #else
  153. #define ATK_InternetGetCookie InternetGetCookie
  154. #endif
  155. #else
  156. #define ATK_InternetGetCookie InternetGetCookieA
  157. #endif
  158. BOOL
  159. ATK_InternetQueryOptionW(IN HINTERNET hInternet,
  160. IN DWORD dwOption,
  161. OUT LPVOID lpBuffer,
  162. IN OUT LPDWORD lpdwBufferLength);
  163. #ifdef _UNICODE
  164. #ifdef USE_ASTRATEK_WRAPPER
  165. #define ATK_InternetQueryOption ATK_InternetQueryOptionW
  166. #else
  167. #define ATK_InternetQueryOption InternetQueryOption
  168. #endif
  169. #else
  170. #define ATK_InternetQueryOption InternetQueryOptionA
  171. #endif
  172. #endif