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
40bf7410
Commit
40bf7410
authored
Aug 02, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement IWinHttpRequest::SetAutoLogonPolicy.
parent
e5b8c497
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
request.c
dlls/winhttp/request.c
+28
-2
winhttp.c
dlls/winhttp/tests/winhttp.c
+15
-0
No files found.
dlls/winhttp/request.c
View file @
40bf7410
...
...
@@ -2174,6 +2174,7 @@ struct winhttp_request
DWORD
bytes_available
;
DWORD
bytes_read
;
DWORD
error
;
DWORD
logon_policy
;
LONG
resolve_timeout
;
LONG
connect_timeout
;
LONG
send_timeout
;
...
...
@@ -2845,6 +2846,11 @@ static HRESULT request_send( struct winhttp_request *request )
{
return
HRESULT_FROM_WIN32
(
get_last_error
()
);
}
if
(
!
WinHttpSetOption
(
request
->
hrequest
,
WINHTTP_OPTION_AUTOLOGON_POLICY
,
&
request
->
logon_policy
,
sizeof
(
request
->
logon_policy
)
))
{
return
HRESULT_FROM_WIN32
(
get_last_error
()
);
}
if
(
!
WinHttpSetTimeouts
(
request
->
hrequest
,
request
->
resolve_timeout
,
request
->
connect_timeout
,
...
...
@@ -3241,8 +3247,28 @@ static HRESULT WINAPI winhttp_request_SetAutoLogonPolicy(
IWinHttpRequest
*
iface
,
WinHttpRequestAutoLogonPolicy
policy
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
struct
winhttp_request
*
request
=
impl_from_IWinHttpRequest
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %u
\n
"
,
request
,
policy
);
EnterCriticalSection
(
&
request
->
cs
);
switch
(
policy
)
{
case
AutoLogonPolicy_Always
:
request
->
logon_policy
=
WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW
;
break
;
case
AutoLogonPolicy_OnlyIfBypassProxy
:
request
->
logon_policy
=
WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM
;
break
;
case
AutoLogonPolicy_Never
:
request
->
logon_policy
=
WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH
;
break
;
default:
hr
=
E_INVALIDARG
;
break
;
}
LeaveCriticalSection
(
&
request
->
cs
);
return
hr
;
}
static
const
struct
IWinHttpRequestVtbl
winhttp_request_vtbl
=
...
...
dlls/winhttp/tests/winhttp.c
View file @
40bf7410
...
...
@@ -2265,6 +2265,12 @@ static void test_IWinHttpRequest(void)
hr
=
IWinHttpRequest_SetRequestHeader
(
req
,
date
,
today
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN
),
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_SetAutoLogonPolicy
(
req
,
0xdeadbeef
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_SetAutoLogonPolicy
(
req
,
AutoLogonPolicy_OnlyIfBypassProxy
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
SysFreeString
(
method
);
method
=
SysAllocString
(
method1W
);
SysFreeString
(
url
);
...
...
@@ -2335,6 +2341,9 @@ static void test_IWinHttpRequest(void)
hr
=
IWinHttpRequest_SetRequestHeader
(
req
,
date
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_SetAutoLogonPolicy
(
req
,
AutoLogonPolicy_OnlyIfBypassProxy
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_Send
(
req
,
empty
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -2396,6 +2405,9 @@ static void test_IWinHttpRequest(void)
hr
=
IWinHttpRequest_SetRequestHeader
(
req
,
date
,
today
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND
),
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_SetAutoLogonPolicy
(
req
,
AutoLogonPolicy_OnlyIfBypassProxy
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
VariantInit
(
&
timeout
);
V_VT
(
&
timeout
)
=
VT_I4
;
V_I4
(
&
timeout
)
=
10
;
...
...
@@ -2457,6 +2469,9 @@ static void test_IWinHttpRequest(void)
hr
=
IWinHttpRequest_SetRequestHeader
(
req
,
date
,
today
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND
),
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_SetAutoLogonPolicy
(
req
,
AutoLogonPolicy_OnlyIfBypassProxy
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWinHttpRequest_Send
(
req
,
empty
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
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