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
887a57fa
Commit
887a57fa
authored
Jun 22, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: Load root PnP drivers on startup.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
00e71346
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
Makefile.in
programs/services/Makefile.in
+1
-1
services.c
programs/services/services.c
+28
-1
No files found.
programs/services/Makefile.in
View file @
887a57fa
MODULE
=
services.exe
IMPORTS
=
rpcrt4 advapi32 userenv
IMPORTS
=
rpcrt4 advapi32 userenv
setupapi
EXTRADLLFLAGS
=
-mconsole
-mno-cygwin
...
...
programs/services/services.c
View file @
887a57fa
...
...
@@ -27,6 +27,7 @@
#include <winsvc.h>
#include <rpc.h>
#include <userenv.h>
#include <setupapi.h>
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -423,25 +424,50 @@ static BOOL schedule_delayed_autostart(struct service_entry **services, unsigned
return
TRUE
;
}
static
BOOL
is_root_pnp_service
(
const
struct
service_entry
*
service
,
HDEVINFO
set
)
{
SP_DEVINFO_DATA
device
=
{
sizeof
(
device
)};
WCHAR
name
[
MAX_SERVICE_NAME
];
unsigned
int
i
;
for
(
i
=
0
;
SetupDiEnumDeviceInfo
(
set
,
i
,
&
device
);
++
i
)
{
if
(
SetupDiGetDeviceRegistryPropertyW
(
set
,
&
device
,
SPDRP_SERVICE
,
NULL
,
(
BYTE
*
)
name
,
sizeof
(
name
),
NULL
)
&&
!
wcsicmp
(
name
,
service
->
name
))
{
return
TRUE
;
}
}
return
FALSE
;
}
static
void
scmdatabase_autostart_services
(
struct
scmdatabase
*
db
)
{
static
const
WCHAR
rootW
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
0
};
struct
service_entry
**
services_list
;
unsigned
int
i
=
0
;
unsigned
int
size
=
32
;
unsigned
int
delayed_cnt
=
0
;
struct
service_entry
*
service
;
HDEVINFO
set
;
services_list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
services_list
[
0
]));
if
(
!
services_list
)
return
;
if
((
set
=
SetupDiGetClassDevsW
(
NULL
,
rootW
,
NULL
,
DIGCF_ALLCLASSES
))
==
INVALID_HANDLE_VALUE
)
WINE_ERR
(
"Failed to enumerate devices, error %#x.
\n
"
,
GetLastError
());
scmdatabase_lock
(
db
);
LIST_FOR_EACH_ENTRY
(
service
,
&
db
->
services
,
struct
service_entry
,
entry
)
{
if
(
service
->
config
.
dwStartType
==
SERVICE_BOOT_START
||
service
->
config
.
dwStartType
==
SERVICE_SYSTEM_START
||
service
->
config
.
dwStartType
==
SERVICE_AUTO_START
)
service
->
config
.
dwStartType
==
SERVICE_AUTO_START
||
(
set
!=
INVALID_HANDLE_VALUE
&&
is_root_pnp_service
(
set
,
service
)))
{
if
(
i
+
1
>=
size
)
{
...
...
@@ -482,6 +508,7 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
if
(
!
delayed_cnt
||
!
schedule_delayed_autostart
(
services_list
,
delayed_cnt
))
heap_free
(
services_list
);
SetupDiDestroyDeviceInfoList
(
set
);
}
static
void
scmdatabase_wait_terminate
(
struct
scmdatabase
*
db
)
...
...
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