ReactOS 0.4.16-dev-125-g798ea90
|
Go to the source code of this file.
Macros | |
#define | NDEBUG |
Functions | |
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. | |
#define NDEBUG |
Definition at line 14 of file smclient.c.
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.