Module: wine Branch: master Commit: 253d2c17d6264050c965f550b7103d174a5097d5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=253d2c17d6264050c965f550b7...
Author: Hans Leidekker hans@codeweavers.com Date: Mon Oct 26 09:56:33 2009 +0100
winhttp: Implement HTTP_OPTION_PARENT_HANDLE for connection handles.
---
dlls/winhttp/session.c | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 448603f..9992e5b 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 };