From b6701ec6f9534a84bd27f4a596b6aa589885b4d9 Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Sat, 26 Feb 2005 23:22:48 +0000 Subject: [PATCH] SM some simple work (wip) svn path=/trunk/; revision=13762 --- reactos/subsys/smss/client.c | 2 ++ reactos/subsys/smss/init.c | 12 ++++++------ reactos/subsys/smss/initobdir.c | 4 +--- reactos/subsys/smss/smss.c | 18 ++++++++++++++++-- reactos/subsys/smss/smss.h | 3 +++ 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/reactos/subsys/smss/client.c b/reactos/subsys/smss/client.c index 66e9050a827..18f81fe0264 100644 --- a/reactos/subsys/smss/client.c +++ b/reactos/subsys/smss/client.c @@ -169,6 +169,8 @@ SmCreateClient(PSM_PORT_MESSAGE Request, PSM_CLIENT_DATA * ClientData) * Initialize the client data */ pClient->SubsystemId = ConnectData->Subsystem; + /* SM auto-initializes; other subsystems are required to call + * SM_API_COMPLETE_SESSION via SMDLL. */ pClient->Initialized = (IMAGE_SUBSYSTEM_NATIVE == pClient->SubsystemId); if (SbApiPortNameSize > 0) { diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index be2125b1ab5..f3a1126c98e 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -36,14 +36,14 @@ static NTSTATUS SmpSignalInitEvent(VOID) { - NTSTATUS Status; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING UnicodeString; - HANDLE ReactOSInitEvent; + NTSTATUS Status = STATUS_SUCCESS; + OBJECT_ATTRIBUTES ObjectAttributes = {0}; + UNICODE_STRING EventName ={0}; + HANDLE ReactOSInitEvent = NULL; - RtlRosInitUnicodeStringFromLiteral(&UnicodeString, L"\\ReactOSInitDone"); + RtlInitUnicodeString (& EventName, L"\\ReactOSInitDone"); InitializeObjectAttributes(&ObjectAttributes, - &UnicodeString, + & EventName, EVENT_ALL_ACCESS, 0, NULL); diff --git a/reactos/subsys/smss/initobdir.c b/reactos/subsys/smss/initobdir.c index 438638986de..0a1c6ad558e 100644 --- a/reactos/subsys/smss/initobdir.c +++ b/reactos/subsys/smss/initobdir.c @@ -23,8 +23,6 @@ * * -------------------------------------------------------------------- */ - - #include "smss.h" #define NDEBUG @@ -82,7 +80,7 @@ SmCreateObjectDirectories(VOID) QueryTable[0].QueryRoutine = SmpObjectDirectoryQueryRoutine; Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, - L"\\Session Manager", + SM_REGISTRY_ROOT_NAME, QueryTable, NULL, NULL); diff --git a/reactos/subsys/smss/smss.c b/reactos/subsys/smss/smss.c index 5d51441b8f6..d95e54a39c0 100644 --- a/reactos/subsys/smss/smss.c +++ b/reactos/subsys/smss/smss.c @@ -30,18 +30,32 @@ #define NDEBUG #include +HANDLE SmSsProcessId = 0; + /* Native image's entry point */ VOID STDCALL NtProcessStartup(PPEB Peb) { NTSTATUS Status; - + PROCESS_BASIC_INFORMATION PBI = {0}; + DisplayString(L"SMSS\n"); PrintString("ReactOS Session Manager %s (Build %s)\n", KERNEL_RELEASE_STR, KERNEL_VERSION_BUILD_STR); + /* Lookup yourself */ + Status = NtQueryInformationProcess (NtCurrentProcess(), + ProcessBasicInformation, + & PBI, + sizeof PBI, + NULL); + if(NT_SUCCESS(Status)) + { + SmSsProcessId = PBI.UniqueProcessId; + } + /* Initialize the system */ Status = InitSessionManager(); if (!NT_SUCCESS(Status)) { @@ -64,7 +78,7 @@ NtProcessStartup(PPEB Peb) NULL); /* NULL for infinite */ if (!NT_SUCCESS(Status)) { - DPRINT1("SM: NtWaitForMultipleObjects failed!\n"); + DPRINT1("SM: NtWaitForMultipleObjects failed! (Status=0x%08lx)\n", Status); } else { diff --git a/reactos/subsys/smss/smss.h b/reactos/subsys/smss/smss.h index 6e0c85ba95e..ea78a899b97 100644 --- a/reactos/subsys/smss/smss.h +++ b/reactos/subsys/smss/smss.h @@ -9,6 +9,9 @@ #define CHILD_CSRSS 0 #define CHILD_WINLOGON 1 +/* smss.c */ +extern HANDLE SmSsProcessId; + /* init.c */ NTSTATUS InitSessionManager(VOID); -- 2.17.1