mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
55 lines
1.1 KiB
C
55 lines
1.1 KiB
C
#include "win32k.h"
|
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
NTSTATUS
|
|
_MmCopyFromCaller(
|
|
_Out_writes_bytes_all_(Bytes) PVOID Target,
|
|
_In_reads_bytes_(Bytes) PVOID Source,
|
|
_In_ UINT Bytes)
|
|
{
|
|
NTSTATUS Status;
|
|
|
|
PAGED_CODE();
|
|
ASSERT(ExGetPreviousMode() == UserMode);
|
|
|
|
Status = STATUS_SUCCESS;
|
|
_SEH2_TRY
|
|
{
|
|
ProbeForRead(Source, Bytes, 1);
|
|
RtlCopyMemory(Target, Source, Bytes);
|
|
}
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
{
|
|
Status = _SEH2_GetExceptionCode();
|
|
}
|
|
_SEH2_END;
|
|
|
|
return Status;
|
|
}
|
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
NTSTATUS
|
|
_MmCopyToCaller(
|
|
_Out_writes_bytes_all_(Bytes) PVOID Target,
|
|
_In_reads_bytes_(Bytes) PVOID Source,
|
|
_In_ UINT Bytes)
|
|
{
|
|
NTSTATUS Status;
|
|
|
|
PAGED_CODE();
|
|
ASSERT(ExGetPreviousMode() == UserMode);
|
|
|
|
Status = STATUS_SUCCESS;
|
|
_SEH2_TRY
|
|
{
|
|
ProbeForWrite(Target, Bytes, 1);
|
|
RtlCopyMemory(Target, Source, Bytes);
|
|
}
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
{
|
|
Status = _SEH2_GetExceptionCode();
|
|
}
|
|
_SEH2_END;
|
|
|
|
return Status;
|
|
}
|