dahall / Vanara

A set of .NET libraries for Windows implementing PInvoke calls to many native Windows APIs with supporting wrappers.
MIT License
1.75k stars 190 forks source link

WTSApi32: Wrong variable used to create dateTime #448

Closed AgentDove closed 3 months ago

AgentDove commented 4 months ago

Describe the bug and how to reproduce

public DateTime LastInputTime => DateTime.FromFileTimeUtc(LogonTimeUTC); Should be public DateTime LastInputTime => DateTime.FromFileTimeUtc(LastInputTimeUTC);

What code is involved

https://github.com/dahall/Vanara/blob/7de0f5301480fc4126c5bebe0a2dd25d2c2f0886/PInvoke/WTSApi32/WTSApi32.cs#L3020

Expected behavior

LastInputTime should be derived form LastInputTimeUTC and not LogonTimeUTC

dahall commented 3 months ago

Fixed in nullable branch. Will release in 4.0 package push shortly.