ntdll: Implement NtDebugContinue().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7bebf7db8c
commit
c8f5cced47
|
@ -72,16 +72,11 @@ BOOL WINAPI DECLSPEC_HOTPATCH CheckRemoteDebuggerPresent( HANDLE process, BOOL *
|
|||
*/
|
||||
BOOL WINAPI DECLSPEC_HOTPATCH ContinueDebugEvent( DWORD pid, DWORD tid, DWORD status )
|
||||
{
|
||||
BOOL ret;
|
||||
SERVER_START_REQ( continue_debug_event )
|
||||
{
|
||||
req->pid = pid;
|
||||
req->tid = tid;
|
||||
req->status = status;
|
||||
ret = !wine_server_call_err( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
return ret;
|
||||
CLIENT_ID id;
|
||||
|
||||
id.UniqueProcess = ULongToHandle( pid );
|
||||
id.UniqueThread = ULongToHandle( tid );
|
||||
return set_ntstatus( DbgUiContinue( &id, status ));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
# @ stub DbgQueryDebugFilterState
|
||||
# @ stub DbgSetDebugFilterState
|
||||
@ stdcall DbgUiConnectToDbg()
|
||||
@ stub DbgUiContinue
|
||||
@ stdcall DbgUiContinue(ptr long)
|
||||
@ stub DbgUiConvertStateChangeStructure
|
||||
@ stdcall DbgUiDebugActiveProcess(long)
|
||||
@ stdcall DbgUiGetThreadDebugObject()
|
||||
|
@ -191,7 +191,7 @@
|
|||
# @ stub NtCreateWaitablePort
|
||||
@ stdcall -arch=i386,arm64 NtCurrentTeb()
|
||||
@ stdcall -syscall NtDebugActiveProcess(long long)
|
||||
# @ stub NtDebugContinue
|
||||
@ stdcall -syscall NtDebugContinue(long ptr long)
|
||||
@ stdcall -syscall NtDelayExecution(long ptr)
|
||||
@ stdcall -syscall NtDeleteAtom(long)
|
||||
# @ stub NtDeleteBootEntry
|
||||
|
@ -1196,7 +1196,7 @@
|
|||
@ stdcall -private -syscall ZwCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr) NtCreateUserProcess
|
||||
# @ stub ZwCreateWaitablePort
|
||||
@ stdcall -private -syscall ZwDebugActiveProcess(long long) NtDebugActiveProcess
|
||||
# @ stub ZwDebugContinue
|
||||
@ stdcall -private -syscall ZwDebugContinue(long ptr long) NtDebugContinue
|
||||
@ stdcall -private -syscall ZwDelayExecution(long ptr) NtDelayExecution
|
||||
@ stdcall -private -syscall ZwDeleteAtom(long) NtDeleteAtom
|
||||
# @ stub ZwDeleteBootEntry
|
||||
|
|
|
@ -170,6 +170,14 @@ NTSTATUS WINAPI DbgUiStopDebugging( HANDLE process )
|
|||
return NtRemoveProcessDebug( process, DbgUiGetThreadDebugObject() );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DbgUiContinue (NTDLL.@)
|
||||
*/
|
||||
NTSTATUS WINAPI DbgUiContinue( CLIENT_ID *client, NTSTATUS status )
|
||||
{
|
||||
return NtDebugContinue( DbgUiGetThreadDebugObject(), client, status );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DbgUiRemoteBreakin (NTDLL.@)
|
||||
*/
|
||||
|
|
|
@ -1781,6 +1781,26 @@ NTSTATUS WINAPI NtRemoveProcessDebug( HANDLE process, HANDLE debug )
|
|||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NtDebugContinue (NTDLL.@)
|
||||
*/
|
||||
NTSTATUS WINAPI NtDebugContinue( HANDLE handle, CLIENT_ID *client, NTSTATUS status )
|
||||
{
|
||||
NTSTATUS ret;
|
||||
|
||||
SERVER_START_REQ( continue_debug_event )
|
||||
{
|
||||
req->debug = wine_server_obj_handle( handle );
|
||||
req->pid = HandleToULong( client->UniqueProcess );
|
||||
req->tid = HandleToULong( client->UniqueThread );
|
||||
req->status = status;
|
||||
ret = wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* __wine_make_process_system (NTDLL.@)
|
||||
*
|
||||
|
|
|
@ -2080,9 +2080,11 @@ struct get_exception_status_reply
|
|||
struct continue_debug_event_request
|
||||
{
|
||||
struct request_header __header;
|
||||
obj_handle_t debug;
|
||||
process_id_t pid;
|
||||
thread_id_t tid;
|
||||
int status;
|
||||
unsigned int status;
|
||||
char __pad_28[4];
|
||||
};
|
||||
struct continue_debug_event_reply
|
||||
{
|
||||
|
@ -6213,7 +6215,7 @@ union generic_reply
|
|||
|
||||
/* ### protocol_version begin ### */
|
||||
|
||||
#define SERVER_PROTOCOL_VERSION 660
|
||||
#define SERVER_PROTOCOL_VERSION 661
|
||||
|
||||
/* ### protocol_version end ### */
|
||||
|
||||
|
|
|
@ -3029,6 +3029,7 @@ NTSYSAPI void WINAPI DbgBreakPoint(void);
|
|||
NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
|
||||
NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
|
||||
NTSYSAPI NTSTATUS WINAPI DbgUiConnectToDbg(void);
|
||||
NTSYSAPI NTSTATUS WINAPI DbgUiContinue(CLIENT_ID*,NTSTATUS);
|
||||
NTSYSAPI NTSTATUS WINAPI DbgUiDebugActiveProcess(HANDLE);
|
||||
NTSYSAPI HANDLE WINAPI DbgUiGetThreadDebugObject(void);
|
||||
NTSYSAPI NTSTATUS WINAPI DbgUiIssueRemoteBreakin(HANDLE);
|
||||
|
@ -3113,6 +3114,7 @@ NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRI
|
|||
NTSYSAPI NTSTATUS WINAPI NtCreateToken(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,TOKEN_TYPE,PLUID,PLARGE_INTEGER,PTOKEN_USER,PTOKEN_GROUPS,PTOKEN_PRIVILEGES,PTOKEN_OWNER,PTOKEN_PRIMARY_GROUP,PTOKEN_DEFAULT_DACL,PTOKEN_SOURCE);
|
||||
NTSYSAPI NTSTATUS WINAPI NtCreateUserProcess(HANDLE*,HANDLE*,ACCESS_MASK,ACCESS_MASK,OBJECT_ATTRIBUTES*,OBJECT_ATTRIBUTES*,ULONG,ULONG,RTL_USER_PROCESS_PARAMETERS*,PS_CREATE_INFO*,PS_ATTRIBUTE_LIST*);
|
||||
NTSYSAPI NTSTATUS WINAPI NtDebugActiveProcess(HANDLE,HANDLE);
|
||||
NTSYSAPI NTSTATUS WINAPI NtDebugContinue(HANDLE,CLIENT_ID*,NTSTATUS);
|
||||
NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
|
||||
NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
|
||||
NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
|
||||
|
|
|
@ -378,11 +378,10 @@ static struct debug_obj *create_debug_obj( struct object *root, const struct uni
|
|||
}
|
||||
|
||||
/* continue a debug event */
|
||||
static int continue_debug_event( struct process *process, struct thread *thread, int status )
|
||||
static int continue_debug_event( struct debug_obj *debug_obj, struct process *process,
|
||||
struct thread *thread, int status )
|
||||
{
|
||||
struct debug_obj *debug_obj = current->debug_obj;
|
||||
|
||||
if (debug_obj && process->debug_obj == debug_obj && thread->process == process)
|
||||
if (process->debug_obj == debug_obj && thread->process == process)
|
||||
{
|
||||
struct debug_event *event;
|
||||
|
||||
|
@ -645,6 +644,7 @@ DECL_HANDLER(wait_debug_event)
|
|||
/* Continue a debug event */
|
||||
DECL_HANDLER(continue_debug_event)
|
||||
{
|
||||
struct debug_obj *debug_obj;
|
||||
struct process *process;
|
||||
|
||||
if (req->status != DBG_EXCEPTION_NOT_HANDLED &&
|
||||
|
@ -656,16 +656,19 @@ DECL_HANDLER(continue_debug_event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(debug_obj = get_debug_obj( current->process, req->debug, DEBUG_READ_EVENT ))) return;
|
||||
|
||||
if ((process = get_process_from_id( req->pid )))
|
||||
{
|
||||
struct thread *thread = get_thread_from_id( req->tid );
|
||||
if (thread)
|
||||
{
|
||||
continue_debug_event( process, thread, req->status );
|
||||
continue_debug_event( debug_obj, process, thread, req->status );
|
||||
release_object( thread );
|
||||
}
|
||||
release_object( process );
|
||||
}
|
||||
release_object( debug_obj );
|
||||
}
|
||||
|
||||
/* start or stop debugging an existing process */
|
||||
|
|
|
@ -1631,9 +1631,10 @@ struct process_info
|
|||
|
||||
/* Continue a debug event */
|
||||
@REQ(continue_debug_event)
|
||||
obj_handle_t debug; /* debug object */
|
||||
process_id_t pid; /* process id to continue */
|
||||
thread_id_t tid; /* thread id to continue */
|
||||
int status; /* continuation status */
|
||||
unsigned int status; /* continuation status */
|
||||
@END
|
||||
|
||||
|
||||
|
|
|
@ -1155,10 +1155,11 @@ C_ASSERT( FIELD_OFFSET(struct queue_exception_event_reply, handle) == 8 );
|
|||
C_ASSERT( sizeof(struct queue_exception_event_reply) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct get_exception_status_request, handle) == 12 );
|
||||
C_ASSERT( sizeof(struct get_exception_status_request) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, pid) == 12 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, tid) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, status) == 20 );
|
||||
C_ASSERT( sizeof(struct continue_debug_event_request) == 24 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, debug) == 12 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, pid) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, tid) == 20 );
|
||||
C_ASSERT( FIELD_OFFSET(struct continue_debug_event_request, status) == 24 );
|
||||
C_ASSERT( sizeof(struct continue_debug_event_request) == 32 );
|
||||
C_ASSERT( FIELD_OFFSET(struct debug_process_request, handle) == 12 );
|
||||
C_ASSERT( FIELD_OFFSET(struct debug_process_request, debug) == 16 );
|
||||
C_ASSERT( FIELD_OFFSET(struct debug_process_request, attach) == 20 );
|
||||
|
|
|
@ -2199,9 +2199,10 @@ static void dump_get_exception_status_request( const struct get_exception_status
|
|||
|
||||
static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
|
||||
{
|
||||
fprintf( stderr, " pid=%04x", req->pid );
|
||||
fprintf( stderr, " debug=%04x", req->debug );
|
||||
fprintf( stderr, ", pid=%04x", req->pid );
|
||||
fprintf( stderr, ", tid=%04x", req->tid );
|
||||
fprintf( stderr, ", status=%d", req->status );
|
||||
fprintf( stderr, ", status=%08x", req->status );
|
||||
}
|
||||
|
||||
static void dump_debug_process_request( const struct debug_process_request *req )
|
||||
|
|
Loading…
Reference in New Issue