ReactOS 0.4.16-dev-297-gc569aee
|
Go to the source code of this file.
Classes | |
struct | _SM_CREATE_FOREIGN_SESSION_MSG |
struct | _SM_SESSION_COMPLETE_MSG |
struct | _SM_TERMINATE_FOREIGN_SESSION_MSG |
struct | _SM_EXEC_PGM_MSG |
struct | _SM_LOAD_DEFERED_SUBSYSTEM_MSG |
struct | _SM_START_CSR_MSG |
struct | _SM_STOP_CSR_MSG |
struct | _SM_API_MSG |
struct | _SB_CREATE_SESSION_MSG |
struct | _SB_TERMINATE_SESSION_MSG |
struct | _SB_FOREIGN_SESSION_COMPLETE_MSG |
struct | _SB_CREATE_PROCESS_MSG |
struct | _SB_CONNECTION_INFO |
struct | _SB_API_MSG |
Macros | |
#define | SB_PROCESS_FLAGS_DEBUG 0x1 |
#define | SB_PROCESS_FLAGS_WAIT_ON_THREAD 0x2 |
#define | SB_PROCESS_FLAGS_RESERVE_1MB 0x8 |
#define | SB_PROCESS_FLAGS_SKIP_CHECKS 0x20 |
Functions | |
C_ASSERT (sizeof(SM_EXEC_PGM_MSG)==0x48) | |
C_ASSERT (sizeof(SM_START_CSR_MSG)==0x110) | |
C_ASSERT (sizeof(SM_API_MSG)==0x130) | |
C_ASSERT (sizeof(SB_CREATE_SESSION_MSG)==0x58) | |
C_ASSERT (sizeof(SB_CREATE_PROCESS_MSG)==0x18) | |
C_ASSERT (sizeof(SB_API_MSG)==0x110) | |
NTSTATUS NTAPI | SmConnectToSm (_In_opt_ PUNICODE_STRING SbApiPortName, _In_opt_ HANDLE SbApiPort, _In_opt_ ULONG ImageType, _Out_ PHANDLE SmApiPort) |
Connects to the SM API port for registering a session callback port (Sb) associated to a subsystem, or for issuing API requests to the SM API port. | |
NTSTATUS NTAPI | SmSendMsgToSm (_In_ HANDLE SmApiPort, _Inout_ PSM_API_MSG SmApiMsg) |
Sends a message to the SM via the SM API port. | |
NTSTATUS NTAPI | SmSessionComplete (_In_ HANDLE SmApiPort, _In_ ULONG SessionId, _In_ NTSTATUS SessionStatus) |
This function is called by an environment subsystem server to tell the SM it has terminated the session it managed. | |
NTSTATUS NTAPI | SmExecPgm (_In_ HANDLE SmApiPort, _In_ PRTL_USER_PROCESS_INFORMATION ProcessInformation, _In_ BOOLEAN DebugFlag) |
Requests the SM to start a process under a new environment session. | |
NTSTATUS NTAPI | SmLoadDeferedSubsystem (_In_ HANDLE SmApiPort, _In_ PUNICODE_STRING DeferedSubsystem) |
This function is used to make the SM start an environment subsystem server process. | |
NTSTATUS NTAPI | SmStartCsr (_In_ HANDLE SmApiPort, _Out_ PULONG pMuSessionId, _In_opt_ PUNICODE_STRING CommandLine, _Out_ PHANDLE pWindowsSubSysProcessId, _Out_ PHANDLE pInitialCommandProcessId) |
Requests the SM to create a new Terminal Services session and start an initial command. | |
NTSTATUS NTAPI | SmStopCsr (_In_ HANDLE SmApiPort, _In_ ULONG MuSessionId) |
Requests the SM to terminate a Terminal Services session. | |
typedef struct _SB_API_MSG * PSB_API_MSG |
typedef BOOLEAN(NTAPI * PSB_API_ROUTINE) (_In_ PSB_API_MSG SbApiMsg) |
typedef struct _SB_CONNECTION_INFO * PSB_CONNECTION_INFO |
typedef struct _SM_API_MSG * PSM_API_MSG |
typedef struct _SM_EXEC_PGM_MSG * PSM_EXEC_PGM_MSG |
typedef struct _SM_START_CSR_MSG * PSM_START_CSR_MSG |
typedef struct _SM_STOP_CSR_MSG * PSM_STOP_CSR_MSG |
typedef struct _SB_API_MSG SB_API_MSG |
typedef enum _SB_API_NUMBER SB_API_NUMBER |
typedef struct _SM_API_MSG SM_API_MSG |
typedef struct _SM_EXEC_PGM_MSG SM_EXEC_PGM_MSG |
typedef struct _SM_START_CSR_MSG SM_START_CSR_MSG |
typedef struct _SM_STOP_CSR_MSG SM_STOP_CSR_MSG |
typedef enum _SMSRV_API_NUMBER SMSRV_API_NUMBER |
Enumerator | |
---|---|
SbpCreateSession | |
SbpTerminateSession | |
SbpForeignSessionComplete | |
SbpCreateProcess | |
SbpMaxApiNumber |
Definition at line 144 of file smmsg.h.
Enumerator | |
---|---|
SmpCreateForeignSessionApi | |
SmpSessionCompleteApi | |
SmpTerminateForeignSessionApi | |
SmpExecPgmApi | |
SmpLoadDeferedSubsystemApi | |
SmpStartCsrApi | |
SmpStopCsrApi | |
SmpMaxApiNumber |
Definition at line 26 of file smmsg.h.
C_ASSERT | ( | sizeof(SB_API_MSG) | = =0x110 | ) |
C_ASSERT | ( | sizeof(SB_CREATE_PROCESS_MSG) | = =0x18 | ) |
C_ASSERT | ( | sizeof(SB_CREATE_SESSION_MSG) | = =0x58 | ) |
C_ASSERT | ( | sizeof(SM_API_MSG) | = =0x130 | ) |
C_ASSERT | ( | sizeof(SM_EXEC_PGM_MSG) | = =0x48 | ) |
C_ASSERT | ( | sizeof(SM_START_CSR_MSG) | = =0x110 | ) |
NTSTATUS NTAPI SmConnectToSm | ( | _In_opt_ PUNICODE_STRING | SbApiPortName, |
_In_opt_ HANDLE | SbApiPort, | ||
_In_opt_ ULONG | ImageType, | ||
_Out_ PHANDLE | SmApiPort | ||
) |
Connects to the SM API port for registering a session callback port (Sb) associated to a subsystem, or for issuing API requests to the SM API port.
There are only two ways to call this API: a) subsystems willing to register with SM will use it with full parameters (the function checks them); b) regular SM clients, will set to 0 the 1st, the 2nd, and the 3rd parameters.
[in] | SbApiPortName | Name of the Sb port the calling subsystem server already created in the system namespace. |
[in] | SbApiPort | LPC port handle (checked, but not used: the subsystem is required to have already created the callback port before it connects to the SM). |
[in] | ImageType | A valid IMAGE_SUBSYSTEM_xxx value. PE images having this subsystem value will be handled by the current subsystem. |
[out] | SmApiPort | Pointer to a HANDLE, which will be filled with a valid client-side LPC communication port. |
Definition at line 57 of file smclient.c.
Referenced by CsrServerInitialization(), and SmpExecuteInitialCommand().
NTSTATUS NTAPI SmExecPgm | ( | _In_ HANDLE | SmApiPort, |
_In_ PRTL_USER_PROCESS_INFORMATION | ProcessInformation, | ||
_In_ BOOLEAN | DebugFlag | ||
) |
Requests the SM to start a process under a new environment session.
[in] | SmApiPort | Port handle returned by SmConnectToSm(). |
[in] | ProcessInformation | A process description as returned by RtlCreateUserProcess(). |
[in] | DebugFlag | If set, indicates that the caller wants to debug this process and act as its debug user interface. |
Definition at line 265 of file smclient.c.
Referenced by SmExecuteProgram(), SmpExecPgm(), and SmpExecuteInitialCommand().
NTSTATUS NTAPI SmLoadDeferedSubsystem | ( | _In_ HANDLE | SmApiPort, |
_In_ PUNICODE_STRING | DeferedSubsystem | ||
) |
This function is used to make the SM start an environment subsystem server process.
[in] | SmApiPort | Port handle returned by SmConnectToSm(). |
[in] | DeferedSubsystem | Name of the subsystem to start. This must be one of the subsystems listed by value's name in the SM registry key \Registry\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems (used by the SM to lookup the corresponding image name). Default valid names are: "Debug", "Windows", "Posix", "Os2". |
Definition at line 317 of file smclient.c.
Sends a message to the SM via the SM API port.
[in] | SmApiPort | Port handle returned by SmConnectToSm(). |
[in,out] | SmApiMsg | Message to send to the SM. The API-specific data must be initialized, and the SmApiMsg->ApiNumber must be specified accordingly. |
Definition at line 149 of file smclient.c.
Referenced by SmExecPgm(), SmLoadDeferedSubsystem(), SmSessionComplete(), SmStartCsr(), and SmStopCsr().
NTSTATUS NTAPI SmSessionComplete | ( | _In_ HANDLE | SmApiPort, |
_In_ ULONG | SessionId, | ||
_In_ NTSTATUS | SessionStatus | ||
) |
This function is called by an environment subsystem server to tell the SM it has terminated the session it managed.
[in] | SmApiPort | Port handle returned by SmConnectToSm(). |
[in] | SessionId | The session ID of the session being terminated. |
[in] | SessionStatus | An NT status code for the termination. |
Definition at line 220 of file smclient.c.
Referenced by CsrDereferenceNtSession().
NTSTATUS NTAPI SmStartCsr | ( | _In_ HANDLE | SmApiPort, |
_Out_ PULONG | pMuSessionId, | ||
_In_opt_ PUNICODE_STRING | CommandLine, | ||
_Out_ PHANDLE | pWindowsSubSysProcessId, | ||
_Out_ PHANDLE | pInitialCommandProcessId | ||
) |
Requests the SM to create a new Terminal Services session and start an initial command.
[in] | SmApiPort | Port handle returned by SmConnectToSm(). |
[out] | pMuSessionId | Pointer to a variable that receives the session ID of the new Terminal Services session that has been created. |
[in] | CommandLine | Full path to the image to be used as the initial command. |
[out] | pWindowsSubSysProcessId | Pointer to a variable that receives the process ID of the environment subsystem that has been started in the new session. |
[out] | pInitialCommandProcessId | Pointer to a variable that receives the process ID of the initial command. |
Definition at line 376 of file smclient.c.
Referenced by SmpStartCsr().
Requests the SM to terminate a Terminal Services session.
[in] | SmApiPort | Port handle returned by SmConnectToSm(). |
[in] | MuSessionId | The Terminal Services session ID, returned by SmStartCsr(). |
Definition at line 445 of file smclient.c.