Commit be86c297 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet: Implement InternetQueryOption(INTERNET_OPTION_DATAFILE_NAME) for ftp file objects.

parent 6f6ee2e7
......@@ -1133,8 +1133,39 @@ static DWORD FTPFILE_QueryOption(object_header_t *hdr, DWORD option, void *buffe
*size = sizeof(DWORD);
*(DWORD*)buffer = INTERNET_HANDLE_TYPE_FTP_FILE;
return ERROR_SUCCESS;
case INTERNET_OPTION_DATAFILE_NAME:
{
DWORD required;
ftp_file_t *file = (ftp_file_t *)hdr;
TRACE("INTERNET_OPTION_DATAFILE_NAME\n");
if (!file->cache_file)
{
*size = 0;
return ERROR_INTERNET_ITEM_NOT_FOUND;
}
if (unicode)
{
required = (lstrlenW(file->cache_file) + 1) * sizeof(WCHAR);
if (*size < required)
return ERROR_INSUFFICIENT_BUFFER;
*size = required;
memcpy(buffer, file->cache_file, *size);
return ERROR_SUCCESS;
}
else
{
required = WideCharToMultiByte(CP_ACP, 0, file->cache_file, -1, NULL, 0, NULL, NULL);
if (required > *size)
return ERROR_INSUFFICIENT_BUFFER;
*size = WideCharToMultiByte(CP_ACP, 0, file->cache_file, -1, buffer, *size, NULL, NULL);
return ERROR_SUCCESS;
}
}
}
return INET_QueryOption(option, buffer, size, unicode);
}
......
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