Document what the session creation parameters do, and which of them ae visible to all users on the machine (#41020)
* Document what the session creation parameters do, and which of them are visible to all users on the machine * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Blue committed
Jul 7, 2026 at 16:37 UTC
82ae2cd1deb0f1a737a88f05a7faaa7924bbb6d7
3 files changed
+40
-7
doc/docs/api-reference/c/session-apis/wslcinitsessionsettings.md
+16
-5
@@ -4,14 +4,25 @@
4
STDAPI WslcInitSessionSettings(_In_ PCWSTR name, _In_ PCWSTR storagePath, _Out_ WslcSessionSettings* sessionSettings);
5
```
6
7
-| Parameter | Type | Direction |
8
-|---|---|---|
9
-| `name` | `PCWSTR` | in |
10
-| `storagePath` | `PCWSTR` | in |
11
-| `sessionSettings` | `WslcSessionSettings*` | out |
7
+| Parameter | Type | Direction | Comment |
8
+|---|---|---|---|
9
+| `name` | `PCWSTR` | in | The name of the session to be created. |
10
+| `storagePath` | `PCWSTR` | in | Path to where the session storage should be written. If the path doesn't exist, it will be created. |
11
+| `sessionSettings` | `WslcSessionSettings*` | out | Pointer to the `WslcSessionSettings` to write the settings to. |
12
13
Return value: `HRESULT`.
14
15
+Session names serve both as display names and as machine-wide keys used to identify sessions. If a session with the same name already exists, session creation will fail with `ERROR_ALREADY_EXISTS`.
16
+
17
+Also note that the following information about a session is visible to all users on the machine:
18
+
19
+- The session's name
20
+- The SID of the user that created the session
21
+- The PID of the process that created the session
22
+
23
+
24
+Do not put credentials or other sensitive information in the session's name.
25
+
26
Example:
27
28
```c
doc/docs/api-reference/cpp/settings-classes/sessionsettings.md
+12
-2
@@ -3,8 +3,18 @@
3
**Constructor**
4
5
- `SessionSettings(hstring name, hstring storagePath)`
6
- - `name` must be non-empty.
7
- - `storagePath` must be non-empty.
6
+ - `name` must be non-empty. The name of the session to be created.
7
+ - `storagePath` must be non-empty. Path to where the session storage should be written. If the path doesn't exist, it will be created.
8
+
9
+Session names serve both as display names and as machine-wide keys used to identify sessions. If a session with the same name already exists, session creation will fail with `ERROR_ALREADY_EXISTS`.
10
+
11
+Also note that the following information about a session is visible to all users on the machine:
12
+
13
+- The session's name
14
+- The SID of the user that created the session
15
+- The PID of the process that created the session
16
+
17
+Do not put credentials or other sensitive information in the session's name.
18
19
**Properties**
20
doc/docs/api-reference/csharp/settings-classes/sessionsettings.md
+12
@@ -19,10 +19,22 @@ public sealed class SessionSettings
19
20
Notes:
21
22
+- `Name` is the name of the session to be created.
23
+- `StoragePath` is the path to where the session storage should be written. If the path doesn't exist, it will be created.
24
- `CpuCount`, `MemorySizeInMB`, and `Timeout` are optional nullable values.
25
- `Timeout` must be positive and must fit in a `uint32` millisecond count.
26
- `VhdRequirements` is optional.
27
28
+Session names serve both as display names and as machine-wide keys used to identify sessions. If a session with the same name already exists, session creation will fail with `ERROR_ALREADY_EXISTS`.
29
+
30
+Also note that the following information about a session is visible to all users on the machine:
31
+
32
+- The session's name
33
+- The SID of the user that created the session
34
+- The PID of the process that created the session
35
+
36
+Do not put credentials or other sensitive information in the session's name.
37
+
38
Example:
39
40
```csharp