mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-01 18:58:29 +00:00
server: Fix querying debug port with restricted DACL.
Today, Wine uses NtQueryInformationProcess/ProcessDebugPort to detect whether the current process is being debugged. If it is, the process issues a breakpoint to yield control to the debugger. Some debuggers (e.g. latest CDB) appear to create debug handles with restricted DACL, which causes querying debug port to fail with STATUS_ACCESS_DENIED. This results in the debuggee erroneously skipping the initial breakpoint. Fix this by not requiring DEBUG_ALL_ACCESS when opening the debug port object. Instead, use MAXIMUM_ALLOWED for the access mask. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52184 Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ee4d38c3b1
commit
3e2f443003
|
@ -3518,20 +3518,16 @@ static void test_debuggee_dbgport(int argc, char **argv)
|
|||
|
||||
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessDebugPort,
|
||||
&debug_port, sizeof(debug_port), NULL );
|
||||
todo_wine_if(access != DEBUG_ALL_ACCESS && access != GENERIC_ALL)
|
||||
ok( !status, "NtQueryInformationProcess ProcessDebugPort failed, status %#x.\n", status );
|
||||
todo_wine_if(access != DEBUG_ALL_ACCESS && access != GENERIC_ALL)
|
||||
ok( debug_port == ~(DWORD_PTR)0, "Expected port %#lx, got %#lx.\n", ~(DWORD_PTR)0, debug_port );
|
||||
|
||||
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessDebugFlags,
|
||||
&debug_flags, sizeof(debug_flags), NULL );
|
||||
todo_wine_if(access != DEBUG_ALL_ACCESS && access != GENERIC_ALL)
|
||||
ok( !status, "NtQueryInformationProcess ProcessDebugFlags failed, status %#x.\n", status );
|
||||
|
||||
expect_status = access ? STATUS_SUCCESS : STATUS_ACCESS_DENIED;
|
||||
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessDebugObjectHandle,
|
||||
&handle, sizeof(handle), NULL );
|
||||
todo_wine_if(access != DEBUG_ALL_ACCESS && access != GENERIC_ALL)
|
||||
ok( status == expect_status, "NtQueryInformationProcess ProcessDebugObjectHandle expected status %#x, actual %#x.\n", expect_status, status );
|
||||
if (SUCCEEDED( status )) NtClose( handle );
|
||||
|
||||
|
|
|
@ -1528,7 +1528,7 @@ DECL_HANDLER(get_process_debug_info)
|
|||
|
||||
reply->debug_children = process->debug_children;
|
||||
if (!process->debug_obj) set_error( STATUS_PORT_NOT_SET );
|
||||
else reply->debug = alloc_handle( current->process, process->debug_obj, DEBUG_ALL_ACCESS, 0 );
|
||||
else reply->debug = alloc_handle( current->process, process->debug_obj, MAXIMUM_ALLOWED, 0 );
|
||||
release_object( process );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue