[TRANSLATION][CLIPBRD] Italian translation implemented (#344)
[reactos.git] / base / system / smss / smsubsys.c
index 4a93e20..819ebe3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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
  */
@@ -9,8 +9,9 @@
 /* INCLUDES *******************************************************************/
 
 #include "smss.h"
+
 #define NDEBUG
-#include "debug.h"
+#include <debug.h>
 
 /* GLOBALS ********************************************************************/
 
@@ -165,7 +166,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
     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);
@@ -219,7 +220,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
     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,
@@ -330,7 +331,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
         {
             /* 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;
@@ -347,7 +348,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
         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;
@@ -364,7 +365,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
         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;
@@ -387,7 +388,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
         {
             /* 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;
@@ -422,7 +423,7 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
         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;
@@ -499,7 +500,7 @@ Quickie2:
     {
         RemoveEntryList(&NewSubsystem->Entry);
         NtSetEvent(NewSubsystem->Event, 0);
-        if (NewSubsystem) SmpDereferenceSubsystem(NewSubsystem);
+        SmpDereferenceSubsystem(NewSubsystem);
     }
 
     /* Finally, we're all done! */
@@ -539,7 +540,7 @@ SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId,
     {
         /* 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,
@@ -570,7 +571,10 @@ SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId,
                     }
                     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,
@@ -597,25 +601,25 @@ SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId,
     {
         /* 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;
         }
 
@@ -671,4 +675,3 @@ SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId,
     /* Return status */
     return Status;
 }
-