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
17d8cb24
Commit
17d8cb24
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: Store whole ProxyServer string so it's not lost while saving settings to registry.
parent
40b5e767
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
internet.c
dlls/wininet/internet.c
+23
-14
No files found.
dlls/wininet/internet.c
View file @
17d8cb24
...
@@ -342,7 +342,8 @@ static LONG INTERNET_SaveProxySettings( proxyinfo_t *lpwpi )
...
@@ -342,7 +342,8 @@ static LONG INTERNET_SaveProxySettings( proxyinfo_t *lpwpi )
if
(
lpwpi
->
proxy
)
if
(
lpwpi
->
proxy
)
{
{
if
((
ret
=
RegSetValueExW
(
key
,
L"ProxyServer"
,
0
,
REG_SZ
,
(
BYTE
*
)
lpwpi
->
proxy
,
sizeof
(
WCHAR
)
*
(
lstrlenW
(
lpwpi
->
proxy
)
+
1
))))
if
((
ret
=
RegSetValueExW
(
key
,
L"ProxyServer"
,
0
,
REG_SZ
,
(
BYTE
*
)
lpwpi
->
proxy
,
sizeof
(
WCHAR
)
*
(
lstrlenW
(
lpwpi
->
proxy
)
+
1
))))
{
{
RegCloseKey
(
key
);
RegCloseKey
(
key
);
return
ret
;
return
ret
;
...
@@ -519,6 +520,23 @@ static BOOL parse_proxy_url( proxyinfo_t *info, const WCHAR *url )
...
@@ -519,6 +520,23 @@ static BOOL parse_proxy_url( proxyinfo_t *info, const WCHAR *url )
return
TRUE
;
return
TRUE
;
}
}
static
WCHAR
*
get_http_proxy
(
const
WCHAR
*
proxy
)
{
const
WCHAR
*
p
,
*
end
;
WCHAR
*
ret
;
p
=
wcsstr
(
proxy
,
L"http="
);
if
(
p
)
p
+=
5
;
else
p
=
proxy
;
end
=
wcschr
(
p
,
';'
);
if
(
!
end
)
end
=
p
+
wcslen
(
p
);
ret
=
malloc
(
(
end
-
p
+
1
)
*
sizeof
(
WCHAR
)
);
memcpy
(
ret
,
p
,
(
end
-
p
)
*
sizeof
(
WCHAR
)
);
ret
[
end
-
p
]
=
0
;
return
ret
;
}
/***********************************************************************
/***********************************************************************
* INTERNET_LoadProxySettings
* INTERNET_LoadProxySettings
*
*
...
@@ -559,7 +577,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -559,7 +577,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
/* figure out how much memory the proxy setting takes */
/* figure out how much memory the proxy setting takes */
if
(
!
RegQueryValueExW
(
key
,
L"ProxyServer"
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
len
&&
(
type
==
REG_SZ
))
if
(
!
RegQueryValueExW
(
key
,
L"ProxyServer"
,
NULL
,
&
type
,
NULL
,
&
len
)
&&
len
&&
(
type
==
REG_SZ
))
{
{
LPWSTR
szProxy
,
p
;
LPWSTR
szProxy
;
if
(
!
(
szProxy
=
malloc
(
len
)))
if
(
!
(
szProxy
=
malloc
(
len
)))
{
{
...
@@ -568,18 +586,8 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
...
@@ -568,18 +586,8 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
}
}
RegQueryValueExW
(
key
,
L"ProxyServer"
,
NULL
,
&
type
,
(
BYTE
*
)
szProxy
,
&
len
);
RegQueryValueExW
(
key
,
L"ProxyServer"
,
NULL
,
&
type
,
(
BYTE
*
)
szProxy
,
&
len
);
/* find the http proxy, and strip away everything else */
p
=
wcsstr
(
szProxy
,
L"http="
);
if
(
p
)
{
p
+=
lstrlenW
(
L"http="
);
lstrcpyW
(
szProxy
,
p
);
}
p
=
wcschr
(
szProxy
,
';'
);
if
(
p
)
*
p
=
0
;
lpwpi
->
proxy
=
szProxy
;
lpwpi
->
proxy
=
szProxy
;
TRACE
(
"
http proxy
(from registry%s) = %s
\n
"
,
lpwpi
->
flags
&
PROXY_TYPE_PROXY
?
""
:
", disabled"
,
TRACE
(
"
proxy server
(from registry%s) = %s
\n
"
,
lpwpi
->
flags
&
PROXY_TYPE_PROXY
?
""
:
", disabled"
,
debugstr_w
(
lpwpi
->
proxy
));
debugstr_w
(
lpwpi
->
proxy
));
}
}
else
else
...
@@ -690,10 +698,11 @@ static BOOL INTERNET_ConfigureProxy( appinfo_t *lpwai )
...
@@ -690,10 +698,11 @@ static BOOL INTERNET_ConfigureProxy( appinfo_t *lpwai )
TRACE
(
"http proxy = %s bypass = %s
\n
"
,
debugstr_w
(
wpi
.
proxy
),
debugstr_w
(
wpi
.
proxyBypass
));
TRACE
(
"http proxy = %s bypass = %s
\n
"
,
debugstr_w
(
wpi
.
proxy
),
debugstr_w
(
wpi
.
proxyBypass
));
lpwai
->
accessType
=
INTERNET_OPEN_TYPE_PROXY
;
lpwai
->
accessType
=
INTERNET_OPEN_TYPE_PROXY
;
lpwai
->
proxy
=
wpi
.
proxy
;
lpwai
->
proxy
=
get_http_proxy
(
wpi
.
proxy
)
;
lpwai
->
proxyBypass
=
wpi
.
proxyBypass
;
lpwai
->
proxyBypass
=
wpi
.
proxyBypass
;
lpwai
->
proxyUsername
=
wpi
.
proxyUsername
;
lpwai
->
proxyUsername
=
wpi
.
proxyUsername
;
lpwai
->
proxyPassword
=
wpi
.
proxyPassword
;
lpwai
->
proxyPassword
=
wpi
.
proxyPassword
;
free
(
wpi
.
proxy
);
return
TRUE
;
return
TRUE
;
}
}
...
...
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