[PATCH 3/5] httpapi: Implement HttpRemoveUrl().
Zebediah Figura
z.figura12 at gmail.com
Thu Aug 22 22:35:26 CDT 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
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 cc52273967..5f2a307934 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;
}
/***********************************************************************
--
2.22.0
More information about the wine-devel
mailing list