httpapi: Implement HttpCreateRequestQueue() and HttpCloseRequestQueue().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47476
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46549
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-08-29 19:58:06 -05:00 committed by Alexandre Julliard
parent f18e026e51
commit b19f4488f6
3 changed files with 48 additions and 1 deletions

View File

@ -7,8 +7,10 @@
@ stub HttpCreateConfigGroup
@ stub HttpCreateFilter
@ stdcall HttpCreateHttpHandle(ptr long)
@ stdcall HttpCreateRequestQueue(long wstr ptr long ptr)
@ stdcall HttpCreateServerSession(long ptr long)
@ stdcall HttpCreateUrlGroup(int64 ptr long)
@ stdcall HttpCloseRequestQueue(ptr)
@ stdcall HttpCloseServerSession(int64)
@ stdcall HttpCloseUrlGroup(int64)
@ stub HttpDeleteConfigGroup

View File

@ -27,6 +27,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(httpapi);
static const WCHAR device_nameW[] = {'\\','D','e','v','i','c','e','\\','H','t','t','p','\\','R','e','q','Q','u','e','u','e',0};
static WCHAR *heap_strdupW(const WCHAR *str)
{
int len = wcslen(str) + 1;
@ -207,7 +209,6 @@ ULONG WINAPI HttpSetServiceConfiguration( HANDLE handle, HTTP_SERVICE_CONFIG_ID
*/
ULONG WINAPI HttpCreateHttpHandle(HANDLE *handle, ULONG reserved)
{
static const WCHAR device_nameW[] = {'\\','D','e','v','i','c','e','\\','H','t','t','p','\\','R','e','q','Q','u','e','u','e',0};
OBJECT_ATTRIBUTES attr = {sizeof(attr)};
UNICODE_STRING string;
IO_STATUS_BLOCK iosb;
@ -693,3 +694,42 @@ ULONG WINAPI HttpRemoveUrlFromUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url, U
return ERROR_SUCCESS;
}
/***********************************************************************
* HttpCreateRequestQueue (HTTPAPI.@)
*/
ULONG WINAPI HttpCreateRequestQueue(HTTPAPI_VERSION version, const WCHAR *name,
SECURITY_ATTRIBUTES *sa, ULONG flags, HANDLE *handle)
{
OBJECT_ATTRIBUTES attr = {sizeof(attr)};
UNICODE_STRING string;
IO_STATUS_BLOCK iosb;
TRACE("version %u.%u, name %s, sa %p, flags %#x, handle %p.\n",
version.HttpApiMajorVersion, version.HttpApiMinorVersion,
debugstr_w(name), sa, flags, handle);
if (name)
FIXME("Unhandled name %s.\n", debugstr_w(name));
if (flags)
FIXME("Unhandled flags %#x.\n", flags);
RtlInitUnicodeString(&string, device_nameW);
attr.ObjectName = &string;
if (sa && sa->bInheritHandle)
attr.Attributes |= OBJ_INHERIT;
attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
return RtlNtStatusToDosError(NtCreateFile(handle, 0, &attr, &iosb, NULL,
FILE_ATTRIBUTE_NORMAL, 0, FILE_OPEN, FILE_NON_DIRECTORY_FILE, NULL, 0));
}
/***********************************************************************
* HttpCloseRequestQueue (HTTPAPI.@)
*/
ULONG WINAPI HttpCloseRequestQueue(HANDLE handle)
{
TRACE("handle %p.\n", handle);
if (!CloseHandle(handle))
return GetLastError();
return ERROR_SUCCESS;
}

View File

@ -37,6 +37,9 @@ typedef struct _HTTPAPI_VERSION
#define HTTPAPI_VERSION_1 {1,0}
#define HTTPAPI_VERSION_2 {2,0}
#define HTTP_CREATE_REQUEST_QUEUE_FLAG_OPEN_EXISTING 0x00000001
#define HTTP_CREATE_REQUEST_QUEUE_FLAG_CONTROLLER 0x00000002
#define HTTP_INITIALIZE_SERVER 0x00000001
#define HTTP_INITIALIZE_CONFIG 0x00000002
@ -426,9 +429,11 @@ typedef struct _HTTP_BINDING_INFO
ULONG WINAPI HttpAddUrl(HANDLE,PCWSTR,PVOID);
ULONG WINAPI HttpAddUrlToUrlGroup(HTTP_URL_GROUP_ID id, const WCHAR *url, HTTP_URL_CONTEXT context, ULONG reserved);
ULONG WINAPI HttpCloseRequestQueue(HANDLE handle);
ULONG WINAPI HttpCloseServerSession(HTTP_SERVER_SESSION_ID id);
ULONG WINAPI HttpCloseUrlGroup(HTTP_URL_GROUP_ID id);
ULONG WINAPI HttpCreateHttpHandle(PHANDLE,ULONG);
ULONG WINAPI HttpCreateRequestQueue(HTTPAPI_VERSION version, const WCHAR *name, SECURITY_ATTRIBUTES *sa, ULONG flags, HANDLE *handle);
ULONG WINAPI HttpCreateServerSession(HTTPAPI_VERSION,PHTTP_SERVER_SESSION_ID,ULONG);
ULONG WINAPI HttpCreateUrlGroup(HTTP_SERVER_SESSION_ID session_id, HTTP_URL_GROUP_ID *group_id, ULONG reserved);
ULONG WINAPI HttpDeleteServiceConfiguration(HANDLE,HTTP_SERVICE_CONFIG_ID,PVOID,ULONG,LPOVERLAPPED);