From 4f714df9d6d948039ed1bccce14b9ef738bca2cb Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 22 Aug 2019 22:35:26 -0500 Subject: [PATCH] httpapi: Implement HttpRemoveUrl(). Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/httpapi/httpapi_main.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/dlls/httpapi/httpapi_main.c b/dlls/httpapi/httpapi_main.c index cc522739677..5f2a3079341 100644 --- a/dlls/httpapi/httpapi_main.c +++ b/dlls/httpapi/httpapi_main.c @@ -218,10 +218,30 @@ ULONG WINAPI HttpAddUrl(HANDLE queue, const WCHAR *url, void *reserved) /*********************************************************************** * HttpRemoveUrl (HTTPAPI.@) */ -ULONG WINAPI HttpRemoveUrl(HANDLE queue, const WCHAR *url) +ULONG WINAPI HttpRemoveUrl(HANDLE queue, const WCHAR *urlW) { - FIXME("queue %p, url %s, stub!\n", queue, debugstr_w(url)); - return ERROR_CALL_NOT_IMPLEMENTED; + ULONG ret = ERROR_SUCCESS; + OVERLAPPED ovl = {}; + char *url; + int len; + + TRACE("queue %p, url %s.\n", queue, debugstr_w(urlW)); + + if (!queue) + return ERROR_INVALID_PARAMETER; + + len = WideCharToMultiByte(CP_ACP, 0, urlW, -1, NULL, 0, NULL, NULL); + if (!(url = heap_alloc(len))) + return ERROR_OUTOFMEMORY; + WideCharToMultiByte(CP_ACP, 0, urlW, -1, url, len, NULL, NULL); + + ovl.hEvent = (HANDLE)((ULONG_PTR)CreateEventW(NULL, TRUE, FALSE, NULL) | 1); + + if (!DeviceIoControl(queue, IOCTL_HTTP_REMOVE_URL, url, len, NULL, 0, NULL, &ovl)) + ret = GetLastError(); + CloseHandle(ovl.hEvent); + heap_free(url); + return ret; } /***********************************************************************