Author: ion
Date: Fri Mar 2 19:26:45 2007
New Revision: 25947
URL:
http://svn.reactos.org/svn/reactos?rev=25947&view=rev
Log:
- Fix multiple WDK compatibilities issues.
- Fix MSVC warnings and incompatibilities.
Modified:
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ndk/iotypes.h
trunk/reactos/include/ndk/mmfuncs.h
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/include/psdk/winnt.h
trunk/reactos/ntoskrnl/fsrtl/fastio.c
trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h
trunk/reactos/ntoskrnl/include/ntoskrnl.h
trunk/reactos/ntoskrnl/ke/i386/cpu.c
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=2…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Fri Mar 2 19:26:45 2007
@@ -3429,7 +3429,6 @@
#define FO_RANDOM_ACCESS 0x00100000
#define FO_FILE_OPEN_CANCELLED 0x00200000
#define FO_VOLUME_OPEN 0x00400000
-#define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000
#define FO_REMOTE_ORIGIN 0x01000000
typedef struct _FILE_OBJECT
@@ -9281,19 +9280,6 @@
MmBuildMdlForNonPagedPool(
IN OUT PMDL MemoryDescriptorList);
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmCreateSection(
- OUT PVOID *SectionObject,
- IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
- IN PLARGE_INTEGER MaximumSize,
- IN ULONG SectionPageProtection,
- IN ULONG AllocationAttributes,
- IN HANDLE FileHandle OPTIONAL,
- IN PFILE_OBJECT File OPTIONAL);
-
typedef enum _MMFLUSH_TYPE {
MmFlushForDelete,
MmFlushForWrite
Modified: trunk/reactos/include/ndk/iotypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/iotypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/iotypes.h (original)
+++ trunk/reactos/include/ndk/iotypes.h Fri Mar 2 19:26:45 2007
@@ -123,6 +123,11 @@
//
#define FILE_REMOVABLE_MEDIA 0x00000001
#define FILE_REMOTE_DEVICE 0x00000010
+
+//
+// File Object Flags
+//
+#define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000
//
// Device Object Extension Flags
Modified: trunk/reactos/include/ndk/mmfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/mmfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/mmfuncs.h (original)
+++ trunk/reactos/include/ndk/mmfuncs.h Fri Mar 2 19:26:45 2007
@@ -29,6 +29,19 @@
//
// Section Functions
//
+NTSTATUS
+NTAPI
+MmCreateSection(
+ OUT PVOID *SectionObject,
+ IN ACCESS_MASK DesiredAccess,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
+ IN PLARGE_INTEGER MaximumSize,
+ IN ULONG SectionPageProtection,
+ IN ULONG AllocationAttributes,
+ IN HANDLE FileHandle OPTIONAL,
+ IN PFILE_OBJECT File OPTIONAL
+);
+
NTSTATUS
NTAPI
MmMapViewOfSection(
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 (original)
+++ trunk/reactos/include/ndk/pstypes.h Fri Mar 2 19:26:45 2007
@@ -114,11 +114,6 @@
#define PSP_VARIABLE_QUANTUMS 4
#define PSP_LONG_QUANTUMS 16
-//
-// Number of TLS expansion slots
-//
-#define TLS_EXPANSION_SLOTS 64
-
#ifndef NTOS_MODE_USER
//
@@ -152,6 +147,20 @@
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
SYNCHRONIZE | \
0xFFF)
+
+//
+// Thread Base Priorities
+//
+#define THREAD_BASE_PRIORITY_LOWRT 15
+#define THREAD_BASE_PRIORITY_MAX 2
+#define THREAD_BASE_PRIORITY_MIN -2
+#define THREAD_BASE_PRIORITY_IDLE -15
+
+//
+// TLS Slots
+//
+#define TLS_MINIMUM_AVAILABLE 64
+#define TLS_EXPANSION_SLOTS 1024
#endif
//
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=2…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h (original)
+++ trunk/reactos/include/psdk/winnt.h Fri Mar 2 19:26:45 2007
@@ -468,10 +468,6 @@
#define THREAD_DIRECT_IMPERSONATION 0x200
#endif
#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
-#define THREAD_BASE_PRIORITY_LOWRT 15
-#define THREAD_BASE_PRIORITY_MAX 2
-#define THREAD_BASE_PRIORITY_MIN (-2)
-#define THREAD_BASE_PRIORITY_IDLE (-15)
#define EXCEPTION_NONCONTINUABLE 1
#define EXCEPTION_MAXIMUM_PARAMETERS 15
/* FIXME: Oh how I wish, I wish the w32api DDK wouldn't include winnt.h... */
@@ -481,6 +477,10 @@
#define TIMER_QUERY_STATE 0x0001
#define TIMER_MODIFY_STATE 0x0002
#define
TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
+#define THREAD_BASE_PRIORITY_LOWRT 15
+#define THREAD_BASE_PRIORITY_MAX 2
+#define THREAD_BASE_PRIORITY_MIN (-2)
+#define THREAD_BASE_PRIORITY_IDLE (-15)
#endif
/*
* To prevent gcc compiler warnings, bracket these defines when initialising
Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/fastio.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/fsrtl/fastio.c (original)
+++ trunk/reactos/ntoskrnl/fsrtl/fastio.c Fri Mar 2 19:26:45 2007
@@ -8,18 +8,9 @@
/* INCLUDES ******************************************************************/
-#ifdef _WINDOWS_TESTING
-#include <ntifs.h>
-#include "ntndk.h"
-#include "fsrtl_glue.h"
-#else
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
-#include <ntifs.h>
-#include <cctypes.h>
-#endif /* _WINDOWS_TESTING */
-
/* PUBLIC FUNCTIONS **********************************************************/
Modified: trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h Fri Mar 2 19:26:45 2007
@@ -116,6 +116,44 @@
VOID
FORCEINLINE
+Ke386Wrmsr(IN ULONG Register,
+ IN ULONG Var1,
+ IN ULONG Var2)
+{
+ __asm mov eax, Var1;
+ __asm mov edx, Var2;
+ __asm wrmsr;
+}
+
+ULONGLONG
+FORCEINLINE
+Ke386Rdmsr(IN ULONG Register,
+ IN ULONG Var1,
+ IN ULONG Var2)
+{
+ __asm mov eax, Var1;
+ __asm mov edx, Var2;
+ __asm rdmsr;
+}
+
+VOID
+FORCEINLINE
+Ki386Cpuid(IN ULONG Operation,
+ OUT PULONG Var1,
+ OUT PULONG Var2,
+ OUT PULONG Var3,
+ OUT PULONG Var4)
+{
+ __asm mov eax, Operation;
+ __asm cpuid;
+ __asm mov [Var1], eax;
+ __asm mov [Var2], ebx;
+ __asm mov [Var3], ecx;
+ __asm mov [Var4], edx;
+}
+
+VOID
+FORCEINLINE
Ke386FnInit(VOID)
{
__asm fninit;
@@ -130,28 +168,28 @@
VOID
FORCEINLINE
-Ke386GetInterruptDescriptorTable(OUT KDESCRIPTOR Descriptor)
+Ke386GetInterruptDescriptorTable(OUT USHORT Descriptor)
{
__asm sidt Descriptor;
}
VOID
FORCEINLINE
-Ke386SetInterruptDescriptorTable(IN KDESCRIPTOR Descriptor)
+Ke386SetInterruptDescriptorTable(IN USHORT Descriptor)
{
__asm lidt Descriptor;
}
VOID
FORCEINLINE
-Ke386GetGlobalDescriptorTable(OUT KDESCRIPTOR Descriptor)
+Ke386GetGlobalDescriptorTable(OUT USHORT Descriptor)
{
__asm sgdt Descriptor;
}
VOID
FORCEINLINE
-Ke386SetGlobalDescriptorTable(IN KDESCRIPTOR Descriptor)
+Ke386SetGlobalDescriptorTable(IN USHORT Descriptor)
{
__asm lgdt Descriptor;
}
Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/ntoskrnl.…
==============================================================================
--- trunk/reactos/ntoskrnl/include/ntoskrnl.h (original)
+++ trunk/reactos/ntoskrnl/include/ntoskrnl.h Fri Mar 2 19:26:45 2007
@@ -36,6 +36,7 @@
#include <diskdump/diskdump.h>
/* C Headers */
+#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <malloc.h>
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Fri Mar 2 19:26:45 2007
@@ -108,7 +108,7 @@
LONGLONG
RDMSR(IN ULONG Register)
{
- LARGE_INTEGER LargeVal;
+ LARGE_INTEGER LargeVal = {{0}};
Ke386Rdmsr(Register, LargeVal.HighPart, LargeVal.LowPart);
return LargeVal.QuadPart;
}
@@ -119,7 +119,7 @@
NTAPI
KiSetProcessorType(VOID)
{
- ULONG EFlags, NewEFlags;
+ ULONG EFlags = 0, NewEFlags;
ULONG Reg[4];
ULONG Stepping, Type;
@@ -671,7 +671,7 @@
KeFlushCurrentTb(VOID)
{
/* Flush the TLB by resetting CR3 */
- __writecr3((ULONGLONG)__readcr3());
+ __writecr3(__readcr3());
}
VOID
@@ -744,10 +744,10 @@
{
/* Set CS and ESP */
Ke386Wrmsr(0x174, KGDT_R0_CODE, 0);
- Ke386Wrmsr(0x175, KeGetCurrentPrcb()->DpcStack, 0);
+ Ke386Wrmsr(0x175, (ULONG)KeGetCurrentPrcb()->DpcStack, 0);
/* Set LSTAR */
- Ke386Wrmsr(0x176, KiFastCallEntry, 0);
+ Ke386Wrmsr(0x176, (ULONG)KiFastCallEntry, 0);
return 0;
}
@@ -811,7 +811,7 @@
NTAPI
KiI386PentiumLockErrataFixup(VOID)
{
- KDESCRIPTOR IdtDescriptor;
+ KDESCRIPTOR IdtDescriptor = {0};
PKIDTENTRY NewIdt, NewIdt2;
/* Allocate memory for a new IDT */
@@ -846,7 +846,7 @@
KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame)
{
- ULONG Flags;
+ ULONG Flags = 0;
/* Disable interrupts and get previous state */
Ke386SaveFlags(Flags);
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Fri Mar 2 19:26:45 2007
@@ -606,7 +606,7 @@
IN PKIPCR *Pcr,
IN PKTSS *Tss)
{
- KDESCRIPTOR GdtDescriptor, IdtDescriptor;
+ KDESCRIPTOR GdtDescriptor = {0}, IdtDescriptor;
KGDTENTRY TssSelector, PcrSelector;
USHORT Tr, Fs;