Commit e09dde5c authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

kernelbase: Implement WaitForDebugEventEx().

parent 090fb2cc
......@@ -1604,6 +1604,7 @@
@ stdcall WTSGetActiveConsoleSessionId()
@ stdcall -import WaitCommEvent(long ptr ptr)
@ stdcall -import WaitForDebugEvent(ptr long)
@ stdcall -import WaitForDebugEventEx(ptr long)
@ stdcall -import WaitForMultipleObjects(long ptr long long)
@ stdcall -import WaitForMultipleObjectsEx(long ptr long long long)
@ stdcall -import WaitForSingleObject(long long)
......
......@@ -1729,7 +1729,7 @@
# @ stub WTSIsServerContainer
@ stdcall WaitCommEvent(long ptr ptr)
@ stdcall WaitForDebugEvent(ptr long)
# @ stub WaitForDebugEventEx
@ stdcall WaitForDebugEventEx(ptr long)
# @ stub WaitForMachinePolicyForegroundProcessingInternal
@ stdcall WaitForMultipleObjects(long ptr long long)
@ stdcall WaitForMultipleObjectsEx(long ptr long long long)
......
......@@ -428,6 +428,34 @@ BOOL WINAPI DECLSPEC_HOTPATCH WaitForDebugEvent( DEBUG_EVENT *event, DWORD timeo
}
}
/******************************************************************************
* WaitForDebugEventEx (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH WaitForDebugEventEx( DEBUG_EVENT *event, DWORD timeout )
{
NTSTATUS status;
LARGE_INTEGER time;
DBGUI_WAIT_STATE_CHANGE state;
for (;;)
{
status = DbgUiWaitStateChange( &state, get_nt_timeout( &time, timeout ) );
switch (status)
{
case STATUS_SUCCESS:
DbgUiConvertStateChangeStructure( &state, event );
return TRUE;
case STATUS_USER_APC:
continue;
case STATUS_TIMEOUT:
SetLastError( ERROR_SEM_TIMEOUT );
return FALSE;
default:
return set_ntstatus( status );
}
}
}
/***********************************************************************
* WaitOnAddress (kernelbase.@)
......
......@@ -511,6 +511,13 @@ NTSTATUS WINAPI DbgUiConvertStateChangeStructure( DBGUI_WAIT_STATE_CHANGE *state
event->u.DebugString.fUnicode = FALSE;
event->u.DebugString.nDebugStringLength = info->ExceptionRecord.ExceptionInformation[0];
}
else if (code == DBG_PRINTEXCEPTION_WIDE_C && info->ExceptionRecord.NumberParameters >= 2)
{
event->dwDebugEventCode = OUTPUT_DEBUG_STRING_EVENT;
event->u.DebugString.lpDebugStringData = (void *)info->ExceptionRecord.ExceptionInformation[1];
event->u.DebugString.fUnicode = TRUE;
event->u.DebugString.nDebugStringLength = info->ExceptionRecord.ExceptionInformation[0];
}
else if (code == DBG_RIPEXCEPTION && info->ExceptionRecord.NumberParameters >= 2)
{
event->dwDebugEventCode = RIP_EVENT;
......
......@@ -8740,7 +8740,6 @@ static void test_outputdebugstring(BOOL unicode, DWORD numexc_ansi, BOOL todo_an
ok(outputdebugstring_exceptions_ansi == numexc_ansi,
"OutputDebugString%c generated %ld ansi exceptions, expected %ld\n",
unicode ? 'W' : 'A', outputdebugstring_exceptions_ansi, numexc_ansi);
todo_wine_if(unicode && numexc_unicode_low)
ok(outputdebugstring_exceptions_unicode >= numexc_unicode_low &&
outputdebugstring_exceptions_unicode <= numexc_unicode_high,
"OutputDebugString%c generated %lu unicode exceptions, expected %ld-%ld\n",
......
......@@ -2817,6 +2817,7 @@ WINBASEAPI BOOL WINAPI VirtualUnlock(LPVOID,SIZE_T);
WINBASEAPI DWORD WINAPI WTSGetActiveConsoleSessionId(void);
WINBASEAPI BOOL WINAPI WaitCommEvent(HANDLE,LPDWORD,LPOVERLAPPED);
WINBASEAPI BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
WINBASEAPI BOOL WINAPI WaitForDebugEventEx(LPDEBUG_EVENT,DWORD);
WINBASEAPI DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD);
WINBASEAPI DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,BOOL,DWORD,BOOL);
WINBASEAPI DWORD WINAPI WaitForSingleObject(HANDLE,DWORD);
......
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