Commit ce6a2289 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Move InternetQueryOption(INTERNET_OPTION_DATAFILE_NAME).

parent 0e010d83
......@@ -1449,6 +1449,35 @@ static DWORD HTTPREQ_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b
return ERROR_SUCCESS;
}
}
case INTERNET_OPTION_DATAFILE_NAME: {
DWORD req_size;
TRACE("INTERNET_OPTION_DATAFILE_NAME\n");
if(!req->lpszCacheFile) {
*size = 0;
return ERROR_INTERNET_ITEM_NOT_FOUND;
}
if(unicode) {
req_size = (lstrlenW(req->lpszCacheFile)+1) * sizeof(WCHAR);
if(*size < req_size)
return ERROR_INSUFFICIENT_BUFFER;
*size = req_size;
memcpy(buffer, req->lpszCacheFile, *size);
return ERROR_SUCCESS;
}else {
req_size = WideCharToMultiByte(CP_ACP, 0, req->lpszCacheFile, -1, NULL, 0, NULL, NULL);
if (req_size > *size)
return ERROR_INSUFFICIENT_BUFFER;
*size = WideCharToMultiByte(CP_ACP, 0, req->lpszCacheFile,
-1, buffer, *size, NULL, NULL);
return ERROR_SUCCESS;
}
}
}
FIXME("Not implemented option %d\n", option);
......
......@@ -1872,51 +1872,6 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
FIXME("INTERNET_OPTION_USER_AGENT\n");
break;
case INTERNET_OPTION_DATAFILE_NAME:
{
TRACE("INTERNET_OPTION_DATAFILE_NAME\n");
if (!lpwhh)
{
WARN("Invalid hInternet handle\n");
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (lpwhh->htype == WH_HHTTPREQ)
{
LPWININETHTTPREQW lpreq = (LPWININETHTTPREQW) lpwhh;
DWORD size;
if(!lpreq->lpszCacheFile) {
*lpdwBufferLength = 0;
INTERNET_SetLastError(ERROR_INTERNET_ITEM_NOT_FOUND);
}
else if(bIsUnicode)
{
size = (lstrlenW(lpreq->lpszCacheFile)+1) * sizeof(WCHAR);
if (*lpdwBufferLength < size)
INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER);
else
{
memcpy(lpBuffer, lpreq->lpszCacheFile, size);
bSuccess = TRUE;
}
*lpdwBufferLength = size;
}
else
{
size = WideCharToMultiByte(CP_ACP, 0, lpreq->lpszCacheFile, -1, NULL, 0, NULL, NULL);
if (size > *lpdwBufferLength) {
INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER);
}else {
*lpdwBufferLength = WideCharToMultiByte(CP_ACP, 0, lpreq->lpszCacheFile,
-1, lpBuffer, *lpdwBufferLength, NULL, NULL);
bSuccess = TRUE;
}
}
}
break;
}
case INTERNET_OPTION_HTTP_VERSION:
{
if (*lpdwBufferLength < sizeof(HTTP_VERSION_INFO))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment