Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9432b8e7
Commit
9432b8e7
authored
Aug 05, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Don't depend on shlwapi for decoding a URL.
parent
c5f48459
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
26 deletions
+29
-26
Makefile.in
dlls/winhttp/Makefile.in
+1
-1
url.c
dlls/winhttp/url.c
+28
-25
No files found.
dlls/winhttp/Makefile.in
View file @
9432b8e7
MODULE
=
winhttp.dll
IMPORTLIB
=
winhttp
IMPORTS
=
uuid
shlwapi
user32 advapi32
IMPORTS
=
uuid user32 advapi32
DELAYIMPORTS
=
oleaut32 crypt32
EXTRALIBS
=
@SOCKETLIBS@
...
...
dlls/winhttp/url.c
View file @
9432b8e7
...
...
@@ -61,12 +61,32 @@ static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len,
return
TRUE
;
}
static
BOOL
decode_url
(
LPCWSTR
url
,
LPWSTR
buffer
,
LPDWORD
buf
len
)
static
WCHAR
*
decode_url
(
LPCWSTR
url
,
DWORD
*
len
)
{
HRESULT
hr
=
UrlCanonicalizeW
(
url
,
buffer
,
buflen
,
URL_WININET_COMPATIBILITY
|
URL_UNESCAPE
);
if
(
hr
==
E_POINTER
)
set_last_error
(
ERROR_INSUFFICIENT_BUFFER
);
if
(
hr
==
E_INVALIDARG
)
set_last_error
(
ERROR_INVALID_PARAMETER
);
return
(
SUCCEEDED
(
hr
))
?
TRUE
:
FALSE
;
const
WCHAR
*
p
=
url
;
WCHAR
hex
[
3
],
*
q
,
*
ret
;
if
(
!
(
ret
=
heap_alloc
(
*
len
*
sizeof
(
WCHAR
)
)))
return
NULL
;
q
=
ret
;
while
(
*
len
>
0
)
{
if
(
p
[
0
]
==
'%'
&&
isxdigitW
(
p
[
1
]
)
&&
isxdigitW
(
p
[
2
]
))
{
hex
[
0
]
=
p
[
1
];
hex
[
1
]
=
p
[
2
];
hex
[
2
]
=
0
;
*
q
++
=
strtolW
(
hex
,
NULL
,
16
);
p
+=
3
;
*
len
-=
3
;
}
else
{
*
q
++
=
*
p
++
;
*
len
-=
1
;
}
}
*
len
=
q
-
ret
;
return
ret
;
}
/***********************************************************************
...
...
@@ -75,8 +95,7 @@ static BOOL decode_url( LPCWSTR url, LPWSTR buffer, LPDWORD buflen )
BOOL
WINAPI
WinHttpCrackUrl
(
LPCWSTR
url
,
DWORD
len
,
DWORD
flags
,
LPURL_COMPONENTSW
uc
)
{
BOOL
ret
=
FALSE
;
WCHAR
*
p
,
*
q
,
*
r
;
WCHAR
*
url_decoded
=
NULL
;
WCHAR
*
p
,
*
q
,
*
r
,
*
url_decoded
=
NULL
;
TRACE
(
"%s, %d, %x, %p
\n
"
,
debugstr_w
(
url
),
len
,
flags
,
uc
);
...
...
@@ -91,28 +110,12 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
if
(
flags
&
ICU_DECODE
)
{
WCHAR
*
url_tmp
;
DWORD
url_len
=
len
+
1
;
if
(
!
(
url_tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
url_len
*
sizeof
(
WCHAR
)
)))
{
set_last_error
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
memcpy
(
url_tmp
,
url
,
len
*
sizeof
(
WCHAR
)
);
url_tmp
[
len
]
=
0
;
if
(
!
(
url_decoded
=
HeapAlloc
(
GetProcessHeap
(),
0
,
url_len
*
sizeof
(
WCHAR
)
)))
if
(
!
(
url_decoded
=
decode_url
(
url
,
&
len
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
url_tmp
);
set_last_error
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
decode_url
(
url_tmp
,
url_decoded
,
&
url_len
))
{
len
=
url_len
;
url
=
url_decoded
;
}
HeapFree
(
GetProcessHeap
(),
0
,
url_tmp
);
url
=
url_decoded
;
}
if
(
!
(
p
=
strchrW
(
url
,
':'
)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment