Move non-DDK Ps* function prototypes and types from ROS DDK to NTOS headers.
Modified: trunk/reactos/include/ddk/psfuncs.h
Modified: trunk/reactos/include/ddk/pstypes.h
Modified: trunk/reactos/include/ntos/ps.h
Modified: trunk/reactos/subsys/win32k/main/dllmain.c

Modified: trunk/reactos/include/ddk/psfuncs.h
--- trunk/reactos/include/ddk/psfuncs.h	2005-06-18 16:21:46 UTC (rev 16048)
+++ trunk/reactos/include/ddk/psfuncs.h	2005-06-18 16:53:34 UTC (rev 16049)
@@ -45,14 +45,6 @@
 NTSTATUS STDCALL
 PsTerminateSystemThread (NTSTATUS ExitStatus);
 
-NTSTATUS STDCALL
-PsCreateSystemProcess (PHANDLE ProcessHandle,
-		       ACCESS_MASK DesiredAccess,
-		       POBJECT_ATTRIBUTES ObjectAttributes);
-
-NTSTATUS STDCALL PsCreateWin32Process(struct _EPROCESS* Process);
-NTSTATUS STDCALL PsCreateWin32Thread(struct _ETHREAD* Thread);
-
 VOID
 STDCALL PsChargePoolQuota(
     IN PEPROCESS Process,
@@ -61,18 +53,6 @@
     );
 
 NTSTATUS
-STDCALL PsChargeProcessNonPagedPoolQuota (
-   	IN PEPROCESS Process,
-    IN ULONG_PTR Amount
-	);
-
-NTSTATUS
-STDCALL PsChargeProcessPagedPoolQuota (
-   	IN PEPROCESS Process,
-    IN ULONG_PTR Amount
-	);
-
-NTSTATUS
 STDCALL PsChargeProcessPoolQuota(
     IN PEPROCESS Process,
     IN POOL_TYPE PoolType,
@@ -95,174 +75,11 @@
     IN PSE_IMPERSONATION_STATE ImpersonationState
     );
 
-ULONG
-STDCALL PsGetCurrentProcessSessionId (
-    VOID
-	);
-
-KPROCESSOR_MODE
-STDCALL PsGetCurrentThreadPreviousMode (
-    VOID
-	);
-
-
-PVOID
-STDCALL PsGetCurrentThreadStackBase (
-    VOID
-	);
-
-PVOID
-STDCALL PsGetCurrentThreadStackLimit (
-    VOID
-	);
-
-PVOID
-STDCALL PsGetJobLock(
-    PEJOB	Job
-	);
-
-PVOID
-STDCALL PsGetJobSessionId(
-    PEJOB	Job
-	);
-
-ULONG
-STDCALL PsGetJobUIRestrictionsClass(
-   	PEJOB	Job
-	);
-
-LONGLONG
-STDCALL PsGetProcessCreateTimeQuadPart(
-    PEPROCESS	Process
-	);
-
-PVOID
-STDCALL PsGetProcessDebugPort(
-    PEPROCESS	Process
-	);
-
-
-BOOLEAN
-STDCALL PsGetProcessExitProcessCalled(
-    PEPROCESS	Process
-	);
-
-NTSTATUS
-STDCALL PsGetProcessExitStatus(
-	PEPROCESS Process
-	);
-
-HANDLE
-STDCALL PsGetProcessId(
-   	PEPROCESS	Process
-	);
-
-LPSTR
-STDCALL PsGetProcessImageFileName(
-    PEPROCESS	Process
-	);
-
-HANDLE
-STDCALL PsGetProcessInheritedFromUniqueProcessId(
-    	PEPROCESS	Process
-	);
-
-PEJOB
-STDCALL PsGetProcessJob(
-	PEPROCESS Process
-	);
-
-PPEB
-STDCALL PsGetProcessPeb(
-    PEPROCESS	Process
-	);
-
-ULONG
-STDCALL PsGetProcessPriorityClass(
-    PEPROCESS	Process
-	);
-
-PVOID
-STDCALL PsGetProcessSectionBaseAddress(
-    PEPROCESS	Process
-	);
-
-PVOID
-STDCALL PsGetProcessSecurityPort(
-	PEPROCESS Process
-	);
-
-HANDLE
-STDCALL PsGetProcessSessionId(
-    PEPROCESS	Process
-	);
-
-PVOID
-STDCALL PsGetProcessWin32Process(
-	PEPROCESS Process
-	);
-
-PVOID
-STDCALL PsGetProcessWin32WindowStation(
-    PEPROCESS	Process
-	);
-
-ULONG
-STDCALL PsGetThreadFreezeCount(
-	struct _ETHREAD* Thread
-	);
-
-BOOLEAN
-STDCALL PsGetThreadHardErrorsAreDisabled(
-    struct _ETHREAD*	Thread
-	);
-
-HANDLE
-STDCALL PsGetThreadId(
-    struct _ETHREAD*	Thread
-	);
-
-PEPROCESS
-STDCALL PsGetThreadProcess(
-    struct _ETHREAD*	Thread
-	);
-
-HANDLE
-STDCALL PsGetThreadProcessId(
-    struct _ETHREAD*	Thread
-	);
-
-HANDLE
-STDCALL PsGetThreadSessionId(
-    struct _ETHREAD*	Thread
-	);
-
-PTEB
-STDCALL PsGetThreadTeb(
-    struct _ETHREAD*	Thread
-	);
-
-PVOID
-STDCALL PsGetThreadWin32Thread(
-    struct _ETHREAD*	Thread
-	);
-
-BOOLEAN
-STDCALL PsIsProcessBeingDebugged(
-    PEPROCESS	Process
-	);
-
-                         
 BOOLEAN                             
 STDCALL PsIsSystemThread(                   
     struct _ETHREAD* Thread                 
      );
 
