if(TimeOut)
{
- ProbeForRead(TimeOut,
- sizeof(LARGE_INTEGER),
- sizeof(ULONG));
-
/* Make a local copy of the timeout on the stack */
- SafeTimeOut = *TimeOut;
+ SafeTimeOut = ProbeForReadLargeInteger(TimeOut);
TimeOut = &SafeTimeOut;
}
}
DefaultObject = ObjectHeader->Type->DefaultObject;
/* Check if it's the internal offset */
- if ((LONG_PTR)DefaultObject >= 0)
+ if (!IsKernelPointer(DefaultObject))
{
/* Increase reference count */
InterlockedIncrement(&ObjectHeader->PointerCount);
{
_SEH_TRY
{
- ProbeForRead(TimeOut,
- sizeof(LARGE_INTEGER),
- sizeof(ULONG));
/* Make a copy on the stack */
- SafeTimeOut = *TimeOut;
+ SafeTimeOut = ProbeForReadLargeInteger(TimeOut);
TimeOut = &SafeTimeOut;
}
_SEH_HANDLE
WaitableObject = BODY_TO_HEADER(Object)->Type->DefaultObject;
/* Is it an offset for internal objects? */
- if ((LONG_PTR)WaitableObject >= 0)
+ if (!IsKernelPointer(WaitableObject))
{
/* Turn it into a pointer */
WaitableObject = (PVOID)((ULONG_PTR)Object +
{
_SEH_TRY
{
- ProbeForRead(TimeOut,
- sizeof(LARGE_INTEGER),
- sizeof(ULONG));
/* Make a copy on the stack */
- SafeTimeOut = *TimeOut;
+ SafeTimeOut = ProbeForReadLargeInteger(TimeOut);
TimeOut = &SafeTimeOut;
}
_SEH_HANDLE
WaitableObject = BODY_TO_HEADER(WaitObj)->Type->DefaultObject;
/* Handle internal offset */
- if ((LONG_PTR)WaitableObject >= 0)
+ if (!IsKernelPointer(WaitableObject))
{
/* Get real pointer */
WaitableObject = (PVOID)((ULONG_PTR)WaitObj +