Hadn't we decided to default to strsafe apis for all new code?
StringCchPrintfW
StringCchCopyW
-----Original Message-----
From: Ros-diffs <ros-diffs-bounces(a)reactos.org> On Behalf Of Pierre Schweitzer
Sent: 08 May 2019 19:42
To: ros-diffs(a)reactos.org
Subject: [ros-diffs] [reactos] 01/02: [BASESVR] Take SessionId into account while creating
BNO directory
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=20f57973866eb54d3c282…
commit 20f57973866eb54d3c2822a3b62a309a9983c196
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Wed May 8 20:35:31 2019 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Wed May 8 20:35:31 2019 +0200
[BASESVR] Take SessionId into account while creating BNO directory
---
subsystems/win/basesrv/init.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/subsystems/win/basesrv/init.c b/subsystems/win/basesrv/init.c
index ebfe937068..84b24f38db 100644
--- a/subsystems/win/basesrv/init.c
+++ b/subsystems/win/basesrv/init.c
@@ -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 */