19const PCSTR SmpSubSystemNames[] =
43 ULONG SubSystemType = ProcessInformation->ImageInformation.SubSystemType;
51 CreateSessionMsg->
ProcessInfo = *ProcessInformation;
67 NtClose(ProcessInformation->ProcessHandle);
68 NtClose(ProcessInformation->ThreadHandle);
79 ProcessInformation->ProcessHandle,
89 ProcessInformation->ThreadHandle,
98 NtClose(ProcessInformation->ProcessHandle);
99 NtClose(ProcessInformation->ThreadHandle);
101 DPRINT1(
"SmpSbCreateSession: NtDuplicateObject (Thread) Failed %lx\n",
Status);
106 NtClose(ProcessInformation->ProcessHandle);
107 NtClose(ProcessInformation->ThreadHandle);
115 SbApiMsg.
h.u2.ZeroInit = 0;
117 SbApiMsg.
h.u1.s1.TotalLength =
sizeof(SbApiMsg);
124 DPRINT1(
"SmpSbCreateSession: NtRequestWaitReply Failed %lx\n",
Status);
138 DPRINT1(
"SmpSbCreateSession: NtDuplicateObject (Process) Failed %lx\n",
Status);
139 NtClose(ProcessInformation->ProcessHandle);
140 NtClose(ProcessInformation->ThreadHandle);
154 CHAR SubSysTypeName[
sizeof(
"Type 0x")+8];
157 SubSysName = SmpSubSystemNames[SubSystemType];
160 SubSysName = SubSysTypeName;
161 sprintf(SubSysTypeName,
"Type 0x%08lx", SubSystemType);
163 DPRINT1(
"SMSS: %s SubSystem not found (either not started or destroyed).\n", SubSysName);
166 NtClose(ProcessInformation->ProcessHandle);
167 NtClose(ProcessInformation->ThreadHandle);
183 DPRINT1(
"Unable to initialize debugging for Native App %lx.%lx -- out of memory\n",
184 ProcessInformation->ClientId.UniqueProcess,
185 ProcessInformation->ClientId.UniqueThread);
186 NtClose(ProcessInformation->ProcessHandle);
187 NtClose(ProcessInformation->ThreadHandle);
192 Process->ClientId = ProcessInformation->ClientId;
194 DPRINT1(
"Native Debug App %lx.%lx\n",
195 Process->ClientId.UniqueProcess,
196 Process->ClientId.UniqueThread);
207 DPRINT(
"Subsystem active, starting thread\n");
208 NtClose(ProcessInformation->ProcessHandle);
210 NtClose(ProcessInformation->ThreadHandle);
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
#define NT_SUCCESS(StatCode)
#define InsertHeadList(ListHead, Entry)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#define sprintf(buf, format,...)
#define THREAD_ALL_ACCESS
#define PROCESS_ALL_ACCESS
#define NtCurrentProcess()
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define IMAGE_SUBSYSTEM_NATIVE
NTSTATUS NTAPI NtRequestWaitReplyPort(IN HANDLE PortHandle, IN PPORT_MESSAGE LpcRequest, IN OUT PPORT_MESSAGE LpcReply)
NTSTATUS NTAPI NtSetInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength)
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
NTSTATUS NTAPI NtDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)
LIST_ENTRY NativeProcessList
struct _SB_CREATE_SESSION_MSG SB_CREATE_SESSION_MSG
NTSTATUS NTAPI SmpSbCreateSession(IN PVOID Reserved, IN PSMP_SUBSYSTEM OtherSubsystem, IN PRTL_USER_PROCESS_INFORMATION ProcessInformation, IN ULONG DbgSessionId, IN PCLIENT_ID DbgUiClientId)
NTSTATUS NTAPI SmpGetProcessMuSessionId(IN HANDLE ProcessHandle, OUT PULONG SessionId)
BOOLEAN NTAPI SmpCheckDuplicateMuSessionId(IN ULONG MuSessionId)
ULONG NTAPI SmpAllocateSessionId(IN PSMP_SUBSYSTEM Subsystem, IN PSMP_SUBSYSTEM OtherSubsystem)
VOID NTAPI SmpDeleteSession(IN ULONG SessionId)
VOID NTAPI SmpDereferenceSubsystem(IN PSMP_SUBSYSTEM SubSystem)
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByType(IN ULONG MuSessionId, IN ULONG ImageType)
SB_CREATE_SESSION_MSG CreateSession
union _SB_API_MSG::@3531::@3533::@3535 u
RTL_USER_PROCESS_INFORMATION ProcessInfo
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_NOT_FOUND
_Reserved_ PVOID Reserved