Author: janderwald
Date: Fri Jun 2 18:08:22 2006
New Revision: 22178
URL:
http://svn.reactos.ru/svn/reactos?rev=22178&view=rev
Log:
forgot header in last commit
bug report(1455) & patch by w3seek
Modified:
trunk/reactos/include/reactos/probe.h
Modified: trunk/reactos/include/reactos/probe.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/reactos/probe.h?rev…
==============================================================================
--- trunk/reactos/include/reactos/probe.h (original)
+++ trunk/reactos/include/reactos/probe.h Fri Jun 2 18:08:22 2006
@@ -73,6 +73,15 @@
#define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType(Ptr, LARGE_INTEGER,
__emptyLargeInteger)
#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType(Ptr, ULARGE_INTEGER,
__emptyULargeInteger)
#define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType(Ptr, UNICODE_STRING,
__emptyUnicodeString)
+
+#define ProbeAndZeroHandle(Ptr) \
+ do { \
+ if ((ULONG_PTR)(Ptr) + sizeof(HANDLE) - 1 < (ULONG_PTR)(Ptr) || \
+ (ULONG_PTR)(Ptr) + sizeof(HANDLE) - 1 >= (ULONG_PTR)MmUserProbeAddress) {
\
+ RtlRaiseStatus (STATUS_ACCESS_VIOLATION); \
+ } \
+ *(volatile HANDLE *)(Ptr) = NULL; \
+ } while (0)
/*
* Inlined Probing Macros