Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b5fec3c0
Commit
b5fec3c0
authored
Jun 07, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Store request object instead of handle in error dialog.
parent
d8b5f468
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
30 deletions
+57
-30
dialogs.c
dlls/wininet/dialogs.c
+55
-28
internet.c
dlls/wininet/tests/internet.c
+2
-2
No files found.
dlls/wininet/dialogs.c
View file @
b5fec3c0
...
...
@@ -50,8 +50,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
struct
WININET_ErrorDlgParams
{
http_request_t
*
req
;
HWND
hWnd
;
HINTERNET
hRequest
;
DWORD
dwError
;
DWORD
dwFlags
;
LPVOID
*
lppvData
;
...
...
@@ -317,7 +317,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
SetWindowLongPtrW
(
hdlg
,
GWLP_USERDATA
,
lParam
);
/* extract the Realm from the proxy response and show it */
if
(
WININET_GetAuthRealm
(
params
->
hReques
t
,
if
(
WININET_GetAuthRealm
(
params
->
req
->
hdr
.
hInterne
t
,
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
),
TRUE
)
)
{
hitem
=
GetDlgItem
(
hdlg
,
IDC_REALM
);
...
...
@@ -325,7 +325,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
}
/* extract the name of the proxy server */
if
(
WININET_GetProxyServer
(
params
->
hRequest
,
if
(
WININET_GetProxyServer
(
params
->
req
->
hdr
.
hInternet
,
szServer
,
sizeof
szServer
/
sizeof
(
WCHAR
))
)
{
hitem
=
GetDlgItem
(
hdlg
,
IDC_PROXY
);
...
...
@@ -360,14 +360,14 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
hitem
=
GetDlgItem
(
hdlg
,
IDC_SAVEPASSWORD
);
if
(
hitem
&&
SendMessageW
(
hitem
,
BM_GETSTATE
,
0
,
0
)
&&
WININET_GetAuthRealm
(
params
->
hReques
t
,
WININET_GetAuthRealm
(
params
->
req
->
hdr
.
hInterne
t
,
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
),
TRUE
)
&&
WININET_GetProxyServer
(
params
->
hRequest
,
WININET_GetProxyServer
(
params
->
req
->
hdr
.
hInternet
,
szServer
,
sizeof
szServer
/
sizeof
(
WCHAR
))
)
{
WININET_GetSetPassword
(
hdlg
,
szServer
,
szRealm
,
TRUE
);
}
WININET_SetAuthorization
(
params
->
hReques
t
,
username
,
password
,
TRUE
);
WININET_SetAuthorization
(
params
->
req
->
hdr
.
hInterne
t
,
username
,
password
,
TRUE
);
EndDialog
(
hdlg
,
ERROR_INTERNET_FORCE_RETRY
);
return
TRUE
;
...
...
@@ -401,7 +401,7 @@ static INT_PTR WINAPI WININET_PasswordDialog(
SetWindowLongPtrW
(
hdlg
,
GWLP_USERDATA
,
lParam
);
/* extract the Realm from the response and show it */
if
(
WININET_GetAuthRealm
(
params
->
hReques
t
,
if
(
WININET_GetAuthRealm
(
params
->
req
->
hdr
.
hInterne
t
,
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
),
FALSE
)
)
{
hitem
=
GetDlgItem
(
hdlg
,
IDC_REALM
);
...
...
@@ -409,7 +409,7 @@ static INT_PTR WINAPI WININET_PasswordDialog(
}
/* extract the name of the server */
if
(
WININET_GetServer
(
params
->
hReques
t
,
if
(
WININET_GetServer
(
params
->
req
->
hdr
.
hInterne
t
,
szServer
,
sizeof
szServer
/
sizeof
(
WCHAR
))
)
{
hitem
=
GetDlgItem
(
hdlg
,
IDC_SERVER
);
...
...
@@ -444,14 +444,14 @@ static INT_PTR WINAPI WININET_PasswordDialog(
hitem
=
GetDlgItem
(
hdlg
,
IDC_SAVEPASSWORD
);
if
(
hitem
&&
SendMessageW
(
hitem
,
BM_GETSTATE
,
0
,
0
)
&&
WININET_GetAuthRealm
(
params
->
hReques
t
,
WININET_GetAuthRealm
(
params
->
req
->
hdr
.
hInterne
t
,
szRealm
,
sizeof
szRealm
/
sizeof
(
WCHAR
),
FALSE
)
&&
WININET_GetServer
(
params
->
hReques
t
,
WININET_GetServer
(
params
->
req
->
hdr
.
hInterne
t
,
szServer
,
sizeof
szServer
/
sizeof
(
WCHAR
))
)
{
WININET_GetSetPassword
(
hdlg
,
szServer
,
szRealm
,
TRUE
);
}
WININET_SetAuthorization
(
params
->
hReques
t
,
username
,
password
,
FALSE
);
WININET_SetAuthorization
(
params
->
req
->
hdr
.
hInterne
t
,
username
,
password
,
FALSE
);
EndDialog
(
hdlg
,
ERROR_INTERNET_FORCE_RETRY
);
return
TRUE
;
...
...
@@ -524,9 +524,10 @@ static INT_PTR WINAPI WININET_InvalidCertificateDialog(
if
(
params
->
dwFlags
&
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS
)
{
http_request_t
*
req
=
params
->
req
;
DWORD
flags
,
size
=
sizeof
(
flags
);
InternetQueryOptionW
(
params
->
hReques
t
,
INTERNET_OPTION_SECURITY_FLAGS
,
&
flags
,
&
size
);
InternetQueryOptionW
(
req
->
hdr
.
hInterne
t
,
INTERNET_OPTION_SECURITY_FLAGS
,
&
flags
,
&
size
);
switch
(
params
->
dwError
)
{
case
ERROR_INTERNET_INVALID_CA
:
...
...
@@ -549,7 +550,7 @@ static INT_PTR WINAPI WININET_InvalidCertificateDialog(
flags
|=
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID
;
break
;
}
res
=
InternetSetOptionW
(
params
->
hReques
t
,
INTERNET_OPTION_SECURITY_FLAGS
,
&
flags
,
size
);
res
=
InternetSetOptionW
(
params
->
req
->
hdr
.
hInterne
t
,
INTERNET_OPTION_SECURITY_FLAGS
,
&
flags
,
size
);
if
(
!
res
)
WARN
(
"InternetSetOption(INTERNET_OPTION_SECURITY_FLAGS) failed.
\n
"
);
}
...
...
@@ -592,7 +593,6 @@ static INT WININET_GetConnectionStatus( HINTERNET hRequest )
return
dwStatus
;
}
/***********************************************************************
* InternetErrorDlg
*/
...
...
@@ -600,15 +600,24 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
DWORD
dwError
,
DWORD
dwFlags
,
LPVOID
*
lppvData
)
{
struct
WININET_ErrorDlgParams
params
;
INT
dwStatus
;
http_request_t
*
req
=
NULL
;
DWORD
res
=
ERROR_SUCCESS
;
TRACE
(
"%p %p %d %08x %p
\n
"
,
hWnd
,
hRequest
,
dwError
,
dwFlags
,
lppvData
);
if
(
!
hWnd
&&
!
(
dwFlags
&
FLAGS_ERROR_UI_FLAGS_NO_UI
)
)
return
ERROR_INVALID_HANDLE
;
if
(
hRequest
)
{
req
=
(
http_request_t
*
)
get_handle_object
(
hRequest
);
if
(
!
req
)
return
ERROR_INVALID_HANDLE
;
if
(
req
->
hdr
.
htype
!=
WH_HHTTPREQ
)
return
ERROR_SUCCESS
;
/* Yes, that was tested */
}
params
.
req
=
req
;
params
.
hWnd
=
hWnd
;
params
.
hRequest
=
hRequest
;
params
.
dwError
=
dwError
;
params
.
dwFlags
=
dwFlags
;
params
.
lppvData
=
lppvData
;
...
...
@@ -616,40 +625,58 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
switch
(
dwError
)
{
case
ERROR_SUCCESS
:
case
ERROR_INTERNET_INCORRECT_PASSWORD
:
case
ERROR_INTERNET_INCORRECT_PASSWORD
:
{
DWORD
dwStatus
;
if
(
!
dwError
&&
!
(
dwFlags
&
FLAGS_ERROR_UI_FILTER_FOR_ERRORS
)
)
return
0
;
break
;
if
(
!
req
)
return
ERROR_INVALID_HANDLE
;
dwStatus
=
WININET_GetConnectionStatus
(
hRequest
);
switch
(
dwStatus
)
{
case
HTTP_STATUS_PROXY_AUTH_REQ
:
return
DialogBoxParamW
(
WININET_hModule
,
MAKEINTRESOURCEW
(
IDD_PROXYDLG
),
hWnd
,
WININET_ProxyPasswordDialog
,
(
LPARAM
)
&
params
);
res
=
DialogBoxParamW
(
WININET_hModule
,
MAKEINTRESOURCEW
(
IDD_PROXYDLG
),
hWnd
,
WININET_ProxyPasswordDialog
,
(
LPARAM
)
&
params
);
break
;
case
HTTP_STATUS_DENIED
:
re
turn
DialogBoxParamW
(
WININET_hModule
,
MAKEINTRESOURCEW
(
IDD_AUTHDLG
),
re
s
=
DialogBoxParamW
(
WININET_hModule
,
MAKEINTRESOURCEW
(
IDD_AUTHDLG
),
hWnd
,
WININET_PasswordDialog
,
(
LPARAM
)
&
params
);
break
;
default:
WARN
(
"unhandled status %u
\n
"
,
dwStatus
);
return
0
;
}
break
;
}
case
ERROR_INTERNET_SEC_CERT_ERRORS
:
case
ERROR_INTERNET_SEC_CERT_CN_INVALID
:
case
ERROR_INTERNET_SEC_CERT_DATE_INVALID
:
case
ERROR_INTERNET_INVALID_CA
:
if
(
dwFlags
&
FLAGS_ERROR_UI_FLAGS_NO_UI
)
return
ERROR_CANCELLED
;
if
(
dwFlags
&
FLAGS_ERROR_UI_FLAGS_NO_UI
)
{
res
=
ERROR_CANCELLED
;
break
;
}
if
(
!
req
)
return
ERROR_INVALID_HANDLE
;
if
(
dwFlags
&
~
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS
)
FIXME
(
"%08x contains unsupported flags.
\n
"
,
dwFlags
);
return
DialogBoxParamW
(
WININET_hModule
,
MAKEINTRESOURCEW
(
IDD_INVCERTDLG
),
hWnd
,
WININET_InvalidCertificateDialog
,
(
LPARAM
)
&
params
);
res
=
DialogBoxParamW
(
WININET_hModule
,
MAKEINTRESOURCEW
(
IDD_INVCERTDLG
),
hWnd
,
WININET_InvalidCertificateDialog
,
(
LPARAM
)
&
params
);
break
;
case
ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR
:
case
ERROR_INTERNET_POST_IS_NON_SECURE
:
FIXME
(
"Need to display dialog for error %d
\n
"
,
dwError
);
return
ERROR_SUCCESS
;
res
=
ERROR_SUCCESS
;
break
;
default:
res
=
ERROR_NOT_SUPPORTED
;
}
return
ERROR_NOT_SUPPORTED
;
if
(
req
)
WININET_Release
(
&
req
->
hdr
);
return
res
;
}
dlls/wininet/tests/internet.c
View file @
b5fec3c0
...
...
@@ -1303,11 +1303,11 @@ static void test_InternetErrorDlg(void)
res
=
InternetErrorDlg
(
hwnd
,
(
HANDLE
)
0xdeadbeef
,
i
,
flags
,
NULL
);
if
(
res
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
todo_wine
ok
(
test_flags
&
FLAG_UNIMPL
,
"%i is unexpectedly unimplemented.
\n
"
,
i
);
ok
(
test_flags
&
FLAG_UNIMPL
,
"%i is unexpectedly unimplemented.
\n
"
,
i
);
continue
;
}
else
todo_wine
ok
(
res
==
ERROR_INVALID_HANDLE
,
"Got %d (%d)
\n
"
,
res
,
i
);
ok
(
res
==
ERROR_INVALID_HANDLE
,
"Got %d (%d)
\n
"
,
res
,
i
);
/* With a valid req */
if
(
i
==
ERROR_INTERNET_NEED_UI
)
...
...
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