#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];
USHORT UserApcPending;
} __attribute__((packed)) KAPC_STATE, *PKAPC_STATE;
+#endif /* __USE_W32API */
+
typedef struct _KTHREAD
{
/* For waiting on thread exit */
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 */
/* 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)
struct _W32THREAD* Win32Thread;
-} __attribute__((packed)) ETHREAD, *PETHREAD;
+} __attribute__((packed)) ETHREAD;
+
+#ifndef __USE_W32API
+
+typedef struct _ETHREAD *PETHREAD;
+
+#endif /* __USE_W32API */
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
UCHAR ThreadSeed; /* 066 */
/* Disable priority boosts? */
UCHAR DisableBoost; /* 067 */
-} KPROCESS, *PKPROCESS;
+} KPROCESS;
+
+#ifndef __USE_W32API
+
+typedef struct _KPROCESS *PKPROCESS;
+
+#endif /* __USE_W32API */
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. */
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 */