mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:02:59 +00:00
[KERNEL32] Minor enhancements for CreateRemoteThread(). (#804)
- Add some cleanup code in failure code paths, instead of asserting. - Move BasepNotifyCsrOfThread() helper to the only file where it is used. - Don't use ERROR_DBGBREAK in failure paths but just DPRINT the error message: we handle the failures properly. - When creating the remote thread, sync its service tag with the parent thread's one.
This commit is contained in:
parent
effdb6f232
commit
44cddadba8
2 changed files with 76 additions and 69 deletions
|
@ -479,36 +479,6 @@ BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress)
|
|||
_SEH2_END;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
BasepNotifyCsrOfThread(IN HANDLE ThreadHandle,
|
||||
IN PCLIENT_ID ClientId)
|
||||
{
|
||||
BASE_API_MESSAGE ApiMessage;
|
||||
PBASE_CREATE_THREAD CreateThreadRequest = &ApiMessage.Data.CreateThreadRequest;
|
||||
|
||||
DPRINT("BasepNotifyCsrOfThread: Thread: %p, Handle %p\n",
|
||||
ClientId->UniqueThread, ThreadHandle);
|
||||
|
||||
/* Fill out the request */
|
||||
CreateThreadRequest->ClientId = *ClientId;
|
||||
CreateThreadRequest->ThreadHandle = ThreadHandle;
|
||||
|
||||
/* Call CSR */
|
||||
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
NULL,
|
||||
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepCreateThread),
|
||||
sizeof(*CreateThreadRequest));
|
||||
if (!NT_SUCCESS(ApiMessage.Status))
|
||||
{
|
||||
DPRINT1("Failed to tell CSRSS about new thread: %lx\n", ApiMessage.Status);
|
||||
return ApiMessage.Status;
|
||||
}
|
||||
|
||||
/* Return Success */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
WINAPI
|
||||
BasePushProcessParameters(IN ULONG ParameterFlags,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue