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
cadad89d
Commit
cadad89d
authored
Nov 28, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Handle http_proxy variable entirely in Unicode.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
86f43b69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
19 deletions
+7
-19
internet.c
dlls/wininet/internet.c
+7
-19
No files found.
dlls/wininet/internet.c
View file @
cadad89d
...
@@ -541,7 +541,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -541,7 +541,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
{
{
HKEY
key
;
HKEY
key
;
DWORD
type
,
len
;
DWORD
type
,
len
;
LPCSTR
envproxy
;
const
WCHAR
*
envproxy
;
LONG
ret
;
LONG
ret
;
memset
(
lpwpi
,
0
,
sizeof
(
*
lpwpi
)
);
memset
(
lpwpi
,
0
,
sizeof
(
*
lpwpi
)
);
...
@@ -573,7 +573,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -573,7 +573,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
}
}
}
}
if
(
!
(
envproxy
=
getenv
(
"http_proxy"
))
||
lpwpi
->
proxyEnabled
)
if
(
!
(
envproxy
=
_wgetenv
(
L
"http_proxy"
))
||
lpwpi
->
proxyEnabled
)
{
{
/* figure out how much memory the proxy setting takes */
/* figure out how much memory the proxy setting takes */
if
(
!
RegQueryValueExW
(
key
,
szProxyServer
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
len
&&
(
type
==
REG_SZ
))
if
(
!
RegQueryValueExW
(
key
,
szProxyServer
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
len
&&
(
type
==
REG_SZ
))
...
@@ -615,18 +615,8 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -615,18 +615,8 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
}
}
else
if
(
envproxy
)
else
if
(
envproxy
)
{
{
WCHAR
*
envproxyW
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
envproxy
,
-
1
,
NULL
,
0
);
if
(
!
(
envproxyW
=
heap_alloc
(
len
*
sizeof
(
WCHAR
))))
{
RegCloseKey
(
key
);
return
ERROR_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
envproxy
,
-
1
,
envproxyW
,
len
);
FreeProxyInfo
(
lpwpi
);
FreeProxyInfo
(
lpwpi
);
if
(
parse_proxy_url
(
lpwpi
,
envproxy
W
))
if
(
parse_proxy_url
(
lpwpi
,
envproxy
))
{
{
TRACE
(
"http proxy (from environment) = %s
\n
"
,
debugstr_w
(
lpwpi
->
proxy
));
TRACE
(
"http proxy (from environment) = %s
\n
"
,
debugstr_w
(
lpwpi
->
proxy
));
lpwpi
->
proxyEnabled
=
1
;
lpwpi
->
proxyEnabled
=
1
;
...
@@ -634,19 +624,18 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -634,19 +624,18 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
}
}
else
else
{
{
WARN
(
"failed to parse http_proxy value %s
\n
"
,
debugstr_w
(
envproxy
W
));
WARN
(
"failed to parse http_proxy value %s
\n
"
,
debugstr_w
(
envproxy
));
lpwpi
->
proxyEnabled
=
0
;
lpwpi
->
proxyEnabled
=
0
;
lpwpi
->
proxy
=
NULL
;
lpwpi
->
proxy
=
NULL
;
lpwpi
->
proxyBypass
=
NULL
;
lpwpi
->
proxyBypass
=
NULL
;
}
}
heap_free
(
envproxyW
);
}
}
if
(
lpwpi
->
proxyEnabled
)
if
(
lpwpi
->
proxyEnabled
)
{
{
TRACE
(
"Proxy is enabled.
\n
"
);
TRACE
(
"Proxy is enabled.
\n
"
);
if
(
!
(
envproxy
=
getenv
(
"no_proxy"
)))
if
(
!
(
envproxy
=
_wgetenv
(
L
"no_proxy"
)))
{
{
/* figure out how much memory the proxy setting takes */
/* figure out how much memory the proxy setting takes */
if
(
!
RegQueryValueExW
(
key
,
szProxyOverride
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
len
&&
(
type
==
REG_SZ
))
if
(
!
RegQueryValueExW
(
key
,
szProxyOverride
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
len
&&
(
type
==
REG_SZ
))
...
@@ -677,13 +666,12 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -677,13 +666,12 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
{
{
WCHAR
*
envproxyW
;
WCHAR
*
envproxyW
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
envproxy
,
-
1
,
NULL
,
0
);
if
(
!
(
envproxyW
=
heap_alloc
(
lstrlenW
(
envproxy
)
*
sizeof
(
WCHAR
))))
if
(
!
(
envproxyW
=
heap_alloc
(
len
*
sizeof
(
WCHAR
))))
{
{
RegCloseKey
(
key
);
RegCloseKey
(
key
);
return
ERROR_OUTOFMEMORY
;
return
ERROR_OUTOFMEMORY
;
}
}
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
envproxy
,
-
1
,
envproxyW
,
len
);
lstrcpyW
(
envproxyW
,
envproxy
);
heap_free
(
lpwpi
->
proxyBypass
);
heap_free
(
lpwpi
->
proxyBypass
);
lpwpi
->
proxyBypass
=
envproxyW
;
lpwpi
->
proxyBypass
=
envproxyW
;
...
...
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