Implemented InternetSetOptionExA/W.

This commit is contained in:
Mike McCormack 2003-05-11 02:59:52 +00:00 committed by Alexandre Julliard
parent 07eda42808
commit 31c9b82411
2 changed files with 76 additions and 7 deletions

View File

@ -1530,10 +1530,79 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
LPVOID lpBuffer, DWORD dwBufferLength)
{
/* FIXME!!! implement if lpBuffer is a string, dwBufferLength is
in TCHARs */
return InternetSetOptionW(hInternet,dwOption, lpBuffer,
dwBufferLength);
LPVOID wbuffer;
DWORD wlen;
BOOL r;
switch( dwOption )
{
case INTERNET_OPTION_PROXY:
{
LPINTERNET_PROXY_INFOA pi = (LPINTERNET_PROXY_INFOA) lpBuffer;
LPINTERNET_PROXY_INFOW piw;
DWORD proxlen, prbylen;
LPWSTR prox, prby;
proxlen = MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, NULL, 0);
prbylen= MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, NULL, 0);
wlen = sizeof *piw + proxlen + prbylen;
wbuffer = HeapAlloc( GetProcessHeap(), 0, wlen );
piw = (LPINTERNET_PROXY_INFOW) wbuffer;
piw->dwAccessType = pi->dwAccessType;
prox = (LPWSTR) &piw[1];
prby = &prox[proxlen+1];
MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, prox, proxlen);
MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, prby, prbylen);
piw->lpszProxy = prox;
piw->lpszProxyBypass = prby;
}
break;
case INTERNET_OPTION_USER_AGENT:
case INTERNET_OPTION_USERNAME:
case INTERNET_OPTION_PASSWORD:
wlen = MultiByteToWideChar( CP_ACP, 0, lpBuffer, dwBufferLength,
NULL, 0 );
wbuffer = HeapAlloc( GetProcessHeap(), 0, wlen );
MultiByteToWideChar( CP_ACP, 0, lpBuffer, dwBufferLength,
wbuffer, wlen );
break;
default:
wbuffer = lpBuffer;
wlen = dwBufferLength;
}
r = InternetSetOptionW(hInternet,dwOption, wbuffer, wlen);
if( lpBuffer != wbuffer )
HeapFree( GetProcessHeap(), 0, wbuffer );
return r;
}
/***********************************************************************
* InternetSetOptionExA (WININET.@)
*/
BOOL WINAPI InternetSetOptionExA(HINTERNET hInternet, DWORD dwOption,
LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags)
{
FIXME("Flags %08lx ignored\n", dwFlags);
return InternetSetOptionA( hInternet, dwOption, lpBuffer, dwBufferLength );
}
/***********************************************************************
* InternetSetOptionExW (WININET.@)
*/
BOOL WINAPI InternetSetOptionExW(HINTERNET hInternet, DWORD dwOption,
LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags)
{
FIXME("Flags %08lx ignored\n", dwFlags);
if( dwFlags & ~ISO_VALID_FLAGS )
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
return InternetSetOptionW( hInternet, dwOption, lpBuffer, dwBufferLength );
}

View File

@ -11,7 +11,7 @@
@ stub DeleteUrlCacheContainerA
@ stub DeleteUrlCacheContainerW
@ stdcall DeleteUrlCacheEntry(str)
@ stdcall DeleteUrlCacheGroup(double long ptr) DeleteUrlCacheGroup
@ stdcall DeleteUrlCacheGroup(double long ptr)
@ stdcall DetectAutoProxyUrl(str long long)
@ stdcall DllInstall(long ptr) WININET_DllInstall
@ stub FindCloseUrlCache
@ -131,8 +131,8 @@
@ stub InternetSetFilePointer
@ stdcall InternetSetOptionA(ptr long ptr long)
@ stdcall InternetSetOptionW(ptr long ptr long)
@ stub InternetSetOptionExA
@ stub InternetSetOptionExW
@ stdcall InternetSetOptionExA(ptr long ptr long long)
@ stdcall InternetSetOptionExW(ptr long ptr long long)
@ stdcall InternetSetStatusCallback(ptr ptr) InternetSetStatusCallbackA
@ stdcall InternetSetStatusCallbackA(ptr ptr)
@ stub InternetSetStatusCallbackW