ntdll: Directly call internal functions from APC handler.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2019-08-01 10:07:39 +02:00 committed by Alexandre Julliard
parent 1aa963efd7
commit 5328b9e083
1 changed files with 12 additions and 9 deletions

View File

@ -391,6 +391,7 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
BOOL user_apc = FALSE;
SIZE_T size;
void *addr;
pe_image_info_t image_info;
memset( result, 0, sizeof(*result) );
@ -429,10 +430,11 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
size = call->virtual_alloc.size;
if ((ULONG_PTR)addr == call->virtual_alloc.addr && size == call->virtual_alloc.size)
{
result->virtual_alloc.status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr,
call->virtual_alloc.zero_bits, &size,
call->virtual_alloc.op_type,
call->virtual_alloc.prot );
result->virtual_alloc.status = virtual_alloc_aligned( &addr,
call->virtual_alloc.zero_bits, &size,
call->virtual_alloc.op_type,
call->virtual_alloc.prot,
0 );
result->virtual_alloc.addr = wine_server_client_ptr( addr );
result->virtual_alloc.size = size;
}
@ -534,11 +536,12 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
{
LARGE_INTEGER offset;
offset.QuadPart = call->map_view.offset;
result->map_view.status = NtMapViewOfSection( wine_server_ptr_handle(call->map_view.handle),
NtCurrentProcess(), &addr,
call->map_view.zero_bits, 0,
&offset, &size, ViewShare,
call->map_view.alloc_type, call->map_view.prot );
result->map_view.status = virtual_map_section( wine_server_ptr_handle(call->map_view.handle),
&addr,
call->map_view.zero_bits, 0,
&offset, &size,
call->map_view.alloc_type, call->map_view.prot,
&image_info );
result->map_view.addr = wine_server_client_ptr( addr );
result->map_view.size = size;
}