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
be419251
Commit
be419251
authored
Mar 13, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Search for MIME filters defined in registry in get_mime_filter.
parent
b36cb0b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
3 deletions
+43
-3
session.c
dlls/urlmon/session.c
+43
-3
No files found.
dlls/urlmon/session.c
View file @
be419251
...
...
@@ -260,9 +260,17 @@ HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, BOOL *urlmon_protocol, ICl
IInternetProtocol
*
get_mime_filter
(
LPCWSTR
mime
)
{
static
const
WCHAR
filtersW
[]
=
{
'P'
,
'r'
,
'o'
,
't'
,
'o'
,
'c'
,
'o'
,
'l'
,
's'
,
'\\'
,
'F'
,
'i'
,
'l'
,
't'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
CLSIDW
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
IClassFactory
*
cf
=
NULL
;
IInternetProtocol
*
ret
;
mime_filter
*
iter
;
HKEY
hlist
,
hfilter
;
WCHAR
clsidw
[
64
];
CLSID
clsid
;
DWORD
res
,
type
,
size
;
HRESULT
hres
;
EnterCriticalSection
(
&
session_cs
);
...
...
@@ -276,12 +284,44 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime)
LeaveCriticalSection
(
&
session_cs
);
if
(
!
cf
)
if
(
cf
)
{
hres
=
IClassFactory_CreateInstance
(
cf
,
NULL
,
&
IID_IInternetProtocol
,
(
void
**
)
&
ret
);
if
(
FAILED
(
hres
))
{
WARN
(
"CreateInstance failed: %08x
\n
"
,
hres
);
return
NULL
;
}
return
ret
;
}
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
filtersW
,
&
hlist
);
if
(
res
!=
ERROR_SUCCESS
)
{
TRACE
(
"Could not open MIME filters key
\n
"
);
return
NULL
;
}
res
=
RegOpenKeyW
(
hlist
,
mime
,
&
hfilter
);
CloseHandle
(
hlist
);
if
(
res
!=
ERROR_SUCCESS
)
return
NULL
;
size
=
sizeof
(
clsidw
);
res
=
RegQueryValueExW
(
hfilter
,
CLSIDW
,
NULL
,
&
type
,
(
LPBYTE
)
clsidw
,
&
size
);
CloseHandle
(
hfilter
);
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
{
WARN
(
"Could not get filter CLSID for %s
\n
"
,
debugstr_w
(
mime
));
return
NULL
;
}
hres
=
CLSIDFromString
(
clsidw
,
&
clsid
);
if
(
FAILED
(
hres
))
{
WARN
(
"CLSIDFromString failed for %s (%x)
\n
"
,
debugstr_w
(
mime
),
hres
);
return
NULL
;
}
hres
=
IClassFactory_CreateInstance
(
cf
,
NULL
,
&
IID_IInternetProtocol
,
(
void
**
)
&
ret
);
hres
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IInternetProtocol
,
(
void
**
)
&
ret
);
if
(
FAILED
(
hres
))
{
WARN
(
"CreateInstance failed: %08x
\n
"
,
hres
);
WARN
(
"C
oC
reateInstance failed: %08x
\n
"
,
hres
);
return
NULL
;
}
...
...
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