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
1709635f
Commit
1709635f
authored
Jul 22, 2015
by
Huw Davies
Committed by
Alexandre Julliard
Jul 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT.
parent
a6749d52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
4 deletions
+72
-4
session.c
dlls/winhttp/session.c
+6
-0
notification.c
dlls/winhttp/tests/notification.c
+65
-4
winhttp_private.h
dlls/winhttp/winhttp_private.h
+1
-0
No files found.
dlls/winhttp/session.c
View file @
1709635f
...
...
@@ -98,6 +98,8 @@ static void session_destroy( object_header_t *hdr )
TRACE
(
"%p
\n
"
,
session
);
if
(
session
->
unload_event
)
SetEvent
(
session
->
unload_event
);
LIST_FOR_EACH_SAFE
(
item
,
next
,
&
session
->
cookie_cache
)
{
domain
=
LIST_ENTRY
(
item
,
domain_t
,
entry
);
...
...
@@ -199,6 +201,10 @@ static BOOL session_set_option( object_header_t *hdr, DWORD option, LPVOID buffe
case
WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH
:
FIXME
(
"WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: 0x%x
\n
"
,
*
(
DWORD
*
)
buffer
);
return
TRUE
;
case
WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT
:
TRACE
(
"WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: %p
\n
"
,
*
(
HANDLE
*
)
buffer
);
session
->
unload_event
=
*
(
HANDLE
*
)
buffer
;
return
TRUE
;
default:
FIXME
(
"unimplemented option %u
\n
"
,
option
);
set_last_error
(
ERROR_INVALID_PARAMETER
);
...
...
dlls/winhttp/tests/notification.c
View file @
1709635f
...
...
@@ -158,9 +158,9 @@ static void setup_test( struct info *info, enum api function, unsigned int line
static
void
test_connection_cache
(
void
)
{
HANDLE
ses
,
con
,
req
;
HANDLE
ses
,
con
,
req
,
event
;
DWORD
size
,
status
;
BOOL
ret
;
BOOL
ret
,
unload
=
TRUE
;
struct
info
info
,
*
context
=
&
info
;
info
.
test
=
cache_test
;
...
...
@@ -171,6 +171,14 @@ static void test_connection_cache( void )
ses
=
WinHttpOpen
(
user_agent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT
,
&
event
,
sizeof
(
event
)
);
if
(
!
ret
)
{
win_skip
(
"Unload event not supported
\n
"
);
unload
=
FALSE
;
}
WinHttpSetStatusCallback
(
ses
,
check_notification
,
WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS
,
0
);
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_CONTEXT_VALUE
,
&
context
,
sizeof
(
struct
info
*
)
);
...
...
@@ -236,15 +244,33 @@ static void test_connection_cache( void )
setup_test
(
&
info
,
winhttp_close_handle
,
__LINE__
);
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
if
(
unload
)
{
status
=
WaitForSingleObject
(
event
,
0
);
ok
(
status
==
WAIT_TIMEOUT
,
"got %08x
\n
"
,
status
);
}
WinHttpCloseHandle
(
ses
);
Sleep
(
2000
);
/* make sure connection is evicted from cache */
if
(
unload
)
{
status
=
WaitForSingleObject
(
event
,
0
);
ok
(
status
==
WAIT_OBJECT_0
,
"got %08x
\n
"
,
status
);
}
info
.
index
=
0
;
ses
=
WinHttpOpen
(
user_agent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
if
(
unload
)
{
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT
,
&
event
,
sizeof
(
event
)
);
ok
(
ret
,
"failed to set unload option
\n
"
);
}
WinHttpSetStatusCallback
(
ses
,
check_notification
,
WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS
,
0
);
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_CONTEXT_VALUE
,
&
context
,
sizeof
(
struct
info
*
)
);
...
...
@@ -311,9 +337,23 @@ static void test_connection_cache( void )
done:
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
if
(
unload
)
{
status
=
WaitForSingleObject
(
event
,
0
);
ok
(
status
==
WAIT_TIMEOUT
,
"got %08x
\n
"
,
status
);
}
WinHttpCloseHandle
(
ses
);
Sleep
(
2000
);
/* make sure connection is evicted from cache */
if
(
unload
)
{
status
=
WaitForSingleObject
(
event
,
0
);
ok
(
status
==
WAIT_OBJECT_0
,
"got %08x
\n
"
,
status
);
}
CloseHandle
(
event
);
}
static
const
struct
notification
redirect_test
[]
=
...
...
@@ -433,9 +473,9 @@ static const struct notification async_test[] =
static
void
test_async
(
void
)
{
HANDLE
ses
,
con
,
req
;
HANDLE
ses
,
con
,
req
,
event
;
DWORD
size
,
status
;
BOOL
ret
;
BOOL
ret
,
unload
=
TRUE
;
struct
info
info
,
*
context
=
&
info
;
char
buffer
[
1024
];
...
...
@@ -447,6 +487,14 @@ static void test_async( void )
ses
=
WinHttpOpen
(
user_agent
,
0
,
NULL
,
NULL
,
WINHTTP_FLAG_ASYNC
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT
,
&
event
,
sizeof
(
event
)
);
if
(
!
ret
)
{
win_skip
(
"Unload event not supported
\n
"
);
unload
=
FALSE
;
}
WinHttpSetStatusCallback
(
ses
,
check_notification
,
WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS
,
0
);
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_CONTEXT_VALUE
,
&
context
,
sizeof
(
struct
info
*
)
);
...
...
@@ -501,9 +549,22 @@ static void test_async( void )
setup_test
(
&
info
,
winhttp_close_handle
,
__LINE__
);
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
if
(
unload
)
{
status
=
WaitForSingleObject
(
event
,
0
);
ok
(
status
==
WAIT_TIMEOUT
,
"got %08x
\n
"
,
status
);
}
WinHttpCloseHandle
(
ses
);
WaitForSingleObject
(
info
.
wait
,
INFINITE
);
if
(
unload
)
{
status
=
WaitForSingleObject
(
event
,
2000
);
ok
(
status
==
WAIT_OBJECT_0
,
"got %08x
\n
"
,
status
);
}
CloseHandle
(
event
);
CloseHandle
(
info
.
wait
);
}
...
...
dlls/winhttp/winhttp_private.h
View file @
1709635f
...
...
@@ -110,6 +110,7 @@ typedef struct
LPWSTR
proxy_username
;
LPWSTR
proxy_password
;
struct
list
cookie_cache
;
HANDLE
unload_event
;
}
session_t
;
typedef
struct
...
...
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