Signed-off-by: Alexandre Badalo alexandre9099@gmail.com --- dlls/winsta/main.c | 17 +++++++++++++++++ dlls/winsta/winsta.h | 1 + dlls/winsta/winsta.spec | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/winsta/main.c b/dlls/winsta/main.c index 7568310aea..87ce8a12c6 100644 --- a/dlls/winsta/main.c +++ b/dlls/winsta/main.c @@ -105,3 +105,20 @@ BOOLEAN WINAPI WinStationEnumerateW( HANDLE server, PSESSIONIDW *sessionids, ULO SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE; } + +BOOLEAN WINAPI WinStationTerminateProcess(HANDLE handle, + ULONG processId, + DWORD exit_code) +{ + NTSTATUS status; + + if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + status = NtTerminateProcess( handle, exit_code ); + if (status) SetLastError( RtlNtStatusToDosError(status) ); + return !status; +} diff --git a/dlls/winsta/winsta.h b/dlls/winsta/winsta.h index d908aa855c..494af2875f 100644 --- a/dlls/winsta/winsta.h +++ b/dlls/winsta/winsta.h @@ -95,5 +95,6 @@ BOOLEAN WINAPI WinStationGetProcessSid(HANDLE,ULONG,FILETIME *,PVOID,PULONG); BOOLEAN WINAPI WinStationQueryInformationW(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG); BOOLEAN WINAPI WinStationRegisterConsoleNotification(HANDLE,HWND,ULONG); BOOLEAN WINAPI WinStationUnRegisterConsoleNotification(HANDLE,HWND); +BOOLEAN WINAPI WinStationTerminateProcess(HANDLE,ULONG,ULONG); #endif /* _WINSTA_H */ diff --git a/dlls/winsta/winsta.spec b/dlls/winsta/winsta.spec index 1f38a238f0..1bfb46f4b9 100644 --- a/dlls/winsta/winsta.spec +++ b/dlls/winsta/winsta.spec @@ -68,7 +68,7 @@ @ stub WinStationShadow @ stub WinStationShadowStop @ stub WinStationShutdownSystem -@ stub WinStationTerminateProcess +@ stdcall WinStationTerminateProcess(ptr long long) @ stdcall WinStationUnRegisterConsoleNotification(ptr ptr) @ stdcall WinStationVirtualOpen(ptr ptr ptr) @ stub WinStationWaitSystemEvent @@ -92,4 +92,4 @@ @ stub _WinStationUpdateClientCachedCredentials @ stub _WinStationUpdateSettings @ stub _WinStationUpdateUserConfig -@ stub _WinStationWaitForConnect +@ stub _WinStationWaitForConnect \ No newline at end of file
Hi,
While running your changed tests on Windows, 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=45475
Your paranoid android.
=== debian9 (build log) ===
error: corrupt patch at line 13 Task: Patch failed to apply
=== debian9 (build log) ===
error: corrupt patch at line 13 Task: Patch failed to apply
On 12/5/18 11:45 AM, Alexandre Badalo wrote:
+BOOLEAN WINAPI WinStationTerminateProcess(HANDLE handle, + ULONG processId, + DWORD exit_code) +{ + NTSTATUS status;
+ if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + }
+ status = NtTerminateProcess( handle, exit_code ); + if (status) SetLastError( RtlNtStatusToDosError(status) ); + return !status; +}
Have you tried calling it on Windows? WinStation* calls take server handle as first argument, so !handle could mean local case. You'll need to get process handle from pid.