Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0029290e
Commit
0029290e
authored
Dec 23, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Use find_mime_from_ext directly in file protocol handler.
parent
9351e225
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
file.c
dlls/urlmon/file.c
+13
-11
mimefilter.c
dlls/urlmon/mimefilter.c
+1
-1
urlmon_main.h
dlls/urlmon/urlmon_main.h
+2
-0
No files found.
dlls/urlmon/file.c
View file @
0029290e
...
...
@@ -251,7 +251,7 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
DWORD
scheme
,
size
;
LPWSTR
mime
=
NULL
;
WCHAR
null_char
=
0
;
BSTR
url
;
BSTR
ext
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p %p %p %08x %p)
\n
"
,
This
,
pUri
,
pOIProtSink
,
...
...
@@ -300,17 +300,19 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IUri_GetDisplayUri
(
pUri
,
&
url
);
if
(
hres
==
S_OK
)
{
hres
=
FindMimeFromData
(
NULL
,
url
,
NULL
,
0
,
NULL
,
0
,
&
mime
,
0
);
SysFreeString
(
url
);
if
(
SUCCEEDED
(
hres
))
{
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
(
grfBINDF
&
BINDF_FROMURLMON
)
?
BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE
:
BINDSTATUS_MIMETYPEAVAILABLE
,
mime
);
CoTaskMemFree
(
mime
);
hres
=
IUri_GetExtension
(
pUri
,
&
ext
);
if
(
SUCCEEDED
(
hres
))
{
if
(
hres
==
S_OK
&&
*
ext
)
{
hres
=
find_mime_from_ext
(
ext
,
&
mime
);
if
(
SUCCEEDED
(
hres
))
{
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
(
grfBINDF
&
BINDF_FROMURLMON
)
?
BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE
:
BINDSTATUS_MIMETYPEAVAILABLE
,
mime
);
CoTaskMemFree
(
mime
);
}
}
SysFreeString
(
ext
);
}
IInternetProtocolSink_ReportData
(
pOIProtSink
,
...
...
dlls/urlmon/mimefilter.c
View file @
0029290e
...
...
@@ -422,7 +422,7 @@ static BOOL application_octet_stream_filter(const BYTE *b, DWORD size)
return
TRUE
;
}
static
HRESULT
find_mime_from_ext
(
const
WCHAR
*
ext
,
WCHAR
**
ret
)
HRESULT
find_mime_from_ext
(
const
WCHAR
*
ext
,
WCHAR
**
ret
)
{
DWORD
res
,
size
;
WCHAR
mime
[
64
];
...
...
dlls/urlmon/urlmon_main.h
View file @
0029290e
...
...
@@ -76,6 +76,8 @@ WCHAR *get_useragent(void) DECLSPEC_HIDDEN;
void
update_user_agent
(
WCHAR
*
)
DECLSPEC_HIDDEN
;
void
free_session
(
void
)
DECLSPEC_HIDDEN
;
HRESULT
find_mime_from_ext
(
const
WCHAR
*
,
WCHAR
**
)
DECLSPEC_HIDDEN
;
HRESULT
bind_to_storage
(
IUri
*
,
IBindCtx
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
HRESULT
bind_to_object
(
IMoniker
*
,
IUri
*
,
IBindCtx
*
,
REFIID
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment