mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[URLMON] Sync with Wine Staging 1.7.47. CORE-9924
svn path=/trunk/; revision=68533
This commit is contained in:
parent
aced48d4b9
commit
f8adfa6715
6 changed files with 90 additions and 35 deletions
|
@ -24,6 +24,7 @@ extern IID IID_IBindStatusCallbackHolder;
|
|||
|
||||
typedef struct {
|
||||
IBindStatusCallbackEx IBindStatusCallbackEx_iface;
|
||||
IInternetBindInfo IInternetBindInfo_iface;
|
||||
IServiceProvider IServiceProvider_iface;
|
||||
IHttpNegotiate2 IHttpNegotiate2_iface;
|
||||
IAuthenticate IAuthenticate_iface;
|
||||
|
@ -121,6 +122,9 @@ static HRESULT WINAPI BindStatusCallback_QueryInterface(IBindStatusCallbackEx *i
|
|||
}else if(IsEqualGUID(&IID_IAuthenticate, riid)) {
|
||||
TRACE("(%p)->(IID_IAuthenticate, %p)\n", This, ppv);
|
||||
*ppv = &This->IAuthenticate_iface;
|
||||
}else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) {
|
||||
TRACE("(%p)->(IID_IInternetBindInfo, %p)\n", This, ppv);
|
||||
*ppv = &This->IInternetBindInfo_iface;
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
|
@ -492,6 +496,63 @@ static const IAuthenticateVtbl BSCAuthenticateVtbl = {
|
|||
BSCAuthenticate_Authenticate
|
||||
};
|
||||
|
||||
static inline BindStatusCallback *impl_from_IInternetBindInfo(IInternetBindInfo *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, BindStatusCallback, IInternetBindInfo_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BSCInternetBindInfo_QueryInterface(IInternetBindInfo *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
BindStatusCallback *This = impl_from_IInternetBindInfo(iface);
|
||||
return IBindStatusCallbackEx_QueryInterface(&This->IBindStatusCallbackEx_iface, riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI BSCInternetBindInfo_AddRef(IInternetBindInfo *iface)
|
||||
{
|
||||
BindStatusCallback *This = impl_from_IInternetBindInfo(iface);
|
||||
return IBindStatusCallbackEx_AddRef(&This->IBindStatusCallbackEx_iface);
|
||||
}
|
||||
|
||||
static ULONG WINAPI BSCInternetBindInfo_Release(IInternetBindInfo *iface)
|
||||
{
|
||||
BindStatusCallback *This = impl_from_IInternetBindInfo(iface);
|
||||
return IBindStatusCallbackEx_Release(&This->IBindStatusCallbackEx_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BSCInternetBindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *bindf, BINDINFO *bindinfo)
|
||||
{
|
||||
BindStatusCallback *This = impl_from_IInternetBindInfo(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, bindf, bindinfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BSCInternetBindInfo_GetBindString(IInternetBindInfo *iface, ULONG string_type,
|
||||
WCHAR **strs, ULONG cnt, ULONG *fetched)
|
||||
{
|
||||
BindStatusCallback *This = impl_from_IInternetBindInfo(iface);
|
||||
IInternetBindInfo *bind_info;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%d %p %d %p)\n", This, string_type, strs, cnt, fetched);
|
||||
|
||||
hres = IBindStatusCallback_QueryInterface(This->callback, &IID_IInternetBindInfo, (void**)&bind_info);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IInternetBindInfo_GetBindString(bind_info, string_type, strs, cnt, fetched);
|
||||
|
||||
IInternetBindInfo_Release(bind_info);
|
||||
return hres;
|
||||
}
|
||||
|
||||
static IInternetBindInfoVtbl BSCInternetBindInfoVtbl = {
|
||||
BSCInternetBindInfo_QueryInterface,
|
||||
BSCInternetBindInfo_AddRef,
|
||||
BSCInternetBindInfo_Release,
|
||||
BSCInternetBindInfo_GetBindInfo,
|
||||
BSCInternetBindInfo_GetBindString
|
||||
};
|
||||
|
||||
static void set_callback(BindStatusCallback *This, IBindStatusCallback *bsc)
|
||||
{
|
||||
IServiceProvider *serv_prov;
|
||||
|
@ -518,6 +579,7 @@ HRESULT wrap_callback(IBindStatusCallback *bsc, IBindStatusCallback **ret_iface)
|
|||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->IBindStatusCallbackEx_iface.lpVtbl = &BindStatusCallbackExVtbl;
|
||||
ret->IInternetBindInfo_iface.lpVtbl = &BSCInternetBindInfoVtbl;
|
||||
ret->IServiceProvider_iface.lpVtbl = &BSCServiceProviderVtbl;
|
||||
ret->IHttpNegotiate2_iface.lpVtbl = &BSCHttpNegotiateVtbl;
|
||||
ret->IAuthenticate_iface.lpVtbl = &BSCAuthenticateVtbl;
|
||||
|
|
|
@ -211,35 +211,14 @@ static inline HRESULT report_result(IInternetProtocolSink *protocol_sink, HRESUL
|
|||
return hres;
|
||||
}
|
||||
|
||||
static HRESULT open_file(FileProtocol *This, const WCHAR *path, IInternetProtocolSink *protocol_sink)
|
||||
{
|
||||
LARGE_INTEGER size;
|
||||
HANDLE file;
|
||||
|
||||
file = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if(file == INVALID_HANDLE_VALUE)
|
||||
return report_result(protocol_sink, INET_E_RESOURCE_NOT_FOUND, GetLastError());
|
||||
|
||||
if(!GetFileSizeEx(file, &size)) {
|
||||
CloseHandle(file);
|
||||
return report_result(protocol_sink, INET_E_RESOURCE_NOT_FOUND, GetLastError());
|
||||
}
|
||||
|
||||
This->file = file;
|
||||
This->size = size.u.LowPart;
|
||||
|
||||
IInternetProtocolSink_ReportProgress(protocol_sink,
|
||||
BINDSTATUS_CACHEFILENAMEAVAILABLE, path);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri,
|
||||
IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
|
||||
DWORD grfPI, HANDLE *dwReserved)
|
||||
{
|
||||
FileProtocol *This = impl_from_IInternetProtocolEx(iface);
|
||||
WCHAR path[MAX_PATH];
|
||||
WCHAR path[MAX_PATH], *ptr;
|
||||
LARGE_INTEGER file_size;
|
||||
HANDLE file_handle;
|
||||
BINDINFO bindinfo;
|
||||
DWORD grfBINDF = 0;
|
||||
DWORD scheme, size;
|
||||
|
@ -290,13 +269,31 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
|
|||
return report_result(pOIProtSink, hres, 0);
|
||||
}
|
||||
|
||||
hres = open_file(This, path, pOIProtSink);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
file_handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if(file_handle == INVALID_HANDLE_VALUE && (ptr = strrchrW(path, '#'))) {
|
||||
/* If path contains fragment part, try without it. */
|
||||
*ptr = 0;
|
||||
file_handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
}
|
||||
if(file_handle == INVALID_HANDLE_VALUE)
|
||||
return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, GetLastError());
|
||||
|
||||
if(!GetFileSizeEx(file_handle, &file_size)) {
|
||||
CloseHandle(file_handle);
|
||||
return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, GetLastError());
|
||||
}
|
||||
|
||||
This->file = file_handle;
|
||||
This->size = file_size.u.LowPart;
|
||||
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_CACHEFILENAMEAVAILABLE, path);
|
||||
|
||||
hres = IUri_GetExtension(pUri, &ext);
|
||||
if(SUCCEEDED(hres)) {
|
||||
if(hres == S_OK && *ext) {
|
||||
if((ptr = strchrW(ext, '#')))
|
||||
*ptr = 0;
|
||||
hres = find_mime_from_ext(ext, &mime);
|
||||
if(SUCCEEDED(hres)) {
|
||||
IInternetProtocolSink_ReportProgress(pOIProtSink,
|
||||
|
|
|
@ -694,8 +694,5 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
|
|||
if(pwzMimeProposed || pBuffer)
|
||||
return find_mime_from_buffer(pBuffer, cbSize, pwzMimeProposed, pwzUrl, ppwzMimeOut);
|
||||
|
||||
if(pwzUrl)
|
||||
return find_mime_from_url(pwzUrl, ppwzMimeOut);
|
||||
|
||||
return E_FAIL;
|
||||
return find_mime_from_url(pwzUrl, ppwzMimeOut);
|
||||
}
|
||||
|
|
|
@ -884,7 +884,7 @@ static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManagerEx2* iface)
|
|||
|
||||
TRACE("(%p) ref=%u\n", This, refCount);
|
||||
|
||||
/* destroy the object if there's no more reference on it */
|
||||
/* destroy the object if there are no more references on it */
|
||||
if (!refCount){
|
||||
if(This->mgrsite)
|
||||
IInternetSecurityMgrSite_Release(This->mgrsite);
|
||||
|
|
|
@ -6834,8 +6834,7 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output,
|
|||
ptr = uri->canon_uri+uri->scheme_start+uri->scheme_len+1;
|
||||
pptr = &ptr;
|
||||
}
|
||||
reduce_path = !(flags & URL_NO_META) &&
|
||||
!(flags & URL_DONT_SIMPLIFY) &&
|
||||
reduce_path = !(flags & URL_DONT_SIMPLIFY) &&
|
||||
ptr && check_hierarchical(pptr);
|
||||
|
||||
for(ptr = uri->canon_uri; ptr < uri->canon_uri+uri->canon_len; ++ptr) {
|
||||
|
|
|
@ -195,7 +195,7 @@ reactos/dll/win32/twain_32 # Synced to WineStaging-1.7.37
|
|||
reactos/dll/win32/unicows # Synced to Wine-1.3.32 (Win9x only, why do we need this?!)
|
||||
reactos/dll/win32/updspapi # Synced to WineStaging-1.7.37
|
||||
reactos/dll/win32/url # Synced to WineStaging-1.7.37
|
||||
reactos/dll/win32/urlmon # Synced to WineStaging-1.7.37
|
||||
reactos/dll/win32/urlmon # Synced to WineStaging-1.7.47
|
||||
reactos/dll/win32/usp10 # Synced to WineStaging-1.7.47
|
||||
reactos/dll/win32/uxtheme # Forked
|
||||
reactos/dll/win32/vbscript # Synced to WineStaging-1.7.37
|
||||
|
|
Loading…
Reference in a new issue