00031 {
00032
PACTIVATEDEBUGGERMSG a = (
PACTIVATEDEBUGGERMSG)&m->u.ApiMessageData;
00033 PCSR_THREAD Thread;
00034
NTSTATUS Status;
00035
00036 UNREFERENCED_PARAMETER(ReplyStatus);
00037
00038
00039
00040
00041
if (a->
ClientId.UniqueProcess == NtCurrentTeb()->ClientId.UniqueProcess) {
00042 DbgBreakPoint();
00043
return STATUS_SUCCESS;
00044 }
00045
00046
00047
00048
00049
if (m->h.u2.s2.Type == LPC_REQUEST) {
00050
if (!CsrImpersonateClient(NULL)) {
00051
return STATUS_UNSUCCESSFUL;
00052 }
00053 }
00054
00055
00056
00057
00058
Status = CsrLockThreadByClientId(a->
ClientId.UniqueThread, &Thread);
00059
if (
NT_SUCCESS(Status)) {
00060
ASSERT(a->
ClientId.UniqueProcess == Thread->ClientId.UniqueProcess);
00061
00062
00063
00064
00065
00066
Status =
RtlRemoteCall(
00067 Thread->Process->ProcessHandle,
00068 Thread->ThreadHandle,
00069 (PVOID)gpfnAttachRoutine,
00070 0,
00071 NULL,
00072 TRUE,
00073 FALSE
00074 );
00075 UserAssert(
NT_SUCCESS(Status));
00076
Status =
NtAlertThread(Thread->ThreadHandle);
00077 UserAssert(
NT_SUCCESS(Status));
00078 CsrUnlockThread(Thread);
00079 }
00080
00081
00082
00083
00084
if (m->h.u2.s2.Type == LPC_REQUEST) {
00085 CsrRevertToSelf();
00086 }
00087
00088
return Status;
00089 }