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
4f8dfdba
Commit
4f8dfdba
authored
Jul 03, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: Do not overwrite the service type in SetServiceStatus().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
946e1b2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+2
-0
rpc.c
programs/services/rpc.c
+10
-7
service.c
programs/services/tests/service.c
+4
-4
No files found.
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
4f8dfdba
...
...
@@ -135,6 +135,8 @@ static BOOL start_driver(HANDLE service)
}
ok
(
status
.
dwCurrentState
==
SERVICE_RUNNING
,
"expected SERVICE_RUNNING, got %d
\n
"
,
status
.
dwCurrentState
);
ok
(
status
.
dwServiceType
==
SERVICE_KERNEL_DRIVER
,
"expected SERVICE_KERNEL_DRIVER, got %#x
\n
"
,
status
.
dwServiceType
);
return
TRUE
;
}
...
...
programs/services/rpc.c
View file @
4f8dfdba
...
...
@@ -865,28 +865,31 @@ static void fill_notify(struct sc_notify_handle *notify, struct service_entry *s
SetEvent
(
notify
->
event
);
}
DWORD
__cdecl
svcctl_SetServiceStatus
(
SC_RPC_HANDLE
hServiceStatus
,
LPSERVICE_STATUS
lpServiceStatus
)
DWORD
__cdecl
svcctl_SetServiceStatus
(
SC_RPC_HANDLE
handle
,
SERVICE_STATUS
*
status
)
{
struct
sc_service_handle
*
service
,
*
service_handle
;
struct
process_entry
*
process
;
DWORD
err
,
mask
;
WINE_TRACE
(
"(%p, %p)
\n
"
,
h
ServiceStatus
,
lpServiceS
tatus
);
WINE_TRACE
(
"(%p, %p)
\n
"
,
h
andle
,
s
tatus
);
if
((
err
=
validate_service_handle
(
h
ServiceStatus
,
SERVICE_SET_STATUS
,
&
service
))
!=
0
)
if
((
err
=
validate_service_handle
(
h
andle
,
SERVICE_SET_STATUS
,
&
service
))
!=
0
)
return
err
;
service_lock
(
service
->
service_entry
);
/* FIXME: be a bit more discriminant about what parts of the status we set
* and check that fields are valid */
service
->
service_entry
->
status
=
*
lpServiceStatus
;
service
->
service_entry
->
status
.
dwCurrentState
=
status
->
dwCurrentState
;
service
->
service_entry
->
status
.
dwControlsAccepted
=
status
->
dwControlsAccepted
;
service
->
service_entry
->
status
.
dwWin32ExitCode
=
status
->
dwWin32ExitCode
;
service
->
service_entry
->
status
.
dwServiceSpecificExitCode
=
status
->
dwServiceSpecificExitCode
;
service
->
service_entry
->
status
.
dwCheckPoint
=
status
->
dwCheckPoint
;
service
->
service_entry
->
status
.
dwWaitHint
=
status
->
dwWaitHint
;
SetEvent
(
service
->
service_entry
->
status_changed_event
);
if
((
process
=
service
->
service_entry
->
process
)
&&
lpServiceS
tatus
->
dwCurrentState
==
SERVICE_STOPPED
)
s
tatus
->
dwCurrentState
==
SERVICE_STOPPED
)
{
service
->
service_entry
->
process
=
NULL
;
if
(
!--
process
->
use_count
)
...
...
programs/services/tests/service.c
View file @
4f8dfdba
...
...
@@ -462,7 +462,7 @@ static void test_service(void)
res
=
QueryServiceStatus
(
service_handle
,
&
status
);
ok
(
res
,
"QueryServiceStatus failed: %d
\n
"
,
GetLastError
());
todo_wine
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwCurrentState
==
SERVICE_RUNNING
,
"status.dwCurrentState = %x
\n
"
,
status
.
dwCurrentState
);
ok
(
status
.
dwControlsAccepted
==
(
SERVICE_ACCEPT_STOP
|
SERVICE_ACCEPT_SHUTDOWN
),
"status.dwControlsAccepted = %x
\n
"
,
status
.
dwControlsAccepted
);
...
...
@@ -517,7 +517,7 @@ static inline void test_no_stop(void)
res
=
QueryServiceStatus
(
service_handle
,
&
status
);
ok
(
res
,
"QueryServiceStatus failed: %d
\n
"
,
GetLastError
());
todo_wine
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwCurrentState
==
SERVICE_RUNNING
,
"status.dwCurrentState = %x
\n
"
,
status
.
dwCurrentState
);
ok
(
status
.
dwControlsAccepted
==
(
SERVICE_ACCEPT_STOP
|
SERVICE_ACCEPT_SHUTDOWN
),
"status.dwControlsAccepted = %x
\n
"
,
status
.
dwControlsAccepted
);
...
...
@@ -538,7 +538,7 @@ static inline void test_no_stop(void)
res
=
QueryServiceStatus
(
service_handle
,
&
status
);
ok
(
res
,
"QueryServiceStatus failed: %d
\n
"
,
GetLastError
());
todo_wine
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwCurrentState
==
SERVICE_STOPPED
||
status
.
dwCurrentState
==
SERVICE_STOP_PENDING
,
"status.dwCurrentState = %x
\n
"
,
status
.
dwCurrentState
);
ok
(
status
.
dwControlsAccepted
==
0
,
"status.dwControlsAccepted = %x
\n
"
,
status
.
dwControlsAccepted
);
...
...
@@ -558,7 +558,7 @@ static inline void test_no_stop(void)
res
=
QueryServiceStatus
(
service_handle
,
&
status
);
ok
(
res
,
"QueryServiceStatus failed: %d
\n
"
,
GetLastError
());
todo_wine
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwServiceType
==
SERVICE_WIN32_OWN_PROCESS
,
"status.dwServiceType = %x
\n
"
,
status
.
dwServiceType
);
ok
(
status
.
dwCurrentState
==
SERVICE_STOPPED
||
status
.
dwCurrentState
==
SERVICE_STOP_PENDING
,
"status.dwCurrentState = %x
\n
"
,
status
.
dwCurrentState
);
ok
(
status
.
dwControlsAccepted
==
0
,
"status.dwControlsAccepted = %x
\n
"
,
status
.
dwControlsAccepted
);
...
...
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