Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fb2551c5
Commit
fb2551c5
authored
Feb 21, 2013
by
Alessandro Pignotti
Committed by
Alexandre Julliard
Feb 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Modify GetClassMediaFile to also extract the SourceFilter value.
parent
e5affa70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
21 deletions
+52
-21
filesource.c
dlls/quartz/filesource.c
+52
-21
No files found.
dlls/quartz/filesource.c
View file @
fb2551c5
...
...
@@ -79,8 +79,10 @@ static const WCHAR mediatype_name[] = {
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
' '
,
'T'
,
'y'
,
'p'
,
'e'
,
0
};
static
const
WCHAR
subtype_name
[]
=
{
'S'
,
'u'
,
'b'
,
't'
,
'y'
,
'p'
,
'e'
,
0
};
static
const
WCHAR
source_filter_name
[]
=
{
'S'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
' '
,
'F'
,
'i'
,
'l'
,
't'
,
'e'
,
'r'
,
0
};
static
HRESULT
process_extensions
(
HKEY
hkeyExtensions
,
LPCOLESTR
pszFileName
,
GUID
*
majorType
,
GUID
*
minorType
)
static
HRESULT
process_extensions
(
HKEY
hkeyExtensions
,
LPCOLESTR
pszFileName
,
GUID
*
majorType
,
GUID
*
minorType
,
GUID
*
sourceFilter
)
{
WCHAR
*
extension
;
LONG
l
;
...
...
@@ -100,17 +102,31 @@ static HRESULT process_extensions(HKEY hkeyExtensions, LPCOLESTR pszFileName, GU
if
(
l
)
return
E_FAIL
;
size
=
sizeof
(
keying
);
l
=
RegQueryValueExW
(
hsub
,
mediatype_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
if
(
!
l
)
CLSIDFromString
(
keying
,
majorType
);
if
(
majorType
)
{
size
=
sizeof
(
keying
);
l
=
RegQueryValueExW
(
hsub
,
mediatype_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
if
(
!
l
)
CLSIDFromString
(
keying
,
majorType
);
}
size
=
sizeof
(
keying
);
if
(
!
l
)
l
=
RegQueryValueExW
(
hsub
,
subtype_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
if
(
minorType
)
{
size
=
sizeof
(
keying
);
if
(
!
l
)
l
=
RegQueryValueExW
(
hsub
,
subtype_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
if
(
!
l
)
CLSIDFromString
(
keying
,
minorType
);
}
if
(
!
l
)
CLSIDFromString
(
keying
,
minorType
);
if
(
sourceFilter
)
{
size
=
sizeof
(
keying
);
if
(
!
l
)
l
=
RegQueryValueExW
(
hsub
,
source_filter_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
if
(
!
l
)
CLSIDFromString
(
keying
,
sourceFilter
);
}
RegCloseKey
(
hsub
);
...
...
@@ -238,7 +254,7 @@ static HRESULT process_pattern_string(LPCWSTR wszPatternString, IAsyncReader * p
return
hr
;
}
static
HRESULT
GetClassMediaFile
(
IAsyncReader
*
pReader
,
LPCOLESTR
pszFileName
,
GUID
*
majorType
,
GUID
*
minorType
)
static
HRESULT
GetClassMediaFile
(
IAsyncReader
*
pReader
,
LPCOLESTR
pszFileName
,
GUID
*
majorType
,
GUID
*
minorType
,
GUID
*
sourceFilter
)
{
HKEY
hkeyMediaType
=
NULL
;
LONG
lRet
;
...
...
@@ -248,8 +264,12 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName,
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
pReader
,
debugstr_w
(
pszFileName
),
majorType
,
minorType
);
*
majorType
=
GUID_NULL
;
*
minorType
=
GUID_NULL
;
if
(
majorType
)
*
majorType
=
GUID_NULL
;
if
(
minorType
)
*
minorType
=
GUID_NULL
;
if
(
sourceFilter
)
*
sourceFilter
=
GUID_NULL
;
lRet
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
wszMediaType
,
0
,
KEY_READ
,
&
hkeyMediaType
);
hr
=
HRESULT_FROM_WIN32
(
lRet
);
...
...
@@ -272,7 +292,7 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName,
TRACE
(
"%s
\n
"
,
debugstr_w
(
wszMajorKeyName
));
if
(
!
strcmpW
(
wszExtensions
,
wszMajorKeyName
))
{
if
(
process_extensions
(
hkeyMajor
,
pszFileName
,
majorType
,
minorType
)
==
S_OK
)
if
(
process_extensions
(
hkeyMajor
,
pszFileName
,
majorType
,
minorType
,
sourceFilter
)
==
S_OK
)
bFound
=
TRUE
;
}
else
...
...
@@ -284,6 +304,8 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName,
HKEY
hkeyMinor
;
WCHAR
wszMinorKeyName
[
CHARS_IN_GUID
];
DWORD
dwMinorKeyNameLen
=
sizeof
(
wszMinorKeyName
)
/
sizeof
(
wszMinorKeyName
[
0
]);
WCHAR
wszSourceFilterKeyName
[
CHARS_IN_GUID
];
DWORD
dwSourceFilterKeyNameLen
=
sizeof
(
wszSourceFilterKeyName
)
/
sizeof
(
wszSourceFilterKeyName
[
0
]);
DWORD
maxValueLen
;
DWORD
indexValue
;
...
...
@@ -305,7 +327,6 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName,
LPWSTR
wszPatternString
=
HeapAlloc
(
GetProcessHeap
(),
0
,
maxValueLen
);
DWORD
dwValueNameLen
=
sizeof
(
wszValueName
)
/
sizeof
(
wszValueName
[
0
]);
/* remember this is in chars */
DWORD
dwDataLen
=
maxValueLen
;
/* remember this is in bytes */
static
const
WCHAR
wszSourceFilter
[]
=
{
'S'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
' '
,
'F'
,
'i'
,
'l'
,
't'
,
'e'
,
'r'
,
0
};
if
(
RegEnumValueW
(
hkeyMinor
,
indexValue
,
wszValueName
,
&
dwValueNameLen
,
NULL
,
&
dwType
,
(
LPBYTE
)
wszPatternString
,
&
dwDataLen
)
!=
ERROR_SUCCESS
)
{
...
...
@@ -313,15 +334,25 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName,
break
;
}
if
(
strcmpW
(
wszValueName
,
source_filter_name
)
==
0
)
continue
;
/* if it is not the source filter value */
if
(
strcmpW
(
wszValueName
,
wszSourceFilter
)
)
if
(
process_pattern_string
(
wszPatternString
,
pReader
)
==
S_OK
)
{
if
(
process_pattern_string
(
wszPatternString
,
pReader
)
==
S_OK
)
if
(
majorType
&&
FAILED
(
CLSIDFromString
(
wszMajorKeyName
,
majorType
)))
break
;
if
(
minorType
&&
FAILED
(
CLSIDFromString
(
wszMinorKeyName
,
minorType
)))
break
;
if
(
sourceFilter
)
{
if
(
SUCCEEDED
(
CLSIDFromString
(
wszMajorKeyName
,
majorType
))
&&
SUCCEEDED
(
CLSIDFromString
(
wszMinorKeyName
,
minorType
)))
bFound
=
TRUE
;
/* Look up the source filter key */
if
(
RegQueryValueExW
(
hkeyMinor
,
source_filter_name
,
NULL
,
NULL
,
(
LPBYTE
)
wszSourceFilterKeyName
,
&
dwSourceFilterKeyNameLen
))
break
;
if
(
FAILED
(
CLSIDFromString
(
wszSourceFilterKeyName
,
sourceFilter
)))
break
;
}
bFound
=
TRUE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
wszPatternString
);
}
...
...
@@ -605,7 +636,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
This
->
pmt
->
pUnk
=
NULL
;
This
->
pmt
->
lSampleSize
=
0
;
This
->
pmt
->
formattype
=
FORMAT_None
;
hr
=
GetClassMediaFile
(
pReader
,
pszFileName
,
&
This
->
pmt
->
majortype
,
&
This
->
pmt
->
subtype
);
hr
=
GetClassMediaFile
(
pReader
,
pszFileName
,
&
This
->
pmt
->
majortype
,
&
This
->
pmt
->
subtype
,
NULL
);
if
(
FAILED
(
hr
))
{
CoTaskMemFree
(
This
->
pmt
);
...
...
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