extern HMODULE WININET_hModule DECLSPEC_HIDDEN;
-#ifndef INET6_ADDRSTRLEN
-#define INET6_ADDRSTRLEN 46
-#endif
-
typedef struct {
WCHAR *name;
INTERNET_PORT port;
return ret;
}
+static inline WCHAR *heap_strndupAtoW(const char *str, int len_a, DWORD *len_w)
+{
+ WCHAR *ret = NULL;
+
+ if(str) {
+ size_t len;
+ if(len_a < 0) len_a = strlen(str);
+ len = MultiByteToWideChar(CP_ACP, 0, str, len_a, NULL, 0);
+ ret = heap_alloc((len+1)*sizeof(WCHAR));
+ if(ret) {
+ MultiByteToWideChar(CP_ACP, 0, str, len_a, ret, len);
+ ret[len] = 0;
+ *len_w = len;
+ }
+ }
+
+ return ret;
+}
+
static inline WCHAR *heap_strdupAtoW(const char *str)
{
LPWSTR ret = NULL;
return ret;
}
+typedef struct {
+ const WCHAR *str;
+ size_t len;
+} substr_t;
+
+static inline substr_t substr(const WCHAR *str, size_t len)
+{
+ substr_t r = {str, len};
+ return r;
+}
+
+static inline substr_t substrz(const WCHAR *str)
+{
+ return substr(str, strlenW(str));
+}
+
static inline void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
{
dataA->dwFileAttributes = dataW->dwFileAttributes;
LONG ref;
HANDLE file_handle;
WCHAR *file_name;
+ WCHAR *url;
BOOL is_committed;
} req_file_t;
BOOL GetAddress(const WCHAR*,INTERNET_PORT,SOCKADDR*,int*,char*) DECLSPEC_HIDDEN;
DWORD get_cookie_header(const WCHAR*,const WCHAR*,WCHAR**) DECLSPEC_HIDDEN;
-DWORD set_cookie(const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*,DWORD) DECLSPEC_HIDDEN;
+DWORD set_cookie(substr_t,substr_t,substr_t,substr_t,DWORD) DECLSPEC_HIDDEN;
void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN;
DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN;
VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength) DECLSPEC_HIDDEN;
-BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen) DECLSPEC_HIDDEN;
+WCHAR *INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto) DECLSPEC_HIDDEN;
DWORD create_netconn(BOOL,server_t*,DWORD,BOOL,DWORD,netconn_t**) DECLSPEC_HIDDEN;
void free_netconn(netconn_t*) DECLSPEC_HIDDEN;
int sock_send(int fd, const void *msg, size_t len, int flags) DECLSPEC_HIDDEN;
int sock_recv(int fd, void *msg, size_t len, int flags) DECLSPEC_HIDDEN;
-server_t *get_server(const WCHAR*,INTERNET_PORT,BOOL,BOOL) DECLSPEC_HIDDEN;
+server_t *get_server(substr_t,INTERNET_PORT,BOOL,BOOL) DECLSPEC_HIDDEN;
DWORD create_req_file(const WCHAR*,req_file_t**) DECLSPEC_HIDDEN;
void req_file_release(req_file_t*) DECLSPEC_HIDDEN;