diff --git a/reactos/include/dxsdk/ddraw.h b/reactos/include/dxsdk/ddraw.h index 699819d60a6..1e8dbd22af5 100644 --- a/reactos/include/dxsdk/ddraw.h +++ b/reactos/include/dxsdk/ddraw.h @@ -8,8 +8,8 @@ #include #else #define IUnknown void -#if !defined(NT_BUILD_ENVIRONMENT) && !defined(WINNT) - #define CO_E_NOTINITIALIZED 0x800401F0 +#if !defined(NT_BUILD_ENVIRONMENT) && !defined(_WINNT_H) + #define CO_E_NOTINITIALIZED 0x800401F0L #endif #endif diff --git a/reactos/include/reactos/probe.h b/reactos/include/reactos/probe.h index 4a13cd7968b..f4c1b6c1ad1 100644 --- a/reactos/include/reactos/probe.h +++ b/reactos/include/reactos/probe.h @@ -14,14 +14,6 @@ static const IO_STATUS_BLOCK __emptyIoStatusBlock = {{0}, 0}; static const LARGE_STRING __emptyLargeString = {0, 0, 0, NULL}; #endif -#if defined(_WIN32K_) -/* - * NOTE: NTOSKRNL unfortunately doesn't export RtlRaiseStatus! - */ -VOID NTAPI W32kRaiseStatus(NTSTATUS Status); -#define RtlRaiseStatus W32kRaiseStatus -#endif - /* * NOTE: Alignment of the pointers is not verified! */ @@ -29,7 +21,7 @@ VOID NTAPI W32kRaiseStatus(NTSTATUS Status); do { \ if ((ULONG_PTR)(Ptr) + sizeof(Type) - 1 < (ULONG_PTR)(Ptr) || \ (ULONG_PTR)(Ptr) + sizeof(Type) - 1 >= (ULONG_PTR)MmUserProbeAddress) { \ - RtlRaiseStatus (STATUS_ACCESS_VIOLATION); \ + ExRaiseAccessViolation(); \ } \ *(volatile Type *)(Ptr) = *(volatile Type *)(Ptr); \ } while (0) @@ -60,7 +52,7 @@ VOID NTAPI W32kRaiseStatus(NTSTATUS Status); #define ProbeForReadGenericType(Ptr, Type, Default) \ (((ULONG_PTR)(Ptr) + sizeof(Type) - 1 < (ULONG_PTR)(Ptr) || \ (ULONG_PTR)(Ptr) + sizeof(Type) - 1 >= (ULONG_PTR)MmUserProbeAddress) ? \ - ExRaiseStatus (STATUS_ACCESS_VIOLATION), Default : \ + ExRaiseAccessViolation(), Default : \ *(const volatile Type *)(Ptr)) #define ProbeForReadBoolean(Ptr) ProbeForReadGenericType(Ptr, BOOLEAN, FALSE) @@ -90,7 +82,7 @@ VOID NTAPI W32kRaiseStatus(NTSTATUS Status); do { \ if ((ULONG_PTR)(Ptr) + sizeof(HANDLE) - 1 < (ULONG_PTR)(Ptr) || \ (ULONG_PTR)(Ptr) + sizeof(HANDLE) - 1 >= (ULONG_PTR)MmUserProbeAddress) { \ - RtlRaiseStatus (STATUS_ACCESS_VIOLATION); \ + ExRaiseAccessViolation(); \ } \ *(volatile HANDLE *)(Ptr) = NULL; \ } while (0) @@ -113,7 +105,7 @@ ProbeArrayForRead(IN const VOID *ArrayPtr, ArraySize = ItemSize * ItemCount; if (ArraySize / ItemSize != ItemCount) { - RtlRaiseStatus (STATUS_INVALID_PARAMETER); + ExRaiseStatus(STATUS_INVALID_PARAMETER); } /* Probe the array */ @@ -135,7 +127,7 @@ ProbeArrayForWrite(IN OUT PVOID ArrayPtr, ArraySize = ItemSize * ItemCount; if (ArraySize / ItemSize != ItemCount) { - RtlRaiseStatus (STATUS_INVALID_PARAMETER); + ExRaiseStatus(STATUS_INVALID_PARAMETER); } /* Probe the array */ diff --git a/reactos/subsystems/win32/win32k/misc/err.c b/reactos/subsystems/win32/win32k/misc/err.c index d584cc24832..5943b4fde1f 100644 --- a/reactos/subsystems/win32/win32k/misc/err.c +++ b/reactos/subsystems/win32/win32k/misc/err.c @@ -61,22 +61,4 @@ GetLastNtError() return 0; } -VOID -APIENTRY -W32kRaiseStatus(NTSTATUS Status) -{ - EXCEPTION_RECORD ExceptionRecord; - - /* Create an exception record */ - ExceptionRecord.ExceptionCode = Status; - ExceptionRecord.ExceptionRecord = NULL; - ExceptionRecord.NumberParameters = 0; - ExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE; - - RtlRaiseException(&ExceptionRecord); - - /* If we returned, raise a status */ - W32kRaiseStatus(Status); -} - /* EOF */ diff --git a/reactos/subsystems/win32/win32k/pch.h b/reactos/subsystems/win32/win32k/pch.h index b53d861341f..a77ee875425 100644 --- a/reactos/subsystems/win32/win32k/pch.h +++ b/reactos/subsystems/win32/win32k/pch.h @@ -36,6 +36,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; #include #include +#define NT_BUILD_ENVIRONMENT #include #include #include diff --git a/reactos/subsystems/win32/win32k/win32k.rbuild b/reactos/subsystems/win32/win32k/win32k.rbuild index 7a16aac8352..47edc91dad5 100644 --- a/reactos/subsystems/win32/win32k/win32k.rbuild +++ b/reactos/subsystems/win32/win32k/win32k.rbuild @@ -10,6 +10,7 @@ include/reactos/subsys include/reactos/drivers -fms-extensions + /wd4276