[BASESVR] Take SessionId into account while creating BNO directory

This commit is contained in:
Pierre Schweitzer 2019-05-08 20:35:31 +02:00
parent a802726577
commit 20f5797386
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -353,8 +353,14 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
SystemRootString.Buffer);
ASSERT(Success);
/* FIXME: Check Session ID */
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 */