mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 01:40:36 +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_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 @@ NTAPI
|
|||
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
|
||||
|
|
|
@ -124,6 +124,11 @@ extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
|
|||
#define FILE_REMOVABLE_MEDIA 0x00000001
|
||||
#define FILE_REMOTE_DEVICE 0x00000010
|
||||
|
||||
//
|
||||
// File Object Flags
|
||||
//
|
||||
#define FO_FILE_OBJECT_HAS_EXTENSION 0x00800000
|
||||
|
||||
//
|
||||
// Device Object Extension Flags
|
||||
//
|
||||
|
|
|
@ -29,6 +29,19 @@ Author:
|
|||
//
|
||||
// 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(
|
||||
|
|
|
@ -114,11 +114,6 @@ Author:
|
|||
#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 @@ Author:
|
|||
#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
|
||||
|
||||
//
|
||||
|
|
|
@ -468,10 +468,6 @@ typedef DWORD FLONG;
|
|||
#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 @@ typedef DWORD FLONG;
|
|||
#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
|
||||
|
|
|
@ -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 **********************************************************/
|
||||
|
||||
|
|
|
@ -114,6 +114,44 @@ static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULO
|
|||
|
||||
#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
|
||||
FORCEINLINE
|
||||
Ke386FnInit(VOID)
|
||||
|
@ -130,28 +168,28 @@ Ke386HaltProcessor(VOID)
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <diskdump/diskdump.h>
|
||||
|
||||
/* C Headers */
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <malloc.h>
|
||||
|
|
|
@ -108,7 +108,7 @@ WRMSR(IN ULONG Register,
|
|||
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 @@ VOID
|
|||
NTAPI
|
||||
KiSetProcessorType(VOID)
|
||||
{
|
||||
ULONG EFlags, NewEFlags;
|
||||
ULONG EFlags = 0, NewEFlags;
|
||||
ULONG Reg[4];
|
||||
ULONG Stepping, Type;
|
||||
|
||||
|
@ -671,7 +671,7 @@ NTAPI
|
|||
KeFlushCurrentTb(VOID)
|
||||
{
|
||||
/* Flush the TLB by resetting CR3 */
|
||||
__writecr3((ULONGLONG)__readcr3());
|
||||
__writecr3(__readcr3());
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -744,10 +744,10 @@ KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context)
|
|||
{
|
||||
/* 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 @@ VOID
|
|||
NTAPI
|
||||
KiI386PentiumLockErrataFixup(VOID)
|
||||
{
|
||||
KDESCRIPTOR IdtDescriptor;
|
||||
KDESCRIPTOR IdtDescriptor = {0};
|
||||
PKIDTENTRY NewIdt, NewIdt2;
|
||||
|
||||
/* Allocate memory for a new IDT */
|
||||
|
@ -846,7 +846,7 @@ NTAPI
|
|||
KeFreezeExecution(IN PKTRAP_FRAME TrapFrame,
|
||||
IN PKEXCEPTION_FRAME ExceptionFrame)
|
||||
{
|
||||
ULONG Flags;
|
||||
ULONG Flags = 0;
|
||||
|
||||
/* Disable interrupts and get previous state */
|
||||
Ke386SaveFlags(Flags);
|
||||
|
|
|
@ -606,7 +606,7 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt,
|
|||
IN PKIPCR *Pcr,
|
||||
IN PKTSS *Tss)
|
||||
{
|
||||
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
|
||||
KDESCRIPTOR GdtDescriptor = {0}, IdtDescriptor;
|
||||
KGDTENTRY TssSelector, PcrSelector;
|
||||
USHORT Tr, Fs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue