#define MI_MAPPED_COPY_PAGES 16
#define MI_POOL_COPY_BYTES 512
#define MI_MAX_TRANSFER_SIZE 64 * 1024
-#define TAG_VM TAG('V', 'm', 'R', 'w')
+#define TAG_VM 'wRmV'
/* PRIVATE FUNCTIONS **********************************************************/
KAPC_STATE ApcState;
BOOLEAN HaveBadAddress;
ULONG_PTR BadAddress;
- NTSTATUS Status = STATUS_SUCCESS;
PAGED_CODE();
/* Calculate the maximum amount of data to move */
if ((FailedInProbe) || (FailedInMapping))
{
/* Exit */
- Status = _SEH2_GetExceptionCode();
- _SEH2_YIELD(return Status);
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
/* Otherwise, we failed probably during the move */
}
/* Return partial copy */
- Status = STATUS_PARTIAL_COPY;
+ _SEH2_YIELD(return STATUS_PARTIAL_COPY);
}
_SEH2_END;
- /* Check for SEH status */
- if (Status != STATUS_SUCCESS) return Status;
-
/* Detach from target */
KeUnstackDetachProcess(&ApcState);
KAPC_STATE ApcState;
BOOLEAN HaveBadAddress;
ULONG_PTR BadAddress;
- NTSTATUS Status = STATUS_SUCCESS;
PAGED_CODE();
/* Calculate the maximum amount of data to move */
if (FailedInProbe)
{
/* Exit */
- Status = _SEH2_GetExceptionCode();
- _SEH2_YIELD(return Status);
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
/* Otherwise, we failed probably during the move */
}
/* Return partial copy */
- Status = STATUS_PARTIAL_COPY;
+ _SEH2_YIELD(return STATUS_PARTIAL_COPY);
}
_SEH2_END;
- /* Check for SEH status */
- if (Status != STATUS_SUCCESS) return Status;
-
/* Detach from target */
KeUnstackDetachProcess(&ApcState);
{
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process;
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status;
SIZE_T BytesRead = 0;
PAGED_CODE();
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- /* Get exception code */
- Status = _SEH2_GetExceptionCode();
+ /* Return the exception code */
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
-
- /* Return if we failed */
- if (!NT_SUCCESS(Status)) return Status;
}
/* Reference the process */
{
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process;
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status;
SIZE_T BytesWritten = 0;
PAGED_CODE();
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- /* Get exception code */
- Status = _SEH2_GetExceptionCode();
+ /* Return the exception code */
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
-
- /* Return if we failed */
- if (!NT_SUCCESS(Status)) return Status;
}
/* Reference the process */
PVOID BaseAddress = NULL;
SIZE_T NumberOfBytesToProtect = 0;
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status;
PAGED_CODE();
/* Check for valid protection flags */
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- /* Get exception code */
- Status = _SEH2_GetExceptionCode();
+ /* Return the exception code */
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
-
- /* Return on exception */
- if (!NT_SUCCESS(Status)) return Status;
}
else
{
IN SIZE_T Length,
OUT PSIZE_T UnsafeResultLength)
{
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status;
SIZE_T ResultLength = 0;
KPROCESSOR_MODE PreviousMode;
WCHAR ModuleFileNameBuffer[MAX_PATH] = {0};
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- Status = _SEH2_GetExceptionCode();
+ /* Return the exception code */
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
-
- if (!NT_SUCCESS(Status))
- {
- return Status;
- }
}
if (Address >= MmSystemRangeStart)