Author: tkreuzer
Date: Sun Mar 14 01:22:25 2010
New Revision: 46197
URL:
http://svn.reactos.org/svn/reactos?rev=46197&view=rev
Log:
[NTIFS] fix NlsMbOemCodePageTag, NlsOemLeadByteInfo, FsRtlLegalAnsiCharacterArray
[XDK] Add IO_PRIORITY_HINT, fix NlsMbCodePageTag, NlsMbOemCodePageTag
- Update wdm.h based on xdk
Modified:
branches/header-work/include/ddk/ntifs.h
branches/header-work/include/ddk/wdm.h
branches/header-work/include/xdk/iotypes.h
branches/header-work/include/xdk/rtltypes.h
Modified: branches/header-work/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntifs.h…
==============================================================================
--- branches/header-work/include/ddk/ntifs.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/ntifs.h [iso-8859-1] Sun Mar 14 01:22:25 2010
@@ -7813,16 +7813,17 @@
(InterlockedDecrement((LONG volatile *)&((FL)->LockRequestsInProgress)));\
}
+extern NTKERNELAPI PUSHORT NlsOemLeadByteInfo;
+#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
+
#ifdef NLS_MB_CODE_PAGE_TAG
#undef NLS_MB_CODE_PAGE_TAG
#endif
-
+#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag
+
+/* GCC compatible definition, MS one is retarded */
+extern NTKERNELAPI const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
-#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag
-#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
-
-extern UCHAR const* const LEGAL_ANSI_CHARACTER_ARRAY;
-extern PUSHORT NLS_OEM_LEAD_BYTE_INFO;
#define FsRtlIsAnsiCharacterWild(C) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
@@ -8935,11 +8936,6 @@
#include "csq.h"
-#ifdef _NTOSKRNL_
-extern PUCHAR FsRtlLegalAnsiCharacterArray;
-#else
-extern DECLSPEC_IMPORT PUCHAR FsRtlLegalAnsiCharacterArray;
-#endif
extern PACL SePublicDefaultDacl;
extern PACL SeSystemDefaultDacl;
@@ -9674,8 +9670,6 @@
IN BOOLEAN LeadingBackslashPermissible
);
-extern PUSHORT NlsOemLeadByteInfo;
-
NTKERNELAPI
BOOLEAN
NTAPI
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] Sun Mar 14 01:22:25 2010
@@ -437,18 +437,11 @@
#endif /* _SLIST_HEADER_ */
-
-/* HACK HACK HACK - GCC (or perhaps LD) is messing this up */
-#if defined(_NTSYSTEM_) || defined(__GNUC__)
+/* MS definition is broken! */
+extern BOOLEAN NTSYSAPI NlsMbCodePageTag;
+extern BOOLEAN NTSYSAPI NlsMbOemCodePageTag;
#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
-#else
-#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag)
-#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
-#endif /* _NT_SYSTEM */
-extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
-extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
-
/******************************************************************************
* Kernel Types *
@@ -1156,7 +1149,6 @@
} XSAVE_FORMAT, *PXSAVE_FORMAT;
-
/******************************************************************************
* Memory manager Types *
******************************************************************************/
@@ -1476,6 +1468,7 @@
PWORKER_THREAD_ROUTINE WorkerRoutine;
volatile PVOID Parameter;
} WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM;
+
/******************************************************************************
@@ -2614,6 +2607,8 @@
PVOID ObjectContext;
PVOID Reserved;
} REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION;
+
+
/******************************************************************************
* I/O Manager Types *
@@ -5158,7 +5153,7 @@
#define MAXIMUM_PRIORITY 32
-#ifdef _X86_
+#if defined(_M_IX86)
/** Kernel definitions for x86 **/
/* Interrupt request levels */
@@ -5173,11 +5168,11 @@
#define IPI_LEVEL 29
#define POWER_LEVEL 30
#define HIGH_LEVEL 31
-#define CLOCK_LEVEL (CLOCK2_LEVEL)
+#define CLOCK_LEVEL CLOCK2_LEVEL
#define KIP0PCRADDRESS 0xffdff000
#define KI_USER_SHARED_DATA 0xffdf0000
-#define SharedUserData ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA)
+#define SharedUserData ((KUSER_SHARED_DATA * CONST)KI_USER_SHARED_DATA)
#define PAGE_SIZE 0x1000
#define PAGE_SHIFT 12L
@@ -5319,9 +5314,319 @@
}
#define KeQueryTickCount(CurrentCount) _KeQueryTickCount(CurrentCount)
-#endif /* _X86_ */
-
-
+
+
+#elif defined(_M_AMD64)
+/** Kernel definitions for AMD64 **/
+
+/* Interrupt request levels */
+#define PASSIVE_LEVEL 0
+#define LOW_LEVEL 0
+#define APC_LEVEL 1
+#define DISPATCH_LEVEL 2
+#define CMCI_LEVEL 5
+#define CLOCK_LEVEL 13
+#define IPI_LEVEL 14
+#define DRS_LEVEL 14
+#define POWER_LEVEL 14
+#define PROFILE_LEVEL 15
+#define HIGH_LEVEL 15
+
+#define PAGE_SIZE 0x1000
+#define PAGE_SHIFT 12L
+
+#define KI_USER_SHARED_DATA 0xFFFFF78000000000UI64
+#define SharedUserData ((PKUSER_SHARED_DATA const)KI_USER_SHARED_DATA)
+
+
+typedef struct _KFLOATING_SAVE {
+ ULONG Dummy;
+} KFLOATING_SAVE, *PKFLOATING_SAVE;
+
+typedef XSAVE_FORMAT XMM_SAVE_AREA32, *PXMM_SAVE_AREA32;
+
+#define KeQueryInterruptTime() \
+ (*(volatile ULONG64*)SharedInterruptTime)
+
+#define KeQuerySystemTime(CurrentCount) \
+ *(ULONG64*)(CurrentCount) = *(volatile ULONG64*)SharedSystemTime
+
+#define KeQueryTickCount(CurrentCount) \
+ *(ULONG64*)(CurrentCount) = *(volatile ULONG64*)SharedTickCount
+
+#define KeGetDcacheFillSize() 1L
+
+#define YieldProcessor _mm_pause
+
+FORCEINLINE
+KIRQL
+KeGetCurrentIrql(VOID)
+{
+ return (KIRQL)__readcr8();
+}
+
+FORCEINLINE
+VOID
+KeLowerIrql(IN KIRQL NewIrql)
+{
+ ASSERT(KeGetCurrentIrql() >= NewIrql);
+ __writecr8(NewIrql);
+}
+
+FORCEINLINE
+KIRQL
+KfRaiseIrql(IN KIRQL NewIrql)
+{
+ KIRQL OldIrql;
+
+ OldIrql = __readcr8();
+ ASSERT(OldIrql <= NewIrql);
+ __writecr8(NewIrql);
+ return OldIrql;
+}
+#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
+
+FORCEINLINE
+KIRQL
+KeRaiseIrqlToDpcLevel(VOID)
+{
+ return KfRaiseIrql(DISPATCH_LEVEL);
+}
+
+FORCEINLINE
+KIRQL
+KeRaiseIrqlToSynchLevel(VOID)
+{
+ return KfRaiseIrql(12); // SYNCH_LEVEL = IPI_LEVEL - 2
+}
+
+FORCEINLINE
+PKTHREAD
+KeGetCurrentThread (
+ VOID)
+{
+ return (struct _KTHREAD *)__readgsqword(0x188);
+}
+
+/* x86 and x64 performs a 0x2C interrupt */
+#define DbgRaiseAssertionFailure __int2c
+
+#elif defined(_M_IA64)
+/** Kernel definitions for IA64 **/
+
+/* Interrupt request levels */
+#define PASSIVE_LEVEL 0
+#define LOW_LEVEL 0
+#define APC_LEVEL 1
+#define DISPATCH_LEVEL 2
+#define CMC_LEVEL 3
+#define DEVICE_LEVEL_BASE 4
+#define PC_LEVEL 12
+#define IPI_LEVEL 14
+#define DRS_LEVEL 14
+#define CLOCK_LEVEL 13
+#define POWER_LEVEL 15
+#define PROFILE_LEVEL 15
+#define HIGH_LEVEL 15
+
+#define KI_USER_SHARED_DATA ((ULONG_PTR)(KADDRESS_BASE + 0xFFFE0000))
+extern volatile LARGE_INTEGER KeTickCount;
+
+FORCEINLINE
+VOID
+KeFlushWriteBuffer(VOID)
+{
+ __mf ();
+ return;
+}
+
+NTSYSAPI
+PKTHREAD
+NTAPI
+KeGetCurrentThread(
+ VOID);
+
+
+#elif defined(_M_PPC)
+
+/* Interrupt request levels */
+#define PASSIVE_LEVEL 0
+#define LOW_LEVEL 0
+#define APC_LEVEL 1
+#define DISPATCH_LEVEL 2
+#define PROFILE_LEVEL 27
+#define CLOCK1_LEVEL 28
+#define CLOCK2_LEVEL 28
+#define IPI_LEVEL 29
+#define POWER_LEVEL 30
+#define HIGH_LEVEL 31
+
+//
+// Used to contain PFNs and PFN counts
+//
+typedef ULONG PFN_COUNT;
+typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
+typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
+
+
+typedef struct _KFLOATING_SAVE {
+ ULONG Dummy;
+} KFLOATING_SAVE, *PKFLOATING_SAVE;
+
+typedef struct _KPCR_TIB {
+ PVOID ExceptionList; /* 00 */
+ PVOID StackBase; /* 04 */
+ PVOID StackLimit; /* 08 */
+ PVOID SubSystemTib; /* 0C */
+ _ANONYMOUS_UNION union {
+ PVOID FiberData; /* 10 */
+ ULONG Version; /* 10 */
+ } DUMMYUNIONNAME;
+ PVOID ArbitraryUserPointer; /* 14 */
+ struct _KPCR_TIB *Self; /* 18 */
+} KPCR_TIB, *PKPCR_TIB; /* 1C */
+
+#define PCR_MINOR_VERSION 1
+#define PCR_MAJOR_VERSION 1
+
+typedef struct _KPCR {
+ KPCR_TIB Tib; /* 00 */
+ struct _KPCR *Self; /* 1C */
+ struct _KPRCB *Prcb; /* 20 */
+ KIRQL Irql; /* 24 */
+ ULONG IRR; /* 28 */
+ ULONG IrrActive; /* 2C */
+ ULONG IDR; /* 30 */
+ PVOID KdVersionBlock; /* 34 */
+ PUSHORT IDT; /* 38 */
+ PUSHORT GDT; /* 3C */
+ struct _KTSS *TSS; /* 40 */
+ USHORT MajorVersion; /* 44 */
+ USHORT MinorVersion; /* 46 */
+ KAFFINITY SetMember; /* 48 */
+ ULONG StallScaleFactor; /* 4C */
+ UCHAR SpareUnused; /* 50 */
+ UCHAR Number; /* 51 */
+} KPCR, *PKPCR; /* 54 */
+
+#define KeGetPcr() PCR
+
+#define YieldProcessor() __asm__ __volatile__("nop");
+
+FORCEINLINE
+ULONG
+DDKAPI
+KeGetCurrentProcessorNumber(VOID)
+{
+ ULONG Number;
+ __asm__ __volatile__ (
+ "lwz %0, %c1(12)\n"
+ : "=r" (Number)
+ : "i" (FIELD_OFFSET(KPCR, Number))
+ );
+ return Number;
+}
+
+NTHALAPI
+VOID
+FASTCALL
+KfLowerIrql(
+ IN KIRQL NewIrql);
+#define KeLowerIrql(a) KfLowerIrql(a)
+
+NTHALAPI
+KIRQL
+FASTCALL
+KfRaiseIrql(
+ IN KIRQL NewIrql);
+#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
+
+NTHALAPI
+KIRQL
+DDKAPI
+KeRaiseIrqlToDpcLevel(
+ VOID);
+
+NTHALAPI
+KIRQL
+DDKAPI
+KeRaiseIrqlToSynchLevel(
+ VOID);
+
+
+
+#elif defined(_M_MIPS)
+#error MIPS Headers are totally incorrect
+
+//
+// Used to contain PFNs and PFN counts
+//
+typedef ULONG PFN_COUNT;
+typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
+typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
+
+#define PASSIVE_LEVEL 0
+#define APC_LEVEL 1
+#define DISPATCH_LEVEL 2
+#define PROFILE_LEVEL 27
+#define IPI_LEVEL 29
+#define HIGH_LEVEL 31
+
+typedef struct _KPCR {
+ struct _KPRCB *Prcb; /* 20 */
+ KIRQL Irql; /* 24 */
+ ULONG IRR; /* 28 */
+ ULONG IDR; /* 30 */
+} KPCR, *PKPCR;
+
+#define KeGetPcr() PCR
+
+typedef struct _KFLOATING_SAVE {
+} KFLOATING_SAVE, *PKFLOATING_SAVE;
+
+static __inline
+ULONG
+DDKAPI
+KeGetCurrentProcessorNumber(VOID)
+{
+ return 0;
+}
+
+#define YieldProcessor() __asm__ __volatile__("nop");
+
+#define KeLowerIrql(a) KfLowerIrql(a)
+#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
+
+NTKERNELAPI
+VOID
+NTAPI
+KfLowerIrql(
+ IN KIRQL NewIrql);
+
+NTKERNELAPI
+KIRQL
+NTAPI
+KfRaiseIrql(
+ IN KIRQL NewIrql);
+
+NTKERNELAPI
+KIRQL
+NTAPI
+KeRaiseIrqlToDpcLevel(
+ VOID);
+
+NTKERNELAPI
+KIRQL
+DDKAPI
+KeRaiseIrqlToSynchLevel(
+ VOID);
+
+
+#elif defined(_M_ARM)
+#include <armddk.h>
+#else
+#error Unknown Architecture
+#endif
/******************************************************************************
* Runtime Library Functions *
@@ -5545,8 +5850,8 @@
#define RtlZeroBytes RtlZeroMemory
-
#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
NTSYSAPI
BOOLEAN
NTAPI
@@ -10415,6 +10720,7 @@
#endif // !defined(MIDL_PASS)
+
/******************************************************************************
* Object Manager Functions *
******************************************************************************/
@@ -10471,6 +10777,7 @@
IN BOOLEAN MemoryAllocated);
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
+
/******************************************************************************
* Process Manager Functions *
@@ -10786,7 +11093,6 @@
}
#endif
-
#ifndef _NTTMAPI_
#define _NTTMAPI_
Modified: branches/header-work/include/xdk/iotypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/iotypes…
==============================================================================
--- branches/header-work/include/xdk/iotypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/iotypes.h [iso-8859-1] Sun Mar 14 01:22:25 2010
@@ -913,6 +913,15 @@
EventCategoryTargetDeviceChange
} IO_NOTIFICATION_EVENT_CATEGORY;
+typedef enum _IO_PRIORITY_HINT {
+ IoPriorityVeryLow = 0,
+ IoPriorityLow,
+ IoPriorityNormal,
+ IoPriorityHigh,
+ IoPriorityCritical,
+ MaxIoPriorityTypes
+} IO_PRIORITY_HINT;
+
#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES 0x00000001
typedef NTSTATUS
Modified: branches/header-work/include/xdk/rtltypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/rtltype…
==============================================================================
--- branches/header-work/include/xdk/rtltypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/rtltypes.h [iso-8859-1] Sun Mar 14 01:22:25 2010
@@ -113,16 +113,9 @@
#endif /* _SLIST_HEADER_ */
-
-/* HACK HACK HACK - GCC (or perhaps LD) is messing this up */
-#if defined(_NTSYSTEM_) || defined(__GNUC__)
+/* MS definition is broken! */
+extern BOOLEAN NTSYSAPI NlsMbCodePageTag;
+extern BOOLEAN NTSYSAPI NlsMbOemCodePageTag;
#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
-#else
-#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag)
-#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
-#endif /* _NT_SYSTEM */
-extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
-extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
-