ntoskrnl.exe: Implemented a couple of time-related APIs.
This commit is contained in:
parent
73cc00f9a5
commit
bd3a08b355
|
@ -130,6 +130,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
|
||||||
IO_STACK_LOCATION irpsp;
|
IO_STACK_LOCATION irpsp;
|
||||||
PDRIVER_DISPATCH dispatch = device->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL];
|
PDRIVER_DISPATCH dispatch = device->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL];
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
LARGE_INTEGER count;
|
||||||
|
|
||||||
TRACE( "ioctl %x device %p in_size %u out_size %u\n", code, device, in_size, *out_size );
|
TRACE( "ioctl %x device %p in_size %u out_size %u\n", code, device, in_size, *out_size );
|
||||||
|
|
||||||
|
@ -159,6 +160,8 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
|
||||||
|
|
||||||
device->CurrentIrp = &irp;
|
device->CurrentIrp = &irp;
|
||||||
|
|
||||||
|
KeQueryTickCount( &count ); /* update the global KeTickCount */
|
||||||
|
|
||||||
if (TRACE_ON(relay))
|
if (TRACE_ON(relay))
|
||||||
DPRINTF( "%04x:Call driver dispatch %p (device=%p,irp=%p)\n",
|
DPRINTF( "%04x:Call driver dispatch %p (device=%p,irp=%p)\n",
|
||||||
GetCurrentThreadId(), dispatch, device, &irp );
|
GetCurrentThreadId(), dispatch, device, &irp );
|
||||||
|
@ -415,6 +418,37 @@ void WINAPI ExFreePoolWithTag( void *ptr, ULONG tag )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* KeQuerySystemTime (NTOSKRNL.EXE.@)
|
||||||
|
*/
|
||||||
|
void WINAPI KeQuerySystemTime( LARGE_INTEGER *time )
|
||||||
|
{
|
||||||
|
NtQuerySystemTime( time );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* KeQueryTickCount (NTOSKRNL.EXE.@)
|
||||||
|
*/
|
||||||
|
void WINAPI KeQueryTickCount( LARGE_INTEGER *count )
|
||||||
|
{
|
||||||
|
count->QuadPart = NtGetTickCount();
|
||||||
|
/* update the global variable too */
|
||||||
|
KeTickCount.LowPart = count->u.LowPart;
|
||||||
|
KeTickCount.High1Time = count->u.HighPart;
|
||||||
|
KeTickCount.High2Time = count->u.HighPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* KeQueryTimeIncrement (NTOSKRNL.EXE.@)
|
||||||
|
*/
|
||||||
|
ULONG WINAPI KeQueryTimeIncrement(void)
|
||||||
|
{
|
||||||
|
return 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* MmAllocateNonCachedMemory (NTOSKRNL.EXE.@)
|
* MmAllocateNonCachedMemory (NTOSKRNL.EXE.@)
|
||||||
*/
|
*/
|
||||||
|
@ -493,11 +527,14 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine( PCREATE_PROCESS_NOTIFY_ROUTINE
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
|
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
|
||||||
{
|
{
|
||||||
|
LARGE_INTEGER count;
|
||||||
|
|
||||||
switch(reason)
|
switch(reason)
|
||||||
{
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
DisableThreadLibraryCalls( inst );
|
DisableThreadLibraryCalls( inst );
|
||||||
RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
|
RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
|
||||||
|
KeQueryTickCount( &count ); /* initialize the global KeTickCount */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -573,9 +573,9 @@
|
||||||
@ stub KeQueryInterruptTime
|
@ stub KeQueryInterruptTime
|
||||||
@ stub KeQueryPriorityThread
|
@ stub KeQueryPriorityThread
|
||||||
@ stub KeQueryRuntimeThread
|
@ stub KeQueryRuntimeThread
|
||||||
@ stub KeQuerySystemTime
|
@ stdcall KeQuerySystemTime(ptr)
|
||||||
@ stub KeQueryTickCount
|
@ stdcall KeQueryTickCount(ptr)
|
||||||
@ stub KeQueryTimeIncrement
|
@ stdcall KeQueryTimeIncrement()
|
||||||
@ stub KeRaiseUserException
|
@ stub KeRaiseUserException
|
||||||
@ stub KeReadStateEvent
|
@ stub KeReadStateEvent
|
||||||
@ stub KeReadStateMutant
|
@ stub KeReadStateMutant
|
||||||
|
|
|
@ -874,6 +874,9 @@ NTSTATUS WINAPI IoDeleteSymbolicLink(UNICODE_STRING*);
|
||||||
PEPROCESS WINAPI IoGetCurrentProcess(void);
|
PEPROCESS WINAPI IoGetCurrentProcess(void);
|
||||||
|
|
||||||
PKTHREAD WINAPI KeGetCurrentThread(void);
|
PKTHREAD WINAPI KeGetCurrentThread(void);
|
||||||
|
void WINAPI KeQuerySystemTime(LARGE_INTEGER*);
|
||||||
|
void WINAPI KeQueryTickCount(LARGE_INTEGER*);
|
||||||
|
ULONG WINAPI KeQueryTimeIncrement(void);
|
||||||
|
|
||||||
LPVOID WINAPI MmAllocateNonCachedMemory(SIZE_T);
|
LPVOID WINAPI MmAllocateNonCachedMemory(SIZE_T);
|
||||||
void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
|
void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
|
||||||
|
|
Loading…
Reference in New Issue