wininet: Support setting username and password through options.

This commit is contained in:
Hans Leidekker 2008-09-24 16:54:37 +02:00 committed by Alexandre Julliard
parent 319f28553c
commit 8c20124fc4
1 changed files with 22 additions and 1 deletions

View File

@ -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,