Started kernel queue implementation.
authorEric Kohl <eric.kohl@reactos.org>
Fri, 4 Jan 2002 13:09:37 +0000 (13:09 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 4 Jan 2002 13:09:37 +0000 (13:09 +0000)
Added win32k support functions.

svn path=/trunk/; revision=2483

reactos/include/ddk/kefuncs.h
reactos/ntoskrnl/Makefile
reactos/ntoskrnl/include/internal/id.h
reactos/ntoskrnl/ke/kqueue.c
reactos/ntoskrnl/ke/queue.c [new file with mode: 0644]
reactos/ntoskrnl/ntoskrnl.def
reactos/ntoskrnl/ntoskrnl.edf
reactos/ntoskrnl/ps/win32.c [new file with mode: 0644]

index 7f6a273..b99a1be 100644 (file)
@@ -131,6 +131,10 @@ VOID STDCALL KeInitializeMutant(IN PKMUTANT Mutant,
 VOID STDCALL KeInitializeMutex (PKMUTEX        Mutex,
                                ULONG   Level);
 
+VOID STDCALL
+KeInitializeQueue(IN PKQUEUE Queue,
+                 IN ULONG Count);
+
 VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE        Semaphore,
                                    LONG                Count,
                                    LONG                Limit);
@@ -154,6 +158,14 @@ BOOLEAN STDCALL KeInsertByKeyDeviceQueue (PKDEVICE_QUEUE DeviceQueue,
 BOOLEAN STDCALL KeInsertDeviceQueue (PKDEVICE_QUEUE            DeviceQueue,
                                     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,
                               PVOID    SystemArgument1,
                               PVOID    SystemArgument2,
@@ -234,23 +246,17 @@ KeReadStateEvent (
 LONG STDCALL
 KeReadStateMutant(IN PKMUTANT Mutant);
 
-LONG
-STDCALL
-KeReadStateMutex (
-       PKMUTEX Mutex
-       );
+LONG STDCALL
+KeReadStateMutex(IN PKMUTEX Mutex);
 
-LONG
-STDCALL
-KeReadStateSemaphore (
-       PKSEMAPHORE     Semaphore
-       );
+LONG STDCALL
+KeReadStateQueue(IN PKQUEUE Queue);
 
-BOOLEAN
-STDCALL
-KeReadStateTimer (
-       PKTIMER Timer
-       );
+LONG STDCALL
+KeReadStateSemaphore(IN PKSEMAPHORE Semaphore);
+
+BOOLEAN STDCALL
+KeReadStateTimer(IN PKTIMER Timer);
 
 BOOLEAN
 STDCALL
@@ -313,27 +319,24 @@ KeRemoveDeviceQueue (
        PKDEVICE_QUEUE  DeviceQueue
        );
 
-BOOLEAN
-STDCALL
-KeRemoveEntryDeviceQueue (
-       PKDEVICE_QUEUE          DeviceQueue,
-       PKDEVICE_QUEUE_ENTRY    DeviceQueueEntry
-       );
+BOOLEAN STDCALL
+KeRemoveEntryDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
+                        PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
 
-BOOLEAN
-STDCALL
-KeRemoveQueueDpc (
-       PKDPC   Dpc
-       );
+PLIST_ENTRY STDCALL
+KeRemoveQueue(IN PKQUEUE Queue,
+             IN KPROCESSOR_MODE WaitMode,
+             IN PLARGE_INTEGER Timeout OPTIONAL);
 
-LONG
-STDCALL
-KeResetEvent (
-       PKEVENT Event
-       );
+BOOLEAN STDCALL
+KeRemoveQueueDpc(IN PKDPC Dpc);
 
-LONG STDCALL KeSetBasePriorityThread (struct _KTHREAD* Thread,
-                                     LONG              Increment);
+LONG STDCALL
+KeResetEvent(IN PKEVENT Event);
+
+LONG STDCALL
+KeSetBasePriorityThread(struct _KTHREAD* Thread,
+                       LONG Increment);
 
 LONG
 STDCALL
index 462ff28..b6cdf77 100644 (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
 #
@@ -125,7 +125,8 @@ OBJECTS_KE = \
        ke/spinlock.o \
        ke/timer.o \
        ke/wait.o \
-       ke/kthread.o
+       ke/kthread.o \
+       ke/queue.o
 
 # Memory Manager (Mm)
 OBJECTS_MM = \
@@ -216,7 +217,8 @@ OBJECTS_PS = \
        ps/thread.o \
        ps/tinfo.o \
        ps/debug.o \
-       ps/suspend.o
+       ps/suspend.o \
+       ps/win32.o
 
 # Executive Subsystem (Ex)
 OBJECTS_EX = \
index 0ad694d..43a2958 100644 (file)
@@ -14,5 +14,6 @@
 #define InternalMutexType                     (InternalBaseType + 9)
 #define InternalNotificationTimer             (InternalBaseType + 10)
 #define InternalSynchronizationTimer          (InternalBaseType + 11)
+#define InternalQueueType                     (InternalBaseType + 12)
 
 
index 37536be..6c8d685 100644 (file)
@@ -187,3 +187,12 @@ KeInsertDeviceQueue (
    KeReleaseSpinLock(&DeviceQueue->Lock,oldlvl);
    return(TRUE);
 }
+
+
+BOOLEAN STDCALL
+KeRemoveEntryDeviceQueue(PKDEVICE_QUEUE DeviceQueue,
+                        PKDEVICE_QUEUE_ENTRY DeviceQueueEntry)
+{
+  UNIMPLEMENTED;
+  return(FALSE);
+}
diff --git a/reactos/ntoskrnl/ke/queue.c b/reactos/ntoskrnl/ke/queue.c
new file mode 100644 (file)
index 0000000..8889e3c
--- /dev/null
@@ -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 */
index 38e7dea..b189374 100644 (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
 ;
@@ -354,15 +354,15 @@ KeInitializeEvent@12
 KeInitializeInterrupt@44
 KeInitializeMutant@8
 KeInitializeMutex@8
-;KeInitializeQueue
+KeInitializeQueue@8
 KeInitializeSemaphore@12
 KeInitializeSpinLock@4
 KeInitializeTimer@4
 KeInitializeTimerEx@8
 KeInsertByKeyDeviceQueue@12
 KeInsertDeviceQueue@8
-;KeInsertHeadQueue
-;KeInsertQueue
+KeInsertHeadQueue@8
+KeInsertQueue@8
 KeInsertQueueApc@16
 KeInsertQueueDpc@12
 ;KeIsExecutingDpc
@@ -379,7 +379,7 @@ KeQueryTimeIncrement@0
 KeReadStateEvent@4
 KeReadStateMutant@4
 KeReadStateMutex@4
-;KeReadStateQueue
+KeReadStateQueue@4
 KeReadStateSemaphore@4
 KeReadStateTimer@4
 KeRegisterBugCheckCallback@20
@@ -389,12 +389,12 @@ KeReleaseSemaphore@16
 KeReleaseSpinLockFromDpcLevel@4
 KeRemoveByKeyDeviceQueue@8
 KeRemoveDeviceQueue@4
-;KeRemoveEntryDeviceQueue
-;KeRemoveQueue
+KeRemoveEntryDeviceQueue@8
+KeRemoveQueue@12
 KeRemoveQueueDpc@4
 KeResetEvent@4
 ;KeRestoreFloatingPointState
-;KeRundownQueue
+KeRundownQueue@4
 ;KeSaveFloatingPointState
 KeServiceDescriptorTable DATA
 ;KeSetAffinityThread
@@ -590,9 +590,9 @@ PsAssignImpersonationToken@8
 ;PsChargePoolQuota@12
 PsCreateSystemProcess@12
 PsCreateSystemThread@28
-;PsCreateWin32Process@4
+PsCreateWin32Process@4
 PsDispatchThread@4
-;PsEstablishWin32Callouts@24
+PsEstablishWin32Callouts@24
 PsGetCurrentProcessId@0
 PsGetCurrentThreadId@0
 PsGetCurrentThread@0
index 6d23e62..7f6312f 100644 (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
 ;
@@ -354,15 +354,15 @@ KeInitializeEvent=KeInitializeEvent@12
 KeInitializeInterrupt=KeInitializeInterrupt@44
 KeInitializeMutant=KeInitializeMutant@8
 KeInitializeMutex=KeInitializeMutex@8
-;KeInitializeQueue
+KeInitializeQueue=KeInitializeQueue@8
 KeInitializeSemaphore=KeInitializeSemaphore@12
 KeInitializeSpinLock=KeInitializeSpinLock@4
 KeInitializeTimer=KeInitializeTimer@4
 KeInitializeTimerEx=KeInitializeTimerEx@8
 KeInsertByKeyDeviceQueue=KeInsertByKeyDeviceQueue@12
 KeInsertDeviceQueue=KeInsertDeviceQueue@8
-;KeInsertHeadQueue
-;KeInsertQueue
+KeInsertHeadQueue=KeInsertHeadQueue@8
+KeInsertQueue=KeInsertQueue@8
 KeInsertQueueApc=KeInsertQueueApc@16
 KeInsertQueueDpc=KeInsertQueueDpc@12
 ;KeIsExecutingDpc
@@ -379,7 +379,7 @@ KeQueryTimeIncrement=KeQueryTimeIncrement@0
 KeReadStateEvent=KeReadStateEvent@4
 KeReadStateMutant=KeReadStateMutant@4
 KeReadStateMutex=KeReadStateMutex@4
-;KeReadStateQueue
+KeReadStateQueue=KeReadStateQueue@4
 KeReadStateSemaphore=KeReadStateSemaphore@4
 KeReadStateTimer=KeReadStateTimer@4
 KeRegisterBugCheckCallback=KeRegisterBugCheckCallback@20
@@ -389,12 +389,12 @@ KeReleaseSemaphore=KeReleaseSemaphore@16
 KeReleaseSpinLockFromDpcLevel=KeReleaseSpinLockFromDpcLevel@4
 KeRemoveByKeyDeviceQueue=KeRemoveByKeyDeviceQueue@8
 KeRemoveDeviceQueue=KeRemoveDeviceQueue@4
-;KeRemoveEntryDeviceQueue
-;KeRemoveQueue
+KeRemoveEntryDeviceQueue=KeRemoveEntryDeviceQueue@8
+KeRemoveQueue=KeRemoveQueue@12
 KeRemoveQueueDpc=KeRemoveQueueDpc@4
 KeResetEvent=KeResetEvent@4
 ;KeRestoreFloatingPointState
-;KeRundownQueue
+KeRundownQueue=KeRundownQueue@4
 ;KeSaveFloatingPointState
 KeServiceDescriptorTable       DATA
 ;KeSetAffinityThread
@@ -590,9 +590,9 @@ PsAssignImpersonationToken=PsAssignImpersonationToken@8
 ;PsChargePoolQuota=PsChargePoolQuota@12
 PsCreateSystemProcess=PsCreateSystemProcess@12
 PsCreateSystemThread=PsCreateSystemThread@28
-;PsCreateWin32Process=PsCreateWin32Process@4
+PsCreateWin32Process=PsCreateWin32Process@4
 PsDispatchThread=PsDispatchThread@4
-;PsEstablishWin32Callouts=PsEstablishWin32Callouts@24
+PsEstablishWin32Callouts=PsEstablishWin32Callouts@24
 PsGetCurrentProcessId=PsGetCurrentProcessId@0
 PsGetCurrentThreadId=PsGetCurrentThreadId@0
 PsGetCurrentThread=PsGetCurrentThread@0
diff --git a/reactos/ntoskrnl/ps/win32.c b/reactos/ntoskrnl/ps/win32.c
new file mode 100644 (file)
index 0000000..2bba115
--- /dev/null
@@ -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 */