Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- programs/services/rpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 41501024dac..8a77d97dd9f 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -831,7 +831,9 @@ static void fill_status_process(SERVICE_STATUS_PROCESS *status, struct service_e { struct process_entry *process = service->process; memcpy(status, &service->status, sizeof(service->status)); - status->dwProcessId = process ? process->process_id : 0; + status->dwProcessId = 0; + if (process && !(service->status.dwServiceType & SERVICE_DRIVER)) + status->dwProcessId = process->process_id; status->dwServiceFlags = 0; }
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- This fixes the test failure reported here:
https://www.winehq.org/pipermail/wine-devel/2019-July/148450.html
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 2 ++ programs/services/rpc.c | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 267fddb7cc3..48ddb299cfd 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -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; } diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 8a77d97dd9f..a657492a5f6 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -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", hServiceStatus, lpServiceStatus); + WINE_TRACE("(%p, %p)\n", handle, status);
- if ((err = validate_service_handle(hServiceStatus, SERVICE_SET_STATUS, &service)) != 0) + if ((err = validate_service_handle(handle, 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) && - lpServiceStatus->dwCurrentState == SERVICE_STOPPED) + status->dwCurrentState == SERVICE_STOPPED) { service->service_entry->process = NULL; if (!--process->use_count)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=54433
Your paranoid android.
=== debian9 (32 bit report) ===
services.exe: service.c:465: Test succeeded inside todo block: status.dwServiceType = 10 service.c:520: Test succeeded inside todo block: status.dwServiceType = 10 service.c:541: Test succeeded inside todo block: status.dwServiceType = 10 service.c:561: Test succeeded inside todo block: status.dwServiceType = 10
=== debian9 (32 bit Chinese:China report) ===
services.exe: service.c:465: Test succeeded inside todo block: status.dwServiceType = 10 service.c:520: Test succeeded inside todo block: status.dwServiceType = 10 service.c:541: Test succeeded inside todo block: status.dwServiceType = 10 service.c:561: Test succeeded inside todo block: status.dwServiceType = 10
=== debian9 (32 bit WoW report) ===
services.exe: service.c:465: Test succeeded inside todo block: status.dwServiceType = 10 service.c:520: Test succeeded inside todo block: status.dwServiceType = 10 service.c:541: Test succeeded inside todo block: status.dwServiceType = 10 service.c:561: Test succeeded inside todo block: status.dwServiceType = 10
=== debian9 (64 bit WoW report) ===
services.exe: service.c:465: Test succeeded inside todo block: status.dwServiceType = 10 service.c:520: Test succeeded inside todo block: status.dwServiceType = 10 service.c:541: Test succeeded inside todo block: status.dwServiceType = 10 service.c:561: Test succeeded inside todo block: status.dwServiceType = 10