1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
/*++ BUILD Version: 0001 // Increment this if a change has global effects
Copyright (c) 1989-1993 Microsoft Corporation
Module Name:
ntsm.h
Abstract:
This module describes the data types and procedure prototypes
that make up the NT session manager. This includes API's
exported by the Session manager and related subsystems.
Author:
Mark Lucovsky (markl) 21-Jun-1989
Revision History:
--*/
#ifndef _NTSM_
#define _NTSM_
#include <nt.h>
typedef PVOID PARGUMENTS;
typedef PVOID PUSERPROFILE;
//
// Message formats used by the Session Manager SubSystem to communicate
// with the Emulation SubSystems, via the Sb API calls exported by each
// emulation subsystem.
//
typedef struct _SBCONNECTINFO {
ULONG SubsystemImageType;
WCHAR EmulationSubSystemPortName[120];
} SBCONNECTINFO, *PSBCONNECTINFO;
typedef enum _SBAPINUMBER {
SbCreateSessionApi,
SbTerminateSessionApi,
SbForeignSessionCompleteApi,
SbMaxApiNumber
} SBAPINUMBER;
typedef struct _SBCREATESESSION {
ULONG SessionId;
RTL_USER_PROCESS_INFORMATION ProcessInformation;
PUSERPROFILE UserProfile;
ULONG DebugSession;
CLIENT_ID DebugUiClientId;
} SBCREATESESSION, *PSBCREATESESSION;
typedef struct _SBTERMINATESESSION {
ULONG SessionId;
NTSTATUS TerminationStatus;
} SBTERMINATESESSION, *PSBTERMINATESESSION;
typedef struct _SBFOREIGNSESSIONCOMPLETE {
ULONG SessionId;
NTSTATUS TerminationStatus;
} SBFOREIGNSESSIONCOMPLETE, *PSBFOREIGNSESSIONCOMPLETE;
typedef struct _SBAPIMSG {
PORT_MESSAGE h;
union {
SBCONNECTINFO ConnectionRequest;
struct {
SBAPINUMBER ApiNumber;
NTSTATUS ReturnedStatus;
union {
SBCREATESESSION CreateSession;
SBTERMINATESESSION TerminateSession;
SBFOREIGNSESSIONCOMPLETE ForeignSessionComplete;
} u;
};
};
} SBAPIMSG, *PSBAPIMSG;
//
// API's Exported by Sm
//
NTSTATUS
NTAPI
SmCreateForeignSession(
IN HANDLE SmApiPort,
OUT PULONG ForeignSessionId,
IN ULONG SourceSessionId,
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
IN PCLIENT_ID DebugUiClientId OPTIONAL
);
NTSTATUS
NTAPI
SmSessionComplete(
IN HANDLE SmApiPort,
IN ULONG SessionId,
IN NTSTATUS CompletionStatus
);
NTSTATUS
NTAPI
SmTerminateForeignSession(
IN HANDLE SmApiPort,
IN ULONG ForeignSessionId,
IN NTSTATUS TerminationStatus
);
NTSTATUS
NTAPI
SmExecPgm(
IN HANDLE SmApiPort,
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
IN BOOLEAN DebugFlag
);
NTSTATUS
NTAPI
SmLoadDeferedSubsystem(
IN HANDLE SmApiPort,
IN PUNICODE_STRING DeferedSubsystem
);
NTSTATUS
NTAPI
SmConnectToSm(
IN PUNICODE_STRING SbApiPortName OPTIONAL,
IN HANDLE SbApiPort OPTIONAL,
IN ULONG SbImageType OPTIONAL,
OUT PHANDLE SmApiPort
);
//
// Emulation Subsystems must export the following APIs
//
NTSTATUS
NTAPI
SbCreateSession(
IN PSBAPIMSG SbApiMsg
);
NTSTATUS
NTAPI
SbTerminateSession(
IN PSBAPIMSG SbApiMsg
);
NTSTATUS
NTAPI
SbForeignSessionComplete(
IN PSBAPIMSG SbApiMsg
);
#endif // _NTSM_
|