diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index a0bfb83a5ad..b1ded904014 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -690,8 +690,8 @@ MmAllocateNonCachedMemory@4 MmAllocatePagesForMdl@28 MmBuildMdlForNonPagedPool@4 MmCanFileBeTruncated@8 -MmCopyFromCaller@12 -MmCopyToCaller@12 +;MmCopyFromCaller@12 +;MmCopyToCaller@12 MmCreateMdl@12 MmCreateSection@32 MmDbgTranslatePhysicalAddress@8 diff --git a/reactos/subsys/win32k/include/mmcopy.h b/reactos/subsys/win32k/include/mmcopy.h new file mode 100644 index 00000000000..c779ead8b25 --- /dev/null +++ b/reactos/subsys/win32k/include/mmcopy.h @@ -0,0 +1,11 @@ +#ifndef NDK_MMCOPY_H +#define NDK_MMCOPY_H + +#include + +NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ); + +#define MmCopyFromCaller(x,y,z) _MmCopyFromCaller((PCHAR)(x),(PCHAR)(y),(UINT)(z)) +#define MmCopyToCaller(x,y,z) MmCopyFromCaller(x,y,z) + +#endif/*NDK_MMCOPY_H*/ diff --git a/reactos/subsys/win32k/include/win32k.h b/reactos/subsys/win32k/include/win32k.h index e7c5c502a63..a30d95d6fa6 100644 --- a/reactos/subsys/win32k/include/win32k.h +++ b/reactos/subsys/win32k/include/win32k.h @@ -54,8 +54,8 @@ #include #include #include +#include #include #include #include - /* EOF */ diff --git a/reactos/subsys/win32k/misc/copy.c b/reactos/subsys/win32k/misc/copy.c new file mode 100644 index 00000000000..3de5a355d73 --- /dev/null +++ b/reactos/subsys/win32k/misc/copy.c @@ -0,0 +1,13 @@ +#include "w32k.h" + +NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH_TRY { + RtlCopyMemory(Target,Source,Bytes); + } _SEH_HANDLE { + Status = _SEH_GetExceptionCode(); + } _SEH_END; + + return Status; +} diff --git a/reactos/subsys/win32k/w32k.h b/reactos/subsys/win32k/w32k.h index 4c5f5cf0852..4d85c84c526 100644 --- a/reactos/subsys/win32k/w32k.h +++ b/reactos/subsys/win32k/w32k.h @@ -19,14 +19,6 @@ #include #include -/* FIXME: ReactOS will be R-Rated if I really write what I'm about to */ -NTSTATUS -STDCALL -MmCopyFromCaller(PVOID Dest, const VOID *Src, ULONG NumberOfBytes); -NTSTATUS -STDCALL -MmCopyToCaller(PVOID Dest, const VOID *Src, ULONG NumberOfBytes); - /* SEH Support with PSEH */ #include diff --git a/reactos/subsys/win32k/win32k.xml b/reactos/subsys/win32k/win32k.xml index 65284dc390c..9d48ad5032e 100644 --- a/reactos/subsys/win32k/win32k.xml +++ b/reactos/subsys/win32k/win32k.xml @@ -58,6 +58,7 @@ math.c object.c ssec.c + copy.c ddraw.c