-BOOLEAN
-STDCALL PsIsThreadImpersonating(
-    struct _ETHREAD*	Thread
-	);
-
 NTSTATUS
 STDCALL PsRemoveCreateThreadNotifyRoutine (
     IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine
@@ -286,86 +103,11 @@
     IN ULONG_PTR Amount
     );
 
-VOID
-STDCALL PsReturnProcessNonPagedPoolQuota(
-    IN PEPROCESS Process,
-    IN ULONG_PTR Amount
-    );
-
-VOID
-STDCALL PsReturnProcessPagedPoolQuota(
-    IN PEPROCESS Process,
-    IN ULONG_PTR Amount
-    );
-
 VOID 
 STDCALL PsRevertToSelf(
 	VOID
 	); 
 
-VOID
-STDCALL
-PsRevertThreadToSelf(
-	IN struct _ETHREAD* Thread
-	);
-
-VOID
-STDCALL PsSetJobUIRestrictionsClass(
-    PEJOB	Job,
-    ULONG	UIRestrictionsClass	
-	);
-
-ULONG 
-STDCALL PsSetLegoNotifyRoutine(   	
-	PVOID LegoNotifyRoutine  	 
-	);
-
-VOID
-STDCALL PsSetProcessPriorityClass(
-    PEPROCESS	Process,
-    ULONG	PriorityClass	
-	);
-
-VOID
-STDCALL PsSetProcessSecurityPort(
-    PEPROCESS	Process,
-    PVOID	SecurityPort	
-	);
-
-VOID
-STDCALL PsSetProcessWin32Process(
-    PEPROCESS	Process,
-    PVOID	Win32Process
-	);
-
-VOID
-STDCALL PsSetProcessWin32WindowStation(
-    PEPROCESS	Process,
-    PVOID	WindowStation
-	);
-
-VOID
-STDCALL PsSetThreadHardErrorsAreDisabled(
-    struct _ETHREAD*	Thread,
-    BOOLEAN	HardErrorsAreDisabled
-	);
-
-VOID
-STDCALL PsSetThreadWin32Thread(
-    struct _ETHREAD*	Thread,
-    PVOID	Win32Thread
-	);
-
-struct _W32_OBJECT_CALLBACK;
-
-VOID STDCALL
-STDCALL PsEstablishWin32Callouts (PW32_PROCESS_CALLBACK W32ProcessCallback,
-			  PW32_THREAD_CALLBACK W32ThreadCallback,
-			  struct _W32_OBJECT_CALLBACK *W32ObjectCallback,
-			  PVOID Param4,
-			  ULONG W32ThreadSize,
-			  ULONG W32ProcessSize);
-
 #define PsGetCurrentProcess() IoGetCurrentProcess()
 #define PsGetCurrentThread() ((struct _ETHREAD*) (KeGetCurrentThread()))
 
@@ -385,9 +127,6 @@
 		     IN BOOLEAN EffectiveOnly,
 		     IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
 
