#include "config.h"
#include "ws2tcpip.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winhttp.h"
#include "shlwapi.h"
#include "wine/debug.h"
#include "winhttp_private.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (winhttp) |
|
static DWORD | set_component (struct url_component *comp, WCHAR *value, DWORD len, DWORD flags, BOOL *overflow) |
|
static WCHAR * | decode_url (LPCWSTR url, DWORD *len) |
|
static BOOL | need_escape (WCHAR ch) |
|
static BOOL | escape_string (const WCHAR *src, DWORD src_len, WCHAR *dst, DWORD *dst_len) |
|
static DWORD | escape_url (const WCHAR *url, DWORD *len, WCHAR **ret) |
|
static DWORD | parse_port (const WCHAR *str, DWORD len, INTERNET_PORT *ret) |
|
BOOL WINAPI | WinHttpCrackUrl (LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW uc) |
|
static INTERNET_SCHEME | get_scheme (const WCHAR *scheme, DWORD len) |
|
static const WCHAR * | get_scheme_string (INTERNET_SCHEME scheme) |
|
static BOOL | uses_default_port (INTERNET_SCHEME scheme, INTERNET_PORT port) |
|
static DWORD | get_comp_length (DWORD len, DWORD flags, WCHAR *comp) |
|
static BOOL | get_url_length (URL_COMPONENTS *uc, DWORD flags, DWORD *len) |
|
BOOL WINAPI | WinHttpCreateUrl (LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDWORD required) |
|
◆ decode_url()
Definition at line 68 of file url.c.
69{
72
76 {
78 {
85 }
86 else
87 {
90 }
91 }
94}
static void * heap_alloc(size_t len)
GLdouble GLdouble GLdouble GLdouble q
Referenced by WinHttpCrackUrl().
◆ escape_string()
Definition at line 109 of file url.c.
110{
111 static const WCHAR hex[] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'};
114
115 *dst_len = src_len;
116 for (
i = 0;
i < src_len;
i++)
117 {
120 {
122 {
127 }
128 *dst_len += 2;
129 }
131 }
132
133 if (
dst)
dst[*dst_len] = 0;
135}
static BOOL need_escape(WCHAR ch)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by escape_url(), and WinHttpCreateUrl().
◆ escape_url()
Definition at line 137 of file url.c.
138{
140 DWORD len_base, len_path;
141
143 {
146 }
147 else
148 {
150 len_path = 0;
151 }
152
155
157 (*ret)[len_base + len_path] = 0;
158
159 *
len = len_base + len_path;
161}
#define ERROR_INVALID_PARAMETER
static BOOL escape_string(const WCHAR *src, DWORD src_len, WCHAR *dst, DWORD *dst_len)
#define memcpy(s1, s2, n)
Referenced by WinHttpCrackUrl().
◆ get_comp_length()
◆ get_scheme()
Definition at line 346 of file url.c.
347{
350 return 0;
351}
static const WCHAR scheme_https[]
static const WCHAR scheme_http[]
#define strncmpW(s1, s2, n)
#define INTERNET_SCHEME_HTTP
#define INTERNET_SCHEME_HTTPS
Referenced by get_url_length(), and WinHttpCreateUrl().
◆ get_scheme_string()
◆ get_url_length()
Definition at line 378 of file url.c.
379{
380 static const WCHAR formatW[] = {
'%',
'u',0};
382
385 {
389 }
390 else
391 {
395 }
397
399 {
402 }
403 else
404 {
406 {
409 }
410 }
412 {
415 }
417 {
419
421 {
423
426 }
428 }
432}
static INTERNET_SCHEME get_scheme(const WCHAR *scheme, DWORD len)
static BOOL uses_default_port(INTERNET_SCHEME scheme, INTERNET_PORT port)
static const WCHAR * get_scheme_string(INTERNET_SCHEME scheme)
static DWORD get_comp_length(DWORD len, DWORD flags, WCHAR *comp)
Referenced by WinHttpCreateUrl().
◆ need_escape()
Definition at line 96 of file url.c.
97{
98 static const WCHAR escapes[] = {
' ',
'"',
'#',
'%',
'<',
'>',
'[',
'\\',
']',
'^',
'`',
'{',
'|',
'}',
'~',0};
100
101 if (ch <= 31 || ch >= 127)
return TRUE;
103 {
104 if (ch == *
p++)
return TRUE;
105 }
107}
Referenced by escape_string(), and get_comp_length().
◆ parse_port()
Definition at line 163 of file url.c.
164{
168 {
171 }
174}
#define ERROR_WINHTTP_INVALID_URL
Referenced by WinHttpCrackUrl().
◆ set_component()
◆ uses_default_port()
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
winhttp |
| ) |
|
◆ WinHttpCrackUrl()
Definition at line 179 of file url.c.
180{
186
188
190 {
193 }
195
197 {
199 {
202 }
204 }
206 {
208 {
211 }
213 }
215 {
218 }
221 else
222 {
225 }
226
229
231
233 if (!
p[0] ||
p[0] !=
'/' ||
p[1] !=
'/')
234 {
237 }
240 {
243 }
244
247
250
252 {
253
255 {
259 }
260 else
261 {
264 }
266 }
267 else
268 {
271 }
272
275
278
281
283 {
285 {
289 }
290 else
291 {
295 }
296
298 {
300 {
303 }
305 }
306 else
307 {
310 }
311 }
312 else
313 {
315 {
319 }
320 else
321 {
325 }
328 }
329
333
336 {
339 }
344}
static BOOL heap_free(void *mem)
#define ERROR_INSUFFICIENT_BUFFER
static DWORD parse_port(const WCHAR *str, DWORD len, INTERNET_PORT *ret)
static WCHAR * decode_url(LPCWSTR url, DWORD *len)
static DWORD set_component(struct url_component *comp, WCHAR *value, DWORD len, DWORD flags, BOOL *overflow)
static DWORD escape_url(const WCHAR *url, DWORD *len, WCHAR **ret)
GLdouble GLdouble GLdouble r
WINE_UNICODE_INLINE WCHAR * memchrW(const WCHAR *ptr, WCHAR ch, size_t n)
#define strncmpiW(s1, s2, n)
#define ERROR_WINHTTP_UNRECOGNIZED_SCHEME
Referenced by download_script(), handle_redirect(), processFile(), run_script(), winhttp_request_Open(), and WinHttpCrackUrl_test().
◆ WinHttpCreateUrl()
Definition at line 437 of file url.c.
438{
439 static const WCHAR formatW[] = {
'%',
'u',0};
442
444
446 {
449 }
450
452
454 {
458 }
460 {
463 }
464
468 {
472
474 }
475 else
476 {
477 const WCHAR *schemeW;
479
481
486 }
487
491
493 {
497
499 {
504 }
506 }
508 {
512
514 {
517 }
518
519
521 {
523 }
524 }
526 {
529 {
531 {
534 }
536 }
537 else
538 {
541 }
542 }
544 {
547 {
549 {
552 }
554 }
555 else
556 {
559 }
560 }
564}
static BOOL get_url_length(URL_COMPONENTS *uc, DWORD flags, DWORD *len)
Referenced by WinHttpCreateUrl_test().
◆ scheme_http
◆ scheme_https