mirror of
https://github.com/reactos/reactos.git
synced 2025-03-10 18:24:02 +00:00
Added time related functions
svn path=/trunk/; revision=1041
This commit is contained in:
parent
89871935c1
commit
bf4806c502
5 changed files with 132 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rtl.h,v 1.12 2000/02/27 02:01:24 ekohl Exp $
|
/* $Id: rtl.h,v 1.13 2000/03/09 15:59:50 ekohl Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -28,11 +28,35 @@ typedef struct _RTL_USER_PROCESS_INFO
|
||||||
|
|
||||||
#define HEAP_BASE (0xa0000000)
|
#define HEAP_BASE (0xa0000000)
|
||||||
|
|
||||||
VOID RtlDeleteCriticalSection (LPCRITICAL_SECTION lpCriticalSection);
|
VOID
|
||||||
VOID RtlEnterCriticalSection (LPCRITICAL_SECTION lpCriticalSection);
|
STDCALL
|
||||||
VOID RtlInitializeCriticalSection (LPCRITICAL_SECTION pcritical);
|
RtlDeleteCriticalSection (
|
||||||
VOID RtlLeaveCriticalSection (LPCRITICAL_SECTION lpCriticalSection);
|
LPCRITICAL_SECTION lpCriticalSection
|
||||||
WINBOOL RtlTryEntryCriticalSection (LPCRITICAL_SECTION lpCriticalSection);
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STDCALL
|
||||||
|
RtlEnterCriticalSection (
|
||||||
|
LPCRITICAL_SECTION lpCriticalSection
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STDCALL
|
||||||
|
RtlInitializeCriticalSection (
|
||||||
|
LPCRITICAL_SECTION pcritical
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STDCALL
|
||||||
|
RtlLeaveCriticalSection (
|
||||||
|
LPCRITICAL_SECTION lpCriticalSection
|
||||||
|
);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
STDCALL
|
||||||
|
RtlTryEntryCriticalSection (
|
||||||
|
LPCRITICAL_SECTION lpCriticalSection
|
||||||
|
);
|
||||||
|
|
||||||
UINT
|
UINT
|
||||||
STDCALL
|
STDCALL
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: ntdll.def,v 1.44 2000/03/09 00:13:37 ekohl Exp $
|
; $Id: ntdll.def,v 1.45 2000/03/09 16:01:24 ekohl Exp $
|
||||||
;
|
;
|
||||||
; ReactOS Operating System
|
; ReactOS Operating System
|
||||||
;
|
;
|
||||||
|
@ -239,7 +239,7 @@ RtlAcquirePebLock@0
|
||||||
;RtlAtomToAtomTable
|
;RtlAtomToAtomTable
|
||||||
;RtlAddAttributeActionToRXact
|
;RtlAddAttributeActionToRXact
|
||||||
;RtlAddAuditAccessToAce
|
;RtlAddAuditAccessToAce
|
||||||
;RtlAccCompoundAce
|
;RtlAddCompoundAce
|
||||||
;RtlAdjustPrivilege
|
;RtlAdjustPrivilege
|
||||||
;RtlAllocateAndInitializeSid
|
;RtlAllocateAndInitializeSid
|
||||||
;RtlAllocateHandle
|
;RtlAllocateHandle
|
||||||
|
@ -308,7 +308,7 @@ RtlDeNormalizeProcessParams@4
|
||||||
;RtlDelete
|
;RtlDelete
|
||||||
;RtlDeleteAce
|
;RtlDeleteAce
|
||||||
;RtlDeleteAtomFromAtomTable
|
;RtlDeleteAtomFromAtomTable
|
||||||
;RtlDeleteCriticalSection
|
RtlDeleteCriticalSection@4
|
||||||
;RtlDeleteElementGenericTable
|
;RtlDeleteElementGenericTable
|
||||||
;RtlDeleteNoSplay
|
;RtlDeleteNoSplay
|
||||||
;RtlDeleteRegistryValue
|
;RtlDeleteRegistryValue
|
||||||
|
@ -330,7 +330,7 @@ RtlDowncaseUnicodeString@12
|
||||||
RtlEnlargedIntegerMultiply@8
|
RtlEnlargedIntegerMultiply@8
|
||||||
RtlEnlargedUnsignedDivide@16
|
RtlEnlargedUnsignedDivide@16
|
||||||
RtlEnlargedUnsignedMultiply@8
|
RtlEnlargedUnsignedMultiply@8
|
||||||
;RtlEnterCriticalSection
|
RtlEnterCriticalSection@4
|
||||||
;RtlEnumProcessHeaps
|
;RtlEnumProcessHeaps
|
||||||
;RtlEnumerateGenericTable
|
;RtlEnumerateGenericTable
|
||||||
;RtlEnumerateGenericTableWithoutSplaying
|
;RtlEnumerateGenericTableWithoutSplaying
|
||||||
|
@ -401,7 +401,7 @@ RtlInitUnicodeString@8
|
||||||
;RtlInitializeAtomPackage
|
;RtlInitializeAtomPackage
|
||||||
RtlInitializeBitMap@12
|
RtlInitializeBitMap@12
|
||||||
RtlInitializeContext@20
|
RtlInitializeContext@20
|
||||||
;RtlInitializeCriticalSection
|
RtlInitializeCriticalSection@4
|
||||||
;RtlInitializeGenericTable
|
;RtlInitializeGenericTable
|
||||||
;RtlInitializeHandleTable
|
;RtlInitializeHandleTable
|
||||||
;RtlInitializeRXact
|
;RtlInitializeRXact
|
||||||
|
@ -424,7 +424,7 @@ RtlLargeIntegerShiftLeft@12
|
||||||
RtlLargeIntegerShiftRight@12
|
RtlLargeIntegerShiftRight@12
|
||||||
RtlLargeIntegerSubtract@16
|
RtlLargeIntegerSubtract@16
|
||||||
;RtlLargeIntegerToChar
|
;RtlLargeIntegerToChar
|
||||||
;RtlLeaveCriticalSection
|
RtlLeaveCriticalSection@4
|
||||||
;RtlLengthRequiredSid
|
;RtlLengthRequiredSid
|
||||||
RtlLengthSecurityDescriptor@4
|
RtlLengthSecurityDescriptor@4
|
||||||
;RtlLengthSid
|
;RtlLengthSid
|
||||||
|
@ -482,8 +482,8 @@ RtlReleasePebLock@0
|
||||||
;RtlResetRtlTranslations
|
;RtlResetRtlTranslations
|
||||||
;RtlRunDecodeUnicodeString
|
;RtlRunDecodeUnicodeString
|
||||||
;RtlRunEncodeUnicodeString
|
;RtlRunEncodeUnicodeString
|
||||||
;RtlSecondsSince1970ToTime
|
RtlSecondsSince1970ToTime@8
|
||||||
;RtlSecondsSince1980ToTime
|
RtlSecondsSince1980ToTime@8
|
||||||
;RtlSelfRelatedToAbsoluteSD
|
;RtlSelfRelatedToAbsoluteSD
|
||||||
RtlSetAllBits@4
|
RtlSetAllBits@4
|
||||||
;RtlSetAttributesSecurityDescriptor
|
;RtlSetAttributesSecurityDescriptor
|
||||||
|
@ -512,12 +512,12 @@ RtlSizeHeap@12
|
||||||
;RtlSubtreePredecessor
|
;RtlSubtreePredecessor
|
||||||
;RtlSubtreeSuccessor
|
;RtlSubtreeSuccessor
|
||||||
;RtlSystemTimeToLocalTime
|
;RtlSystemTimeToLocalTime
|
||||||
;RtlTimeFieldsToTime
|
RtlTimeFieldsToTime@8
|
||||||
;RtlTimeToElapsedTimeFields
|
;RtlTimeToElapsedTimeFields
|
||||||
;RtlTimeToSecondsSince1970
|
RtlTimeToSecondsSince1970@8
|
||||||
;RtlTimeToSecondsSince1980
|
RtlTimeToSecondsSince1980@8
|
||||||
;RtlTimeToTimeFields
|
RtlTimeToTimeFields@8
|
||||||
;RtlTryEnterCriticalSection
|
RtlTryEnterCriticalSection@4
|
||||||
RtlUnicodeStringToAnsiSize@4
|
RtlUnicodeStringToAnsiSize@4
|
||||||
RtlUnicodeStringToAnsiString@12
|
RtlUnicodeStringToAnsiString@12
|
||||||
RtlUnicodeStringToCountedOemString@12
|
RtlUnicodeStringToCountedOemString@12
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: ntdll.edf,v 1.33 2000/03/09 00:13:37 ekohl Exp $
|
; $Id: ntdll.edf,v 1.34 2000/03/09 16:01:25 ekohl Exp $
|
||||||
;
|
;
|
||||||
; ReactOS Operating System
|
; ReactOS Operating System
|
||||||
;
|
;
|
||||||
|
@ -254,6 +254,7 @@ RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8
|
||||||
RtlCreateUserProcess=RtlCreateUserProcess@40
|
RtlCreateUserProcess=RtlCreateUserProcess@40
|
||||||
RtlCreateUserThread=RtlCreateUserThread@40
|
RtlCreateUserThread=RtlCreateUserThread@40
|
||||||
RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4
|
RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4
|
||||||
|
RtlDeleteCriticalSection=RtlDeleteCriticalSection@4
|
||||||
RtlDestroyEnvironment=RtlDestroyEnvironment@4
|
RtlDestroyEnvironment=RtlDestroyEnvironment@4
|
||||||
RtlDestroyHeap=RtlDestroyHeap@4
|
RtlDestroyHeap=RtlDestroyHeap@4
|
||||||
RtlDestroyProcessParameters=RtlDestroyProcessParameters@4
|
RtlDestroyProcessParameters=RtlDestroyProcessParameters@4
|
||||||
|
@ -265,6 +266,7 @@ RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
|
||||||
RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8
|
RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8
|
||||||
RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16
|
RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16
|
||||||
RtlEnlargedUnsignedMultiply=RtlEnlargedUnsignedMultiply@8
|
RtlEnlargedUnsignedMultiply=RtlEnlargedUnsignedMultiply@8
|
||||||
|
RtlEnterCriticalSection=RtlEnterCriticalSection@4
|
||||||
RtlEqualString=RtlEqualString@12
|
RtlEqualString=RtlEqualString@12
|
||||||
RtlEqualUnicodeString=RtlEqualUnicodeString@12
|
RtlEqualUnicodeString=RtlEqualUnicodeString@12
|
||||||
RtlEraseUnicodeString=RtlEraseUnicodeString@4
|
RtlEraseUnicodeString=RtlEraseUnicodeString@4
|
||||||
|
@ -295,6 +297,7 @@ RtlInitString=RtlInitString@8
|
||||||
RtlInitUnicodeString=RtlInitUnicodeString@8
|
RtlInitUnicodeString=RtlInitUnicodeString@8
|
||||||
RtlInitializeBitMap=RtlInitializeBitMap@12
|
RtlInitializeBitMap=RtlInitializeBitMap@12
|
||||||
RtlInitializeContext=RtlInitializeContext@20
|
RtlInitializeContext=RtlInitializeContext@20
|
||||||
|
RtlInitializeCriticalSection=RtlInitializeCriticalSection@4
|
||||||
RtlIntegerToChar=RtlIntegerToChar@16
|
RtlIntegerToChar=RtlIntegerToChar@16
|
||||||
RtlIntegerToUnicodeString=RtlIntegerToUnicodeString@12
|
RtlIntegerToUnicodeString=RtlIntegerToUnicodeString@12
|
||||||
RtlIsDosDeviceName_U=RtlIsDosDeviceName_U@4
|
RtlIsDosDeviceName_U=RtlIsDosDeviceName_U@4
|
||||||
|
@ -306,6 +309,7 @@ RtlLargeIntegerNegate=RtlLargeIntegerNegate@8
|
||||||
RtlLargeIntegerShiftLeft=RtlLargeIntegerShiftLeft@12
|
RtlLargeIntegerShiftLeft=RtlLargeIntegerShiftLeft@12
|
||||||
RtlLargeIntegerShiftRight=RtlLargeIntegerShiftRight@12
|
RtlLargeIntegerShiftRight=RtlLargeIntegerShiftRight@12
|
||||||
RtlLargeIntegerSubtract=RtlLargeIntegerSubtract@16
|
RtlLargeIntegerSubtract=RtlLargeIntegerSubtract@16
|
||||||
|
RtlLeaveCriticalSection=RtlLeaveCriticalSection@4
|
||||||
RtlLengthSecurityDescriptor=RtlLengthSecurityDescriptor@4
|
RtlLengthSecurityDescriptor=RtlLengthSecurityDescriptor@4
|
||||||
RtlLockHeap=RtlLockHeap@4
|
RtlLockHeap=RtlLockHeap@4
|
||||||
RtlMoveMemory=RtlMoveMemory@12
|
RtlMoveMemory=RtlMoveMemory@12
|
||||||
|
@ -322,6 +326,8 @@ RtlOemToUnicodeN=RtlOemToUnicodeN@20
|
||||||
RtlQueryEnvironmentVariable_U=RtlQueryEnvironmentVariable_U@12
|
RtlQueryEnvironmentVariable_U=RtlQueryEnvironmentVariable_U@12
|
||||||
RtlReAllocateHeap=RtlReAllocateHeap@16
|
RtlReAllocateHeap=RtlReAllocateHeap@16
|
||||||
RtlReleasePebLock=RtlReleasePebLock@0
|
RtlReleasePebLock=RtlReleasePebLock@0
|
||||||
|
RtlSecondsSince1970ToTime=RtlSecondsSince1970ToTime@8
|
||||||
|
RtlSecondsSince1980ToTime=RtlSecondsSince1980ToTime@8
|
||||||
RtlSetAllBits=RtlSetAllBits@4
|
RtlSetAllBits=RtlSetAllBits@4
|
||||||
RtlSetBits=RtlSetBits@12
|
RtlSetBits=RtlSetBits@12
|
||||||
RtlSetCurrentDirectory_U=RtlSetCurrentDirectory_U@4
|
RtlSetCurrentDirectory_U=RtlSetCurrentDirectory_U@4
|
||||||
|
@ -331,6 +337,11 @@ RtlSetEnvironmentVariable=RtlSetEnvironmentVariable@12
|
||||||
RtlSetGroupSecurityDescriptor=RtlSetGroupSecurityDescriptor@12
|
RtlSetGroupSecurityDescriptor=RtlSetGroupSecurityDescriptor@12
|
||||||
RtlSetOwnerSecurityDescriptor=RtlSetOwnerSecurityDescriptor@12
|
RtlSetOwnerSecurityDescriptor=RtlSetOwnerSecurityDescriptor@12
|
||||||
RtlSizeHeap=RtlSizeHeap@12
|
RtlSizeHeap=RtlSizeHeap@12
|
||||||
|
RtlTimeFieldsToTime=RtlTimeFieldsToTime@8
|
||||||
|
RtlTimeToSecondsSince1970=RtlTimeToSecondsSince1970@8
|
||||||
|
RtlTimeToSecondsSince1980=RtlTimeToSecondsSince1980@8
|
||||||
|
RtlTimeToTimeFields=RtlTimeToTimeFields@8
|
||||||
|
RtlTryEnterCriticalSection=RtlTryEnterCriticalSection@4
|
||||||
RtlUnicodeStringToAnsiSize=RtlUnicodeStringToAnsiSize@4
|
RtlUnicodeStringToAnsiSize=RtlUnicodeStringToAnsiSize@4
|
||||||
RtlUnicodeStringToAnsiString=RtlUnicodeStringToAnsiString@12
|
RtlUnicodeStringToAnsiString=RtlUnicodeStringToAnsiString@12
|
||||||
RtlUnicodeStringToCountedOemString=RtlUnicodeStringToCountedOemString@12
|
RtlUnicodeStringToCountedOemString=RtlUnicodeStringToCountedOemString@12
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: makefile,v 1.39 2000/03/09 00:13:14 ekohl Exp $
|
# $Id: makefile,v 1.40 2000/03/09 16:00:29 ekohl Exp $
|
||||||
#
|
#
|
||||||
# ReactOS Operating System
|
# ReactOS Operating System
|
||||||
#
|
#
|
||||||
|
@ -30,7 +30,7 @@ DBG_OBJECTS = dbg/brkpoint.o dbg/print.o
|
||||||
RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
|
RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
|
||||||
rtl/math.o rtl/mem.o rtl/nls.o rtl/process.o rtl/sd.o \
|
rtl/math.o rtl/mem.o rtl/nls.o rtl/process.o rtl/sd.o \
|
||||||
rtl/thread.o rtl/unicode.o rtl/env.o rtl/path.o rtl/ppb.o \
|
rtl/thread.o rtl/unicode.o rtl/env.o rtl/path.o rtl/ppb.o \
|
||||||
rtl/bitmap.o
|
rtl/bitmap.o rtl/time.o
|
||||||
|
|
||||||
STDIO_OBJECTS = stdio/sprintf.o stdio/swprintf.o
|
STDIO_OBJECTS = stdio/sprintf.o stdio/swprintf.o
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#define DAYSPERLEAPYEAR 366
|
#define DAYSPERLEAPYEAR 366
|
||||||
#define MONSPERYEAR 12
|
#define MONSPERYEAR 12
|
||||||
|
|
||||||
|
#define TICKSTO1970 0x019db1ded53e8000
|
||||||
|
#define TICKSTO1980 0x01a8e79fe1d58000
|
||||||
|
|
||||||
static const int YearLengths[2] = {DAYSPERNORMALYEAR, DAYSPERLEAPYEAR};
|
static const int YearLengths[2] = {DAYSPERNORMALYEAR, DAYSPERLEAPYEAR};
|
||||||
static const int MonthLengths[2][MONSPERYEAR] =
|
static const int MonthLengths[2][MONSPERYEAR] =
|
||||||
{
|
{
|
||||||
|
@ -191,4 +194,76 @@ RtlTimeFieldsToTime (
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STDCALL
|
||||||
|
RtlSecondsSince1970ToTime (
|
||||||
|
ULONG SecondsSince1970,
|
||||||
|
PLARGE_INTEGER Time
|
||||||
|
)
|
||||||
|
{
|
||||||
|
LONGLONG llTime;
|
||||||
|
|
||||||
|
llTime = (SecondsSince1970 * TICKSPERSEC) + TICKSTO1970;
|
||||||
|
|
||||||
|
*Time = *(LARGE_INTEGER *)&llTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STDCALL
|
||||||
|
RtlSecondsSince1980ToTime (
|
||||||
|
ULONG SecondsSince1980,
|
||||||
|
PLARGE_INTEGER Time
|
||||||
|
)
|
||||||
|
{
|
||||||
|
LONGLONG llTime;
|
||||||
|
|
||||||
|
llTime = (SecondsSince1980 * TICKSPERSEC) + TICKSTO1980;
|
||||||
|
|
||||||
|
*Time = *(LARGE_INTEGER *)&llTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
STDCALL
|
||||||
|
RtlTimeToSecondsSince1970 (
|
||||||
|
PLARGE_INTEGER Time,
|
||||||
|
PULONG SecondsSince1970
|
||||||
|
)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER liTime;
|
||||||
|
|
||||||
|
liTime.QuadPart = Time->QuadPart - TICKSTO1970;
|
||||||
|
liTime.QuadPart = liTime.QuadPart / TICKSPERSEC;
|
||||||
|
|
||||||
|
if (liTime.u.HighPart != 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
*SecondsSince1970 = liTime.u.LowPart;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
STDCALL
|
||||||
|
RtlTimeToSecondsSince1980 (
|
||||||
|
PLARGE_INTEGER Time,
|
||||||
|
PULONG SecondsSince1980
|
||||||
|
)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER liTime;
|
||||||
|
|
||||||
|
liTime.QuadPart = Time->QuadPart - TICKSTO1980;
|
||||||
|
liTime.QuadPart = liTime.QuadPart / TICKSPERSEC;
|
||||||
|
|
||||||
|
if (liTime.u.HighPart != 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
*SecondsSince1980 = liTime.u.LowPart;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
Loading…
Reference in a new issue