mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:43:02 +00:00
[URLMON] Sync with Wine Staging 2.2. CORE-12823
1b04cf1 urlmon: Remove 'stub' from implemented functions trace message. 8f23a89 urlmon: Fix FindMimeFromData spec file entry. 32671b1 urlmon: Added Seek implementations for streams using cache file. aa2ed73 urlmon: Correctly handle INTERNET_STATUS_REQUEST_COMPLETE notification with no data available. 22b4599 urlmon: Fix buffer overflow in parse_canonicalize. svn path=/trunk/; revision=74195
This commit is contained in:
parent
4fba105205
commit
8b55390e8d
6 changed files with 62 additions and 28 deletions
|
@ -512,8 +512,40 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove
|
||||||
DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
|
DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
|
||||||
{
|
{
|
||||||
ProtocolStream *This = impl_from_IStream(iface);
|
ProtocolStream *This = impl_from_IStream(iface);
|
||||||
FIXME("(%p)->(%d %08x %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
|
LARGE_INTEGER new_pos;
|
||||||
return E_NOTIMPL;
|
DWORD method;
|
||||||
|
|
||||||
|
TRACE("(%p)->(%d %08x %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
|
||||||
|
|
||||||
|
if(This->buf->file == INVALID_HANDLE_VALUE) {
|
||||||
|
/* We should probably call protocol handler's Seek. */
|
||||||
|
FIXME("no cache file, not supported\n");
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(dwOrigin) {
|
||||||
|
case STREAM_SEEK_SET:
|
||||||
|
method = FILE_BEGIN;
|
||||||
|
break;
|
||||||
|
case STREAM_SEEK_CUR:
|
||||||
|
method = FILE_CURRENT;
|
||||||
|
break;
|
||||||
|
case STREAM_SEEK_END:
|
||||||
|
method = FILE_END;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WARN("Invalid origin %x\n", dwOrigin);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!SetFilePointerEx(This->buf->file, dlibMove, &new_pos, method)) {
|
||||||
|
FIXME("SetFilePointerEx failed: %u\n", GetLastError());
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(plibNewPosition)
|
||||||
|
plibNewPosition->QuadPart = new_pos.QuadPart;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ProtocolStream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
|
static HRESULT WINAPI ProtocolStream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
|
||||||
|
|
|
@ -482,7 +482,7 @@ HRESULT WINAPI CoInternetQueryInfo(LPCWSTR pwzUrl, QUERYOPTION QueryOption,
|
||||||
IInternetProtocolInfo *protocol_info;
|
IInternetProtocolInfo *protocol_info;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("(%s, %x, %x, %p, %x, %p, %x): stub\n", debugstr_w(pwzUrl),
|
TRACE("(%s, %x, %x, %p, %x, %p, %x)\n", debugstr_w(pwzUrl),
|
||||||
QueryOption, dwQueryFlags, pvBuffer, cbBuffer, pcbBuffer, dwReserved);
|
QueryOption, dwQueryFlags, pvBuffer, cbBuffer, pcbBuffer, dwReserved);
|
||||||
|
|
||||||
protocol_info = get_protocol_info(pwzUrl);
|
protocol_info = get_protocol_info(pwzUrl);
|
||||||
|
|
|
@ -391,13 +391,7 @@ HRESULT protocol_continue(Protocol *protocol, PROTOCOLDATA *data)
|
||||||
if(res) {
|
if(res) {
|
||||||
TRACE("available %u bytes\n", protocol->query_available);
|
TRACE("available %u bytes\n", protocol->query_available);
|
||||||
if(!protocol->query_available) {
|
if(!protocol->query_available) {
|
||||||
if(is_start) {
|
|
||||||
TRACE("empty file\n");
|
|
||||||
all_data_read(protocol);
|
all_data_read(protocol);
|
||||||
}else {
|
|
||||||
WARN("unexpected end of file?\n");
|
|
||||||
report_result(protocol, INET_E_DOWNLOAD_FAILURE);
|
|
||||||
}
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
protocol->available_bytes = protocol->query_available;
|
protocol->available_bytes = protocol->query_available;
|
||||||
|
|
|
@ -6760,7 +6760,7 @@ HRESULT WINAPI CoInternetCombineUrlEx(IUri *pBaseUri, LPCWSTR pwzRelativeUrl, DW
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
IInternetProtocolInfo *info;
|
IInternetProtocolInfo *info;
|
||||||
|
|
||||||
TRACE("(%p %s %x %p %x) stub\n", pBaseUri, debugstr_w(pwzRelativeUrl), dwCombineFlags,
|
TRACE("(%p %s %x %p %x)\n", pBaseUri, debugstr_w(pwzRelativeUrl), dwCombineFlags,
|
||||||
ppCombinedUri, (DWORD)dwReserved);
|
ppCombinedUri, (DWORD)dwReserved);
|
||||||
|
|
||||||
if(!ppCombinedUri)
|
if(!ppCombinedUri)
|
||||||
|
@ -6817,7 +6817,6 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output,
|
||||||
const WCHAR *ptr = NULL;
|
const WCHAR *ptr = NULL;
|
||||||
WCHAR *path = NULL;
|
WCHAR *path = NULL;
|
||||||
const WCHAR **pptr;
|
const WCHAR **pptr;
|
||||||
WCHAR buffer[INTERNET_MAX_URL_LENGTH+1];
|
|
||||||
DWORD len = 0;
|
DWORD len = 0;
|
||||||
BOOL reduce_path;
|
BOOL reduce_path;
|
||||||
|
|
||||||
|
@ -6844,11 +6843,11 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output,
|
||||||
* it later.
|
* it later.
|
||||||
*/
|
*/
|
||||||
if(reduce_path && !path && ptr == uri->canon_uri+uri->path_start)
|
if(reduce_path && !path && ptr == uri->canon_uri+uri->path_start)
|
||||||
path = buffer+len;
|
path = output+len;
|
||||||
|
|
||||||
/* Check if it's time to reduce the path. */
|
/* Check if it's time to reduce the path. */
|
||||||
if(reduce_path && ptr == uri->canon_uri+uri->path_start+uri->path_len) {
|
if(reduce_path && ptr == uri->canon_uri+uri->path_start+uri->path_len) {
|
||||||
DWORD current_path_len = (buffer+len) - path;
|
DWORD current_path_len = (output+len) - path;
|
||||||
DWORD new_path_len = remove_dot_segments(path, current_path_len);
|
DWORD new_path_len = remove_dot_segments(path, current_path_len);
|
||||||
|
|
||||||
/* Update the current length. */
|
/* Update the current length. */
|
||||||
|
@ -6860,7 +6859,9 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output,
|
||||||
const WCHAR decoded = decode_pct_val(ptr);
|
const WCHAR decoded = decode_pct_val(ptr);
|
||||||
if(decoded) {
|
if(decoded) {
|
||||||
if(allow_unescape && (flags & URL_UNESCAPE)) {
|
if(allow_unescape && (flags & URL_UNESCAPE)) {
|
||||||
buffer[len++] = decoded;
|
if(len < output_len)
|
||||||
|
output[len] = decoded;
|
||||||
|
len++;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
do_default_action = FALSE;
|
do_default_action = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -6868,48 +6869,55 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output,
|
||||||
|
|
||||||
/* See if %'s needed to encoded. */
|
/* See if %'s needed to encoded. */
|
||||||
if(do_default_action && (flags & URL_ESCAPE_PERCENT)) {
|
if(do_default_action && (flags & URL_ESCAPE_PERCENT)) {
|
||||||
pct_encode_val(*ptr, buffer+len);
|
if(len + 3 < output_len)
|
||||||
|
pct_encode_val(*ptr, output+len);
|
||||||
len += 3;
|
len += 3;
|
||||||
do_default_action = FALSE;
|
do_default_action = FALSE;
|
||||||
}
|
}
|
||||||
} else if(*ptr == ' ') {
|
} else if(*ptr == ' ') {
|
||||||
if((flags & URL_ESCAPE_SPACES_ONLY) &&
|
if((flags & URL_ESCAPE_SPACES_ONLY) &&
|
||||||
!(flags & URL_ESCAPE_UNSAFE)) {
|
!(flags & URL_ESCAPE_UNSAFE)) {
|
||||||
pct_encode_val(*ptr, buffer+len);
|
if(len + 3 < output_len)
|
||||||
|
pct_encode_val(*ptr, output+len);
|
||||||
len += 3;
|
len += 3;
|
||||||
do_default_action = FALSE;
|
do_default_action = FALSE;
|
||||||
}
|
}
|
||||||
} else if(!is_reserved(*ptr) && !is_unreserved(*ptr)) {
|
} else if(!is_reserved(*ptr) && !is_unreserved(*ptr)) {
|
||||||
if(flags & URL_ESCAPE_UNSAFE) {
|
if(flags & URL_ESCAPE_UNSAFE) {
|
||||||
pct_encode_val(*ptr, buffer+len);
|
if(len + 3 < output_len)
|
||||||
|
pct_encode_val(*ptr, output+len);
|
||||||
len += 3;
|
len += 3;
|
||||||
do_default_action = FALSE;
|
do_default_action = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(do_default_action)
|
if(do_default_action) {
|
||||||
buffer[len++] = *ptr;
|
if(len < output_len)
|
||||||
|
output[len] = *ptr;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sometimes the path is the very last component of the IUri, so
|
/* Sometimes the path is the very last component of the IUri, so
|
||||||
* see if the dot segments need to be reduced now.
|
* see if the dot segments need to be reduced now.
|
||||||
*/
|
*/
|
||||||
if(reduce_path && path) {
|
if(reduce_path && path) {
|
||||||
DWORD current_path_len = (buffer+len) - path;
|
DWORD current_path_len = (output+len) - path;
|
||||||
DWORD new_path_len = remove_dot_segments(path, current_path_len);
|
DWORD new_path_len = remove_dot_segments(path, current_path_len);
|
||||||
|
|
||||||
/* Update the current length. */
|
/* Update the current length. */
|
||||||
len -= (current_path_len-new_path_len);
|
len -= (current_path_len-new_path_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[len++] = 0;
|
if(len < output_len)
|
||||||
|
output[len] = 0;
|
||||||
|
else
|
||||||
|
output[output_len-1] = 0;
|
||||||
|
|
||||||
/* The null terminator isn't included in the length. */
|
/* The null terminator isn't included in the length. */
|
||||||
*result_len = len-1;
|
*result_len = len;
|
||||||
if(len > output_len)
|
if(len >= output_len)
|
||||||
return STRSAFE_E_INSUFFICIENT_BUFFER;
|
return STRSAFE_E_INSUFFICIENT_BUFFER;
|
||||||
else
|
|
||||||
memcpy(output, buffer, len*sizeof(WCHAR));
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
164 stdcall FaultInIEFeature(long ptr ptr long)
|
164 stdcall FaultInIEFeature(long ptr ptr long)
|
||||||
#165 stub FindMediaType
|
#165 stub FindMediaType
|
||||||
#166 stub FindMediaTypeClass
|
#166 stub FindMediaTypeClass
|
||||||
167 stdcall FindMimeFromData(long ptr ptr long ptr long ptr long)
|
167 stdcall FindMimeFromData(ptr ptr ptr long ptr long ptr long)
|
||||||
#168 GetAddSitesFileUrl
|
#168 GetAddSitesFileUrl
|
||||||
169 stdcall GetClassFileOrMime(ptr wstr ptr long wstr long ptr)
|
169 stdcall GetClassFileOrMime(ptr wstr ptr long wstr long ptr)
|
||||||
#170 stub GetClassURL
|
#170 stub GetClassURL
|
||||||
|
|
|
@ -188,7 +188,7 @@ reactos/dll/win32/traffic # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/twain_32 # Synced to WineStaging-1.9.11
|
reactos/dll/win32/twain_32 # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/updspapi # Synced to WineStaging-1.9.11
|
reactos/dll/win32/updspapi # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/url # Synced to WineStaging-1.9.11
|
reactos/dll/win32/url # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/urlmon # Synced to WineStaging-1.9.23
|
reactos/dll/win32/urlmon # Synced to WineStaging-2.2
|
||||||
reactos/dll/win32/usp10 # Synced to WineStaging-2.2
|
reactos/dll/win32/usp10 # Synced to WineStaging-2.2
|
||||||
reactos/dll/win32/uxtheme # Forked
|
reactos/dll/win32/uxtheme # Forked
|
||||||
reactos/dll/win32/vbscript # Synced to WineStaging-1.9.23
|
reactos/dll/win32/vbscript # Synced to WineStaging-1.9.23
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue