/*
* PROJECT: ReactOS Windows-Compatible Session Manager
* LICENSE: BSD 2-Clause License
- * FILE: base/system/smss/smss.c
+ * FILE: base/system/smss/smsubsys.c
* PURPOSE: Main SMSS Code
* PROGRAMMERS: Alex Ionescu
*/
/* INCLUDES *******************************************************************/
#include "smss.h"
+
#define NDEBUG
-#include "debug.h"
+#include <debug.h>
/* GLOBALS ********************************************************************/
RtlEnterCriticalSection(&SmpKnownSubSysLock);
while (TRUE)
{
- /* Check if we found a subsystem not yet fully iniitalized */
+ /* Check if we found a subsystem not yet fully initialized */
Subsystem = SmpLocateKnownSubSysByType(MuSessionId, -1);
if (!Subsystem) break;
RtlLeaveCriticalSection(&SmpKnownSubSysLock);
NewSubsystem->PortHandle = NULL;
NewSubsystem->SbApiPort = NULL;
- /* Create the event we'll be wating on for initialization */
+ /* Create the event we'll be waiting on for initialization */
Status = NtCreateEvent(&NewSubsystem->Event,
EVENT_ALL_ACCESS,
NULL,
{
/* Odd failure -- but handle it anyway */
Status = STATUS_NO_SUCH_PACKAGE;
- DPRINT1("SMSS: SmpLoadSubSystem - SmpLocateKnownSubSysByType Failed with Status %lx for sessionid %ld\n",
+ DPRINT1("SMSS: SmpLoadSubSystem - SmpLocateKnownSubSysByType Failed with Status %lx for sessionid %lu\n",
Status,
MuSessionId);
goto Quickie;
if (!NT_SUCCESS(Status))
{
/* Fail since this is critical */
- DPRINT1("SMSS: SmpLoadSubSystem - NtDuplicateObject Failed with Status %lx for sessionid %ld\n",
+ DPRINT1("SMSS: SmpLoadSubSystem - NtDuplicateObject Failed with Status %lx for sessionid %lu\n",
Status,
MuSessionId);
goto Quickie;
if (!NT_SUCCESS(Status))
{
/* Fail since this is critical */
- DPRINT1("SMSS: SmpLoadSubSystem - NtDuplicateObject Failed with Status %lx for sessionid %ld\n",
+ DPRINT1("SMSS: SmpLoadSubSystem - NtDuplicateObject Failed with Status %lx for sessionid %lu\n",
Status,
MuSessionId);
goto Quickie;
{
/* Delete the session and handle failure if the LPC call failed */
SmpDeleteSession(CreateSession->SessionId);
- DPRINT1("SMSS: SmpLoadSubSystem - NtRequestWaitReplyPort Failed with Status %lx for sessionid %ld\n",
+ DPRINT1("SMSS: SmpLoadSubSystem - NtRequestWaitReplyPort Failed with Status %lx for sessionid %lu\n",
Status,
CreateSession->SessionId);
goto Quickie;
if (Status != STATUS_WAIT_0)
{
/* Something is wrong with the subsystem, so back out of everything */
- DPRINT1("SMSS: SmpLoadSubSystem - Timeout waiting for subsystem connect with Status %lx for sessionid %ld\n",
+ DPRINT1("SMSS: SmpLoadSubSystem - Timeout waiting for subsystem connect with Status %lx for sessionid %lu\n",
Status,
MuSessionId);
goto Quickie;
{
RemoveEntryList(&NewSubsystem->Entry);
NtSetEvent(NewSubsystem->Event, 0);
- if (NewSubsystem) SmpDereferenceSubsystem(NewSubsystem);
+ SmpDereferenceSubsystem(NewSubsystem);
}
/* Finally, we're all done! */
{
/* Get the entry and check if this is the special Win32k entry */
RegEntry = CONTAINING_RECORD(NextEntry, SMP_REGISTRY_VALUE, Entry);
- if (!_wcsicmp(RegEntry->Name.Buffer, L"Kmode"))
+ if (_wcsicmp(RegEntry->Name.Buffer, L"Kmode") == 0)
{
/* Translate it */
if (!RtlDosPathNameToNtPathName_U(RegEntry->Value.Buffer,
}
AttachedSessionId = *MuSessionId;
- /* Start Win32k.sys on this session */
+ /*
+ * Start Win32k.sys on this session. Use a hardcoded value
+ * instead of the Kmode one...
+ */
RtlInitUnicodeString(&DestinationString,
L"\\SystemRoot\\System32\\win32k.sys");
Status = NtSetSystemInformation(SystemExtendServiceTableInformation,
{
/* Get each entry and check if it's the internal debug or not */
RegEntry = CONTAINING_RECORD(NextEntry, SMP_REGISTRY_VALUE, Entry);
- if (_wcsicmp(RegEntry->Name.Buffer, L"debug"))
+ if (_wcsicmp(RegEntry->Name.Buffer, L"Debug") == 0)
{
- /* Load the required subsystem */
+ /* Load the internal debug system */
Status = SmpExecuteCommand(&RegEntry->Value,
*MuSessionId,
ProcessId,
- SMP_SUBSYSTEM_FLAG);
+ SMP_DEBUG_FLAG | SMP_SUBSYSTEM_FLAG);
}
else
{
- /* Load the internal debug system */
+ /* Load the required subsystem */
Status = SmpExecuteCommand(&RegEntry->Value,
*MuSessionId,
ProcessId,
- SMP_DEBUG_FLAG | SMP_SUBSYSTEM_FLAG);
+ SMP_SUBSYSTEM_FLAG);
}
if (!NT_SUCCESS(Status))
{
- DbgPrint("SMSS: Subsystem execute failed (%WZ)\n", &RegEntry->Value);
+ DbgPrint("SMSS: Subsystem execute failed (%wZ)\n", &RegEntry->Value);
return Status;
}
/* Return status */
return Status;
}
-