wininet: Added default fallback for setting handle options and use it for INTERNET_OPTION_CALLBACK.

This commit is contained in:
Jacek Caban 2012-03-08 12:19:14 +01:00 committed by Alexandre Julliard
parent a729027c69
commit 4863257e30
4 changed files with 19 additions and 21 deletions

View File

@ -1297,7 +1297,7 @@ static const object_vtbl_t FTPFILEVtbl = {
FTPFILE_Destroy, FTPFILE_Destroy,
NULL, NULL,
FTPFILE_QueryOption, FTPFILE_QueryOption,
NULL, INET_SetOption,
FTPFILE_ReadFile, FTPFILE_ReadFile,
FTPFILE_ReadFileExA, FTPFILE_ReadFileExA,
FTPFILE_ReadFileExW, FTPFILE_ReadFileExW,
@ -2389,7 +2389,7 @@ static const object_vtbl_t FTPSESSIONVtbl = {
FTPSESSION_Destroy, FTPSESSION_Destroy,
FTPSESSION_CloseConnection, FTPSESSION_CloseConnection,
FTPSESSION_QueryOption, FTPSESSION_QueryOption,
NULL, INET_SetOption,
NULL, NULL,
NULL, NULL,
NULL, NULL,
@ -3474,7 +3474,7 @@ static const object_vtbl_t FTPFINDNEXTVtbl = {
FTPFINDNEXT_Destroy, FTPFINDNEXT_Destroy,
NULL, NULL,
FTPFINDNEXT_QueryOption, FTPFINDNEXT_QueryOption,
NULL, INET_SetOption,
NULL, NULL,
NULL, NULL,
NULL, NULL,

View File

@ -2212,7 +2212,7 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer,
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
return ERROR_INTERNET_INVALID_OPTION; return INET_SetOption(hdr, option, buffer, size);
} }
/* read some more data into the read buffer (the read section must be held) */ /* read some more data into the read buffer (the read section must be held) */
@ -5515,7 +5515,7 @@ static DWORD HTTPSESSION_SetOption(object_header_t *hdr, DWORD option, void *buf
default: break; default: break;
} }
return ERROR_INTERNET_INVALID_OPTION; return INET_SetOption(hdr, option, buffer, size);
} }
static const object_vtbl_t HTTPSESSIONVtbl = { static const object_vtbl_t HTTPSESSIONVtbl = {

View File

@ -881,7 +881,7 @@ static const object_vtbl_t APPINFOVtbl = {
APPINFO_Destroy, APPINFO_Destroy,
NULL, NULL,
APPINFO_QueryOption, APPINFO_QueryOption,
NULL, INET_SetOption,
NULL, NULL,
NULL, NULL,
NULL, NULL,
@ -2529,6 +2529,16 @@ BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption,
return res == ERROR_SUCCESS; return res == ERROR_SUCCESS;
} }
DWORD INET_SetOption(object_header_t *hdr, DWORD option, void *buf, DWORD size)
{
switch(option) {
case INTERNET_OPTION_CALLBACK:
WARN("Not settable option %u\n", option);
return ERROR_INTERNET_OPTION_NOT_SETTABLE;
}
return ERROR_INTERNET_INVALID_OPTION;
}
/*********************************************************************** /***********************************************************************
* InternetSetOptionW (WININET.@) * InternetSetOptionW (WININET.@)
@ -2549,7 +2559,7 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
TRACE("(%p %d %p %d)\n", hInternet, dwOption, lpBuffer, dwBufferLength); TRACE("(%p %d %p %d)\n", hInternet, dwOption, lpBuffer, dwBufferLength);
lpwhh = (object_header_t*) get_handle_object( hInternet ); lpwhh = (object_header_t*) get_handle_object( hInternet );
if(lpwhh && lpwhh->vtbl->SetOption) { if(lpwhh) {
DWORD res; DWORD res;
res = lpwhh->vtbl->SetOption(lpwhh, dwOption, lpBuffer, dwBufferLength); res = lpwhh->vtbl->SetOption(lpwhh, dwOption, lpBuffer, dwBufferLength);
@ -2845,19 +2855,6 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
switch( dwOption ) switch( dwOption )
{ {
case INTERNET_OPTION_CALLBACK:
{
object_header_t *lpwh;
if (!(lpwh = get_handle_object(hInternet)))
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return FALSE;
}
WININET_Release(lpwh);
INTERNET_SetLastError(ERROR_INTERNET_OPTION_NOT_SETTABLE);
return FALSE;
}
case INTERNET_OPTION_PROXY: case INTERNET_OPTION_PROXY:
{ {
LPINTERNET_PROXY_INFOA pi = (LPINTERNET_PROXY_INFOA) lpBuffer; LPINTERNET_PROXY_INFOA pi = (LPINTERNET_PROXY_INFOA) lpBuffer;

View File

@ -486,7 +486,8 @@ object_header_t *get_handle_object( HINTERNET hinternet ) DECLSPEC_HIDDEN;
object_header_t *WININET_AddRef( object_header_t *info ) DECLSPEC_HIDDEN; object_header_t *WININET_AddRef( object_header_t *info ) DECLSPEC_HIDDEN;
BOOL WININET_Release( object_header_t *info ) DECLSPEC_HIDDEN; BOOL WININET_Release( object_header_t *info ) DECLSPEC_HIDDEN;
DWORD INET_QueryOption( object_header_t *, DWORD, void *, DWORD *, BOOL ) DECLSPEC_HIDDEN; DWORD INET_QueryOption(object_header_t*,DWORD,void*,DWORD*,BOOL) DECLSPEC_HIDDEN;
DWORD INET_SetOption(object_header_t*,DWORD,void*,DWORD) DECLSPEC_HIDDEN;
time_t ConvertTimeString(LPCWSTR asctime) DECLSPEC_HIDDEN; time_t ConvertTimeString(LPCWSTR asctime) DECLSPEC_HIDDEN;