From 253d2c17d6264050c965f550b7103d174a5097d5 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 26 Oct 2009 09:56:33 +0100 Subject: [PATCH] winhttp: Implement HTTP_OPTION_PARENT_HANDLE for connection handles. --- dlls/winhttp/session.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 448603f6222..9992e5bb1e9 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -229,10 +229,36 @@ static void connect_destroy( object_header_t *hdr ) heap_free( connect ); } +static BOOL connect_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) +{ + connect_t *connect = (connect_t *)hdr; + + switch (option) + { + case WINHTTP_OPTION_PARENT_HANDLE: + { + if (!buffer || *buflen < sizeof(HINTERNET)) + { + *buflen = sizeof(HINTERNET); + set_last_error( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + + *(HINTERNET *)buffer = ((object_header_t *)connect->session)->handle; + *buflen = sizeof(HINTERNET); + return TRUE; + } + default: + FIXME("unimplemented option %u\n", option); + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } +} + static const object_vtbl_t connect_vtbl = { connect_destroy, - NULL, + connect_query_option, NULL };