[BASESVR] Take SessionId into account while creating BNO directory
authorPierre Schweitzer <pierre@reactos.org>
Wed, 8 May 2019 18:35:31 +0000 (20:35 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 8 May 2019 18:35:31 +0000 (20:35 +0200)
subsystems/win/basesrv/init.c

index ebfe937..84b24f3 100644 (file)
@@ -353,8 +353,14 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
                                      SystemRootString.Buffer);
     ASSERT(Success);
 
-    /* FIXME: Check Session ID */
-    wcscpy(BnoBuffer, L"\\BaseNamedObjects");
+    if (SessionId != 0)
+    {
+        swprintf(BnoBuffer, L"\\Sessions\\%ld\\BaseNamedObjects", SessionId);
+    }
+    else
+    {
+        wcscpy(BnoBuffer, L"\\BaseNamedObjects");
+    }
     RtlInitUnicodeString(&BnoString, BnoBuffer);
 
     /* Allocate the server data */
@@ -531,7 +537,7 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
         Status = NtCreateSymbolicLinkObject(&SymHandle,
                                             SYMBOLIC_LINK_ALL_ACCESS,
                                             &ObjectAttributes,
-                                            &SymlinkName);
+                                            &BnoString);
         if ((NT_SUCCESS(Status)) && SessionId == 0) NtClose(SymHandle);
 
         /* Make Session point back to BNOLINKS */