[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / subsystems / win32 / win32k / misc / copy.c
1 #include "win32k.h"
2
3 NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) {
4 NTSTATUS Status = STATUS_SUCCESS;
5
6 _SEH2_TRY
7 {
8 ProbeForRead(Source,Bytes,1);
9 RtlCopyMemory(Target,Source,Bytes);
10 }
11 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
12 {
13 Status = _SEH2_GetExceptionCode();
14 }
15 _SEH2_END;
16
17 return Status;
18 }
19
20 NTSTATUS _MmCopyToCaller( PVOID Target, PVOID Source, UINT Bytes ) {
21 NTSTATUS Status = STATUS_SUCCESS;
22
23 _SEH2_TRY
24 {
25 /* ProbeForWrite(Target,Bytes,1); */
26 RtlCopyMemory(Target,Source,Bytes);
27 }
28 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
29 {
30 Status = _SEH2_GetExceptionCode();
31 }
32 _SEH2_END;
33
34 return Status;
35 }