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
76eb42a7
Commit
76eb42a7
authored
Aug 28, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpapi: Implement HttpCreateServerSession() and HttpCloseServerSession().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
efacf6f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
14 deletions
+51
-14
httpapi_main.c
dlls/httpapi/httpapi_main.c
+50
-6
httpapi.c
dlls/httpapi/tests/httpapi.c
+0
-7
http.h
include/http.h
+1
-1
No files found.
dlls/httpapi/httpapi_main.c
View file @
76eb42a7
...
...
@@ -23,6 +23,7 @@
#include "winternl.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
httpapi
);
...
...
@@ -470,20 +471,63 @@ ULONG WINAPI HttpSendHttpResponse(HANDLE queue, HTTP_REQUEST_ID id, ULONG flags,
return
ret
;
}
struct
server_session
{
struct
list
entry
;
};
static
struct
list
server_sessions
=
LIST_INIT
(
server_sessions
);
static
struct
server_session
*
get_server_session
(
HTTP_SERVER_SESSION_ID
id
)
{
struct
server_session
*
session
;
LIST_FOR_EACH_ENTRY
(
session
,
&
server_sessions
,
struct
server_session
,
entry
)
{
if
((
HTTP_SERVER_SESSION_ID
)(
ULONG_PTR
)
session
==
id
)
return
session
;
}
return
NULL
;
}
/***********************************************************************
* HttpCreateServerSession (HTTPAPI.@)
*/
ULONG
WINAPI
HttpCreateServerSession
(
HTTPAPI_VERSION
version
,
HTTP_SERVER_SESSION_ID
*
id
,
ULONG
reserved
)
ULONG
WINAPI
HttpCreateServerSession
(
HTTPAPI_VERSION
version
,
HTTP_SERVER_SESSION_ID
*
id
,
ULONG
reserved
)
{
FIXME
(
"({%d,%d}, %p, %d): stub!
\n
"
,
version
.
HttpApiMajorVersion
,
version
.
HttpApiMinorVersion
,
id
,
reserved
);
return
ERROR_ACCESS_DENIED
;
struct
server_session
*
session
;
TRACE
(
"version %u.%u, id %p, reserved %u.
\n
"
,
version
.
HttpApiMajorVersion
,
version
.
HttpApiMinorVersion
,
id
,
reserved
);
if
(
!
id
)
return
ERROR_INVALID_PARAMETER
;
if
((
version
.
HttpApiMajorVersion
!=
1
&&
version
.
HttpApiMajorVersion
!=
2
)
||
version
.
HttpApiMinorVersion
)
return
ERROR_REVISION_MISMATCH
;
if
(
!
(
session
=
heap_alloc
(
sizeof
(
*
session
))))
return
ERROR_OUTOFMEMORY
;
list_add_tail
(
&
server_sessions
,
&
session
->
entry
);
*
id
=
(
ULONG_PTR
)
session
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
* HttpCloseServerSession (HTTPAPI.@)
*/
ULONG
WINAPI
HttpCloseServerSession
(
HTTP_SERVER_SESSION_ID
id
)
ULONG
WINAPI
HttpCloseServerSession
(
HTTP_SERVER_SESSION_ID
id
)
{
FIXME
(
"(%s): stub!
\n
"
,
wine_dbgstr_longlong
(
id
));
return
ERROR_INVALID_PARAMETER
;
struct
server_session
*
session
;
TRACE
(
"id %s.
\n
"
,
wine_dbgstr_longlong
(
id
));
if
(
!
(
session
=
get_server_session
(
id
)))
return
ERROR_INVALID_PARAMETER
;
list_remove
(
&
session
->
entry
);
heap_free
(
session
);
return
ERROR_SUCCESS
;
}
dlls/httpapi/tests/httpapi.c
View file @
76eb42a7
...
...
@@ -888,37 +888,30 @@ static void test_HttpCreateServerSession(void)
version
.
HttpApiMajorVersion
=
1
;
version
.
HttpApiMinorVersion
=
0
;
ret
=
pHttpCreateServerSession
(
version
,
NULL
,
0
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %u.
\n
"
,
ret
);
version
.
HttpApiMajorVersion
=
1
;
version
.
HttpApiMinorVersion
=
1
;
ret
=
pHttpCreateServerSession
(
version
,
&
session
,
0
);
todo_wine
ok
(
ret
==
ERROR_REVISION_MISMATCH
,
"Unexpected return value %u.
\n
"
,
ret
);
version
.
HttpApiMajorVersion
=
3
;
version
.
HttpApiMinorVersion
=
0
;
ret
=
pHttpCreateServerSession
(
version
,
&
session
,
0
);
todo_wine
ok
(
ret
==
ERROR_REVISION_MISMATCH
,
"Unexpected return value %u.
\n
"
,
ret
);
version
.
HttpApiMajorVersion
=
2
;
version
.
HttpApiMinorVersion
=
0
;
ret
=
pHttpCreateServerSession
(
version
,
&
session
,
0
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %u.
\n
"
,
ret
);
ret
=
pHttpCloseServerSession
(
session
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %u.
\n
"
,
ret
);
version
.
HttpApiMajorVersion
=
1
;
version
.
HttpApiMinorVersion
=
0
;
ret
=
pHttpCreateServerSession
(
version
,
&
session
,
0
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %u.
\n
"
,
ret
);
ret
=
pHttpCloseServerSession
(
session
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %u.
\n
"
,
ret
);
ret
=
pHttpCloseServerSession
(
0xdead
);
...
...
include/http.h
View file @
76eb42a7
...
...
@@ -398,9 +398,9 @@ typedef struct _HTTP_LOG_DATA
}
HTTP_LOG_DATA
,
*
PHTTP_LOG_DATA
;
ULONG
WINAPI
HttpAddUrl
(
HANDLE
,
PCWSTR
,
PVOID
);
ULONG
WINAPI
HttpCloseServerSession
(
HTTP_SERVER_SESSION_ID
id
);
ULONG
WINAPI
HttpCreateHttpHandle
(
PHANDLE
,
ULONG
);
ULONG
WINAPI
HttpCreateServerSession
(
HTTPAPI_VERSION
,
PHTTP_SERVER_SESSION_ID
,
ULONG
);
ULONG
WINAPI
HttpCloseServerSession
(
HTTP_SERVER_SESSION_ID
);
ULONG
WINAPI
HttpDeleteServiceConfiguration
(
HANDLE
,
HTTP_SERVICE_CONFIG_ID
,
PVOID
,
ULONG
,
LPOVERLAPPED
);
ULONG
WINAPI
HttpInitialize
(
HTTPAPI_VERSION
version
,
ULONG
flags
,
void
*
reserved
);
ULONG
WINAPI
HttpTerminate
(
ULONG
flags
,
void
*
reserved
);
...
...
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