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
29162c65
Commit
29162c65
authored
Jul 23, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Prepare for showing a regular authentication dialog.
parent
1126b893
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
21 deletions
+37
-21
dialogs.c
dlls/wininet/dialogs.c
+37
-21
No files found.
dlls/wininet/dialogs.c
View file @
29162c65
...
...
@@ -99,16 +99,20 @@ done:
*
* Determine the name of the (basic) Authentication realm
*/
static
BOOL
WININET_GetAuthRealm
(
HINTERNET
hRequest
,
LPWSTR
szBuf
,
DWORD
sz
)
static
BOOL
WININET_GetAuthRealm
(
HINTERNET
hRequest
,
LPWSTR
szBuf
,
DWORD
sz
,
BOOL
proxy
)
{
LPWSTR
p
,
q
;
DWORD
index
;
DWORD
index
,
query
;
static
const
WCHAR
szRealm
[]
=
{
'r'
,
'e'
,
'a'
,
'l'
,
'm'
,
'='
,
0
};
/* extract the Realm from the proxy response and show it */
if
(
proxy
)
query
=
HTTP_QUERY_PROXY_AUTHENTICATE
;
else
query
=
HTTP_QUERY_WWW_AUTHENTICATE
;
/* extract the Realm from the response and show it */
index
=
0
;
if
(
!
HttpQueryInfoW
(
hRequest
,
HTTP_QUERY_PROXY_AUTHENTICATE
,
szBuf
,
&
sz
,
&
index
)
)
if
(
!
HttpQueryInfoW
(
hRequest
,
query
,
szBuf
,
&
sz
,
&
index
)
)
return
FALSE
;
/*
...
...
@@ -118,11 +122,10 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
p
=
strchrW
(
szBuf
,
' '
);
if
(
!
p
||
strncmpW
(
p
+
1
,
szRealm
,
strlenW
(
szRealm
)
)
)
{
ERR
(
"
proxy
response wrong? (%s)
\n
"
,
debugstr_w
(
szBuf
));
ERR
(
"response wrong? (%s)
\n
"
,
debugstr_w
(
szBuf
));
return
FALSE
;
}
/* remove quotes */
p
+=
7
;
if
(
*
p
==
'"'
)
...
...
@@ -203,14 +206,13 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
}
/***********************************************************************
* WININET_Set
Proxy
Authorization
* WININET_SetAuthorization
*/
static
BOOL
WININET_Set
ProxyAuthorization
(
HINTERNET
hRequest
,
LPWSTR
username
,
LPWSTR
password
)
static
BOOL
WININET_Set
Authorization
(
HINTERNET
hRequest
,
LPWSTR
username
,
LPWSTR
password
,
BOOL
proxy
)
{
http_request_t
*
lpwhr
;
http_session_t
*
lpwhs
;
appinfo_t
*
hIC
;
BOOL
ret
=
FALSE
;
LPWSTR
p
;
...
...
@@ -225,21 +227,35 @@ static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest,
goto
done
;
}
hIC
=
lpwhs
->
lpAppInfo
;
p
=
heap_strdupW
(
username
);
if
(
!
p
)
goto
done
;
HeapFree
(
GetProcessHeap
(),
0
,
hIC
->
lpszProxyUsername
);
hIC
->
lpszProxyUsername
=
p
;
p
=
heap_strdupW
(
password
);
if
(
!
p
)
{
HeapFree
(
GetProcessHeap
(),
0
,
username
);
goto
done
;
}
HeapFree
(
GetProcessHeap
(),
0
,
hIC
->
lpszProxyPassword
);
hIC
->
lpszProxyPassword
=
p
;
if
(
proxy
)
{
appinfo_t
*
hIC
=
lpwhs
->
lpAppInfo
;
HeapFree
(
GetProcessHeap
(),
0
,
hIC
->
lpszProxyUsername
);
hIC
->
lpszProxyUsername
=
p
;
HeapFree
(
GetProcessHeap
(),
0
,
hIC
->
lpszProxyPassword
);
hIC
->
lpszProxyPassword
=
p
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
lpwhs
->
lpszUserName
);
lpwhs
->
lpszUserName
=
p
;
HeapFree
(
GetProcessHeap
(),
0
,
lpwhs
->
lpszPassword
);
lpwhs
->
lpszPassword
=
p
;
}
ret
=
TRUE
;
...
...
@@ -268,7 +284,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
/* extract the Realm from the proxy response and show it */
if
(
WININET_GetAuthRealm
(
params
->
hRequest
,
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
))
)
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
)
,
TRUE
)
)
{
hitem
=
GetDlgItem
(
hdlg
,
IDC_REALM
);
SetWindowTextW
(
hitem
,
szRealm
);
...
...
@@ -311,13 +327,13 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
if
(
hitem
&&
SendMessageW
(
hitem
,
BM_GETSTATE
,
0
,
0
)
&&
WININET_GetAuthRealm
(
params
->
hRequest
,
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
))
&&
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
)
,
TRUE
)
&&
WININET_GetProxyServer
(
params
->
hRequest
,
szServer
,
sizeof
szServer
/
sizeof
(
WCHAR
))
)
{
WININET_GetSetPassword
(
hdlg
,
szServer
,
szRealm
,
TRUE
);
}
WININET_Set
ProxyAuthorization
(
params
->
hRequest
,
username
,
password
);
WININET_Set
Authorization
(
params
->
hRequest
,
username
,
password
,
TRUE
);
EndDialog
(
hdlg
,
ERROR_INTERNET_FORCE_RETRY
);
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