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
9cf9483a
Commit
9cf9483a
authored
Nov 06, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineboot: Create a root-enumerated device object for winebus.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cba5674d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletion
+56
-1
Makefile.in
programs/wineboot/Makefile.in
+1
-1
wineboot.c
programs/wineboot/wineboot.c
+55
-0
No files found.
programs/wineboot/Makefile.in
View file @
9cf9483a
MODULE
=
wineboot.exe
APPMODE
=
-mconsole
IMPORTS
=
uuid advapi32
DELAYIMPORTS
=
shell32 shlwapi version user32
DELAYIMPORTS
=
shell32 shlwapi version user32
setupapi newdev
EXTRADLLFLAGS
=
-mno-cygwin
...
...
programs/wineboot/wineboot.c
View file @
9cf9483a
...
...
@@ -69,6 +69,8 @@
#include <shobjidl.h>
#include <shlwapi.h>
#include <shellapi.h>
#include <setupapi.h>
#include <newdev.h>
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wineboot
);
...
...
@@ -1121,6 +1123,57 @@ static HANDLE start_rundll32( const WCHAR *inf_path, BOOL wow64 )
return
pi
.
hProcess
;
}
static
void
install_root_pnp_devices
(
void
)
{
static
const
struct
{
const
char
*
name
;
const
char
*
hardware_id
;
const
char
*
infpath
;
}
root_devices
[]
=
{
{
"root
\\
wine
\\
winebus"
,
"root
\\
winebus
\0
"
,
"C:
\\
windows
\\
inf
\\
winebus.inf"
},
};
SP_DEVINFO_DATA
device
=
{
sizeof
(
device
)};
unsigned
int
i
;
HDEVINFO
set
;
if
((
set
=
SetupDiCreateDeviceInfoList
(
NULL
,
NULL
))
==
INVALID_HANDLE_VALUE
)
{
WINE_ERR
(
"Failed to create device info list, error %#x.
\n
"
,
GetLastError
());
return
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
root_devices
);
++
i
)
{
if
(
!
SetupDiCreateDeviceInfoA
(
set
,
root_devices
[
i
].
name
,
&
GUID_NULL
,
NULL
,
NULL
,
0
,
&
device
))
{
if
(
GetLastError
()
!=
ERROR_DEVINST_ALREADY_EXISTS
)
WINE_ERR
(
"Failed to create device %s, error %#x.
\n
"
,
debugstr_a
(
root_devices
[
i
].
name
),
GetLastError
());
continue
;
}
if
(
!
SetupDiSetDeviceRegistryPropertyA
(
set
,
&
device
,
SPDRP_HARDWAREID
,
(
const
BYTE
*
)
root_devices
[
i
].
hardware_id
,
(
strlen
(
root_devices
[
i
].
hardware_id
)
+
2
)
*
sizeof
(
WCHAR
)))
{
WINE_ERR
(
"Failed to set hardware id for %s, error %#x.
\n
"
,
debugstr_a
(
root_devices
[
i
].
name
),
GetLastError
());
continue
;
}
if
(
!
SetupDiCallClassInstaller
(
DIF_REGISTERDEVICE
,
set
,
&
device
))
{
WINE_ERR
(
"Failed to register device %s, error %#x.
\n
"
,
debugstr_a
(
root_devices
[
i
].
name
),
GetLastError
());
continue
;
}
if
(
!
UpdateDriverForPlugAndPlayDevicesA
(
NULL
,
root_devices
[
i
].
hardware_id
,
root_devices
[
i
].
infpath
,
0
,
NULL
))
WINE_ERR
(
"Failed to install drivers for %s, error %#x.
\n
"
,
debugstr_a
(
root_devices
[
i
].
name
),
GetLastError
());
}
SetupDiDestroyDeviceInfoList
(
set
);
}
/* execute rundll32 on the wine.inf file if necessary */
static
void
update_wineprefix
(
BOOL
force
)
{
...
...
@@ -1164,6 +1217,8 @@ static void update_wineprefix( BOOL force )
}
DestroyWindow
(
hwnd
);
}
install_root_pnp_devices
();
WINE_MESSAGE
(
"wine: configuration in '%s' has been updated.
\n
"
,
prettyprint_configdir
()
);
}
...
...
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