mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 12:24:48 +00:00
- Fix multiple WDK compatibilities issues.
- Fix MSVC warnings and incompatibilities. svn path=/trunk/; revision=25947
This commit is contained in:
parent
7270b49222
commit
9efff39376
10 changed files with 87 additions and 44 deletions
|
@ -3429,7 +3429,6 @@ typedef struct _IO_COMPLETION_CONTEXT {
|
||||||
#define FO_RANDOM_ACCESS 0x00100000
|
#define FO_RANDOM_ACCESS 0x00100000
|
||||||
#define FO_FILE_OPEN_CANCELLED 0x00200000
|
#define FO_FILE_OPEN_CANCELLED 0x00200000
|
||||||
#define FO_VOLUME_OPEN 0x00400000
|
#define FO_VOLUME_OPEN 0x00400000
|
||||||
#define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000
|
|
||||||
#define FO_REMOTE_ORIGIN 0x01000000
|
#define FO_REMOTE_ORIGIN 0x01000000
|
||||||
|
|
||||||
typedef struct _FILE_OBJECT
|
typedef struct _FILE_OBJECT
|
||||||
|
@ -9281,19 +9280,6 @@ NTAPI
|
||||||
MmBuildMdlForNonPagedPool(
|
MmBuildMdlForNonPagedPool(
|
||||||
IN OUT PMDL MemoryDescriptorList);
|
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 {
|
typedef enum _MMFLUSH_TYPE {
|
||||||
MmFlushForDelete,
|
MmFlushForDelete,
|
||||||
MmFlushForWrite
|
MmFlushForWrite
|
||||||
|
|
|
@ -124,6 +124,11 @@ extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
|
||||||
#define FILE_REMOVABLE_MEDIA 0x00000001
|
#define FILE_REMOVABLE_MEDIA 0x00000001
|
||||||
#define FILE_REMOTE_DEVICE 0x00000010
|
#define FILE_REMOTE_DEVICE 0x00000010
|
||||||
|
|
||||||
|
//
|
||||||
|
// File Object Flags
|
||||||
|
//
|
||||||
|
#define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000
|
||||||
|
|
||||||
//
|
//
|
||||||
// Device Object Extension Flags
|
// Device Object Extension Flags
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,6 +29,19 @@ Author:
|
||||||
//
|
//
|
||||||
// Section Functions
|
// 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
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmMapViewOfSection(
|
MmMapViewOfSection(
|
||||||
|
|
|
@ -114,11 +114,6 @@ Author:
|
||||||
#define PSP_VARIABLE_QUANTUMS 4
|
#define PSP_VARIABLE_QUANTUMS 4
|
||||||
#define PSP_LONG_QUANTUMS 16
|
#define PSP_LONG_QUANTUMS 16
|
||||||
|
|
||||||
//
|
|
||||||
// Number of TLS expansion slots
|
|
||||||
//
|
|
||||||
#define TLS_EXPANSION_SLOTS 64
|
|
||||||
|
|
||||||
#ifndef NTOS_MODE_USER
|
#ifndef NTOS_MODE_USER
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -152,6 +147,20 @@ Author:
|
||||||
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
|
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
|
||||||
SYNCHRONIZE | \
|
SYNCHRONIZE | \
|
||||||
0xFFF)
|
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
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -468,10 +468,6 @@ typedef DWORD FLONG;
|
||||||
#define THREAD_DIRECT_IMPERSONATION 0x200
|
#define THREAD_DIRECT_IMPERSONATION 0x200
|
||||||
#endif
|
#endif
|
||||||
#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
|
#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_NONCONTINUABLE 1
|
||||||
#define EXCEPTION_MAXIMUM_PARAMETERS 15
|
#define EXCEPTION_MAXIMUM_PARAMETERS 15
|
||||||
/* FIXME: Oh how I wish, I wish the w32api DDK wouldn't include winnt.h... */
|
/* FIXME: Oh how I wish, I wish the w32api DDK wouldn't include winnt.h... */
|
||||||
|
@ -481,6 +477,10 @@ typedef DWORD FLONG;
|
||||||
#define TIMER_QUERY_STATE 0x0001
|
#define TIMER_QUERY_STATE 0x0001
|
||||||
#define TIMER_MODIFY_STATE 0x0002
|
#define TIMER_MODIFY_STATE 0x0002
|
||||||
#define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
|
#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
|
#endif
|
||||||
/*
|
/*
|
||||||
* To prevent gcc compiler warnings, bracket these defines when initialising
|
* To prevent gcc compiler warnings, bracket these defines when initialising
|
||||||
|
|
|
@ -8,18 +8,9 @@
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#ifdef _WINDOWS_TESTING
|
|
||||||
#include <ntifs.h>
|
|
||||||
#include "ntndk.h"
|
|
||||||
#include "fsrtl_glue.h"
|
|
||||||
#else
|
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <ntifs.h>
|
|
||||||
#include <cctypes.h>
|
|
||||||
#endif /* _WINDOWS_TESTING */
|
|
||||||
|
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS **********************************************************/
|
/* PUBLIC FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,44 @@ static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULO
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
|
|
||||||
|
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
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
Ke386FnInit(VOID)
|
Ke386FnInit(VOID)
|
||||||
|
@ -130,28 +168,28 @@ Ke386HaltProcessor(VOID)
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
Ke386GetInterruptDescriptorTable(OUT KDESCRIPTOR Descriptor)
|
Ke386GetInterruptDescriptorTable(OUT USHORT Descriptor)
|
||||||
{
|
{
|
||||||
__asm sidt Descriptor;
|
__asm sidt Descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
Ke386SetInterruptDescriptorTable(IN KDESCRIPTOR Descriptor)
|
Ke386SetInterruptDescriptorTable(IN USHORT Descriptor)
|
||||||
{
|
{
|
||||||
__asm lidt Descriptor;
|
__asm lidt Descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
Ke386GetGlobalDescriptorTable(OUT KDESCRIPTOR Descriptor)
|
Ke386GetGlobalDescriptorTable(OUT USHORT Descriptor)
|
||||||
{
|
{
|
||||||
__asm sgdt Descriptor;
|
__asm sgdt Descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
Ke386SetGlobalDescriptorTable(IN KDESCRIPTOR Descriptor)
|
Ke386SetGlobalDescriptorTable(IN USHORT Descriptor)
|
||||||
{
|
{
|
||||||
__asm lgdt Descriptor;
|
__asm lgdt Descriptor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include <diskdump/diskdump.h>
|
#include <diskdump/diskdump.h>
|
||||||
|
|
||||||
/* C Headers */
|
/* C Headers */
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
|
@ -108,7 +108,7 @@ WRMSR(IN ULONG Register,
|
||||||
LONGLONG
|
LONGLONG
|
||||||
RDMSR(IN ULONG Register)
|
RDMSR(IN ULONG Register)
|
||||||
{
|
{
|
||||||
LARGE_INTEGER LargeVal;
|
LARGE_INTEGER LargeVal = {{0}};
|
||||||
Ke386Rdmsr(Register, LargeVal.HighPart, LargeVal.LowPart);
|
Ke386Rdmsr(Register, LargeVal.HighPart, LargeVal.LowPart);
|
||||||
return LargeVal.QuadPart;
|
return LargeVal.QuadPart;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiSetProcessorType(VOID)
|
KiSetProcessorType(VOID)
|
||||||
{
|
{
|
||||||
ULONG EFlags, NewEFlags;
|
ULONG EFlags = 0, NewEFlags;
|
||||||
ULONG Reg[4];
|
ULONG Reg[4];
|
||||||
ULONG Stepping, Type;
|
ULONG Stepping, Type;
|
||||||
|
|
||||||
|
@ -671,7 +671,7 @@ NTAPI
|
||||||
KeFlushCurrentTb(VOID)
|
KeFlushCurrentTb(VOID)
|
||||||
{
|
{
|
||||||
/* Flush the TLB by resetting CR3 */
|
/* Flush the TLB by resetting CR3 */
|
||||||
__writecr3((ULONGLONG)__readcr3());
|
__writecr3(__readcr3());
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -744,10 +744,10 @@ KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context)
|
||||||
{
|
{
|
||||||
/* Set CS and ESP */
|
/* Set CS and ESP */
|
||||||
Ke386Wrmsr(0x174, KGDT_R0_CODE, 0);
|
Ke386Wrmsr(0x174, KGDT_R0_CODE, 0);
|
||||||
Ke386Wrmsr(0x175, KeGetCurrentPrcb()->DpcStack, 0);
|
Ke386Wrmsr(0x175, (ULONG)KeGetCurrentPrcb()->DpcStack, 0);
|
||||||
|
|
||||||
/* Set LSTAR */
|
/* Set LSTAR */
|
||||||
Ke386Wrmsr(0x176, KiFastCallEntry, 0);
|
Ke386Wrmsr(0x176, (ULONG)KiFastCallEntry, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,7 +811,7 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiI386PentiumLockErrataFixup(VOID)
|
KiI386PentiumLockErrataFixup(VOID)
|
||||||
{
|
{
|
||||||
KDESCRIPTOR IdtDescriptor;
|
KDESCRIPTOR IdtDescriptor = {0};
|
||||||
PKIDTENTRY NewIdt, NewIdt2;
|
PKIDTENTRY NewIdt, NewIdt2;
|
||||||
|
|
||||||
/* Allocate memory for a new IDT */
|
/* Allocate memory for a new IDT */
|
||||||
|
@ -846,7 +846,7 @@ NTAPI
|
||||||
KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
|
KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
|
||||||
IN PKEXCEPTION_FRAME ExceptionFrame)
|
IN PKEXCEPTION_FRAME ExceptionFrame)
|
||||||
{
|
{
|
||||||
ULONG Flags;
|
ULONG Flags = 0;
|
||||||
|
|
||||||
/* Disable interrupts and get previous state */
|
/* Disable interrupts and get previous state */
|
||||||
Ke386SaveFlags(Flags);
|
Ke386SaveFlags(Flags);
|
||||||
|
|
|
@ -606,7 +606,7 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt,
|
||||||
IN PKIPCR *Pcr,
|
IN PKIPCR *Pcr,
|
||||||
IN PKTSS *Tss)
|
IN PKTSS *Tss)
|
||||||
{
|
{
|
||||||
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
|
KDESCRIPTOR GdtDescriptor = {0}, IdtDescriptor;
|
||||||
KGDTENTRY TssSelector, PcrSelector;
|
KGDTENTRY TssSelector, PcrSelector;
|
||||||
USHORT Tr, Fs;
|
USHORT Tr, Fs;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue