Commit a7c2f4e5 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Implement ImmEnumInputContext.

parent 44e1e943
......@@ -3033,10 +3033,25 @@ BOOL WINAPI ImmDisableTextFrameService(DWORD idThread)
* ImmEnumInputContext(IMM32.@)
*/
BOOL WINAPI ImmEnumInputContext(DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam)
BOOL WINAPI ImmEnumInputContext( DWORD thread, IMCENUMPROC callback, LPARAM lparam )
{
FIXME("Stub\n");
return FALSE;
HIMC buffer[256];
NTSTATUS status;
UINT i, size;
TRACE( "thread %lu, callback %p, lparam %#Ix\n", thread, callback, lparam );
if ((status = NtUserBuildHimcList( thread, ARRAY_SIZE(buffer), buffer, &size )))
{
RtlSetLastWin32Error( RtlNtStatusToDosError( status ) );
WARN( "NtUserBuildHimcList returned %#lx\n", status );
return FALSE;
}
if (size == ARRAY_SIZE(buffer)) FIXME( "NtUserBuildHimcList returned %u handles\n", size );
for (i = 0; i < size; i++) if (!callback( buffer[i], lparam )) return FALSE;
return TRUE;
}
/***********************************************************************
......
......@@ -2930,18 +2930,19 @@ static void test_ImmEnumInputContext(void)
{
HIMC himc;
todo_wine
ok_ret( 1, ImmEnumInputContext( 0, enum_get_context, (LPARAM)&default_himc ) );
ok_ret( 1, ImmEnumInputContext( -1, enum_find_context, 0 ) );
ok_ret( 1, ImmEnumInputContext( GetCurrentThreadId(), enum_find_context, 0 ) );
todo_wine
ok_ret( 0, ImmEnumInputContext( 1, enum_find_context, 0 ) );
todo_wine
ok_ret( 1, ImmEnumInputContext( GetCurrentThreadId(), enum_find_context, 0 ) );
ok_ret( 0, ImmEnumInputContext( GetCurrentProcessId(), enum_find_context, 0 ) );
himc = ImmCreateContext();
ok_ne( NULL, himc, HIMC, "%p" );
ok_ret( 0, ImmEnumInputContext( GetCurrentThreadId(), enum_find_context, (LPARAM)himc ) );
ok_ret( 1, ImmDestroyContext( himc ) );
todo_wine
ok_ret( 1, ImmEnumInputContext( GetCurrentThreadId(), enum_find_context, (LPARAM)himc ) );
}
......
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