[CSRSRV2]: Formatting and a few bug fixes.
authorAlex Ionescu <aionescu@gmail.com>
Wed, 15 Feb 2012 15:03:42 +0000 (15:03 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Wed, 15 Feb 2012 15:03:42 +0000 (15:03 +0000)
svn path=/trunk/; revision=55606

reactos/subsystems/csr/csrsrv/init.c
reactos/subsystems/csr/main.c

index 77667a6..835d0f4 100644 (file)
@@ -66,7 +66,7 @@ CsrParseServerCommandLine(IN ULONG ArgumentCount,
     /* Save our Session ID, and create a Directory for it */
     SessionId = NtCurrentPeb()->SessionId;
     Status = CsrCreateSessionObjectDirectory(SessionId);
-    if (NT_SUCCESS(Status))
+    if (!NT_SUCCESS(Status))
     {
         DPRINT1("CSRSS: CsrCreateSessionObjectDirectory failed (%lx)\n",
                 Status);
@@ -82,9 +82,9 @@ CsrParseServerCommandLine(IN ULONG ArgumentCount,
         /* Split Name and Value */
         ParameterName = Arguments[i];
         ParameterValue = NULL;
-        ParameterValue = strchr(ParameterName, L'=');
-        if (ParameterValue) *ParameterValue++ = '\0';
-        DPRINT("Name=%S, Value=%S\n", ParameterName, ParameterValue);
+        ParameterValue = strchr(ParameterName, '=');
+        if (ParameterValue) *ParameterValue++ = ANSI_NULL;
+        DPRINT1("Name=%s, Value=%s\n", ParameterName, ParameterValue);
 
         /* Check for Object Directory */
         if (!_stricmp(ParameterName, "ObjectDirectory"))
@@ -107,8 +107,7 @@ CsrParseServerCommandLine(IN ULONG ArgumentCount,
             /* Create it */
             InitializeObjectAttributes(&ObjectAttributes,
                                        &CsrDirectoryName,
-                                       OBJ_OPENIF | OBJ_CASE_INSENSITIVE |
-                                       (SessionId) ? 0 : OBJ_PERMANENT,
+                                       OBJ_OPENIF | OBJ_CASE_INSENSITIVE | OBJ_PERMANENT,
                                        NULL,
                                        NULL);
             Status = NtCreateDirectoryObject(&CsrObjectDirectory,
index af89bec..301ff50 100644 (file)
@@ -51,7 +51,6 @@ _main(int argc,
     UNREFERENCED_PARAMETER(envp);
     UNREFERENCED_PARAMETER(DebugFlag);
 
-
     /* Set the Priority */
     NtSetInformationProcess(NtCurrentProcess(),
                             ProcessBasePriority,
@@ -81,7 +80,7 @@ _main(int argc,
     {
         /* Kill us */
         DPRINT1("CSRSS: CsrServerInitialization failed:% lx\n", Status);
-        NtTerminateProcess (NtCurrentProcess(), Status);
+        NtTerminateProcess(NtCurrentProcess(), Status);
     }
 
     /* Disable errors */
@@ -91,7 +90,7 @@ _main(int argc,
     if (!NtCurrentPeb()->SessionId) RtlSetProcessIsCritical(TRUE, NULL, FALSE);
 
     /* Kill this thread. CSRSRV keeps us going */
-    NtTerminateThread (NtCurrentThread(), Status);
+    NtTerminateThread(NtCurrentThread(), Status);
     return 0;
 }