5 Dec
2018
5 Dec
'18
9:06 a.m.
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.