67 ULONG ConnectInfoLength =
sizeof(ConnectInfo);
85 if (SbApiPortName->Length >=
sizeof(ConnectInfo.
SbApiPortName))
90 SbApiPortName->Buffer,
91 SbApiPortName->Length);
115 DPRINT1(
"SmConnectToSm: Connect to Sm failed %lx\n",
Status);
117#if (NTDDI_VERSION < NTDDI_VISTA)
171 DataLength = RtlpSmMessageInfo[SmApiMsg->ApiNumber];
175 SmApiMsg->h.u2.ZeroInit = 0;
183 SmApiMsg->h.u1.s1.TotalLength = SmApiMsg->h.u1.s1.DataLength +
sizeof(SmApiMsg->h);
189 DPRINT1(
"SmSendMsgToSm: NtRequestWaitReplyPort failed, Status: 0x%08lx\n",
Status);
194 Status = SmApiMsg->ReturnValue;
230 if (SmpIsWow64Process())
276 if (SmpIsWow64Process())
291 NtClose(ProcessInformation->ProcessHandle);
292 NtClose(ProcessInformation->ThreadHandle);
326 if (SmpIsWow64Process())
328 return SmpWow64LoadDeferedSubsystem(
SmApiPort, DeferedSubsystem);
333 if (DeferedSubsystem->Length >
sizeof(LoadDefered->
Buffer))
338 LoadDefered->
Length = DeferedSubsystem->Length;
340 DeferedSubsystem->Buffer,
341 DeferedSubsystem->Length);
389 if (SmpIsWow64Process())
394 pWindowsSubSysProcessId,
395 pInitialCommandProcessId);
403 if (CommandLine->Length >
sizeof(StartCsr->
Buffer))
407 StartCsr->
Length = CommandLine->Length;
410 CommandLine->Length);
453 if (SmpIsWow64Process())
455 return SmpWow64StopCsr(
SmApiPort, MuSessionId);
static UNICODE_STRING PortName
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
#define NT_SUCCESS(StatCode)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define IMAGE_SUBSYSTEM_UNKNOWN
NTSTATUS NTAPI NtConnectPort(OUT PHANDLE PortHandle, IN PUNICODE_STRING PortName, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos, IN OUT PPORT_VIEW ClientView OPTIONAL, IN OUT PREMOTE_PORT_VIEW ServerView OPTIONAL, OUT PULONG MaxMessageLength OPTIONAL, IN OUT PVOID ConnectionInformation OPTIONAL, IN OUT PULONG ConnectionInformationLength OPTIONAL)
NTSTATUS NTAPI NtRequestWaitReplyPort(IN HANDLE PortHandle, IN PPORT_MESSAGE LpcRequest, IN OUT PPORT_MESSAGE LpcReply)
#define STATUS_INVALID_PARAMETER_MIX
#define STATUS_NOT_IMPLEMENTED
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 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 sessi...
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 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,...
NTSTATUS NTAPI SmSendMsgToSm(_In_ HANDLE SmApiPort, _Inout_ PSM_API_MSG SmApiMsg)
Sends a message to the SM via the SM API port.
NTSTATUS NTAPI SmStopCsr(_In_ HANDLE SmApiPort, _In_ ULONG MuSessionId)
Requests the SM to terminate a Terminal Services session.
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.
struct _SM_STOP_CSR_MSG SM_STOP_CSR_MSG
struct _SM_SESSION_COMPLETE_MSG SM_SESSION_COMPLETE_MSG
@ SmpLoadDeferedSubsystemApi
struct _SM_LOAD_DEFERED_SUBSYSTEM_MSG SM_LOAD_DEFERED_SUBSYSTEM_MSG
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
SM_SESSION_COMPLETE_MSG SessionComplete
SM_START_CSR_MSG StartCsr
union _SM_API_MSG::@3521 u
SMSRV_API_NUMBER ApiNumber
SM_LOAD_DEFERED_SUBSYSTEM_MSG LoadDefered
RTL_USER_PROCESS_INFORMATION ProcessInformation
HANDLE SmpInitialCommandProcessId
HANDLE WindowsSubSysProcessId
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define SECURITY_DYNAMIC_TRACKING