mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 16:36:11 +00:00
probe the pointers in _MmCopyFromCaller and _MmCopyToCaller. There's no need to check the processor mode since it's always just used to copy from/to user memory
svn path=/trunk/; revision=16690
This commit is contained in:
parent
8112d02490
commit
4bfbd2cfaf
|
@ -4,8 +4,9 @@
|
|||
#include <pseh/pseh.h>
|
||||
|
||||
NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes );
|
||||
NTSTATUS _MmCopyToCaller( 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)
|
||||
#define MmCopyToCaller(x,y,z) _MmCopyToCaller((PCHAR)(x),(PCHAR)(y),(UINT)(z))
|
||||
|
||||
#endif/*NDK_MMCOPY_H*/
|
||||
|
|
|
@ -2,9 +2,23 @@
|
|||
|
||||
NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) {
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
|
||||
_SEH_TRY {
|
||||
RtlCopyMemory(Target,Source,Bytes);
|
||||
ProbeForRead(Source,Bytes,1);
|
||||
RtlCopyMemory(Target,Source,Bytes);
|
||||
} _SEH_HANDLE {
|
||||
Status = _SEH_GetExceptionCode();
|
||||
} _SEH_END;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
NTSTATUS _MmCopyToCaller( PVOID Target, PVOID Source, UINT Bytes ) {
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
_SEH_TRY {
|
||||
ProbeForWrite(Target,Bytes,1);
|
||||
RtlCopyMemory(Target,Source,Bytes);
|
||||
} _SEH_HANDLE {
|
||||
Status = _SEH_GetExceptionCode();
|
||||
} _SEH_END;
|
||||
|
|
Loading…
Reference in a new issue