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
773cf1e5
Commit
773cf1e5
authored
Aug 26, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmi: Implement StartMode property for service class.
parent
74329496
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
builtin.c
dlls/wbemprox/builtin.c
+45
-0
No files found.
dlls/wbemprox/builtin.c
View file @
773cf1e5
...
...
@@ -143,6 +143,8 @@ static const WCHAR prop_serialnumberW[] =
{
'S'
,
'e'
,
'r'
,
'i'
,
'a'
,
'l'
,
'N'
,
'u'
,
'm'
,
'b'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
prop_servicetypeW
[]
=
{
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'T'
,
'y'
,
'p'
,
'e'
,
0
};
static
const
WCHAR
prop_startmodeW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'M'
,
'o'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
prop_sizeW
[]
=
{
'S'
,
'i'
,
'z'
,
'e'
,
0
};
static
const
WCHAR
prop_speedW
[]
=
...
...
@@ -259,6 +261,7 @@ static const struct column col_service[] =
{
prop_nameW
,
CIM_STRING
|
COL_FLAG_DYNAMIC
|
COL_FLAG_KEY
},
{
prop_processidW
,
CIM_UINT32
},
{
prop_servicetypeW
,
CIM_STRING
},
{
prop_startmodeW
,
CIM_STRING
},
{
prop_stateW
,
CIM_STRING
}
};
static
const
struct
column
col_stdregprov
[]
=
...
...
@@ -395,6 +398,7 @@ struct record_service
const
WCHAR
*
name
;
UINT32
process_id
;
const
WCHAR
*
servicetype
;
const
WCHAR
*
startmode
;
const
WCHAR
*
state
;
};
struct
record_stdregprov
...
...
@@ -836,6 +840,28 @@ static const WCHAR *get_service_state( DWORD state )
}
}
static
const
WCHAR
*
get_service_startmode
(
DWORD
mode
)
{
static
const
WCHAR
bootW
[]
=
{
'B'
,
'o'
,
'o'
,
't'
,
0
};
static
const
WCHAR
systemW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
0
};
static
const
WCHAR
autoW
[]
=
{
'A'
,
'u'
,
't'
,
'o'
,
0
};
static
const
WCHAR
manualW
[]
=
{
'M'
,
'a'
,
'n'
,
'u'
,
'a'
,
'l'
,
0
};
static
const
WCHAR
disabledW
[]
=
{
'D'
,
'i'
,
's'
,
'a'
,
'b'
,
'l'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
unknownW
[]
=
{
'U'
,
'n'
,
'k'
,
'n'
,
'o'
,
'w'
,
'n'
,
0
};
switch
(
mode
)
{
case
SERVICE_BOOT_START
:
return
bootW
;
case
SERVICE_SYSTEM_START
:
return
systemW
;
case
SERVICE_AUTO_START
:
return
autoW
;
case
SERVICE_DEMAND_START
:
return
manualW
;
case
SERVICE_DISABLED
:
return
disabledW
;
default:
ERR
(
"unknown mode 0x%x
\n
"
,
mode
);
return
unknownW
;
}
}
static
void
fill_service
(
struct
table
*
table
)
{
struct
record_service
*
rec
;
...
...
@@ -866,6 +892,24 @@ 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
(
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
);
status
=
&
services
[
i
].
ServiceStatusProcess
;
rec
=
(
struct
record_service
*
)(
table
->
data
+
offset
);
rec
->
accept_pause
=
(
status
->
dwControlsAccepted
&
SERVICE_ACCEPT_PAUSE_CONTINUE
)
?
-
1
:
0
;
...
...
@@ -874,6 +918,7 @@ 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
(
startmode
);
rec
->
state
=
get_service_state
(
status
->
dwCurrentState
);
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