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
020bd631
Commit
020bd631
authored
May 17, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Launch winedevice.exe when asked to start a kernel driver service.
parent
c81d0995
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
service.c
dlls/advapi32/service.c
+32
-15
No files found.
dlls/advapi32/service.c
View file @
020bd631
...
...
@@ -1486,26 +1486,43 @@ static DWORD service_start_process(struct sc_service *hsvc, LPDWORD ppid)
PROCESS_INFORMATION
pi
;
STARTUPINFOW
si
;
LPWSTR
path
=
NULL
,
str
;
DWORD
type
,
size
,
ret
;
DWORD
type
,
size
,
ret
,
svc_type
;
HANDLE
handles
[
2
];
BOOL
r
;
/* read the executable path from memory */
size
=
0
;
ret
=
RegQueryValueExW
(
hsvc
->
hkey
,
_ImagePathW
,
NULL
,
&
type
,
NULL
,
&
size
);
if
(
ret
!=
ERROR_SUCCESS
)
return
FALSE
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
RegQueryValueExW
(
hsvc
->
hkey
,
_ImagePathW
,
NULL
,
&
type
,
(
LPBYTE
)
str
,
&
size
);
if
(
ret
==
ERROR_SUCCESS
)
size
=
sizeof
(
svc_type
);
if
(
RegQueryValueExW
(
hsvc
->
hkey
,
szType
,
NULL
,
&
type
,
(
LPBYTE
)
&
svc_type
,
&
size
)
||
type
!=
REG_DWORD
)
svc_type
=
0
;
if
(
svc_type
==
SERVICE_KERNEL_DRIVER
)
{
size
=
ExpandEnvironmentStringsW
(
str
,
NULL
,
0
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
ExpandEnvironmentStringsW
(
str
,
path
,
size
);
static
const
WCHAR
winedeviceW
[]
=
{
'\\'
,
'w'
,
'i'
,
'n'
,
'e'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'.'
,
'e'
,
'x'
,
'e'
,
' '
,
0
};
DWORD
len
=
GetSystemDirectoryW
(
NULL
,
0
)
+
sizeof
(
winedeviceW
)
/
sizeof
(
WCHAR
)
+
strlenW
(
hsvc
->
name
);
if
(
!
(
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
GetSystemDirectoryW
(
path
,
len
);
lstrcatW
(
path
,
winedeviceW
);
lstrcatW
(
path
,
hsvc
->
name
);
}
else
{
/* read the executable path from the registry */
size
=
0
;
ret
=
RegQueryValueExW
(
hsvc
->
hkey
,
_ImagePathW
,
NULL
,
&
type
,
NULL
,
&
size
);
if
(
ret
!=
ERROR_SUCCESS
)
return
FALSE
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
RegQueryValueExW
(
hsvc
->
hkey
,
_ImagePathW
,
NULL
,
&
type
,
(
LPBYTE
)
str
,
&
size
);
if
(
ret
==
ERROR_SUCCESS
)
{
size
=
ExpandEnvironmentStringsW
(
str
,
NULL
,
0
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
ExpandEnvironmentStringsW
(
str
,
path
,
size
);
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
if
(
!
path
)
return
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
if
(
!
path
)
return
FALSE
;
/* wait for the process to start and set an event or terminate */
handles
[
0
]
=
service_get_event_handle
(
hsvc
->
name
);
...
...
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