microsoft / microsoft/win32metadata

RM_PROCESS_INFO::TSSessionId is unsigned but RM_INVALID_TS_SESSION is signed

Open
#1,927 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

RM_INVALID_TS_SESSION is intended to be compared to RM_PROCESS_INFO::TSSessionId but they have different types; one is signed and the other is unsigned. That then requires an `unchecked` cast when these are compared in C#.

Can the same type be used for both? I guess it would have to be the unsigned type, for consistency with WTS_CURRENT_SESSION, WTSQuerySessionInformationW, and others.

Contributor guide

Open the contributing guide

Research direction

Start with generation/WinSDK/RecompiledIdlHeaders/um/RestartManager.h at the referenced declarations for RM_INVALID_TS_SESSION and RM_PROCESS_INFO::TSSessionId. Compare their types with WTS_CURRENT_SESSION and WTSQuerySessionInformationW, then verify that the declarations use a consistent type and no unchecked cast is required by the corresponding C# projection.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.