ntdll: Implementation of inter-process VirtualProtectEx.
diff --git a/server/protocol.def b/server/protocol.def
index b24e275..8c40e10 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -233,7 +233,8 @@
APC_ASYNC_IO,
APC_VIRTUAL_ALLOC,
APC_VIRTUAL_FREE,
- APC_VIRTUAL_QUERY
+ APC_VIRTUAL_QUERY,
+ APC_VIRTUAL_PROTECT
};
typedef union
@@ -281,6 +282,13 @@
enum apc_type type; /* APC_VIRTUAL_QUERY */
const void *addr; /* requested address */
} virtual_query;
+ struct
+ {
+ enum apc_type type; /* APC_VIRTUAL_PROTECT */
+ void *addr; /* requested address */
+ unsigned long size; /* requested address */
+ unsigned int prot; /* new protection flags */
+ } virtual_protect;
} apc_call_t;
typedef union
@@ -312,6 +320,14 @@
unsigned int alloc_prot;/* resulting allocation protection */
unsigned int alloc_type;/* resulting region allocation type */
} virtual_query;
+ struct
+ {
+ enum apc_type type; /* APC_VIRTUAL_PROTECT */
+ unsigned int status; /* status returned by call */
+ void *addr; /* resulting address */
+ unsigned long size; /* resulting size */
+ unsigned int prot; /* old protection flags */
+ } virtual_protect;
} apc_result_t;
/****************************************************************/
diff --git a/server/thread.c b/server/thread.c
index 62bd559..35484a4 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1157,6 +1157,7 @@
case APC_VIRTUAL_ALLOC:
case APC_VIRTUAL_FREE:
case APC_VIRTUAL_QUERY:
+ case APC_VIRTUAL_PROTECT:
access = (apc->call.type == APC_VIRTUAL_QUERY) ? PROCESS_QUERY_INFORMATION : PROCESS_VM_OPERATION;
if ((process = get_process_from_handle( req->process, access )))
{
diff --git a/server/trace.c b/server/trace.c
index 2b9ee8c..b878c02 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -133,6 +133,11 @@
case APC_VIRTUAL_QUERY:
fprintf( stderr, "APC_VIRTUAL_QUERY,addr=%p", call->virtual_query.addr );
break;
+ case APC_VIRTUAL_PROTECT:
+ fprintf( stderr, "APC_VIRTUAL_PROTECT,addr=%p,size=%lu,prot=%x",
+ call->virtual_protect.addr, call->virtual_protect.size,
+ call->virtual_protect.prot );
+ break;
default:
fprintf( stderr, "type=%u", call->type );
break;
@@ -165,6 +170,12 @@
result->virtual_query.prot, result->virtual_query.alloc_prot,
result->virtual_query.alloc_type );
break;
+ case APC_VIRTUAL_PROTECT:
+ fprintf( stderr, "APC_VIRTUAL_PROTECT,status=%s,addr=%p,size=%lu,prot=%x",
+ get_status_name( result->virtual_protect.status ),
+ result->virtual_protect.addr, result->virtual_protect.size,
+ result->virtual_protect.prot );
+ break;
default:
fprintf( stderr, "type=%u", result->type );
break;