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
d22e7d6a
Commit
d22e7d6a
authored
May 20, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Check for compatible platforms in SetupDiBuildDriverInfoList().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8369f60c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
devinst.c
dlls/setupapi/devinst.c
+43
-1
No files found.
dlls/setupapi/devinst.c
View file @
d22e7d6a
...
...
@@ -4111,10 +4111,37 @@ static BOOL device_matches_id(const struct device *device, const WCHAR *id_type,
return
FALSE
;
}
static
BOOL
version_is_compatible
(
const
WCHAR
*
version
)
{
const
WCHAR
*
machine_ext
=
NtPlatformExtension
+
1
,
*
p
;
size_t
len
=
strlenW
(
version
);
BOOL
wow64
;
/* We are only concerned with architecture. */
if
((
p
=
strchrW
(
version
,
'.'
)))
len
=
p
-
version
;
if
(
!
strncmpiW
(
version
,
NtExtension
+
1
,
len
))
return
TRUE
;
if
(
IsWow64Process
(
GetCurrentProcess
(),
&
wow64
)
&&
wow64
)
{
#ifdef __i386__
static
const
WCHAR
wow_ext
[]
=
{
'N'
,
'T'
,
'a'
,
'm'
,
'd'
,
'6'
,
'4'
,
0
};
machine_ext
=
wow_ext
;
#elif defined(__arm__)
static
const
WCHAR
wow_ext
[]
=
{
'N'
,
'T'
,
'a'
,
'r'
,
'm'
,
'6'
,
'4'
,
0
};
machine_ext
=
wow_ext
;
#endif
}
return
!
strncmpiW
(
version
,
machine_ext
,
len
);
}
static
void
enum_compat_drivers_from_file
(
struct
device
*
device
,
const
WCHAR
*
path
)
{
static
const
WCHAR
manufacturerW
[]
=
{
'M'
,
'a'
,
'n'
,
'u'
,
'f'
,
'a'
,
'c'
,
't'
,
'u'
,
'r'
,
'e'
,
'r'
,
0
};
WCHAR
mfg_name
[
LINE_LEN
],
mfg_key
[
LINE_LEN
],
mfg_key_ext
[
LINE_LEN
],
id
[
MAX_DEVICE_ID_LEN
];
WCHAR
mfg_name
[
LINE_LEN
],
mfg_key
[
LINE_LEN
],
mfg_key_ext
[
LINE_LEN
],
id
[
MAX_DEVICE_ID_LEN
]
,
version
[
MAX_DEVICE_ID_LEN
]
;
INFCONTEXT
ctx
;
DWORD
i
,
j
,
k
;
HINF
hinf
;
...
...
@@ -4130,6 +4157,21 @@ static void enum_compat_drivers_from_file(struct device *device, const WCHAR *pa
if
(
!
SetupGetStringFieldW
(
&
ctx
,
1
,
mfg_key
,
ARRAY_SIZE
(
mfg_key
),
NULL
))
strcpyW
(
mfg_key
,
mfg_name
);
if
(
SetupGetFieldCount
(
&
ctx
)
>=
2
)
{
BOOL
compatible
=
FALSE
;
for
(
j
=
2
;
SetupGetStringFieldW
(
&
ctx
,
j
,
version
,
ARRAY_SIZE
(
version
),
NULL
);
++
j
)
{
if
(
version_is_compatible
(
version
))
{
compatible
=
TRUE
;
break
;
}
}
if
(
!
compatible
)
continue
;
}
if
(
!
SetupDiGetActualSectionToInstallW
(
hinf
,
mfg_key
,
mfg_key_ext
,
ARRAY_SIZE
(
mfg_key_ext
),
NULL
,
NULL
))
{
WARN
(
"Failed to find section for %s, skipping.
\n
"
,
debugstr_w
(
mfg_key
));
...
...
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