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
e86ed3bf
Commit
e86ed3bf
authored
May 03, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
May 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sc: Implement the start and stop commands.
parent
3e1f5ba3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
sc.c
programs/sc/sc.c
+25
-0
No files found.
programs/sc/sc.c
View file @
e86ed3bf
...
...
@@ -219,7 +219,10 @@ int wmain( int argc, const WCHAR *argv[] )
static
const
WCHAR
descriptionW
[]
=
{
'd'
,
'e'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
failureW
[]
=
{
'f'
,
'a'
,
'i'
,
'l'
,
'u'
,
'r'
,
'e'
,
0
};
static
const
WCHAR
deleteW
[]
=
{
'd'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
static
const
WCHAR
startW
[]
=
{
's'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
stopW
[]
=
{
's'
,
't'
,
'o'
,
'p'
,
0
};
SC_HANDLE
manager
,
service
;
SERVICE_STATUS
status
;
BOOL
ret
=
FALSE
;
if
(
argc
<
3
)
usage
();
...
...
@@ -305,6 +308,28 @@ int wmain( int argc, const WCHAR *argv[] )
}
else
WINE_TRACE
(
"failed to open service %u
\n
"
,
GetLastError
());
}
else
if
(
!
strcmpiW
(
argv
[
1
],
startW
))
{
service
=
OpenServiceW
(
manager
,
argv
[
2
],
SERVICE_START
);
if
(
service
)
{
ret
=
StartServiceW
(
service
,
argc
-
3
,
argv
+
3
);
if
(
!
ret
)
WINE_TRACE
(
"failed to start service %u
\n
"
,
GetLastError
());
CloseServiceHandle
(
service
);
}
else
WINE_TRACE
(
"failed to open service %u
\n
"
,
GetLastError
());
}
else
if
(
!
strcmpiW
(
argv
[
1
],
stopW
))
{
service
=
OpenServiceW
(
manager
,
argv
[
2
],
SERVICE_STOP
);
if
(
service
)
{
ret
=
ControlService
(
service
,
SERVICE_CONTROL_STOP
,
&
status
);
if
(
!
ret
)
WINE_TRACE
(
"failed to stop service %u
\n
"
,
GetLastError
());
CloseServiceHandle
(
service
);
}
else
WINE_TRACE
(
"failed to open service %u
\n
"
,
GetLastError
());
}
else
WINE_FIXME
(
"command not supported
\n
"
);
...
...
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