branch update for HEAD-2003091401
[reactos.git] / ntoskrnl / include / internal / ps.h
index be7e94d..bc1ba01 100644 (file)
@@ -43,13 +43,17 @@ struct _KTRAPFRAME;
 #include <internal/mm.h>
 #include <napi/teb.h>
 
+#ifndef __USE_W32API
 #define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber)
+#endif
 
 extern HANDLE SystemProcessHandle;
 
 extern LCID PsDefaultThreadLocaleId;
 extern LCID PsDefaultSystemLocaleId;
 
+#ifndef __USE_W32API
+
 typedef struct _KAPC_STATE
 {
    LIST_ENTRY ApcListHead[2];
@@ -59,6 +63,8 @@ typedef struct _KAPC_STATE
    USHORT UserApcPending;
 } __attribute__((packed)) KAPC_STATE, *PKAPC_STATE;
 
+#endif /* __USE_W32API */
+
 typedef struct _KTHREAD
 {
    /* For waiting on thread exit */
@@ -103,7 +109,10 @@ typedef struct _KTHREAD
    LONG              KernelApcDisable;    /* D0 */
    KAFFINITY         UserAffinity;        /* D4 */
    UCHAR             SystemAffinityActive;/* D8 */
-   UCHAR             Pad[7];              /* D9 */
+   UCHAR             PowerState;          /* D9 */
+   UCHAR             NpxIrql;             /* DA */
+   UCHAR             Pad;                 /* DB */
+   SSDT_ENTRY        *ServiceTable;       /* DC */
    PKQUEUE           Queue;               /* E0 */
    KSPIN_LOCK        ApcQueueLock;        /* E4 */
    KTIMER            Timer;               /* E8 */
@@ -143,7 +152,7 @@ typedef struct _KTHREAD
    
    /* Added by Phillip Susi for list of threads in a process */
    LIST_ENTRY        ProcessThreadListEntry;         /* 1B0 */
-} __attribute__((packed)) KTHREAD, *PKTHREAD;
+} __attribute__((packed)) KTHREAD;
 
 /* Top level irp definitions. */
 #define        FSRTL_FSP_TOP_LEVEL_IRP                 (0x01)
@@ -217,7 +226,13 @@ typedef struct _ETHREAD
 
   struct _W32THREAD* Win32Thread;
   
-} __attribute__((packed)) ETHREAD, *PETHREAD;
+} __attribute__((packed)) ETHREAD;
+
+#ifndef __USE_W32API
+
+typedef struct _ETHREAD *PETHREAD;
+
+#endif /* __USE_W32API */
 
 
 typedef struct _KPROCESS 
@@ -239,11 +254,11 @@ typedef struct _KPROCESS
    */
   ULONG                 LdtDescriptor[2];             /* 020 */
   /*
-   * Presumably for processing int 0x21 from V86 mode DOS, currently
-   * unused.
+   * Virtual Dos Machine flag.
    */
-  ULONG                 Int21Descriptor[2];           /* 028 */
-  /* Don't know. */
+  ULONG                 NtVdmFlag;                    /* 028 */
+  ULONG                 VdmUnused;                    /* 02C */
+  /* Is the i/o permission map enabled for the process. */
   USHORT                IopmOffset;                   /* 030 */
   /* 
    * Presumably I/O privilege level to be used for this process, currently
@@ -282,7 +297,13 @@ typedef struct _KPROCESS
   UCHAR                        ThreadSeed;                   /* 066 */
   /* Disable priority boosts? */
   UCHAR                        DisableBoost;                 /* 067 */
-} KPROCESS, *PKPROCESS;
+} KPROCESS;
+
+#ifndef __USE_W32API
+
+typedef struct _KPROCESS *PKPROCESS;
+
+#endif /* __USE_W32API */
 
 struct _EPROCESS
 {
@@ -294,8 +315,14 @@ struct _EPROCESS
   KEVENT                LockEvent;                    /* 06C */
   /* Unknown. */
   ULONG                 LockCount;                    /* 07C */
+
   /* Time of process creation. */
+#ifdef __USE_W32API
+  LARGE_INTEGER                  CreateTime;                   /* 080 */
+#else
   TIME                  CreateTime;                   /* 080 */
+#endif
+
   /* Time of process exit. */
   TIME                  ExitTime;                     /* 088 */
   /* Unknown. */
@@ -503,6 +530,19 @@ PsInitialiseSuspendImplementation(VOID);
 
 extern ULONG PiNrThreadsAwaitingReaping;
 
+
+NTSTATUS
+PsInitWin32Thread (PETHREAD Thread);
+
+VOID
+PsTerminateWin32Process (PEPROCESS Process);
+
+VOID
+PsTerminateWin32Thread (PETHREAD Thread);
+
+VOID
+PsInitialiseW32Call(VOID);
+
 #endif /* ASSEMBLER */
 
 #endif /* __INCLUDE_INTERNAL_PS_H */