Author: akhaldi
Date: Wed Mar 3 12:38:57 2010
New Revision: 45782
URL:
http://svn.reactos.org/svn/reactos?rev=45782&view=rev
Log:
- Move more stuff to wdm.h
- Add missing MM_ALLOCATE_* definitions
- Improve KeTryToAcquireSpinLockAtDpcLevel and KeTestSpinLock
- Fix a typo in BYTES_TO_PAGES definition
- Remove a useless #if block
- Add missing ntddk.h include in ntoskrnl.h
Modified:
branches/header-work/include/ddk/wdm.h
branches/header-work/include/ddk/winddk.h
branches/header-work/ntoskrnl/include/ntoskrnl.h
Modified: branches/header-work/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
==============================================================================
--- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 12:38:57 2010
@@ -978,6 +978,14 @@
#define SharedUserData ((KUSER_SHARED_DATA * CONST)
KI_USER_SHARED_DATA)
+#define EFLAG_SIGN 0x8000
+#define EFLAG_ZERO 0x4000
+#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO)
+
+#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
+#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) &
EFLAG_SELECT)
+#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
+
typedef enum _TRACE_INFORMATION_CLASS {
TraceIdClass,
TraceHandleClass,
@@ -1445,8 +1453,76 @@
#endif // _AMD64_
/******************************************************************************
+ * Kernel Functions *
+ ******************************************************************************/
+
+/* SPINLOCK FUNCTIONS */
+
+/* FIXME : #if (NTDDI_VERSION >= NTDDI_WS03SP1) */
+NTKERNELAPI
+BOOLEAN
+FASTCALL
+KeTryToAcquireSpinLockAtDpcLevel(
+ IN OUT PKSPIN_LOCK SpinLock
+);
+/* #endif (NTDDI_VERSION >= NTDDI_WS03SP1) */
+
+#if (NTDDI_VERSION >= NTDDI_WS03)
+NTKERNELAPI
+BOOLEAN
+FASTCALL
+KeTestSpinLock(
+ IN PKSPIN_LOCK SpinLock
+);
+#endif
+
+/*
+** Utillity functions
+*/
+
+/*
+ * ULONG
+ * BYTE_OFFSET(
+ * IN PVOID Va)
+ */
+#define BYTE_OFFSET(Va) \
+ ((ULONG) ((ULONG_PTR) (Va) & (PAGE_SIZE - 1)))
+
+/*
+ * ULONG
+ * BYTES_TO_PAGES(
+ * IN ULONG Size)
+ */
+#define BYTES_TO_PAGES(Size) \
+ (((Size) >> PAGE_SHIFT) + (((Size) & (PAGE_SIZE - 1)) != 0))
+
+/*
+ * PVOID
+ * PAGE_ALIGN(
+ * IN PVOID Va)
+ */
+#define PAGE_ALIGN(Va) \
+ ((PVOID) ((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1)))
+
+/*
+ * ULONG_PTR
+ * ROUND_TO_PAGES(
+ * IN ULONG_PTR Size)
+ */
+#define ROUND_TO_PAGES(Size) \
+ (((ULONG_PTR) (Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
+
+
+/******************************************************************************
* Memory manager Types *
******************************************************************************/
+
+#define MM_DONT_ZERO_ALLOCATION 0x00000001
+#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002
+#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004
+#define MM_ALLOCATE_NO_WAIT 0x00000008
+#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010
+#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020
#define MDL_MAPPED_TO_SYSTEM_VA 0x0001
#define MDL_PAGES_LOCKED 0x0002
@@ -6864,10 +6940,6 @@
IN ULONG Count);
#endif // (NTDDI_VERSION >= NTDDI_WINXPSP2)
-#if (NTDDI_VERSION >= NTDDI_WS03)
-
-#endif // (NTDDI_VERSION >= NTDDI_WS03)
-
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
NTKERNELAPI
PEX_RUNDOWN_REF_CACHE_AWARE
Modified: branches/header-work/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
==============================================================================
--- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 12:38:57 2010
@@ -2052,18 +2052,6 @@
#error Unknown architecture
#endif
-#define MM_DONT_ZERO_ALLOCATION 0x00000001
-#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002
-
-
-#define EFLAG_SIGN 0x8000
-#define EFLAG_ZERO 0x4000
-#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO)
-
-#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
-#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) &
EFLAG_SELECT)
-#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
-
typedef enum _INTERLOCKED_RESULT {
ResultNegative = RESULT_NEGATIVE,
ResultZero = RESULT_ZERO,
@@ -2113,20 +2101,6 @@
/** SPINLOCK FUNCTIONS ********************************************************/
-
-NTKERNELAPI
-BOOLEAN
-FASTCALL
-KeTryToAcquireSpinLockAtDpcLevel(
- IN OUT PKSPIN_LOCK SpinLock
-);
-
-NTKERNELAPI
-BOOLEAN
-FASTCALL
-KeTestSpinLock(
- IN PKSPIN_LOCK SpinLock
-);
#if defined (_X86_)
@@ -2275,40 +2249,6 @@
#define ARGUMENT_PRESENT(ArgumentPointer) \
((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL)
-/*
- * ULONG
- * BYTE_OFFSET(
- * IN PVOID Va)
- */
-#define BYTE_OFFSET(Va) \
- ((ULONG) ((ULONG_PTR) (Va) & (PAGE_SIZE - 1)))
-
-/*
- * ULONG
- * BYTES_TO_PAGES(
- * IN ULONG Size)
- */
-#define BYTES_TO_PAGES(Size) \
- ((ULONG) ((ULONG_PTR) (Size) >> PAGE_SHIFT) + (((ULONG) (Size) & (PAGE_SIZE -
1)) != 0))
-
-/*
- * PVOID
- * PAGE_ALIGN(
- * IN PVOID Va)
- */
-#define PAGE_ALIGN(Va) \
- ((PVOID) ((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1)))
-
-/*
- * ULONG_PTR
- * ROUND_TO_PAGES(
- * IN ULONG_PTR Size)
- */
-#define ROUND_TO_PAGES(Size) \
- ((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
-
-
-
#if defined(_X86_) || defined(_AMD64_)
//
Modified: branches/header-work/ntoskrnl/include/ntoskrnl.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/include/nt…
==============================================================================
--- branches/header-work/ntoskrnl/include/ntoskrnl.h [iso-8859-1] (original)
+++ branches/header-work/ntoskrnl/include/ntoskrnl.h [iso-8859-1] Wed Mar 3 12:38:57
2010
@@ -24,6 +24,7 @@
#undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT
#include <ntifs.h>
+#include <ntddk.h>
#include <wdmguid.h>
#include <arc/arc.h>
#undef NTHALAPI