Autosyncing with Wine HEAD
[reactos.git] / reactos / dll / win32 / wininet / wininet_ros.diff
1 Index: ftp.c
2 ===================================================================
3 --- ftp.c (revision 30893)
4 +++ ftp.c (working copy)
5 @@ -58,6 +58,7 @@
6
7 #include "wine/debug.h"
8 #include "internet.h"
9 +typedef size_t socklen_t;
10
11 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
12
13 Index: http.c
14 ===================================================================
15 --- http.c (revision 30893)
16 +++ http.c (working copy)
17 @@ -60,6 +60,8 @@
18 #include "wine/debug.h"
19 #include "wine/unicode.h"
20
21 +#include "inet_ntop.c"
22 +
23 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
24
25 static const WCHAR g_szHttp1_0[] = {' ','H','T','T','P','/','1','.','0',0 };
26 @@ -3010,7 +3011,11 @@
27 /*
28 * HACK peek at the buffer
29 */
30 +#if 0
31 + /* This is Wine code, we don't support MSG_PEEK yet so we have to do it
32 + a bit different */
33 NETCON_recv(&lpwhr->netConnection, buffer, buflen, MSG_PEEK, &rc);
34 +#endif
35
36 /*
37 * We should first receive 'HTTP/1.x nnn OK' where nnn is the status code.
38 @@ -3019,6 +3024,9 @@
39 memset(buffer, 0, MAX_REPLY_LEN);
40 if (!NETCON_getNextLine(&lpwhr->netConnection, bufferA, &buflen))
41 goto lend;
42 +#if 1
43 + rc = buflen;
44 +#endif
45 MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
46
47 /* regenerate raw headers */
48 Index: inet_ntop.c
49 ===================================================================
50 --- inet_ntop.c (revision 30893)
51 +++ inet_ntop.c (working copy)
52 @@ -0,0 +1,189 @@
53 +/* from NetBSD: inet_ntop.c,v 1.9 2000/01/22 22:19:16 mycroft Exp */
54 +
55 +/* Copyright (c) 1996 by Internet Software Consortium.
56 + *
57 + * Permission to use, copy, modify, and distribute this software for any
58 + * purpose with or without fee is hereby granted, provided that the above
59 + * copyright notice and this permission notice appear in all copies.
60 + *
61 + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
62 + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
63 + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
64 + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
65 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
66 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
67 + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
68 + * SOFTWARE.
69 + */
70 +
71 +#define ENOSPC 28
72 +#define EAFNOSUPPORT 52
73 +
74 +#ifndef IN6ADDRSZ
75 +#define IN6ADDRSZ 16
76 +#endif
77 +
78 +#ifndef INT16SZ
79 +#define INT16SZ 2
80 +#endif
81 +
82 +#ifdef SPRINTF_CHAR
83 +# define SPRINTF(x) strlen(sprintf/**/x)
84 +#else
85 +# define SPRINTF(x) ((size_t)sprintf x)
86 +#endif
87 +
88 +/*
89 + * WARNING: Don't even consider trying to compile this on a system where
90 + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
91 + */
92 +
93 +static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
94 +static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
95 +
96 +/* char *
97 + * inet_ntop(af, src, dst, size)
98 + * convert a network format address to presentation format.
99 + * return:
100 + * pointer to presentation format address (`dst'), or NULL (see errno).
101 + * author:
102 + * Paul Vixie, 1996.
103 + */
104 +const char *
105 +inet_ntop(int af, const void *src, char *dst, size_t size)
106 +{
107 +
108 + switch (af) {
109 + case AF_INET:
110 + return (inet_ntop4(src, dst, size));
111 +#ifdef INET6
112 + case AF_INET6:
113 + return (inet_ntop6(src, dst, size));
114 +#endif
115 + default:
116 + errno = EAFNOSUPPORT;
117 + return (NULL);
118 + }
119 + /* NOTREACHED */
120 +}
121 +
122 +/* const char *
123 + * inet_ntop4(src, dst, size)
124 + * format an IPv4 address, more or less like inet_ntoa()
125 + * return:
126 + * `dst' (as a const)
127 + * notes:
128 + * (1) uses no statics
129 + * (2) takes a u_char* not an in_addr as input
130 + * author:
131 + * Paul Vixie, 1996.
132 + */
133 +static const char *
134 +inet_ntop4(const u_char *src, char *dst, size_t size)
135 +{
136 + static const char fmt[] = "%u.%u.%u.%u";
137 + char tmp[sizeof "255.255.255.255"];
138 +
139 + if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
140 + errno = ENOSPC;
141 + return (NULL);
142 + }
143 + strcpy(dst, tmp);
144 + return (dst);
145 +}
146 +
147 +#ifdef INET6
148 +/* const char *
149 + * inet_ntop6(src, dst, size)
150 + * convert IPv6 binary address into presentation (printable) format
151 + * author:
152 + * Paul Vixie, 1996.
153 + */
154 +static const char *
155 +inet_ntop6(const u_char *src, char *dst, size_t size)
156 +{
157 + /*
158 + * Note that int32_t and int16_t need only be "at least" large enough
159 + * to contain a value of the specified size. On some systems, like
160 + * Crays, there is no such thing as an integer variable with 16 bits.
161 + * Keep this in mind if you think this function should have been coded
162 + * to use pointer overlays. All the world's not a VAX.
163 + */
164 + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
165 + struct { int base, len; } best, cur;
166 + u_int words[IN6ADDRSZ / INT16SZ];
167 + int i;
168 +
169 + /*
170 + * Preprocess:
171 + * Copy the input (bytewise) array into a wordwise array.
172 + * Find the longest run of 0x00's in src[] for :: shorthanding.
173 + */
174 + memset(words, '\0', sizeof words);
175 + for (i = 0; i < IN6ADDRSZ; i++)
176 + words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
177 + best.base = -1;
178 + cur.base = -1;
179 + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
180 + if (words[i] == 0) {
181 + if (cur.base == -1)
182 + cur.base = i, cur.len = 1;
183 + else
184 + cur.len++;
185 + } else {
186 + if (cur.base != -1) {
187 + if (best.base == -1 || cur.len > best.len)
188 + best = cur;
189 + cur.base = -1;
190 + }
191 + }
192 + }
193 + if (cur.base != -1) {
194 + if (best.base == -1 || cur.len > best.len)
195 + best = cur;
196 + }
197 + if (best.base != -1 && best.len < 2)
198 + best.base = -1;
199 +
200 + /*
201 + * Format the result.
202 + */
203 + tp = tmp;
204 + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
205 + /* Are we inside the best run of 0x00's? */
206 + if (best.base != -1 && i >= best.base &&
207 + i < (best.base + best.len)) {
208 + if (i == best.base)
209 + *tp++ = ':';
210 + continue;
211 + }
212 + /* Are we following an initial run of 0x00s or any real hex? */
213 + if (i != 0)
214 + *tp++ = ':';
215 + /* Is this address an encapsulated IPv4? */
216 + if (i == 6 && best.base == 0 &&
217 + (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
218 + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
219 + return (NULL);
220 + tp += strlen(tp);
221 + break;
222 + }
223 + tp += SPRINTF((tp, "%x", words[i]));
224 + }
225 + /* Was it a trailing run of 0x00's? */
226 + if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
227 + *tp++ = ':';
228 + *tp++ = '\0';
229 +
230 + /*
231 + * Check for overflow, copy, and we're done.
232 + */
233 + if ((size_t)(tp - tmp) > size) {
234 + errno = ENOSPC;
235 + return (NULL);
236 + }
237 + strcpy(dst, tmp);
238 + return (dst);
239 +}
240 +#endif
241 +
242 Index: internet.c
243 ===================================================================
244 --- internet.c (revision 30893)
245 +++ internet.c (working copy)
246 @@ -67,6 +67,7 @@
247 #include "resource.h"
248
249 #include "wine/unicode.h"
250 +#define CP_UNIXCP CP_THREAD_ACP
251
252 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
253
254 Index: netconnection.c
255 ===================================================================
256 --- netconnection.c (revision 30893)
257 +++ netconnection.c (working copy)
258 @@ -58,6 +58,8 @@
259 #include "internet.h"
260
261 #define RESPONSE_TIMEOUT 30 /* FROM internet.c */
262 +#define sock_get_error(x) WSAGetLastError()
263 +#undef FIONREAD
264
265
266 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
267 @@ -200,6 +202,7 @@
268 return TRUE;
269 }
270
271 +#ifndef __REACTOS__
272 /* translate a unix error code into a winsock one */
273 static int sock_get_error( int err )
274 {
275 @@ -263,6 +266,7 @@
276 default: errno=err; perror("sock_set_error"); return WSAEFAULT;
277 }
278 }
279 +#endif
280
281 /******************************************************************************
282 * NETCON_create
283 Index: rsrc.rc
284 ===================================================================
285 --- rsrc.rc (revision 30893)
286 +++ rsrc.rc (working copy)
287 @@ -60,3 +60,4 @@
288 #include "wininet_Si.rc"
289 #include "wininet_Sv.rc"
290 #include "wininet_Tr.rc"
291 +#include "wininet_Uk.rc"
292 Index: utility.c
293 ===================================================================
294 --- utility.c (revision 30893)
295 +++ utility.c (working copy)
296 @@ -37,6 +37,7 @@
297
298 #include "wine/debug.h"
299 #include "internet.h"
300 +#define CP_UNIXCP CP_THREAD_ACP
301
302 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
303
304 Index: wininet.rbuild
305 ===================================================================
306 --- wininet.rbuild (revision 30893)
307 +++ wininet.rbuild (working copy)
308 @@ -19,6 +19,7 @@
309 <library>ntdll</library>
310 <library>secur32</library>
311 <library>crypt32</library>
312 + <library>ws2_32</library>
313 <file>cookie.c</file>
314 <file>dialogs.c</file>
315 <file>ftp.c</file>
316 Index: wininet_Uk.rc
317 ===================================================================
318 --- wininet_Uk.rc (revision 30893)
319 +++ wininet_Uk.rc (working copy)
320 @@ -0,0 +1,46 @@
321 +/*
322 + * wininet.dll (Ukrainian resources)
323 + *
324 + * Copyright 2006 Artem Reznikov
325 + *
326 + * This library is free software; you can redistribute it and/or
327 + * modify it under the terms of the GNU Lesser General Public
328 + * License as published by the Free Software Foundation; either
329 + * version 2.1 of the License, or (at your option) any later version.
330 + *
331 + * This library is distributed in the hope that it will be useful,
332 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
333 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
334 + * Lesser General Public License for more details.
335 + *
336 + * You should have received a copy of the GNU Lesser General Public
337 + * License along with this library; if not, write to the Free Software
338 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
339 + */
340 +
341 +LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
342 +
343 +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
344 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
345 +CAPTION "Ââåä³òü Ìåðåæíèé Ïàðîëü"
346 +FONT 8, "MS Shell Dlg"
347 +{
348 + LTEXT "Áóäü ëàñêà, ââåä³òü Âàø³ ³ì'ÿ òà ïàðîëü:", -1, 40, 6, 150, 15
349 + LTEXT "Ïðîêñ³", -1, 40, 26, 50, 10
350 + LTEXT "Îáëàñòü", -1, 40, 46, 50, 10
351 + LTEXT "Êîðèñòóâà÷", -1, 40, 66, 50, 10
352 + LTEXT "Ïàðîëü", -1, 40, 86, 50, 10
353 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
354 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0
355 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
356 + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
357 + CHECKBOX "&Çáåðåãòè öåé ïàðîëü (íåáåçïå÷íî)", IDC_SAVEPASSWORD,
358 + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
359 + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
360 + PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
361 +}
362 +
363 +STRINGTABLE DISCARDABLE
364 +{
365 + IDS_LANCONNECTION "ϳäêëþ÷åííÿ ïî ëîêàëüí³é ìåðåæ³"
366 +}