question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible issue: Systemtime vs. Filetime

See original GitHub issue

I was referring to your library to verify our own implementation of the GetExtendedTcpTable function, and noticed a potential bug here. Microsoft says the liCreateTimestamp member is a SYSTEMTIME. And as I read it, SYSTEMTIME is time since system boot, while FILETIME is absolute time (irrespective of boot etc.).

I think this member should be a SYSTEMTIME, as to not lead any users to think it’s a FILETIME.

https://github.com/dahall/Vanara/blob/c68aca71ac1f9de82e70845c9df5bc048b158edc/PInvoke/IpHlpApi/TcpMib.cs#L1145

See: https://docs.microsoft.com/en-us/windows/win32/api/tcpmib/ns-tcpmib-mib_tcprow_owner_module

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dahallcommented, Nov 8, 2020

I have updated the comments for those fields and have submitted a PR to Microsoft to change their documentation as well.

1reaction
dahallcommented, Nov 6, 2020

Well, the changes you asked me to make (from FILETIME to SYSTEMTIME) did, in fact, break the structure layout. I’m testing now to determine how MS reads that value to get to a time. More to come shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Latest possible FILETIME - c++
My understanding is that FILETIME was made to represent any valid SYSTEMTIME in 64 bits. If you take the limit of SYSTEMTIME (last ......
Read more >
Writing FILETIME or SYSTEMTIME to File?
I am looking to write either a FILETIME struct or a SYSTEMTIME struct to a file for later usage. I am using the...
Read more >
FILETIME structure (minwinbase.h) - Win32
A function using the FILETIME structure can allow for values outside of zero or positive values typically specified by the dwLowDateTime and ...
Read more >
FileTimeToSystemTime function (timezoneapi.h) - Win32 ...
Converts a file time to system time format. System time is based on Coordinated Universal Time (UTC).
Read more >
Consider making `std::time::SystemTime` platform- ...
The range of FILETIME is ±2 63 × 100ns ≈ 29227 years, while the range of 64-bit timespec is ±2 63 s ≈...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found