mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed problem with __NTOSKRNL__ not being defined by the compiler
Implemented some APIs svn path=/trunk/; revision=2231
This commit is contained in:
parent
1701b0b02f
commit
6cb5e548e2
4 changed files with 80 additions and 28 deletions
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.53 2001/09/03 20:41:52 ea Exp $
|
||||
# $Id: Makefile,v 1.54 2001/09/06 20:26:36 dwelch Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -32,9 +32,13 @@ else
|
|||
OBJECTS_KDBG :=
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(SDK_PATH_INC)),)
|
||||
ASFLAGS += -I./include
|
||||
CFLAGS += -I./include -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror
|
||||
else
|
||||
ASFLAGS += -I./include -I$(SDK_PATH_INC)
|
||||
CFLAGS += -I./include -I$(SDK_PATH_INC) -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror
|
||||
endif
|
||||
|
||||
#
|
||||
# Build configuration
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: time.c,v 1.11 2000/10/22 16:36:49 ekohl Exp $
|
||||
/* $Id: time.c,v 1.12 2001/09/06 20:26:36 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -13,6 +13,9 @@
|
|||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/ex.h>
|
||||
#include <internal/safe.h>
|
||||
#include <ddk/halfuncs.h>
|
||||
#include <ddk/kefuncs.h>
|
||||
|
||||
#include <internal/debug.h>
|
||||
|
||||
|
@ -38,27 +41,71 @@ ExInitTimeZoneInfo (VOID)
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
NtSetSystemTime (
|
||||
IN PLARGE_INTEGER SystemTime,
|
||||
IN PLARGE_INTEGER NewSystemTime OPTIONAL
|
||||
)
|
||||
NTSTATUS STDCALL
|
||||
NtSetSystemTime (IN PLARGE_INTEGER UnsafeNewSystemTime,
|
||||
OUT PLARGE_INTEGER UnsafeOldSystemTime OPTIONAL)
|
||||
/*
|
||||
* FUNCTION: Sets the system time.
|
||||
* PARAMETERS:
|
||||
* NewTime - Points to a variable that specified the new time
|
||||
* of day in the standard time format.
|
||||
* OldTime - Optionally points to a variable that receives the
|
||||
* old time of day in the standard time format.
|
||||
* RETURNS: Status
|
||||
*/
|
||||
{
|
||||
// HalSetRealTimeClock ((PTIME)SystemTime);
|
||||
// UNIMPLEMENTED;
|
||||
return STATUS_SUCCESS;
|
||||
NTSTATUS Status;
|
||||
LARGE_INTEGER OldSystemTime;
|
||||
LARGE_INTEGER NewSystemTime;
|
||||
|
||||
/* FIXME: Check for SeSystemTimePrivilege */
|
||||
|
||||
Status = MmCopyFromCaller(&NewSystemTime, UnsafeNewSystemTime,
|
||||
sizeof(NewSystemTime));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return(Status);
|
||||
}
|
||||
|
||||
if (UnsafeOldSystemTime != NULL)
|
||||
{
|
||||
KeQuerySystemTime(&OldSystemTime);
|
||||
}
|
||||
HalSetRealTimeClock ((PTIME_FIELDS)&NewSystemTime);
|
||||
|
||||
if (UnsafeOldSystemTime != NULL)
|
||||
{
|
||||
Status = MmCopyToCaller(UnsafeOldSystemTime, &OldSystemTime,
|
||||
sizeof(OldSystemTime));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return(Status);
|
||||
}
|
||||
}
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
NtQuerySystemTime (
|
||||
OUT TIME * CurrentTime
|
||||
)
|
||||
NTSTATUS STDCALL
|
||||
NtQuerySystemTime (OUT TIME* UnsafeCurrentTime)
|
||||
/*
|
||||
* FUNCTION: Retrieves the system time.
|
||||
* PARAMETERS:
|
||||
* CurrentTime - Points to a variable that receives the current
|
||||
* time of day in the standard time format.
|
||||
*/
|
||||
{
|
||||
KeQuerySystemTime((PLARGE_INTEGER)CurrentTime);
|
||||
return STATUS_SUCCESS;
|
||||
LARGE_INTEGER CurrentTime;
|
||||
NTSTATUS Status;
|
||||
|
||||
KeQuerySystemTime(&CurrentTime);
|
||||
Status = MmCopyToCaller(UnsafeCurrentTime, &CurrentTime,
|
||||
sizeof(CurrentTime));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return(Status);
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <ddk/ntddk.h>
|
||||
#include <internal/ex.h>
|
||||
#include <internal/ob.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: largeint.c,v 1.9 1999/11/27 03:31:20 ekohl Exp $
|
||||
/* $Id: largeint.c,v 1.10 2001/09/06 20:26:36 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -119,15 +119,15 @@ RtlExtendedLargeIntegerDivide (
|
|||
return RC;
|
||||
}
|
||||
|
||||
LARGE_INTEGER
|
||||
STDCALL
|
||||
RtlExtendedMagicDivide (
|
||||
LARGE_INTEGER Dividend,
|
||||
LARGE_INTEGER MagicDivisor,
|
||||
CCHAR ShiftCount
|
||||
)
|
||||
LARGE_INTEGER STDCALL
|
||||
RtlExtendedMagicDivide (LARGE_INTEGER Dividend,
|
||||
LARGE_INTEGER MagicDivisor,
|
||||
CCHAR ShiftCount)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
LARGE_INTEGER Result;
|
||||
|
||||
Result.QuadPart = (Dividend.QuadPart * MagicDivisor.QuadPart) >> ShiftCount;
|
||||
return(Result);
|
||||
}
|
||||
|
||||
LARGE_INTEGER
|
||||
|
|
Loading…
Reference in a new issue