Started kernel queue implementation.

Added win32k support functions.

svn path=/trunk/; revision=2483
This commit is contained in:
Eric Kohl 2002-01-04 13:09:37 +00:00
parent f376a8013e
commit 0d5652813b
8 changed files with 241 additions and 56 deletions

View file

@ -131,6 +131,10 @@ VOID STDCALL KeInitializeMutant(IN PKMUTANT Mutant,
VOID STDCALL KeInitializeMutex (PKMUTEX Mutex, VOID STDCALL KeInitializeMutex (PKMUTEX Mutex,
ULONG Level); ULONG Level);
VOID STDCALL
KeInitializeQueue(IN PKQUEUE Queue,
IN ULONG Count);
VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE Semaphore, VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE Semaphore,
LONG Count, LONG Count,
LONG Limit); LONG Limit);
@ -154,6 +158,14 @@ BOOLEAN STDCALL KeInsertByKeyDeviceQueue (PKDEVICE_QUEUE DeviceQueue,
BOOLEAN STDCALL KeInsertDeviceQueue (PKDEVICE_QUEUE DeviceQueue, BOOLEAN STDCALL KeInsertDeviceQueue (PKDEVICE_QUEUE DeviceQueue,
PKDEVICE_QUEUE_ENTRY DeviceQueueEntry); PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
LONG STDCALL
KeInsertHeadQueue(IN PKQUEUE Queue,
IN PLIST_ENTRY Entry);
LONG STDCALL
KeInsertQueue(IN PKQUEUE Queue,
IN PLIST_ENTRY Entry);
VOID STDCALL KeInsertQueueApc (PKAPC Apc, VOID STDCALL KeInsertQueueApc (PKAPC Apc,
PVOID SystemArgument1, PVOID SystemArgument1,
PVOID SystemArgument2, PVOID SystemArgument2,
@ -234,23 +246,17 @@ KeReadStateEvent (
LONG STDCALL LONG STDCALL
KeReadStateMutant(IN PKMUTANT Mutant); KeReadStateMutant(IN PKMUTANT Mutant);
LONG LONG STDCALL
STDCALL KeReadStateMutex(IN PKMUTEX Mutex);
KeReadStateMutex (
PKMUTEX Mutex
);
LONG LONG STDCALL
STDCALL KeReadStateQueue(IN PKQUEUE Queue);
KeReadStateSemaphore (
PKSEMAPHORE Semaphore
);
BOOLEAN LONG STDCALL
STDCALL KeReadStateSemaphore(IN PKSEMAPHORE Semaphore);
KeReadStateTimer (
PKTIMER Timer BOOLEAN STDCALL
); KeReadStateTimer(IN PKTIMER Timer);
BOOLEAN BOOLEAN
STDCALL STDCALL
@ -313,26 +319,23 @@ KeRemoveDeviceQueue (
PKDEVICE_QUEUE DeviceQueue PKDEVICE_QUEUE DeviceQueue
); );
BOOLEAN BOOLEAN STDCALL
STDCALL KeRemoveEntryDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
KeRemoveEntryDeviceQueue ( PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
PKDEVICE_QUEUE DeviceQueue,
PKDEVICE_QUEUE_ENTRY DeviceQueueEntry
);
BOOLEAN PLIST_ENTRY STDCALL
STDCALL KeRemoveQueue(IN PKQUEUE Queue,
KeRemoveQueueDpc ( IN KPROCESSOR_MODE WaitMode,
PKDPC Dpc IN PLARGE_INTEGER Timeout OPTIONAL);
);
LONG BOOLEAN STDCALL
STDCALL KeRemoveQueueDpc(IN PKDPC Dpc);
KeResetEvent (
PKEVENT Event
);
LONG STDCALL KeSetBasePriorityThread (struct _KTHREAD* Thread, LONG STDCALL
KeResetEvent(IN PKEVENT Event);
LONG STDCALL
KeSetBasePriorityThread(struct _KTHREAD* Thread,
LONG Increment); LONG Increment);
LONG LONG

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.62 2002/01/03 14:51:25 ekohl Exp $ # $Id: Makefile,v 1.63 2002/01/04 13:09:36 ekohl Exp $
# #
# ReactOS Operating System # ReactOS Operating System
# #
@ -125,7 +125,8 @@ OBJECTS_KE = \
ke/spinlock.o \ ke/spinlock.o \
ke/timer.o \ ke/timer.o \
ke/wait.o \ ke/wait.o \
ke/kthread.o ke/kthread.o \
ke/queue.o
# Memory Manager (Mm) # Memory Manager (Mm)
OBJECTS_MM = \ OBJECTS_MM = \
@ -216,7 +217,8 @@ OBJECTS_PS = \
ps/thread.o \ ps/thread.o \
ps/tinfo.o \ ps/tinfo.o \
ps/debug.o \ ps/debug.o \
ps/suspend.o ps/suspend.o \
ps/win32.o
# Executive Subsystem (Ex) # Executive Subsystem (Ex)
OBJECTS_EX = \ OBJECTS_EX = \

View file

@ -14,5 +14,6 @@
#define InternalMutexType (InternalBaseType + 9) #define InternalMutexType (InternalBaseType + 9)
#define InternalNotificationTimer (InternalBaseType + 10) #define InternalNotificationTimer (InternalBaseType + 10)
#define InternalSynchronizationTimer (InternalBaseType + 11) #define InternalSynchronizationTimer (InternalBaseType + 11)
#define InternalQueueType (InternalBaseType + 12)

View file

@ -187,3 +187,12 @@ KeInsertDeviceQueue (
KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl); KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
return(TRUE); return(TRUE);
} }
BOOLEAN STDCALL
KeRemoveEntryDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
PKDEVICE_QUEUE_ENTRY DeviceQueueEntry)
{
UNIMPLEMENTED;
return(FALSE);
}

View file

@ -0,0 +1,97 @@
/*
* ReactOS kernel
* Copyright (C) 1998, 1999, 2000, 2001, 2002 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: queue.c,v 1.1 2002/01/04 13:08:39 ekohl Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/queue.c
* PURPOSE: Implements kernel queues
* PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
* UPDATE HISTORY:
* Created 04/01/2002
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/ke.h>
#include <internal/id.h>
#define NDEBUG
#include <internal/debug.h>
/* FUNCTIONS *****************************************************************/
VOID STDCALL
KeInitializeQueue(IN PKQUEUE Queue,
IN ULONG Count OPTIONAL)
{
KeInitializeDispatcherHeader(&Queue->Header,
InternalQueueType,
sizeof(KQUEUE)/sizeof(ULONG),
0);
InitializeListHead(&Queue->EntryListHead);
InitializeListHead(&Queue->ThreadListEntry);
Queue->CurrentCount = 0;
Queue->MaximumCount = (Count == 0) ? KeNumberProcessors : Count;
}
LONG STDCALL
KeReadStateQueue(IN PKQUEUE Queue)
{
return(Queue->Header.SignalState);
}
LONG STDCALL
KeInsertHeadQueue(IN PKQUEUE Queue,
IN PLIST_ENTRY Entry)
{
UNIMPLEMENTED;
return 0;
}
LONG STDCALL
KeInsertQueue(IN PKQUEUE Queue,
IN PLIST_ENTRY Entry)
{
UNIMPLEMENTED;
return 0;
}
PLIST_ENTRY STDCALL
KeRemoveQueue(IN PKQUEUE Queue,
IN KPROCESSOR_MODE WaitMode,
IN PLARGE_INTEGER Timeout OPTIONAL)
{
UNIMPLEMENTED;
return NULL;
}
PLIST_ENTRY STDCALL
KeRundownQueue(IN PKQUEUE Queue)
{
UNIMPLEMENTED;
return NULL;
}
/* EOF */

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.122 2002/01/03 18:02:34 ekohl Exp $ ; $Id: ntoskrnl.def,v 1.123 2002/01/04 13:09:37 ekohl Exp $
; ;
; reactos/ntoskrnl/ntoskrnl.def ; reactos/ntoskrnl/ntoskrnl.def
; ;
@ -354,15 +354,15 @@ KeInitializeEvent@12
KeInitializeInterrupt@44 KeInitializeInterrupt@44
KeInitializeMutant@8 KeInitializeMutant@8
KeInitializeMutex@8 KeInitializeMutex@8
;KeInitializeQueue KeInitializeQueue@8
KeInitializeSemaphore@12 KeInitializeSemaphore@12
KeInitializeSpinLock@4 KeInitializeSpinLock@4
KeInitializeTimer@4 KeInitializeTimer@4
KeInitializeTimerEx@8 KeInitializeTimerEx@8
KeInsertByKeyDeviceQueue@12 KeInsertByKeyDeviceQueue@12
KeInsertDeviceQueue@8 KeInsertDeviceQueue@8
;KeInsertHeadQueue KeInsertHeadQueue@8
;KeInsertQueue KeInsertQueue@8
KeInsertQueueApc@16 KeInsertQueueApc@16
KeInsertQueueDpc@12 KeInsertQueueDpc@12
;KeIsExecutingDpc ;KeIsExecutingDpc
@ -379,7 +379,7 @@ KeQueryTimeIncrement@0
KeReadStateEvent@4 KeReadStateEvent@4
KeReadStateMutant@4 KeReadStateMutant@4
KeReadStateMutex@4 KeReadStateMutex@4
;KeReadStateQueue KeReadStateQueue@4
KeReadStateSemaphore@4 KeReadStateSemaphore@4
KeReadStateTimer@4 KeReadStateTimer@4
KeRegisterBugCheckCallback@20 KeRegisterBugCheckCallback@20
@ -389,12 +389,12 @@ KeReleaseSemaphore@16
KeReleaseSpinLockFromDpcLevel@4 KeReleaseSpinLockFromDpcLevel@4
KeRemoveByKeyDeviceQueue@8 KeRemoveByKeyDeviceQueue@8
KeRemoveDeviceQueue@4 KeRemoveDeviceQueue@4
;KeRemoveEntryDeviceQueue KeRemoveEntryDeviceQueue@8
;KeRemoveQueue KeRemoveQueue@12
KeRemoveQueueDpc@4 KeRemoveQueueDpc@4
KeResetEvent@4 KeResetEvent@4
;KeRestoreFloatingPointState ;KeRestoreFloatingPointState
;KeRundownQueue KeRundownQueue@4
;KeSaveFloatingPointState ;KeSaveFloatingPointState
KeServiceDescriptorTable DATA KeServiceDescriptorTable DATA
;KeSetAffinityThread ;KeSetAffinityThread
@ -590,9 +590,9 @@ PsAssignImpersonationToken@8
;PsChargePoolQuota@12 ;PsChargePoolQuota@12
PsCreateSystemProcess@12 PsCreateSystemProcess@12
PsCreateSystemThread@28 PsCreateSystemThread@28
;PsCreateWin32Process@4 PsCreateWin32Process@4
PsDispatchThread@4 PsDispatchThread@4
;PsEstablishWin32Callouts@24 PsEstablishWin32Callouts@24
PsGetCurrentProcessId@0 PsGetCurrentProcessId@0
PsGetCurrentThreadId@0 PsGetCurrentThreadId@0
PsGetCurrentThread@0 PsGetCurrentThread@0

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.108 2002/01/03 18:02:34 ekohl Exp $ ; $Id: ntoskrnl.edf,v 1.109 2002/01/04 13:09:37 ekohl Exp $
; ;
; reactos/ntoskrnl/ntoskrnl.def ; reactos/ntoskrnl/ntoskrnl.def
; ;
@ -354,15 +354,15 @@ KeInitializeEvent=KeInitializeEvent@12
KeInitializeInterrupt=KeInitializeInterrupt@44 KeInitializeInterrupt=KeInitializeInterrupt@44
KeInitializeMutant=KeInitializeMutant@8 KeInitializeMutant=KeInitializeMutant@8
KeInitializeMutex=KeInitializeMutex@8 KeInitializeMutex=KeInitializeMutex@8
;KeInitializeQueue KeInitializeQueue=KeInitializeQueue@8
KeInitializeSemaphore=KeInitializeSemaphore@12 KeInitializeSemaphore=KeInitializeSemaphore@12
KeInitializeSpinLock=KeInitializeSpinLock@4 KeInitializeSpinLock=KeInitializeSpinLock@4
KeInitializeTimer=KeInitializeTimer@4 KeInitializeTimer=KeInitializeTimer@4
KeInitializeTimerEx=KeInitializeTimerEx@8 KeInitializeTimerEx=KeInitializeTimerEx@8
KeInsertByKeyDeviceQueue=KeInsertByKeyDeviceQueue@12 KeInsertByKeyDeviceQueue=KeInsertByKeyDeviceQueue@12
KeInsertDeviceQueue=KeInsertDeviceQueue@8 KeInsertDeviceQueue=KeInsertDeviceQueue@8
;KeInsertHeadQueue KeInsertHeadQueue=KeInsertHeadQueue@8
;KeInsertQueue KeInsertQueue=KeInsertQueue@8
KeInsertQueueApc=KeInsertQueueApc@16 KeInsertQueueApc=KeInsertQueueApc@16
KeInsertQueueDpc=KeInsertQueueDpc@12 KeInsertQueueDpc=KeInsertQueueDpc@12
;KeIsExecutingDpc ;KeIsExecutingDpc
@ -379,7 +379,7 @@ KeQueryTimeIncrement=KeQueryTimeIncrement@0
KeReadStateEvent=KeReadStateEvent@4 KeReadStateEvent=KeReadStateEvent@4
KeReadStateMutant=KeReadStateMutant@4 KeReadStateMutant=KeReadStateMutant@4
KeReadStateMutex=KeReadStateMutex@4 KeReadStateMutex=KeReadStateMutex@4
;KeReadStateQueue KeReadStateQueue=KeReadStateQueue@4
KeReadStateSemaphore=KeReadStateSemaphore@4 KeReadStateSemaphore=KeReadStateSemaphore@4
KeReadStateTimer=KeReadStateTimer@4 KeReadStateTimer=KeReadStateTimer@4
KeRegisterBugCheckCallback=KeRegisterBugCheckCallback@20 KeRegisterBugCheckCallback=KeRegisterBugCheckCallback@20
@ -389,12 +389,12 @@ KeReleaseSemaphore=KeReleaseSemaphore@16
KeReleaseSpinLockFromDpcLevel=KeReleaseSpinLockFromDpcLevel@4 KeReleaseSpinLockFromDpcLevel=KeReleaseSpinLockFromDpcLevel@4
KeRemoveByKeyDeviceQueue=KeRemoveByKeyDeviceQueue@8 KeRemoveByKeyDeviceQueue=KeRemoveByKeyDeviceQueue@8
KeRemoveDeviceQueue=KeRemoveDeviceQueue@4 KeRemoveDeviceQueue=KeRemoveDeviceQueue@4
;KeRemoveEntryDeviceQueue KeRemoveEntryDeviceQueue=KeRemoveEntryDeviceQueue@8
;KeRemoveQueue KeRemoveQueue=KeRemoveQueue@12
KeRemoveQueueDpc=KeRemoveQueueDpc@4 KeRemoveQueueDpc=KeRemoveQueueDpc@4
KeResetEvent=KeResetEvent@4 KeResetEvent=KeResetEvent@4
;KeRestoreFloatingPointState ;KeRestoreFloatingPointState
;KeRundownQueue KeRundownQueue=KeRundownQueue@4
;KeSaveFloatingPointState ;KeSaveFloatingPointState
KeServiceDescriptorTable DATA KeServiceDescriptorTable DATA
;KeSetAffinityThread ;KeSetAffinityThread
@ -590,9 +590,9 @@ PsAssignImpersonationToken=PsAssignImpersonationToken@8
;PsChargePoolQuota=PsChargePoolQuota@12 ;PsChargePoolQuota=PsChargePoolQuota@12
PsCreateSystemProcess=PsCreateSystemProcess@12 PsCreateSystemProcess=PsCreateSystemProcess@12
PsCreateSystemThread=PsCreateSystemThread@28 PsCreateSystemThread=PsCreateSystemThread@28
;PsCreateWin32Process=PsCreateWin32Process@4 PsCreateWin32Process=PsCreateWin32Process@4
PsDispatchThread=PsDispatchThread@4 PsDispatchThread=PsDispatchThread@4
;PsEstablishWin32Callouts=PsEstablishWin32Callouts@24 PsEstablishWin32Callouts=PsEstablishWin32Callouts@24
PsGetCurrentProcessId=PsGetCurrentProcessId@0 PsGetCurrentProcessId=PsGetCurrentProcessId@0
PsGetCurrentThreadId=PsGetCurrentThreadId@0 PsGetCurrentThreadId=PsGetCurrentThreadId@0
PsGetCurrentThread=PsGetCurrentThread@0 PsGetCurrentThread=PsGetCurrentThread@0

View file

@ -0,0 +1,73 @@
/*
* ReactOS kernel
* Copyright (C) 2002 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: win32.c,v 1.1 2002/01/04 13:09:11 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ps/win32.c
* PURPOSE: win32k support
* PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
* REVISION HISTORY:
* 04/01/2002: Created
*/
/* INCLUDES ****************************************************************/
#include <ddk/ntddk.h>
#include <internal/ps.h>
/* TYPES *******************************************************************/
/* GLOBALS ******************************************************************/
static ULONG PspWin32ProcessSize = 0;
/* FUNCTIONS ***************************************************************/
NTSTATUS STDCALL
PsCreateWin32Process(PEPROCESS Process)
{
if (Process->Win32Process != NULL)
return(STATUS_SUCCESS);
Process->Win32Process = ExAllocatePool(NonPagedPool,
PspWin32ProcessSize);
if (Process->Win32Process == NULL)
return(STATUS_NO_MEMORY);
RtlZeroMemory(Process->Win32Process,
PspWin32ProcessSize);
return(STATUS_SUCCESS);
}
VOID STDCALL
PsEstablishWin32Callouts(PVOID Param1,
PVOID Param2,
PVOID Param3,
PVOID Param4,
PVOID Param5,
ULONG W32ProcessSize)
{
PspWin32ProcessSize = W32ProcessSize;
}
/* EOF */