forked from dotnet/corert
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
114 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,21 +9,24 @@ internal partial class Interop | |
{ | ||
internal partial class Kernel32 | ||
{ | ||
// FullSystemTime struct matches Windows SYSTEMTIME struct, except we added the extra nanoSeconds field to store | ||
// FullSystemTime struct matches Windows SYSTEMTIME struct, except we added the extra hundredNanoSecond field to store | ||
// more precise time. | ||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct FullSystemTime | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jkotas
|
||
{ | ||
internal Interop.Kernel32.SYSTEMTIME systemTime; | ||
internal long hundredNanoSecond; | ||
|
||
internal FullSystemTime(int year, int month, DayOfWeek dayOfWeek, int day, int hour, int minute, int second) | ||
{ | ||
wYear = (ushort) year; | ||
wMonth = (ushort) month; | ||
wDayOfWeek = (ushort) dayOfWeek; | ||
wDay = (ushort) day; | ||
wHour = (ushort) hour; | ||
wMinute = (ushort) minute; | ||
wSecond = (ushort) second; | ||
wMillisecond = 0; | ||
systemTime.Year = (ushort) year; | ||
systemTime.Month = (ushort) month; | ||
systemTime.DayOfWeek = (ushort) dayOfWeek; | ||
systemTime.Day = (ushort) day; | ||
systemTime.Hour = (ushort) hour; | ||
systemTime.Minute = (ushort) minute; | ||
systemTime.Second = (ushort) second; | ||
systemTime.Milliseconds = 0; | ||
hundredNanoSecond = 0; | ||
} | ||
|
||
|
@@ -34,26 +37,17 @@ internal FullSystemTime(long ticks) | |
int year, month, day; | ||
dt.GetDatePart(out year, out month, out day); | ||
|
||
wYear = (ushort) year; | ||
wMonth = (ushort) month; | ||
wDayOfWeek = (ushort) dt.DayOfWeek; | ||
wDay = (ushort) day; | ||
wHour = (ushort) dt.Hour; | ||
wMinute = (ushort) dt.Minute; | ||
wSecond = (ushort) dt.Second; | ||
wMillisecond = (ushort) dt.Millisecond; | ||
systemTime.Year = (ushort) year; | ||
systemTime.Month = (ushort) month; | ||
systemTime.DayOfWeek = (ushort) dt.DayOfWeek; | ||
systemTime.Day = (ushort) day; | ||
systemTime.Hour = (ushort) dt.Hour; | ||
systemTime.Minute = (ushort) dt.Minute; | ||
systemTime.Second = (ushort) dt.Second; | ||
systemTime.Milliseconds = (ushort) dt.Millisecond; | ||
hundredNanoSecond = 0; | ||
} | ||
|
||
internal ushort wYear; | ||
internal ushort wMonth; | ||
internal ushort wDayOfWeek; | ||
internal ushort wDay; | ||
internal ushort wHour; | ||
internal ushort wMinute; | ||
internal ushort wSecond; | ||
internal ushort wMillisecond; | ||
internal long hundredNanoSecond; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
FullSystemTime
does not seem to have anything to do with interop now. It is just an internal implementation detail of DateTime. It would be nice to move it to the right spot (e.g. as a nested type of DateTime.Windows.cs or something similar).