diff --git a/reactos/subsystems/csr/csrsrv/init.c b/reactos/subsystems/csr/csrsrv/init.c index 77667a6f4f5..835d0f4ef26 100644 --- a/reactos/subsystems/csr/csrsrv/init.c +++ b/reactos/subsystems/csr/csrsrv/init.c @@ -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, diff --git a/reactos/subsystems/csr/main.c b/reactos/subsystems/csr/main.c index af89bec210e..301ff50084e 100644 --- a/reactos/subsystems/csr/main.c +++ b/reactos/subsystems/csr/main.c @@ -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; }