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
132da0e0
Commit
132da0e0
authored
Feb 06, 2024
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Return process-wide proxy settings from INTERNET_GetProxySettings.
Use INTERNET_LoadProxySettings when settings from registry are needed.
parent
5fe47776
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
30 deletions
+34
-30
internet.c
dlls/wininet/internet.c
+34
-30
No files found.
dlls/wininet/internet.c
View file @
132da0e0
...
...
@@ -609,46 +609,50 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
return
ERROR_SUCCESS
;
}
/***********************************************************************
* INTERNET_GetProxySettings
*
* Loads proxy information from registry, enironment or process-wide settings
* into lpwpi.
*/
static
LONG
INTERNET_GetProxySettings
(
proxyinfo_t
*
lpwpi
)
static
void
init_global_proxy
(
void
)
{
const
WCHAR
*
envproxy
;
LONG
ret
;
if
((
ret
=
INTERNET_LoadProxySettings
(
lpwpi
))
||
(
lpwpi
->
flags
&
PROXY_TYPE_PROXY
))
return
ret
;
FreeProxyInfo
(
lpwpi
);
EnterCriticalSection
(
&
WININET_cs
);
if
(
global_proxy
.
flags
)
goto
done
;
if
((
envproxy
=
_wgetenv
(
L"http_proxy"
)))
INTERNET_LoadProxySettings
(
&
global_proxy
);
if
(
global_proxy
.
flags
&
PROXY_TYPE_PROXY
||
!
(
envproxy
=
_wgetenv
(
L"http_proxy"
)))
goto
done
;
if
(
parse_proxy_url
(
&
global_proxy
,
envproxy
))
{
memset
(
lpwpi
,
0
,
sizeof
(
*
lpwpi
)
);
lpwpi
->
flags
=
PROXY_TYPE_DIRECT
;
if
(
parse_proxy_url
(
lpwpi
,
envproxy
))
{
lpwpi
->
flags
=
PROXY_TYPE_PROXY
;
lpwpi
->
proxyBypass
=
wcsdup
(
_wgetenv
(
L"no_proxy"
));
TRACE
(
"http proxy (from environment) = %s
\n
"
,
debugstr_w
(
lpwpi
->
proxy
));
TRACE
(
"http proxy bypass (from environment) = %s
\n
"
,
debugstr_w
(
lpwpi
->
proxyBypass
));
}
else
{
WARN
(
"failed to parse http_proxy value %s
\n
"
,
debugstr_w
(
envproxy
));
}
return
ERROR_SUCCESS
;
global_proxy
.
flags
|=
PROXY_TYPE_PROXY
;
global_proxy
.
proxyBypass
=
wcsdup
(
_wgetenv
(
L"no_proxy"
));
TRACE
(
"http proxy (from environment) = %s
\n
"
,
debugstr_w
(
global_proxy
.
proxy
));
TRACE
(
"http proxy bypass (from environment) = %s
\n
"
,
debugstr_w
(
global_proxy
.
proxyBypass
));
}
else
{
WARN
(
"failed to parse http_proxy value %s
\n
"
,
debugstr_w
(
envproxy
));
}
done:
LeaveCriticalSection
(
&
WININET_cs
);
}
/***********************************************************************
* INTERNET_GetProxySettings
*
* Loads process-wide proxy settings into lpwpi.
*/
static
LONG
INTERNET_GetProxySettings
(
proxyinfo_t
*
lpwpi
)
{
init_global_proxy
();
memset
(
lpwpi
,
0
,
sizeof
(
*
lpwpi
));
EnterCriticalSection
(
&
WININET_cs
);
lpwpi
->
flags
=
global_proxy
.
flags
;
lpwpi
->
proxy
=
wcsdup
(
global_proxy
.
proxy
);
lpwpi
->
proxyBypass
=
wcsdup
(
global_proxy
.
proxyBypass
);
lpwpi
->
proxyUsername
=
wcsdup
(
global_proxy
.
proxyUsername
);
lpwpi
->
proxyPassword
=
wcsdup
(
global_proxy
.
proxyPassword
);
LeaveCriticalSection
(
&
WININET_cs
);
lpwpi
->
flags
|=
PROXY_TYPE_DIRECT
;
return
ERROR_SUCCESS
;
}
...
...
@@ -2651,7 +2655,7 @@ static DWORD query_global_option(DWORD option, void *buffer, DWORD *size, BOOL u
LONG
ret
;
TRACE
(
"Getting global proxy info
\n
"
);
if
((
ret
=
INTERNET_
Get
ProxySettings
(
&
pi
)))
if
((
ret
=
INTERNET_
Load
ProxySettings
(
&
pi
)))
return
ret
;
FIXME
(
"INTERNET_OPTION_PER_CONNECTION_OPTION stub
\n
"
);
...
...
@@ -3142,7 +3146,7 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
unsigned
int
i
;
proxyinfo_t
pi
;
if
(
INTERNET_
Get
ProxySettings
(
&
pi
))
return
FALSE
;
if
(
INTERNET_
Load
ProxySettings
(
&
pi
))
return
FALSE
;
for
(
i
=
0
;
i
<
con
->
dwOptionCount
;
i
++
)
{
INTERNET_PER_CONN_OPTIONW
*
option
=
con
->
pOptions
+
i
;
...
...
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