Module: wine Branch: master Commit: 8c20124fc42d4249883825345cf0b8e82a534b09 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c20124fc42d4249883825345c...
Author: Hans Leidekker hans@codeweavers.com Date: Wed Sep 24 16:54:37 2008 +0200
wininet: Support setting username and password through options.
---
dlls/wininet/http.c | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 00dfa0f..7cb3961 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3484,11 +3484,32 @@ static DWORD HTTPSESSION_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, voi return INET_QueryOption(option, buffer, size, unicode); }
+static DWORD HTTPSESSION_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD size) +{ + WININETHTTPSESSIONW *ses = (WININETHTTPSESSIONW*)hdr; + + switch(option) { + case INTERNET_OPTION_USERNAME: + { + if (!(ses->lpszUserName = WININET_strdupW(buffer))) break; + return ERROR_SUCCESS; + } + case INTERNET_OPTION_PASSWORD: + { + if (!(ses->lpszPassword = WININET_strdupW(buffer))) break; + return ERROR_SUCCESS; + } + default: break; + } + + return ERROR_INTERNET_INVALID_OPTION; +} + static const HANDLEHEADERVtbl HTTPSESSIONVtbl = { HTTPSESSION_Destroy, NULL, HTTPSESSION_QueryOption, - NULL, + HTTPSESSION_SetOption, NULL, NULL, NULL,