mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[ntdll]
- Logic change of r37554 is correct, RtlTimeFieldsToTime doesn't normalize invalid input values - remove these codes - Related to bug #4917, part 1 svn path=/trunk/; revision=44344
This commit is contained in:
parent
9d7f91d6ca
commit
09bdd4ffa0
1 changed files with 0 additions and 41 deletions
|
@ -61,14 +61,6 @@ static int DaysSinceEpoch(int Year)
|
|||
return Days;
|
||||
}
|
||||
|
||||
static __inline void NormalizeTimeFields(CSHORT *FieldToNormalize,
|
||||
CSHORT *CarryField,
|
||||
int Modulus)
|
||||
{
|
||||
*FieldToNormalize = (CSHORT) (*FieldToNormalize - Modulus);
|
||||
*CarryField = (CSHORT) (*CarryField + 1);
|
||||
}
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -199,39 +191,6 @@ RtlTimeFieldsToTime(
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* Normalize the TIME_FIELDS structure here */
|
||||
while (IntTimeFields.Second >= SECSPERMIN)
|
||||
{
|
||||
NormalizeTimeFields(&IntTimeFields.Second,
|
||||
&IntTimeFields.Minute,
|
||||
SECSPERMIN);
|
||||
}
|
||||
while (IntTimeFields.Minute >= MINSPERHOUR)
|
||||
{
|
||||
NormalizeTimeFields(&IntTimeFields.Minute,
|
||||
&IntTimeFields.Hour,
|
||||
MINSPERHOUR);
|
||||
}
|
||||
while (IntTimeFields.Hour >= HOURSPERDAY)
|
||||
{
|
||||
NormalizeTimeFields(&IntTimeFields.Hour,
|
||||
&IntTimeFields.Day,
|
||||
HOURSPERDAY);
|
||||
}
|
||||
while (IntTimeFields.Day >
|
||||
MonthLengths[IsLeapYear(IntTimeFields.Year)][IntTimeFields.Month - 1])
|
||||
{
|
||||
NormalizeTimeFields(&IntTimeFields.Day,
|
||||
&IntTimeFields.Month,
|
||||
SECSPERMIN);
|
||||
}
|
||||
while (IntTimeFields.Month > MONSPERYEAR)
|
||||
{
|
||||
NormalizeTimeFields(&IntTimeFields.Month,
|
||||
&IntTimeFields.Year,
|
||||
MONSPERYEAR);
|
||||
}
|
||||
|
||||
/* Compute the time */
|
||||
Time->QuadPart = DaysSinceEpoch(IntTimeFields.Year);
|
||||
for (CurMonth = 1; CurMonth < IntTimeFields.Month; CurMonth++)
|
||||
|
|
Loading…
Reference in a new issue