mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:40:59 +00:00
ntdll: Don't call NtClose directly in delete_view.
This commit is contained in:
parent
06505c9a34
commit
71beac3219
|
@ -39,6 +39,8 @@ struct drive_info
|
|||
ino_t ino;
|
||||
};
|
||||
|
||||
extern NTSTATUS close_handle( HANDLE );
|
||||
|
||||
/* exceptions */
|
||||
extern void wait_suspend( CONTEXT *context );
|
||||
extern NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *context );
|
||||
|
|
|
@ -348,6 +348,22 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Everquest 2 / Pirates of the Burning Sea hooks NtClose, so we need a wrapper */
|
||||
NTSTATUS close_handle( HANDLE handle )
|
||||
{
|
||||
NTSTATUS ret;
|
||||
int fd = server_remove_fd_from_cache( handle );
|
||||
|
||||
SERVER_START_REQ( close_handle )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
ret = wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
if (fd != -1) close( fd );
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* NtClose [NTDLL.@]
|
||||
*
|
||||
|
@ -362,17 +378,7 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source,
|
|||
*/
|
||||
NTSTATUS WINAPI NtClose( HANDLE Handle )
|
||||
{
|
||||
NTSTATUS ret;
|
||||
int fd = server_remove_fd_from_cache( Handle );
|
||||
|
||||
SERVER_START_REQ( close_handle )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( Handle );
|
||||
ret = wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
if (fd != -1) close( fd );
|
||||
return ret;
|
||||
return close_handle( Handle );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -444,7 +444,7 @@ static void delete_view( struct file_view *view ) /* [in] View */
|
|||
{
|
||||
if (!(view->protect & VPROT_SYSTEM)) unmap_area( view->base, view->size );
|
||||
list_remove( &view->entry );
|
||||
if (view->mapping) NtClose( view->mapping );
|
||||
if (view->mapping) close_handle( view->mapping );
|
||||
RtlFreeHeap( virtual_heap, 0, view );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue