mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[WIN32K]
- Reinstate ProbeForWrite call in MmCopyToCaller CORE-8095 #resolve svn path=/trunk/; revision=62958
This commit is contained in:
parent
2ad472f039
commit
3eff9e0536
2 changed files with 41 additions and 10 deletions
|
@ -1,12 +1,22 @@
|
||||||
#include "win32k.h"
|
#include "win32k.h"
|
||||||
|
|
||||||
NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) {
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
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
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
ProbeForRead(Source,Bytes,1);
|
ProbeForRead(Source, Bytes, 1);
|
||||||
RtlCopyMemory(Target,Source,Bytes);
|
RtlCopyMemory(Target, Source, Bytes);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -17,13 +27,23 @@ NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS _MmCopyToCaller( PVOID Target, PVOID Source, UINT Bytes ) {
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
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
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* ProbeForWrite(Target,Bytes,1); */
|
ProbeForWrite(Target, Bytes, 1);
|
||||||
RtlCopyMemory(Target,Source,Bytes);
|
RtlCopyMemory(Target, Source, Bytes);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes );
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS _MmCopyToCaller( PVOID Target, PVOID Source, UINT Bytes );
|
NTSTATUS
|
||||||
|
_MmCopyFromCaller(
|
||||||
|
_Out_writes_bytes_all_(Bytes) PVOID Target,
|
||||||
|
_In_reads_bytes_(Bytes) PVOID Source,
|
||||||
|
_In_ UINT Bytes);
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
|
NTSTATUS
|
||||||
|
_MmCopyToCaller(
|
||||||
|
_Out_writes_bytes_all_(Bytes) PVOID Target,
|
||||||
|
_In_reads_bytes_(Bytes) PVOID Source,
|
||||||
|
_In_ UINT Bytes);
|
||||||
|
|
||||||
#define MmCopyFromCaller(x,y,z) _MmCopyFromCaller((PCHAR)(x),(PCHAR)(y),(UINT)(z))
|
#define MmCopyFromCaller(x,y,z) _MmCopyFromCaller((PCHAR)(x),(PCHAR)(y),(UINT)(z))
|
||||||
#define MmCopyToCaller(x,y,z) _MmCopyToCaller((PCHAR)(x),(PCHAR)(y),(UINT)(z))
|
#define MmCopyToCaller(x,y,z) _MmCopyToCaller((PCHAR)(x),(PCHAR)(y),(UINT)(z))
|
||||||
|
|
Loading…
Reference in a new issue