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
3396ca87
Commit
3396ca87
authored
Feb 13, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvfw32: Fix driver enumeration.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f08342f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
msvideo_main.c
dlls/msvfw32/msvideo_main.c
+20
-19
No files found.
dlls/msvfw32/msvideo_main.c
View file @
3396ca87
...
...
@@ -223,34 +223,33 @@ static int compare_fourcc(DWORD fcc1, DWORD fcc2)
return
strncasecmp
(
fcc_str1
,
fcc_str2
,
4
);
}
typedef
BOOL
(
*
enum_handler_t
)(
const
char
*
,
unsigned
int
,
void
*
);
typedef
BOOL
(
*
enum_handler_t
)(
const
char
*
name
,
const
char
*
driver
,
unsigned
int
index
,
void
*
param
);
static
BOOL
enum_drivers
(
DWORD
fccType
,
enum_handler_t
handler
,
void
*
param
)
{
CHAR
buf
[
2048
],
fccTypeStr
[
5
],
*
s
;
char
fccTypeStr
[
4
];
char
name_buf
[
10
];
char
buf
[
2048
];
DWORD
i
,
cnt
=
0
,
lRet
;
BOOL
result
=
FALSE
;
HKEY
hKey
;
fourcc_to_string
(
fccTypeStr
,
fccType
);
fccTypeStr
[
4
]
=
'.'
;
/* first, go through the registry entries */
lRet
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
HKLM_DRIVERS32
,
0
,
KEY_QUERY_VALUE
,
&
hKey
);
if
(
lRet
==
ERROR_SUCCESS
)
{
DWORD
name
,
data
,
type
;
i
=
0
;
for
(;;)
{
name
=
10
;
data
=
sizeof
buf
-
name
;
lRet
=
RegEnumValueA
(
hKey
,
i
++
,
buf
,
&
name
,
0
,
&
type
,
(
LPBYTE
)(
buf
+
name
),
&
data
);
DWORD
name_len
=
10
,
driver_len
=
128
;
lRet
=
RegEnumValueA
(
hKey
,
i
++
,
name_buf
,
&
name_len
,
0
,
0
,
(
BYTE
*
)
buf
,
&
driver_len
);
if
(
lRet
==
ERROR_NO_MORE_ITEMS
)
break
;
if
(
lRet
!=
ERROR_SUCCESS
)
continue
;
if
(
fccType
&&
(
name
!=
9
||
strncasecmp
(
buf
,
fccTypeStr
,
5
)))
continue
;
buf
[
name
]
=
'='
;
if
((
result
=
handler
(
buf
,
cnt
++
,
param
)))
break
;
if
(
name_len
!=
9
||
name_buf
[
4
]
!=
'.'
)
continue
;
if
(
fccType
&&
strncasecmp
(
name_buf
,
fccTypeStr
,
4
))
continue
;
if
((
result
=
handler
(
name_buf
,
buf
,
cnt
++
,
param
)))
break
;
}
RegCloseKey
(
hKey
);
}
...
...
@@ -259,11 +258,12 @@ static BOOL enum_drivers(DWORD fccType, enum_handler_t handler, void* param)
/* if that didn't work, go through the values in system.ini */
if
(
GetPrivateProfileSectionA
(
"drivers32"
,
buf
,
sizeof
(
buf
),
"system.ini"
))
{
char
*
s
;
for
(
s
=
buf
;
*
s
;
s
+=
strlen
(
s
)
+
1
)
{
TRACE
(
"got %s
\n
"
,
s
)
;
if
(
fccType
&&
(
strncasecmp
(
s
,
fccTypeStr
,
5
)
||
s
[
9
]
!=
'='
))
continue
;
if
((
result
=
handler
(
s
,
cnt
++
,
param
)))
break
;
if
(
s
[
4
]
!=
'.'
||
s
[
9
]
!=
'='
)
continue
;
if
(
fccType
&&
strncasecmp
(
s
,
fccTypeStr
,
4
))
continue
;
if
((
result
=
handler
(
s
,
s
+
10
,
cnt
++
,
param
)))
break
;
}
}
...
...
@@ -294,10 +294,11 @@ DWORD WINAPI VideoForWindowsVersion(void)
return
0x040003B6
;
/* 4.950 */
}
static
BOOL
ICInfo_enum_handler
(
const
char
*
drv
,
unsigned
int
nr
,
void
*
param
)
static
BOOL
ICInfo_enum_handler
(
const
char
*
name
,
const
char
*
driver
,
unsigned
int
nr
,
void
*
param
)
{
ICINFO
*
lpicinfo
=
param
;
DWORD
fccHandler
=
mmioStringToFOURCCA
(
drv
+
5
,
0
);
DWORD
fccType
=
mmioStringToFOURCCA
(
name
,
0
);
DWORD
fccHandler
=
mmioStringToFOURCCA
(
name
+
5
,
0
);
if
(
lpicinfo
->
fccHandler
!=
nr
&&
compare_fourcc
(
lpicinfo
->
fccHandler
,
fccHandler
))
return
FALSE
;
...
...
@@ -308,7 +309,7 @@ static BOOL ICInfo_enum_handler(const char *drv, unsigned int nr, void *param)
lpicinfo
->
dwVersionICM
=
ICVERSION
;
lpicinfo
->
szName
[
0
]
=
0
;
lpicinfo
->
szDescription
[
0
]
=
0
;
MultiByteToWideChar
(
CP_ACP
,
0
,
dr
v
+
10
,
-
1
,
lpicinfo
->
szDriver
,
MultiByteToWideChar
(
CP_ACP
,
0
,
dr
iver
,
-
1
,
lpicinfo
->
szDriver
,
sizeof
(
lpicinfo
->
szDriver
)
/
sizeof
(
WCHAR
));
return
TRUE
;
...
...
@@ -647,10 +648,10 @@ static HIC try_driver(driver_info_t *info)
return
0
;
}
static
BOOL
ICLocate_enum_handler
(
const
char
*
drv
,
unsigned
int
nr
,
void
*
param
)
static
BOOL
ICLocate_enum_handler
(
const
char
*
name
,
const
char
*
driver
,
unsigned
int
nr
,
void
*
param
)
{
driver_info_t
*
info
=
param
;
info
->
fccHandler
=
mmioStringToFOURCCA
(
drv
+
5
,
0
);
info
->
fccHandler
=
mmioStringToFOURCCA
(
name
+
5
,
0
);
info
->
hic
=
try_driver
(
info
);
return
info
->
hic
!=
0
;
}
...
...
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