mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
rename IsKernelPointer to IsPointerOffset
svn path=/trunk/; revision=17477
This commit is contained in:
parent
453763e6eb
commit
38caf3038e
2 changed files with 9 additions and 9 deletions
|
@ -148,22 +148,22 @@ RtlReleaseCapturedUnicodeString(
|
|||
#define ProbeForReadUlargeInteger(Ptr) ((ULARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, ULONGLONG, 0))
|
||||
|
||||
/*
|
||||
* Use IsKernelPointer to test whether a pointer points to the kernel address
|
||||
* space
|
||||
* Use IsPointerOffset to test whether a pointer should be interpreted as an offset
|
||||
* or as a pointer
|
||||
*/
|
||||
#if defined(_X86_) || defined(_M_AMD64)
|
||||
|
||||
/* for x86 and x86-64 the MSB is 1 so we can simply test on that */
|
||||
#define IsKernelPointer(Ptr) ((LONG_PTR)(Ptr) < 0)
|
||||
#define IsPointerOffset(Ptr) ((LONG_PTR)(Ptr) >= 0)
|
||||
|
||||
#elif defined(_IA64_)
|
||||
|
||||
/* on Itanium if the 24 most significant bits are set, we're not dealing with
|
||||
user mode pointers. */
|
||||
#define IsKernelPointer(Ptr) (((ULONG_PTR)(Ptr) & 0xFFFFFF0000000000ULL) != 0)
|
||||
offsets anymore. */
|
||||
#define IsPointerOffset(Ptr) (((ULONG_PTR)(Ptr) & 0xFFFFFF0000000000ULL) == 0)
|
||||
|
||||
#else
|
||||
#error IsKernelPointer() needs to be defined for this architecture
|
||||
#error IsPointerOffset() needs to be defined for this architecture
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -149,7 +149,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
|
|||
DefaultObject = ObjectHeader->Type->DefaultObject;
|
||||
|
||||
/* Check if it's the internal offset */
|
||||
if (!IsKernelPointer(DefaultObject))
|
||||
if (IsPointerOffset(DefaultObject))
|
||||
{
|
||||
/* Increase reference count */
|
||||
InterlockedIncrement(&ObjectHeader->PointerCount);
|
||||
|
@ -295,7 +295,7 @@ NtWaitForSingleObject(IN HANDLE ObjectHandle,
|
|||
WaitableObject = BODY_TO_HEADER(Object)->Type->DefaultObject;
|
||||
|
||||
/* Is it an offset for internal objects? */
|
||||
if (!IsKernelPointer(WaitableObject))
|
||||
if (IsPointerOffset(WaitableObject))
|
||||
{
|
||||
/* Turn it into a pointer */
|
||||
WaitableObject = (PVOID)((ULONG_PTR)Object +
|
||||
|
@ -389,7 +389,7 @@ NtSignalAndWaitForSingleObject(IN HANDLE ObjectHandleToSignal,
|
|||
WaitableObject = BODY_TO_HEADER(WaitObj)->Type->DefaultObject;
|
||||
|
||||
/* Handle internal offset */
|
||||
if (!IsKernelPointer(WaitableObject))
|
||||
if (IsPointerOffset(WaitableObject))
|
||||
{
|
||||
/* Get real pointer */
|
||||
WaitableObject = (PVOID)((ULONG_PTR)WaitObj +
|
||||
|
|
Loading…
Reference in a new issue