-VOID STDCALL
-PsRevertToSelf (VOID);
-
 BOOLEAN STDCALL PsGetVersion (PULONG		MajorVersion	OPTIONAL,
 			      PULONG		MinorVersion	OPTIONAL,
 			      PULONG		BuildNumber	OPTIONAL,
@@ -396,18 +135,6 @@
 LARGE_INTEGER STDCALL PsGetProcessExitTime(VOID);
 BOOLEAN STDCALL PsIsThreadTerminating(struct _ETHREAD* Thread);
 
-NTSTATUS STDCALL PsLookupProcessByProcessId(IN HANDLE ProcessId,
-					    OUT PEPROCESS *Process);
-
-NTSTATUS STDCALL PsLookupProcessThreadByCid(IN PCLIENT_ID Cid,
-					    OUT PEPROCESS *Process OPTIONAL,
-					    OUT struct _ETHREAD **Thread);
-					 /* OUT PETHREAD *Thread); */
-
-NTSTATUS STDCALL PsLookupThreadByThreadId(IN HANDLE ThreadId,
-					  OUT struct _ETHREAD **Thread);
-					/* OUT PETHREAD *Thread); */
-
 NTSTATUS STDCALL
 PsSetCreateProcessNotifyRoutine(IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine,
 				IN BOOLEAN Remove);

Modified: trunk/reactos/include/ddk/pstypes.h
--- trunk/reactos/include/ddk/pstypes.h	2005-06-18 16:21:46 UTC (rev 16048)
+++ trunk/reactos/include/ddk/pstypes.h	2005-06-18 16:53:34 UTC (rev 16049)
@@ -22,7 +22,6 @@
 struct _KTHREAD;
 struct _EJOB;
 
-typedef struct _EJOB *PEJOB;
 typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
 
 typedef struct _IMAGE_INFO {
@@ -59,14 +58,6 @@
                               HANDLE ProcessId,
                               PIMAGE_INFO ImageInfo);
 
-typedef NTSTATUS STDCALL_FUNC
-(*PW32_PROCESS_CALLBACK)(struct _EPROCESS *Process,
-			 BOOLEAN Create);
-
-typedef NTSTATUS STDCALL_FUNC
-(*PW32_THREAD_CALLBACK)(struct _ETHREAD *Thread,
-			BOOLEAN Create);
-                        
 typedef struct _STACK_INFORMATION
 {
   PVOID BaseAddress;

Modified: trunk/reactos/include/ntos/ps.h
--- trunk/reactos/include/ntos/ps.h	2005-06-18 16:21:46 UTC (rev 16048)
+++ trunk/reactos/include/ntos/ps.h	2005-06-18 16:53:34 UTC (rev 16049)
@@ -13,6 +13,8 @@
 #ifndef __INCLUDE_PS_H
 #define __INCLUDE_PS_H
 
+#include <napi/teb.h>
+
 #define THREAD_READ			(0x020048L)
 #define THREAD_WRITE			(0x020037L)
 #define THREAD_EXECUTE			(0x120000L)
@@ -42,12 +44,14 @@
 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES	(16)
 #define JOB_OBJECT_ALL_ACCESS	(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
 
+/* Thread access rights */
+#define THREAD_ALERT (0x0004L)
+
 #ifndef __USE_W32API
 
 /* Thread access rights */
 #define THREAD_TERMINATE		(0x0001L)
 #define THREAD_SUSPEND_RESUME		(0x0002L)
-#define THREAD_ALERT (0x0004L)
 #define THREAD_GET_CONTEXT		(0x0008L)
 #define THREAD_SET_CONTEXT		(0x0010L)
 #define THREAD_SET_INFORMATION		(0x0020L)
@@ -103,6 +107,8 @@
 
 #endif /* !__USE_W32API */
 
+#ifdef NTOS_MODE_KERNEL
+
 #ifdef __NTOSKRNL__
 #ifdef __GNUC__
 extern struct _EPROCESS* EXPORTED PsInitialSystemProcess;
@@ -122,4 +128,334 @@
 #endif
 #endif
 
+typedef NTSTATUS
+(STDCALL *PW32_PROCESS_CALLBACK)(struct _EPROCESS *Process,
+			         BOOLEAN Create);
+
+typedef NTSTATUS
+(STDCALL *PW32_THREAD_CALLBACK)(struct _ETHREAD *Thread,
+			        BOOLEAN Create);
+
+typedef struct _EJOB *PEJOB;
+
+NTSTATUS STDCALL
+PsCreateSystemProcess (PHANDLE ProcessHandle,
+		       ACCESS_MASK DesiredAccess,
+		       POBJECT_ATTRIBUTES ObjectAttributes);
+
+
+NTSTATUS STDCALL PsCreateWin32Process(struct _EPROCESS* Process);
+
+NTSTATUS STDCALL PsCreateWin32Thread(struct _ETHREAD* Thread);
+
+
+NTSTATUS
+STDCALL PsChargeProcessNonPagedPoolQuota (
+   	IN PEPROCESS Process,
+    IN ULONG_PTR Amount
+	);
+
+
+NTSTATUS
+STDCALL PsChargeProcessPagedPoolQuota (
+   	IN PEPROCESS Process,
+    IN ULONG_PTR Amount
+	);
+
+
+ULONG
+STDCALL PsGetCurrentProcessSessionId (
+    VOID
+	);
+
+
+KPROCESSOR_MODE
+STDCALL PsGetCurrentThreadPreviousMode (
+    VOID
+	);
+
+
+PVOID
+STDCALL PsGetCurrentThreadStackBase (
+    VOID
+	);
+
+
+PVOID
+STDCALL PsGetCurrentThreadStackLimit (
+    VOID
+	);
+
+
+PVOID
+STDCALL PsGetJobLock(
+    PEJOB	Job
+	);
+
+
+PVOID
+STDCALL PsGetJobSessionId(
+    PEJOB	Job
+	);
+
+
+ULONG
+STDCALL PsGetJobUIRestrictionsClass(
+   	PEJOB	Job
+	);
+
+
+LONGLONG
+STDCALL PsGetProcessCreateTimeQuadPart(
+    PEPROCESS	Process
+	);
+
+
+PVOID
+STDCALL PsGetProcessDebugPort(
+    PEPROCESS	Process
+	);
+
+
+BOOLEAN
+STDCALL PsGetProcessExitProcessCalled(
+    PEPROCESS	Process
+	);
+
+
+NTSTATUS
+STDCALL PsGetProcessExitStatus(
+	PEPROCESS Process
+	);
+
+
+HANDLE
+STDCALL PsGetProcessId(
+   	PEPROCESS	Process
+	);
+
+
+LPSTR
+STDCALL PsGetProcessImageFileName(
+    PEPROCESS	Process
+	);
+
+
+HANDLE
+STDCALL PsGetProcessInheritedFromUniqueProcessId(
+    	PEPROCESS	Process
+	);
+
+
+PEJOB
+STDCALL PsGetProcessJob(
+	PEPROCESS Process
+	);
+
+
+PPEB
+STDCALL PsGetProcessPeb(
+    PEPROCESS	Process
+	);
+
+
+ULONG
+STDCALL PsGetProcessPriorityClass(
+    PEPROCESS	Process
+	);
+
+
+PVOID
+STDCALL PsGetProcessSectionBaseAddress(
+    PEPROCESS	Process
+	);
+
+
+PVOID
+STDCALL PsGetProcessSecurityPort(
+	PEPROCESS Process
+	);
+
+
+HANDLE
+STDCALL PsGetProcessSessionId(
+    PEPROCESS	Process
+	);
+
+
+PVOID
+STDCALL PsGetProcessWin32Process(
+	PEPROCESS Process
+	);
+
+
+PVOID
+STDCALL PsGetProcessWin32WindowStation(
+    PEPROCESS	Process
+	);
+
+
+ULONG
+STDCALL PsGetThreadFreezeCount(
+	struct _ETHREAD* Thread
+	);
+
+
+BOOLEAN
+STDCALL PsGetThreadHardErrorsAreDisabled(
+    struct _ETHREAD*	Thread
+	);
+
+
+HANDLE
+STDCALL PsGetThreadId(
+    struct _ETHREAD*	Thread
+	);
+
+
+PEPROCESS
+STDCALL PsGetThreadProcess(
+    struct _ETHREAD*	Thread
+	);
+
+
+HANDLE
+STDCALL PsGetThreadProcessId(
+    struct _ETHREAD*	Thread
+	);
+
+
+HANDLE
+STDCALL PsGetThreadSessionId(
+    struct _ETHREAD*	Thread
+	);
+
+
+PTEB
+STDCALL PsGetThreadTeb(
+    struct _ETHREAD*	Thread
+	);
+
+
+PVOID
+STDCALL PsGetThreadWin32Thread(
+    struct _ETHREAD*	Thread
+	);
+
+
+BOOLEAN
+STDCALL PsIsProcessBeingDebugged(
+    PEPROCESS	Process
+	);
+
+
+BOOLEAN
+STDCALL PsIsThreadImpersonating(
+    struct _ETHREAD*	Thread
+	);
+
+
+VOID
+STDCALL PsReturnProcessNonPagedPoolQuota(
+    IN PEPROCESS Process,
+    IN ULONG_PTR Amount
+    );
+
+
+VOID
+STDCALL PsReturnProcessPagedPoolQuota(
+    IN PEPROCESS Process,
+    IN ULONG_PTR Amount
+    );
+
+
+VOID
+STDCALL
+PsRevertThreadToSelf(
+	IN struct _ETHREAD* Thread
+	);
+
+
+VOID
+STDCALL PsSetJobUIRestrictionsClass(
+    PEJOB	Job,
+    ULONG	UIRestrictionsClass	
+	);
+
+
+ULONG 
+STDCALL PsSetLegoNotifyRoutine(
+	PVOID LegoNotifyRoutine  	 
+	);
+
+
+VOID
+STDCALL PsSetProcessPriorityClass(
+    PEPROCESS	Process,
+    ULONG	PriorityClass	
+	);
+
+
+VOID
+STDCALL PsSetProcessSecurityPort(
+    PEPROCESS	Process,
+    PVOID	SecurityPort	
+	);
+
+
+VOID
+STDCALL PsSetProcessWin32Process(
+    PEPROCESS	Process,
+    PVOID	Win32Process
+	);
+
+
+VOID
+STDCALL PsSetProcessWin32WindowStation(
+    PEPROCESS	Process,
+    PVOID	WindowStation
+	);
+
+
+VOID
+STDCALL PsSetThreadHardErrorsAreDisabled(
+    struct _ETHREAD*	Thread,
+    BOOLEAN	HardErrorsAreDisabled
+	);
+
+
+VOID
+STDCALL PsSetThreadWin32Thread(
+    struct _ETHREAD*	Thread,
+    PVOID	Win32Thread
+	);
+
+
+struct _W32_OBJECT_CALLBACK;
+
+
+VOID STDCALL
+STDCALL PsEstablishWin32Callouts (PW32_PROCESS_CALLBACK W32ProcessCallback,
+			  PW32_THREAD_CALLBACK W32ThreadCallback,
+			  struct _W32_OBJECT_CALLBACK *W32ObjectCallback,
+			  PVOID Param4,
+			  ULONG W32ThreadSize,
+			  ULONG W32ProcessSize);
+
+
+NTSTATUS STDCALL PsLookupProcessByProcessId(IN HANDLE ProcessId,
+					    OUT PEPROCESS *Process);
+
+
+NTSTATUS STDCALL PsLookupProcessThreadByCid(IN PCLIENT_ID Cid,
+					    OUT PEPROCESS *Process OPTIONAL,
+					    OUT struct _ETHREAD **Thread);
+					 /* OUT PETHREAD *Thread); */
+
+NTSTATUS STDCALL PsLookupThreadByThreadId(IN HANDLE ThreadId,
+					  OUT struct _ETHREAD **Thread);
+					/* OUT PETHREAD *Thread); */
+
+#endif /* NTOS_MODE_KERNEL */
+
 #endif /* __INCLUDE_PS_H */

Modified: trunk/reactos/subsys/win32k/main/dllmain.c
--- trunk/reactos/subsys/win32k/main/dllmain.c	2005-06-18 16:21:46 UTC (rev 16048)
+++ trunk/reactos/subsys/win32k/main/dllmain.c	2005-06-18 16:53:34 UTC (rev 16049)
@@ -26,25 +26,6 @@
 #include <win32k/debug1.h>
 #include <debug.h>
 
-#ifdef __USE_W32API
-typedef NTSTATUS (STDCALL *PW32_PROCESS_CALLBACK)(
-   struct _EPROCESS *Process,
-   BOOLEAN Create);
-
-typedef NTSTATUS (STDCALL *PW32_THREAD_CALLBACK)(
-   struct _ETHREAD *Thread,
-   BOOLEAN Create);
-
-VOID STDCALL
-PsEstablishWin32Callouts(
-   PW32_PROCESS_CALLBACK W32ProcessCallback,
-   PW32_THREAD_CALLBACK W32ThreadCallback,
-   PW32_OBJECT_CALLBACK W32ObjectCallback,
-   PVOID Param4,
-   ULONG W32ThreadSize,
-   ULONG W32ProcessSize);
-#endif
-
 BOOL INTERNAL_CALL GDI_CleanupForProcess (struct _EPROCESS *Process);
 
 extern SSDT Win32kSSDT[];