From d631c67e578c45ad41ca3cb32c49d72ada8f9fb3 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 21 Nov 2005 11:20:11 +0000 Subject: [PATCH] fixed the ProbeForWriteLargeInteger and ProbeForWriteUlargeInteger macros svn path=/trunk/; revision=19406 --- reactos/ntoskrnl/include/internal/ntoskrnl.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index bdd3b0a1496..7b16a96e880 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -84,6 +84,8 @@ RtlpLogException(IN PEXCEPTION_RECORD ExceptionRecord, #define ExRaiseStatus RtlRaiseStatus static const UNICODE_STRING __emptyUnicodeString = {0}; +static const LARGE_INTEGER __emptyLargeInteger = {{0, 0}}; +static const ULARGE_INTEGER __emptyULargeInteger = {{0, 0}}; /* * NOTE: Alignment of the pointers is not verified! @@ -120,7 +122,7 @@ static const UNICODE_STRING __emptyUnicodeString = {0}; (((ULONG_PTR)(Ptr) + sizeof(Type) - 1 < (ULONG_PTR)(Ptr) || \ (ULONG_PTR)(Ptr) + sizeof(Type) - 1 >= (ULONG_PTR)MmUserProbeAddress) ? \ ExRaiseStatus (STATUS_ACCESS_VIOLATION), Default : \ - *(volatile Type *)(Ptr)) + *(Type *)&(*(volatile Type *)(Ptr))) #define ProbeForReadBoolean(Ptr) ProbeForReadGenericType(Ptr, BOOLEAN, FALSE) #define ProbeForReadUchar(Ptr) ProbeForReadGenericType(Ptr, UCHAR, 0) @@ -136,13 +138,8 @@ static const UNICODE_STRING __emptyUnicodeString = {0}; #define ProbeForReadPointer(Ptr) ProbeForReadGenericType(Ptr, PVOID, NULL) #define ProbeForReadHandle(Ptr) ProbeForReadGenericType(Ptr, HANDLE, NULL) #define ProbeForReadLangid(Ptr) ProbeForReadGenericType(Ptr, LANGID, 0) -#ifdef _MSC_VER -#define ProbeForReadLargeInteger(Ptr) (*(volatile LARGE_INTEGER*)ProbeForReadGenericType(&(Ptr)->QuadPart, LONGLONG, 0)) -#define ProbeForReadUlargeInteger(Ptr) (*(volatile ULARGE_INTEGER*)ProbeForReadGenericType(&(Ptr)->QuadPart, ULONGLONG, 0)) -#else -#define ProbeForReadLargeInteger(Ptr) ((LARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, LONGLONG, 0)) -#define ProbeForReadUlargeInteger(Ptr) ((ULARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, ULONGLONG, 0)) -#endif +#define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType(Ptr, LARGE_INTEGER, __emptyLargeInteger) +#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType(Ptr, ULARGE_INTEGER, __emptyULargeInteger) #define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType(Ptr, UNICODE_STRING, __emptyUnicodeString) /*