[PATCH 0/1] MR2697: winhttp: Support WINHTTP_OPTION_PARENT_HANDLE in request_query_option().
This is needed for mod.io integration in game "The Entropy Centre". Without support for this option the game hangs when trying to authenticate. Please note that i do not know how Wine works, and have very little understanding of what i am doing. I copied and adjusted code from `connect_query_option()` in the same file. The game does work with this patch though. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2697
From: Vova Mshanetskiy <vovams163(a)gmail.com> --- dlls/winhttp/session.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 6b426bee220..9104f185274 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -737,6 +737,14 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void switch (option) { + case WINHTTP_OPTION_PARENT_HANDLE: + { + if (!validate_buffer( buffer, buflen, sizeof(HINTERNET) )) return FALSE; + + *(HINTERNET *)buffer = ((struct object_header *)request->connect)->handle; + *buflen = sizeof(HINTERNET); + return TRUE; + } case WINHTTP_OPTION_SECURITY_FLAGS: { DWORD flags; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2697
Hans Leidekker (@hans) commented about dlls/winhttp/session.c:
switch (option) { + case WINHTTP_OPTION_PARENT_HANDLE: + { + if (!validate_buffer( buffer, buflen, sizeof(HINTERNET) )) return FALSE; + + *(HINTERNET *)buffer = ((struct object_header *)request->connect)->handle;
Thanks for the patch. You can avoid the cast like this: ``` *(HINTERNET *)buffer = request->connect->hdr.handle; ``` Please also remove the cast from connect_query_option(). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2697#note_30977
participants (3)
-
Hans Leidekker (@hans) -
Vova Mshanetskiy -
Vova Mshanetskiy (@vovams)