mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
- 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. svn path=/trunk/; revision=42346
This commit is contained in:
parent
ee2e05e18d
commit
5fcfaf2e11
5 changed files with 9 additions and 33 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -36,6 +36,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
|
|||
|
||||
#include <winerror.h>
|
||||
#include <wingdi.h>
|
||||
#define NT_BUILD_ENVIRONMENT
|
||||
#include <winddi.h>
|
||||
#include <winuser.h>
|
||||
#include <prntfont.h>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue