mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
moved smdll to rosrtl. We just _can't_ have separate dlls for everything internal, that's what static libraries are for. Unless we want a dll hell even worse than necessary...
svn path=/trunk/; revision=13458
This commit is contained in:
parent
63e01b63df
commit
fb80c5416d
9 changed files with 0 additions and 269 deletions
|
@ -1,39 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS system libraries
|
|
||||||
* FILE: lib/smlib/compses.c
|
|
||||||
* PURPOSE: Call SM API SM_API_COMPLETE_SESSION
|
|
||||||
*/
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ntos.h>
|
|
||||||
#include <sm/api.h>
|
|
||||||
#include <sm/helper.h>
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
|
||||||
SmCompleteSession (HANDLE hSmApiPort, HANDLE hSbApiPort, HANDLE hApiPort)
|
|
||||||
{
|
|
||||||
NTSTATUS Status;
|
|
||||||
SM_PORT_MESSAGE SmReqMsg;
|
|
||||||
|
|
||||||
/* Marshal Ses in the LPC message */
|
|
||||||
SmReqMsg.CompSes.hApiPort = hApiPort;
|
|
||||||
SmReqMsg.CompSes.hSbApiPort = hSbApiPort;
|
|
||||||
|
|
||||||
/* SM API to invoke */
|
|
||||||
SmReqMsg.ApiIndex = SM_API_COMPLETE_SESSION;
|
|
||||||
|
|
||||||
/* Port message */
|
|
||||||
SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE;
|
|
||||||
SmReqMsg.Header.DataSize = SM_PORT_DATA_SIZE(SmReqMsg.CompSes);
|
|
||||||
SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE;
|
|
||||||
Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return SmReqMsg.Status;
|
|
||||||
}
|
|
||||||
DbgPrint ("%s failed (Status=0x%08lx)\n", __FUNCTION__, Status);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -1,83 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS system libraries
|
|
||||||
* FILE: reactos/lib/smdll/connect.c
|
|
||||||
* PURPOSE: Connect to the API LPC port exposed by the SM
|
|
||||||
*/
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ntos.h>
|
|
||||||
#include <sm/api.h>
|
|
||||||
#include <sm/helper.h>
|
|
||||||
#include <pe.h>
|
|
||||||
|
|
||||||
/**********************************************************************
|
|
||||||
* NAME EXPORTED
|
|
||||||
* SmConnectApiPort/4
|
|
||||||
*
|
|
||||||
* DESCRIPTION
|
|
||||||
* Connect to SM API port and register a session "begin" port (Sb)
|
|
||||||
* or to issue API requests to SmApiPort.
|
|
||||||
*
|
|
||||||
* ARGUMENTS
|
|
||||||
* pSbApiPortName: name of the Sb port the calling subsystem
|
|
||||||
* server already created in the system name space;
|
|
||||||
* hSbApiPort: LPC port handle (checked, but not used);
|
|
||||||
* dwSubsystem: a valid IMAGE_SUBSYSTEM_xxx value;
|
|
||||||
* phSmApiPort: a pointer to a HANDLE, which will be
|
|
||||||
* filled with a valid client-side LPC comm port.
|
|
||||||
*
|
|
||||||
* RETURN VALUE
|
|
||||||
* If all three optional values are omitted, an LPC status.
|
|
||||||
* STATUS_INVALID_PARAMETER_MIX if PortName is defined and
|
|
||||||
* both hSbApiPort and dwSubsystem are 0.
|
|
||||||
*/
|
|
||||||
NTSTATUS STDCALL
|
|
||||||
SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL,
|
|
||||||
IN HANDLE hSbApiPort OPTIONAL,
|
|
||||||
IN DWORD dwSubsystem OPTIONAL,
|
|
||||||
IN OUT PHANDLE phSmApiPort)
|
|
||||||
{
|
|
||||||
UNICODE_STRING SmApiPortName;
|
|
||||||
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
|
||||||
SM_CONNECT_DATA ConnectData = {0,{0}};
|
|
||||||
ULONG ConnectDataLength = 0;
|
|
||||||
|
|
||||||
if (pSbApiPortName)
|
|
||||||
{
|
|
||||||
if (NULL == hSbApiPort || IMAGE_SUBSYSTEM_UNKNOWN == dwSubsystem)
|
|
||||||
{
|
|
||||||
return STATUS_INVALID_PARAMETER_MIX;
|
|
||||||
}
|
|
||||||
ConnectData.Subsystem = dwSubsystem;
|
|
||||||
memmove (& ConnectData.SbName, pSbApiPortName->Buffer, pSbApiPortName->Length);
|
|
||||||
}
|
|
||||||
ConnectDataLength = sizeof (ConnectData);
|
|
||||||
|
|
||||||
SecurityQos.Length = sizeof (SecurityQos);
|
|
||||||
SecurityQos.ImpersonationLevel = SecurityIdentification;
|
|
||||||
SecurityQos.ContextTrackingMode = TRUE;
|
|
||||||
SecurityQos.EffectiveOnly = TRUE;
|
|
||||||
|
|
||||||
RtlInitUnicodeString (& SmApiPortName, SM_API_PORT_NAME);
|
|
||||||
|
|
||||||
Status = NtConnectPort (
|
|
||||||
phSmApiPort,
|
|
||||||
& SmApiPortName,
|
|
||||||
& SecurityQos,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
& ConnectData,
|
|
||||||
& ConnectDataLength
|
|
||||||
);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
DbgPrint ("%s failed (Status=0x%08lx)\n", __FUNCTION__, Status);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -1,17 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS
|
|
||||||
* FILE: lib/smdll/dllmain.c
|
|
||||||
* PURPOSE: SM Helper Library
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ntos.h>
|
|
||||||
|
|
||||||
BOOL STDCALL DllMain(HANDLE hinstDll, DWORD fdwReason, LPVOID fImpLoad)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -1,49 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS system libraries
|
|
||||||
* FILE: lib/smdll/execpgm.c
|
|
||||||
* PURPOSE: Call SM API SM_API_EXECPGM
|
|
||||||
*/
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ntos.h>
|
|
||||||
#include <sm/api.h>
|
|
||||||
#include <sm/helper.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
|
||||||
SmExecPgm (HANDLE hSmApiPort, PUNICODE_STRING Pgm)
|
|
||||||
{
|
|
||||||
NTSTATUS Status;
|
|
||||||
SM_PORT_MESSAGE SmReqMsg;
|
|
||||||
|
|
||||||
|
|
||||||
/* Check Pgm's length */
|
|
||||||
if (Pgm->Length > (sizeof (Pgm->Buffer[0]) * SM_EXEXPGM_MAX_LENGTH))
|
|
||||||
{
|
|
||||||
return STATUS_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
/* Marshal Pgm in the LPC message */
|
|
||||||
RtlZeroMemory (& SmReqMsg, sizeof SmReqMsg);
|
|
||||||
SmReqMsg.ExecPgm.NameLength = Pgm->Length;
|
|
||||||
RtlCopyMemory (SmReqMsg.ExecPgm.Name, Pgm->Buffer, Pgm->Length);
|
|
||||||
|
|
||||||
/* SM API to invoke */
|
|
||||||
SmReqMsg.ApiIndex = SM_API_EXECUTE_PROGRAMME;
|
|
||||||
|
|
||||||
/* LPC message */
|
|
||||||
SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE;
|
|
||||||
SmReqMsg.Header.DataSize = SM_PORT_DATA_SIZE(SmReqMsg.ExecPgm);
|
|
||||||
SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE;
|
|
||||||
|
|
||||||
/* Call SM and wait for a reply */
|
|
||||||
Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return SmReqMsg.Status;
|
|
||||||
}
|
|
||||||
DbgPrint ("%s failed (Status=0x%08lx)\n", __FUNCTION__, Status);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -1,34 +0,0 @@
|
||||||
# $Id$
|
|
||||||
|
|
||||||
PATH_TO_TOP = ../..
|
|
||||||
|
|
||||||
TARGET_TYPE = dynlink
|
|
||||||
|
|
||||||
TARGET_NAME = smdll
|
|
||||||
|
|
||||||
TARGET_SDKLIBS = ntdll.a
|
|
||||||
|
|
||||||
TARGET_CFLAGS = -I./include -Wall -Werror
|
|
||||||
|
|
||||||
# require os code to explicitly request A/W version of structs/functions
|
|
||||||
TARGET_CFLAGS += -D_DISABLE_TIDENTS
|
|
||||||
|
|
||||||
TARGET_LFLAGS = -nostartfiles -nostdlib
|
|
||||||
|
|
||||||
#TARGET_BASE =
|
|
||||||
|
|
||||||
TARGET_OBJECTS = \
|
|
||||||
dllmain.o \
|
|
||||||
connect.o \
|
|
||||||
execpgm.o \
|
|
||||||
compses.o
|
|
||||||
|
|
||||||
DEP_OBJECTS = $(TARGET_OBJECTS)
|
|
||||||
|
|
||||||
include $(PATH_TO_TOP)/rules.mak
|
|
||||||
|
|
||||||
include $(TOOLS_PATH)/helper.mk
|
|
||||||
|
|
||||||
include $(TOOLS_PATH)/depend.mk
|
|
||||||
|
|
||||||
# EOF
|
|
|
@ -1,18 +0,0 @@
|
||||||
$Id$
|
|
||||||
|
|
||||||
This is SMDLL: a helper library to talk to the ReactOS session manager (SM).
|
|
||||||
|
|
||||||
It should be linked in the following components:
|
|
||||||
|
|
||||||
a) the SM itself, because iy registers for managing native processes
|
|
||||||
IMAGE_SUBSYSTEM_NATIVE;
|
|
||||||
|
|
||||||
b) environment subsystem servers, because each one should register in
|
|
||||||
the SM its own subsystem (willing to manageg those processes);
|
|
||||||
|
|
||||||
c) terminal emulators for optional subsystems, like posixw32 and os2w32,
|
|
||||||
to ask the SM to start the optional subsystem server they need connect to;
|
|
||||||
|
|
||||||
d) system and development utilites to debug/query the SM.
|
|
||||||
|
|
||||||
2004-02-15 ea
|
|
|
@ -1,5 +0,0 @@
|
||||||
LIBRARY SMDLL.DLL
|
|
||||||
EXPORTS
|
|
||||||
SmCompleteSession@12
|
|
||||||
SmConnectApiPort@16
|
|
||||||
SmExecPgm@8
|
|
|
@ -1,4 +0,0 @@
|
||||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS SM Helper\0"
|
|
||||||
#define REACTOS_STR_INTERNAL_NAME "smdll.dll\0"
|
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "smdll.dll\0"
|
|
||||||
#include <reactos/version.rc>
|
|
|
@ -1,20 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ntos.h>
|
|
||||||
#include <sm/api.h>
|
|
||||||
|
|
||||||
VOID STDCALL SmPrintPortMessage (PSM_PORT_MESSAGE SmMessage)
|
|
||||||
{
|
|
||||||
DbgPrint ("SM_PORT_MESSAGE %08lx:\n", (ULONG) SmMessage);
|
|
||||||
DbgPrint (" Header:\n");
|
|
||||||
DbgPrint (" MessageType = %u\n", SmMessage->Header.MessageType);
|
|
||||||
DbgPrint (" DataSize = %d\n", SmMessage->Header.DataSize);
|
|
||||||
DbgPrint (" MessageSize = %d\n", SmMessage->Header.MessageSize);
|
|
||||||
DbgPrint (" ApiIndex = %ld\n", SmMessage->ApiIndex);
|
|
||||||
DbgPrint (" Status = %08lx\n", SmMessage->Status);
|
|
||||||
DbgPrint (" ExecPgm:\n");
|
|
||||||
DbgPrint (" NameLength = %ld\n", SmMessage->ExecPgm.NameLength);
|
|
||||||
DbgPrint (" Name = %ls\n", (LPWSTR) & SmMessage->ExecPgm.Name);
|
|
||||||
}
|
|
||||||
/* EOF */
|
|
||||||
|
|
Loading…
Reference in a new issue