Author: tkreuzer
Date: Sat Feb 4 21:16:52 2012
New Revision: 55418
URL:
http://svn.reactos.org/svn/reactos?rev=55418&view=rev
Log:
[NDK]
Fix amd64 definitions of SYNCH_LEVEL, DISPATCH_LENGTH, KINTERRUPT, KTHREAD, KPROCESS,
EPROCESS
- add MM_SHARED_USER_DATA_VA
- Add PsGetProcessSessionId prototype
- Remove duplicated RtlWow64Get/SetThreadContext prototypes
Modified:
trunk/reactos/include/ddk/wdm.h
trunk/reactos/include/ndk/amd64/ketypes.h
trunk/reactos/include/ndk/amd64/mmtypes.h
trunk/reactos/include/ndk/ketypes.h
trunk/reactos/include/ndk/psfuncs.h
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/include/xdk/generate.bat
Modified: trunk/reactos/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=5541…
==============================================================================
--- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -1033,7 +1033,11 @@
struct _KWAIT_BLOCK *NextWaitBlock;
USHORT WaitKey;
UCHAR WaitType;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
volatile UCHAR BlockState;
+#else
+ UCHAR SpareByte;
+#endif
#if defined(_WIN64)
LONG SpareLong;
#endif
@@ -1875,7 +1879,7 @@
VOID
KeLowerIrql(IN KIRQL NewIrql)
{
- //ASSERT(KeGetCurrentIrql() >= NewIrql);
+ ASSERT((KIRQL)__readcr8() >= NewIrql);
__writecr8(NewIrql);
}
@@ -1886,7 +1890,7 @@
KIRQL OldIrql;
OldIrql = (KIRQL)__readcr8();
- //ASSERT(OldIrql <= NewIrql);
+ ASSERT(OldIrql <= NewIrql);
__writecr8(NewIrql);
return OldIrql;
}
Modified: trunk/reactos/include/ndk/amd64/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/ketypes.…
==============================================================================
--- trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -184,11 +184,7 @@
//
// Synchronization-level IRQL
//
-#ifndef CONFIG_SMP
-#define SYNCH_LEVEL DISPATCH_LEVEL
-#else
-#define SYNCH_LEVEL (IPI_LEVEL - 2)
-#endif
+#define SYNCH_LEVEL 12
#define NMI_STACK_SIZE 0x2000
Modified: trunk/reactos/include/ndk/amd64/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/mmtypes.…
==============================================================================
--- trunk/reactos/include/ndk/amd64/mmtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/amd64/mmtypes.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -32,6 +32,11 @@
#define PAGE_SHIFT 12L
#define MM_ALLOCATION_GRANULARITY 0x10000
#define MM_ALLOCATION_GRANULARITY_SHIFT 16L
+
+//
+// Address of the shared user page
+//
+#define MM_SHARED_USER_DATA_VA 0x7FFE0000ULL
//
// Sanity checks for Paging Macros
Modified: trunk/reactos/include/ndk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/ketypes.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -112,7 +112,9 @@
//
// Number of dispatch codes supported by KINTERRUPT
//
-#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+#ifdef _M_AMD64
+#define DISPATCH_LENGTH 4
+#elif (NTDDI_VERSION >= NTDDI_LONGHORN)
#define DISPATCH_LENGTH 135
#else
#define DISPATCH_LENGTH 106
@@ -648,6 +650,10 @@
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
ULONGLONG Rsvd1;
#endif
+#ifdef _M_AMD64
+ PKTRAP_FRAME TrapFrame;
+ PVOID Reserved;
+#endif
ULONG DispatchCode[DISPATCH_LENGTH];
} KINTERRUPT;
@@ -690,7 +696,7 @@
LIST_ENTRY MutantListHead;
#endif
PVOID InitialStack;
- ULONG_PTR StackLimit;
+ ULONG_PTR StackLimit; // FIXME: PVOID
PVOID KernelStack;
KSPIN_LOCK ThreadLock;
union
@@ -698,7 +704,11 @@
KAPC_STATE ApcState;
struct
{
+#ifdef _M_AMD64
+ UCHAR ApcStateFill[43]; // 23 / 43
+#else
UCHAR ApcStateFill[23];
+#endif
UCHAR ApcQueueable;
volatile UCHAR NextProcessor;
volatile UCHAR DeferredProcessor;
@@ -707,11 +717,13 @@
};
};
KSPIN_LOCK ApcQueueLock;
+#ifndef _M_AMD64
ULONG ContextSwitches;
volatile UCHAR State;
UCHAR NpxState;
KIRQL WaitIrql;
KPROCESSOR_MODE WaitMode;
+#endif
LONG_PTR WaitStatus;
union
{
@@ -749,6 +761,7 @@
SINGLE_LIST_ENTRY SwapListEntry;
};
PKQUEUE Queue;
+#ifndef _M_AMD64
ULONG WaitTime;
union
{
@@ -759,13 +772,14 @@
};
ULONG CombinedApcDisable;
};
+#endif
struct _TEB *Teb;
union
{
KTIMER Timer;
struct
{
- UCHAR TimerFill[40];
+ UCHAR TimerFill[FIELD_OFFSET(KTIMER, Period) + sizeof(LONG)]; // 40 / 60
union
{
struct
@@ -790,7 +804,7 @@
KWAIT_BLOCK WaitBlock[THREAD_WAIT_OBJECTS + 1];
struct
{
- UCHAR WaitBlockFill0[23];
+ UCHAR WaitBlockFill0[FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 32bit = 23,
64bit = 43
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
UCHAR IdealProcessor;
#else
@@ -799,19 +813,52 @@
};
struct
{
- UCHAR WaitBlockFill1[47];
+ UCHAR WaitBlockFill1[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK,
SpareByte)]; // 47 / 91
CCHAR PreviousMode;
};
struct
{
- UCHAR WaitBlockFill2[71];
+ UCHAR WaitBlockFill2[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK,
SpareByte)]; // 71 / 139
UCHAR ResourceIndex;
};
struct
{
- UCHAR WaitBlockFill3[95];
+ UCHAR WaitBlockFill3[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK,
SpareByte)]; // 95 / 187
UCHAR LargeStack;
};
+#ifdef _M_AMD64
+ struct
+ {
+ UCHAR WaitBlockFill4[FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
+ ULONG ContextSwitches;
+ };
+ struct
+ {
+ UCHAR WaitBlockFill5[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK,
SpareLong)];
+ UCHAR State;
+ UCHAR NpxState;
+ UCHAR WaitIrql;
+ CHAR WaitMode;
+ };
+ struct
+ {
+ UCHAR WaitBlockFill6[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK,
SpareLong)];
+ ULONG WaitTime;
+ };
+ struct
+ {
+ UCHAR WaitBlockFill7[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK,
SpareLong)];
+ union
+ {
+ struct
+ {
+ SHORT KernelApcDisable;
+ SHORT SpecialApcDisable;
+ };
+ ULONG CombinedApcDisable;
+ };
+ };
+#endif
};
LIST_ENTRY QueueListEntry;
PKTRAP_FRAME TrapFrame;
@@ -820,6 +867,9 @@
#endif
PVOID CallbackStack;
PVOID ServiceTable;
+#ifdef _M_AMD64
+ ULONG KernelLimit;
+#endif
UCHAR ApcStateIndex;
#if (NTDDI_VERSION < NTDDI_LONGHORN)
UCHAR IdealProcessor;
@@ -829,6 +879,10 @@
BOOLEAN CalloutActive;
#else
BOOLEAN ProcessReadyQueue;
+#ifdef _M_AMD64
+ PVOID Win32kTable;
+ ULONG Win32kLimit;
+#endif
BOOLEAN KernelStackResident;
#endif
SCHAR BasePriority;
@@ -847,7 +901,7 @@
KAPC_STATE SavedApcState;
struct
{
- UCHAR SavedApcStateFill[23];
+ UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1]; // 23
/ 43
CCHAR FreezeCount;
CCHAR SuspendCount;
UCHAR UserIdealProcessor;
@@ -890,7 +944,7 @@
};
struct
{
- UCHAR SuspendApcFill3[36];
+ UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)];
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
PKPRCB WaitPrcb;
#else
@@ -899,12 +953,12 @@
};
struct
{
- UCHAR SuspendApcFill4[40];
+ UCHAR SuspendApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]; // 40 / 72
PVOID LegoData;
};
struct
{
- UCHAR SuspendApcFill5[47];
+ UCHAR SuspendApcFill5[FIELD_OFFSET(KAPC, Inserted) + 1]; // 47 / 83
UCHAR PowerState;
ULONG UserTime;
};
@@ -914,7 +968,7 @@
KSEMAPHORE SuspendSemaphore;
struct
{
- UCHAR SuspendSemaphorefill[20];
+ UCHAR SuspendSemaphorefill[FIELD_OFFSET(KSEMAPHORE, Limit) + 4]; // 20 / 28
ULONG SListFaultCount;
};
};
@@ -925,6 +979,14 @@
PVOID SListFaultAddress;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
PVOID MdlForLockedteb;
+#endif
+#ifdef _M_AMD64
+ LONG64 ReadOperationCount;
+ LONG64 WriteOperationCount;
+ LONG64 OtherOperationCount;
+ LONG64 ReadTransferCount;
+ LONG64 WriteTransferCount;
+ LONG64 OtherTransferCount;
#endif
} KTHREAD;
@@ -947,7 +1009,9 @@
#if defined(_M_IX86)
KGDTENTRY LdtDescriptor;
KIDTENTRY Int21Descriptor;
+#endif
USHORT IopmOffset;
+#if defined(_M_IX86)
UCHAR Iopl;
UCHAR Unused;
#endif
Modified: trunk/reactos/include/ndk/psfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -192,9 +192,15 @@
PEPROCESS Process
);
-NTKERNELAPI
-BOOLEAN
-NTAPI
+HANDLE
+NTAPI
+PsGetProcessSessionId(
+ IN PEPROCESS Process
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
PsGetProcessExitProcessCalled(
PEPROCESS Process
);
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -1056,11 +1056,11 @@
EX_RUNDOWN_REF RundownProtect;
HANDLE UniqueProcessId;
LIST_ENTRY ActiveProcessLinks;
- ULONG QuotaUsage[3]; /* 0=PagedPool, 1=NonPagedPool, 2=Pagefile */
- ULONG QuotaPeak[3]; /* ditto */
- ULONG CommitCharge;
- ULONG PeakVirtualSize;
- ULONG VirtualSize;
+ SIZE_T QuotaUsage[3]; /* 0=PagedPool, 1=NonPagedPool, 2=Pagefile */
+ SIZE_T QuotaPeak[3]; /* ditto */
+ SIZE_T CommitCharge;
+ SIZE_T PeakVirtualSize;
+ SIZE_T VirtualSize;
LIST_ENTRY SessionProcessLinks;
PVOID DebugPort;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
@@ -1075,7 +1075,7 @@
#endif
PHANDLE_TABLE ObjectTable;
EX_FAST_REF Token;
- ULONG WorkingSetPage;
+ PFN_NUMBER WorkingSetPage;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
EX_PUSH_LOCK AddressCreationLock;
PETHREAD RotateInProgress;
@@ -1084,11 +1084,11 @@
KSPIN_LOCK HyperSpaceLock;
#endif
PETHREAD ForkInProgress;
- ULONG HardwareTrigger;
+ ULONG_PTR HardwareTrigger;
PMM_AVL_TABLE PhysicalVadRoot;
PVOID CloneRoot;
- ULONG NumberOfPrivatePages;
- ULONG NumberOfLockedPages;
+ PFN_NUMBER NumberOfPrivatePages;
+ PFN_NUMBER NumberOfLockedPages;
PVOID *Win32Process;
struct _EJOB *Job;
PVOID SectionObject;
@@ -1112,7 +1112,7 @@
HARDWARE_PTE PageDirectoryPte;
ULONGLONG Filler;
};
- ULONG Session;
+ ULONG Session; // FIXME: PVOID
CHAR ImageFileName[16];
LIST_ENTRY JobLinks;
PVOID LockedPagesList;
@@ -1135,12 +1135,16 @@
LARGE_INTEGER ReadTransferCount;
LARGE_INTEGER WriteTransferCount;
LARGE_INTEGER OtherTransferCount;
- ULONG CommitChargeLimit;
- ULONG CommitChargePeak;
+ SIZE_T CommitChargeLimit;
+ SIZE_T CommitChargePeak;
PVOID AweInfo;
SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo;
MMSUPPORT Vm;
+#ifdef _M_AMD64
+ ULONG Spares[2];
+#else
LIST_ENTRY MmProcessLinks;
+#endif
ULONG ModifiedPageCount;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
union
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -2089,25 +2089,6 @@
PCANSI_STRING String2,
BOOLEAN CaseInsensitive
);
-
-#ifdef _M_X64
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlWow64GetThreadContext(
- IN HANDLE ThreadHandle,
- IN OUT PWOW64_CONTEXT ThreadContext
-);
-
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlWow64SetThreadContext(
- IN HANDLE ThreadHandle,
- IN PWOW64_CONTEXT ThreadContext
-);
-#endif
NTSYSAPI
BOOLEAN
@@ -3907,7 +3888,7 @@
RtlGUIDFromString(
IN PUNICODE_STRING GuidString,
OUT GUID *Guid);
-
+
NTSYSAPI
NTSTATUS
NTAPI
Modified: trunk/reactos/include/xdk/generate.bat
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/generate.bat?r…
==============================================================================
--- trunk/reactos/include/xdk/generate.bat [iso-8859-1] (original)
+++ trunk/reactos/include/xdk/generate.bat [iso-8859-1] Sat Feb 4 21:16:52 2012
@@ -1,6 +1,6 @@
-..\..\output-i386\tools\hpp\hpp.exe wdm.template.h wdm.h
-..\..\output-i386\tools\hpp\hpp.exe ntddk.template.h ntddk.h
-..\..\output-i386\tools\hpp\hpp.exe ntifs.template.h ntifs.h
-..\..\output-i386\tools\hpp\hpp.exe devioctl.template.h devioctl.h
+hpp.exe wdm.template.h wdm.h
+hpp.exe ntddk.template.h ntddk.h
+hpp.exe ntifs.template.h ntifs.h
+hpp.exe devioctl.template.h devioctl.h