Zebediah Figura : httpapi: Implement HttpCreateHttpHandle().

Alexandre Julliard julliard at winehq.org
Thu Aug 22 15:09:54 CDT 2019


Module: wine
Branch: master
Commit: cf14c0bde259aea6172b07c258f32a6e484014a4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cf14c0bde259aea6172b07c258f32a6e484014a4

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Aug 21 23:30:14 2019 -0500

httpapi: Implement HttpCreateHttpHandle().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/httpapi/httpapi_main.c  | 19 ++++++++++++++++---
 dlls/httpapi/tests/httpapi.c |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/httpapi/httpapi_main.c b/dlls/httpapi/httpapi_main.c
index 429ae1a..4536aa8 100644
--- a/dlls/httpapi/httpapi_main.c
+++ b/dlls/httpapi/httpapi_main.c
@@ -22,6 +22,7 @@
 
 #include "windef.h"
 #include "winbase.h"
+#include "winternl.h"
 #include "http.h"
 #include "wine/debug.h"
 
@@ -167,10 +168,22 @@ ULONG WINAPI HttpSetServiceConfiguration( HANDLE handle, HTTP_SERVICE_CONFIG_ID
  *   NO_ERROR if function succeeds, or error code if function fails
  *
  */
-ULONG WINAPI HttpCreateHttpHandle( PHANDLE handle, ULONG reserved )
+ULONG WINAPI HttpCreateHttpHandle(HANDLE *handle, ULONG reserved)
 {
-    FIXME( "(%p, %d): stub!\n", handle, reserved);
-    return ERROR_CALL_NOT_IMPLEMENTED;
+    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;
+
+    TRACE("handle %p, reserved %#x.\n", handle, reserved);
+
+    if (!handle)
+        return ERROR_INVALID_PARAMETER;
+
+    RtlInitUnicodeString(&string, device_nameW);
+    attr.ObjectName = &string;
+    return RtlNtStatusToDosError(NtCreateFile(handle, 0, &attr, &iosb, NULL,
+            FILE_ATTRIBUTE_NORMAL, 0, FILE_OPEN, FILE_NON_DIRECTORY_FILE, NULL, 0));
 }
 
 /***********************************************************************
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index 6646e8e..c30c380 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -117,7 +117,7 @@ static void test_v1_server(void)
     memset(req_buffer, 0xcc, sizeof(req_buffer));
 
     ret = HttpCreateHttpHandle(NULL, 0);
-    todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Unexpected error %u.\n", ret);
+    ok(ret == ERROR_INVALID_PARAMETER, "Unexpected error %u.\n", ret);
 
     /* Non-zero reserved parameter is accepted on XP/2k3. */
     queue = NULL;




More information about the wine-cvs mailing list