Author: sginsberg Date: Sun Aug 2 22:35:19 2009 New Revision: 42346
URL: http://svn.reactos.org/svn/reactos?rev=42346&view=rev Log: - probe.h: "NTOSKRNL unfortunately doesn't export RtlRaiseStatus!" -- no, but it does export ExRaiseStatus, so use it instead from win32k instead of "W32kRaiseStatus". Also use ExRaiseAccessViolation instead of RtlRaiseStatus(STATUS_ACCESS_VIOLATION) to save some space. - ddraw.h: Don't check if WINNT is defined, our winnt.h defines _WINNT_H. Also fix the way CO_E_NOTINITIALIZED is defined. - Define NT_BUILD_ENVIRONMENT in win32k so the define in ddraw.h doesn't conflict with winerror.h. Not sure if this is correct, but our headers are a mess. - Add a hack to disable C4276 (caused by napi.h) until a more proper fix is devised. - Win32K now fully compiles in MSVC.
Modified: trunk/reactos/include/dxsdk/ddraw.h trunk/reactos/include/reactos/probe.h trunk/reactos/subsystems/win32/win32k/misc/err.c trunk/reactos/subsystems/win32/win32k/pch.h trunk/reactos/subsystems/win32/win32k/win32k.rbuild
Modified: trunk/reactos/include/dxsdk/ddraw.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/dxsdk/ddraw.h?rev=4... ============================================================================== --- trunk/reactos/include/dxsdk/ddraw.h [iso-8859-1] (original) +++ trunk/reactos/include/dxsdk/ddraw.h [iso-8859-1] Sun Aug 2 22:35:19 2009 @@ -8,8 +8,8 @@ #include <objbase.h> #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
Modified: trunk/reactos/include/reactos/probe.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/probe.h?rev... ============================================================================== --- trunk/reactos/include/reactos/probe.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/probe.h [iso-8859-1] Sun Aug 2 22:35:19 2009 @@ -12,14 +12,6 @@
#if defined(_WIN32K_) 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
/* @@ -29,7 +21,7 @@ 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 @@ #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 @@ 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 @@ ArraySize = ItemSize * ItemCount; if (ArraySize / ItemSize != ItemCount) { - RtlRaiseStatus (STATUS_INVALID_PARAMETER); + ExRaiseStatus(STATUS_INVALID_PARAMETER); }
/* Probe the array */ @@ -135,7 +127,7 @@ ArraySize = ItemSize * ItemCount; if (ArraySize / ItemSize != ItemCount) { - RtlRaiseStatus (STATUS_INVALID_PARAMETER); + ExRaiseStatus(STATUS_INVALID_PARAMETER); }
/* Probe the array */
Modified: trunk/reactos/subsystems/win32/win32k/misc/err.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/mis... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/misc/err.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/misc/err.c [iso-8859-1] Sun Aug 2 22:35:19 2009 @@ -61,22 +61,4 @@ 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 */
Modified: trunk/reactos/subsystems/win32/win32k/pch.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/pch... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] Sun Aug 2 22:35:19 2009 @@ -36,6 +36,7 @@
#include <winerror.h> #include <wingdi.h> +#define NT_BUILD_ENVIRONMENT #include <winddi.h> #include <winuser.h> #include <prntfont.h>
Modified: trunk/reactos/subsystems/win32/win32k/win32k.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/win... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Sun Aug 2 22:35:19 2009 @@ -10,6 +10,7 @@ <include base="ReactOS">include/reactos/subsys</include> <include base="ReactOS">include/reactos/drivers</include> <compilerflag compilerset="gcc">-fms-extensions</compilerflag> + <compilerflag compilerset="msc">/wd4276</compilerflag> <define name="LANGPACK" /> <define name="_WIN32K_" /> <!-- See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38269