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
bbb823f8
Commit
bbb823f8
authored
Sep 04, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add a function to query the service configuration.
parent
d582950d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
builtin.c
dlls/wbemprox/builtin.c
+22
-21
No files found.
dlls/wbemprox/builtin.c
View file @
bbb823f8
...
...
@@ -880,6 +880,25 @@ static const WCHAR *get_service_startmode( DWORD mode )
}
}
static
QUERY_SERVICE_CONFIGW
*
query_service_config
(
SC_HANDLE
manager
,
const
WCHAR
*
name
)
{
QUERY_SERVICE_CONFIGW
*
config
=
NULL
;
SC_HANDLE
service
;
DWORD
size
;
if
(
!
(
service
=
OpenServiceW
(
manager
,
name
,
SERVICE_QUERY_CONFIG
)))
return
NULL
;
QueryServiceConfigW
(
service
,
NULL
,
0
,
&
size
);
if
(
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
goto
done
;
if
(
!
(
config
=
heap_alloc
(
size
)))
goto
done
;
if
(
QueryServiceConfigW
(
service
,
config
,
size
,
&
size
))
goto
done
;
heap_free
(
config
);
config
=
NULL
;
done:
CloseServiceHandle
(
service
);
return
config
;
}
static
void
fill_service
(
struct
table
*
table
)
{
struct
record_service
*
rec
;
...
...
@@ -915,27 +934,8 @@ static void fill_service( struct table *table )
for
(
i
=
0
;
i
<
count
;
i
++
)
{
QUERY_SERVICE_CONFIGW
*
config
;
SC_HANDLE
service
;
DWORD
startmode
;
DWORD
size
;
service
=
OpenServiceW
(
manager
,
services
[
i
].
lpServiceName
,
GENERIC_READ
);
QueryServiceConfigW
(
service
,
NULL
,
0
,
&
size
);
config
=
heap_alloc
(
size
);
if
(
!
config
)
{
CloseServiceHandle
(
service
);
break
;
}
if
(
QueryServiceConfigW
(
service
,
config
,
size
,
&
size
))
startmode
=
config
->
dwStartType
;
else
{
ERR
(
"failed to get %s service config data
\n
"
,
debugstr_w
(
services
[
i
].
lpServiceName
));
startmode
=
SERVICE_DISABLED
;
}
CloseServiceHandle
(
service
);
heap_free
(
config
);
if
(
!
(
config
=
query_service_config
(
manager
,
services
[
i
].
lpServiceName
)))
continue
;
status
=
&
services
[
i
].
ServiceStatusProcess
;
rec
=
(
struct
record_service
*
)(
table
->
data
+
offset
);
...
...
@@ -945,9 +945,10 @@ static void fill_service( struct table *table )
rec
->
name
=
heap_strdupW
(
services
[
i
].
lpServiceName
);
rec
->
process_id
=
status
->
dwProcessId
;
rec
->
servicetype
=
get_service_type
(
status
->
dwServiceType
);
rec
->
startmode
=
get_service_startmode
(
startmod
e
);
rec
->
startmode
=
get_service_startmode
(
config
->
dwStartTyp
e
);
rec
->
state
=
get_service_state
(
status
->
dwCurrentState
);
rec
->
systemname
=
heap_strdupW
(
sysnameW
);
heap_free
(
config
);
offset
+=
sizeof
(
*
rec
);
num_rows
++
;
}
...
...
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