Commit 8de06f12 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32: Replace Peb->BeingDebugged check by CheckRemoteDebuggerPresent().

misctool.dll from AmiBroker intentionally sets PEB->BeingDebugged to a random value returned by RDTSC instruction on PROCESS_ATTACH. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarSebastian Lackner <sebastian@fds-team.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7c10daf2
......@@ -1085,6 +1085,7 @@ static inline DWORD call_process_entry( PEB *peb, LPTHREAD_START_ROUTINE entry )
*/
static DWORD WINAPI start_process( LPTHREAD_START_ROUTINE entry )
{
BOOL being_debugged;
PEB *peb = NtCurrentTeb()->Peb;
if (!entry)
......@@ -1098,8 +1099,11 @@ static DWORD WINAPI start_process( LPTHREAD_START_ROUTINE entry )
DPRINTF( "%04x:Starting process %s (entryproc=%p)\n", GetCurrentThreadId(),
debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), entry );
if (!CheckRemoteDebuggerPresent( GetCurrentProcess(), &being_debugged ))
being_debugged = FALSE;
SetLastError( 0 ); /* clear error code */
if (peb->BeingDebugged) DbgBreakPoint();
if (being_debugged) DbgBreakPoint();
return call_process_entry( peb, entry );
}
......
......@@ -1737,6 +1737,7 @@ WINBASEAPI BOOL WINAPI CancelTimerQueueTimer(HANDLE,HANDLE);
WINBASEAPI BOOL WINAPI CancelWaitableTimer(HANDLE);
WINBASEAPI BOOL WINAPI CheckNameLegalDOS8Dot3A(const char*,char*,DWORD,BOOL*,BOOL*);
WINBASEAPI BOOL WINAPI CheckNameLegalDOS8Dot3W(const WCHAR*, char*,DWORD,BOOL*,BOOL*);
WINBASEAPI BOOL WINAPI CheckRemoteDebuggerPresent(HANDLE,BOOL*);
WINBASEAPI BOOL WINAPI ChangeTimerQueueTimer(HANDLE,HANDLE,ULONG,ULONG);
WINADVAPI BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
WINBASEAPI BOOL WINAPI ClearCommBreak(HANDLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment