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
66d40aab
Commit
66d40aab
authored
Aug 06, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Always try to detect a file by extension first.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7d89e791
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
59 deletions
+29
-59
filesource.c
dlls/quartz/filesource.c
+29
-59
No files found.
dlls/quartz/filesource.c
View file @
66d40aab
...
...
@@ -102,58 +102,6 @@ static const WCHAR subtype_name[] = {
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
,
GUID
*
sourceFilter
)
{
WCHAR
*
extension
;
LONG
l
;
HKEY
hsub
;
WCHAR
keying
[
39
];
DWORD
size
;
if
(
!
pszFileName
)
return
E_POINTER
;
/* Get the part of the name that matters */
if
(
!
(
extension
=
wcsrchr
(
pszFileName
,
'.'
)))
return
E_FAIL
;
l
=
RegOpenKeyExW
(
hkeyExtensions
,
extension
,
0
,
KEY_READ
,
&
hsub
);
if
(
l
)
return
E_FAIL
;
if
(
majorType
)
{
size
=
sizeof
(
keying
);
l
=
RegQueryValueExW
(
hsub
,
mediatype_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
if
(
!
l
)
CLSIDFromString
(
keying
,
majorType
);
}
if
(
minorType
)
{
size
=
sizeof
(
keying
);
if
(
!
l
)
l
=
RegQueryValueExW
(
hsub
,
subtype_name
,
NULL
,
NULL
,
(
LPBYTE
)
keying
,
&
size
);
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
);
if
(
!
l
)
return
S_OK
;
return
E_FAIL
;
}
static
unsigned
char
byte_from_hex_char
(
WCHAR
wHex
)
{
switch
(
towlower
(
wHex
))
...
...
@@ -278,6 +226,9 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
HRESULT
hr
=
S_OK
;
BOOL
bFound
=
FALSE
;
static
const
WCHAR
wszMediaType
[]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
' '
,
'T'
,
'y'
,
'p'
,
'e'
,
0
};
WCHAR
extensions_path
[
278
]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
' '
,
'T'
,
'y'
,
'p'
,
'e'
,
'\\'
,
'E'
,
'x'
,
't'
,
'e'
,
'n'
,
's'
,
'i'
,
'o'
,
'n'
,
's'
,
'\\'
,
0
};
const
WCHAR
*
ext
;
DWORD
size
;
if
(
majorType
)
*
majorType
=
GUID_NULL
;
...
...
@@ -286,6 +237,31 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
if
(
sourceFilter
)
*
sourceFilter
=
GUID_NULL
;
if
((
ext
=
wcsrchr
(
pszFileName
,
'.'
)))
{
WCHAR
guidstr
[
39
];
HKEY
key
;
wcscat
(
extensions_path
,
ext
);
if
(
!
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
extensions_path
,
0
,
KEY_READ
,
&
key
))
{
size
=
sizeof
(
guidstr
);
if
(
majorType
&&
!
RegQueryValueExW
(
key
,
mediatype_name
,
NULL
,
NULL
,
(
BYTE
*
)
guidstr
,
&
size
))
CLSIDFromString
(
guidstr
,
majorType
);
size
=
sizeof
(
guidstr
);
if
(
minorType
&&
!
RegQueryValueExW
(
key
,
subtype_name
,
NULL
,
NULL
,
(
BYTE
*
)
guidstr
,
&
size
))
CLSIDFromString
(
guidstr
,
minorType
);
size
=
sizeof
(
guidstr
);
if
(
sourceFilter
&&
!
RegQueryValueExW
(
key
,
source_filter_name
,
NULL
,
NULL
,
(
BYTE
*
)
guidstr
,
&
size
))
CLSIDFromString
(
guidstr
,
sourceFilter
);
RegCloseKey
(
key
);
return
S_OK
;
}
}
lRet
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
wszMediaType
,
0
,
KEY_READ
,
&
hkeyMediaType
);
hr
=
HRESULT_FROM_WIN32
(
lRet
);
...
...
@@ -304,13 +280,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
break
;
if
(
RegOpenKeyExW
(
hkeyMediaType
,
wszMajorKeyName
,
0
,
KEY_READ
,
&
hkeyMajor
)
!=
ERROR_SUCCESS
)
break
;
if
(
!
wcscmp
(
wszExtensions
,
wszMajorKeyName
))
{
if
(
process_extensions
(
hkeyMajor
,
pszFileName
,
majorType
,
minorType
,
sourceFilter
)
==
S_OK
)
bFound
=
TRUE
;
}
/* We need a reader interface to check bytes */
else
if
(
pReader
)
if
(
wcscmp
(
wszExtensions
,
wszMajorKeyName
)
&&
pReader
)
{
DWORD
indexMinor
;
...
...
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