Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
871635c6
Commit
871635c6
authored
Aug 31, 2004
by
Alexander Yaworsky
Committed by
Alexandre Julliard
Aug 31, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand ImagePath in QueryServiceConfigW.
parent
4cb6c5c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
service.c
dlls/advapi32/service.c
+27
-7
No files found.
dlls/advapi32/service.c
View file @
871635c6
...
...
@@ -1026,6 +1026,7 @@ QueryServiceConfigW( SC_HANDLE hService,
static
const
WCHAR
szDependencies
[]
=
{
'D'
,
'e'
,
'p'
,
'e'
,
'n'
,
'd'
,
'e'
,
'n'
,
'c'
,
'i'
,
'e'
,
's'
,
0
};
HKEY
hKey
=
((
struct
sc_handle
*
)
hService
)
->
u
.
service
.
hkey
;
WCHAR
str_buffer
[
MAX_PATH
];
LONG
r
;
DWORD
type
,
val
,
sz
,
total
,
n
;
LPBYTE
p
;
...
...
@@ -1036,10 +1037,20 @@ QueryServiceConfigW( SC_HANDLE hService,
/* calculate the size required first */
total
=
sizeof
(
QUERY_SERVICE_CONFIGW
);
sz
=
0
;
r
=
RegQueryValueExW
(
hKey
,
szImagePath
,
0
,
&
type
,
NULL
,
&
sz
);
if
(
(
r
==
ERROR_SUCCESS
)
&&
(
type
==
REG_SZ
)
)
total
+=
sz
;
sz
=
sizeof
(
str_buffer
);
r
=
RegQueryValueExW
(
hKey
,
szImagePath
,
0
,
&
type
,
(
LPBYTE
)
str_buffer
,
&
sz
);
if
(
(
r
==
ERROR_SUCCESS
)
&&
(
type
==
REG_SZ
||
type
==
REG_EXPAND_SZ
)
)
{
sz
=
ExpandEnvironmentStringsW
(
str_buffer
,
NULL
,
0
);
if
(
0
==
sz
)
return
FALSE
;
total
+=
sizeof
(
WCHAR
)
*
sz
;
}
else
{
/* FIXME: set last error */
return
FALSE
;
}
sz
=
0
;
r
=
RegQueryValueExW
(
hKey
,
szGroup
,
0
,
&
type
,
NULL
,
&
sz
);
...
...
@@ -1091,14 +1102,23 @@ QueryServiceConfigW( SC_HANDLE hService,
p
=
(
LPBYTE
)
&
lpServiceConfig
[
1
];
n
=
total
-
sizeof
(
QUERY_SERVICE_CONFIGW
);
sz
=
n
;
r
=
RegQueryValueExW
(
hKey
,
szImagePath
,
0
,
&
type
,
p
,
&
sz
);
if
(
(
r
==
ERROR_SUCCESS
)
||
(
type
==
REG
_SZ
)
)
sz
=
sizeof
(
str_buffer
)
;
r
=
RegQueryValueExW
(
hKey
,
szImagePath
,
0
,
&
type
,
(
LPBYTE
)
str_buffer
,
&
sz
);
if
(
(
r
==
ERROR_SUCCESS
)
&&
(
type
==
REG_SZ
||
type
==
REG_EXPAND
_SZ
)
)
{
sz
=
ExpandEnvironmentStringsW
(
str_buffer
,
(
LPWSTR
)
p
,
n
);
sz
*=
sizeof
(
WCHAR
);
if
(
0
==
sz
||
sz
>
n
)
return
FALSE
;
lpServiceConfig
->
lpBinaryPathName
=
(
LPWSTR
)
p
;
p
+=
sz
;
n
-=
sz
;
}
else
{
/* FIXME: set last error */
return
FALSE
;
}
sz
=
n
;
r
=
RegQueryValueExW
(
hKey
,
szGroup
,
0
,
&
type
,
p
,
&
sz
);
...
...
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