wininet: Support setting username and password through options.
Hans Leidekker
hans at codeweavers.com
Wed Sep 24 09:54:37 CDT 2008
Outlook 2007 supplies credentials this way when you configure it
to use a Hotmail account.
-Hans
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,
More information about the wine-patches
mailing list