From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by Paint.NET. --- dlls/coremessaging/main.c | 23 ++++++++++++++++++----- dlls/coremessaging/tests/coremessaging.c | 5 +---- 2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/dlls/coremessaging/main.c b/dlls/coremessaging/main.c index 02e7de09da6..bb74d9bca56 100644 --- a/dlls/coremessaging/main.c +++ b/dlls/coremessaging/main.c @@ -396,14 +396,14 @@ static const struct IDispatcherQueueControllerVtbl dispatcher_queue_controller_v
DEFINE_IINSPECTABLE( dispatcher_queue_controller_statics, IDispatcherQueueControllerStatics, struct dispatcher_queue_controller_statics, IActivationFactory_iface )
-static HRESULT WINAPI dispatcher_queue_controller_statics_CreateOnDedicatedThread( IDispatcherQueueControllerStatics *iface, IDispatcherQueueController **result ) +static HRESULT create_dispatcher_queue_controller( DispatcherQueueOptions options, IDispatcherQueueController **result ) { struct dispatcher_queue_controller *impl; HRESULT hr;
- FIXME( "iface %p, result %p semi-stub!\n", iface, result ); - if (!result) return E_POINTER; + if (options.dwSize != sizeof( DispatcherQueueOptions )) return E_INVALIDARG; + if (options.threadType != DQTYPE_THREAD_DEDICATED && options.threadType != DQTYPE_THREAD_CURRENT) return E_INVALIDARG; if (!(impl = calloc( 1, sizeof( *impl ) ))) return E_OUTOFMEMORY;
impl->IDispatcherQueueController_iface.lpVtbl = &dispatcher_queue_controller_vtbl; @@ -419,6 +419,19 @@ static HRESULT WINAPI dispatcher_queue_controller_statics_CreateOnDedicatedThrea return S_OK; }
+static HRESULT WINAPI dispatcher_queue_controller_statics_CreateOnDedicatedThread( IDispatcherQueueControllerStatics *iface, IDispatcherQueueController **result ) +{ + DispatcherQueueOptions options; + + FIXME( "iface %p, result %p semi-stub!\n", iface, result ); + + options.dwSize = sizeof( DispatcherQueueOptions ); + options.threadType = DQTYPE_THREAD_DEDICATED; + options.apartmentType = DQTAT_COM_ASTA; + + return create_dispatcher_queue_controller( options, result ); +} + static const struct IDispatcherQueueControllerStaticsVtbl dispatcher_queue_controller_statics_vtbl = { dispatcher_queue_controller_statics_QueryInterface, @@ -458,7 +471,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa
HRESULT WINAPI CreateDispatcherQueueController( DispatcherQueueOptions options, PDISPATCHERQUEUECONTROLLER *queue_controller ) { - FIXME( "options.dwSize = %lu, options.threadType = %d, options.apartmentType = %d, queue_controller %p stub!\n", + FIXME( "options.dwSize = %lu, options.threadType = %d, options.apartmentType = %d, queue_controller %p semi-stub!\n", options.dwSize, options.threadType, options.apartmentType, queue_controller ); - return E_NOTIMPL; + return create_dispatcher_queue_controller( options, queue_controller ); } diff --git a/dlls/coremessaging/tests/coremessaging.c b/dlls/coremessaging/tests/coremessaging.c index 04be062e16a..e3d9946c3ad 100644 --- a/dlls/coremessaging/tests/coremessaging.c +++ b/dlls/coremessaging/tests/coremessaging.c @@ -236,9 +236,8 @@ static void check_create_dispatcher_queue_controller_( unsigned int line, DWORD options.apartmentType = apartment_type;
hr = CreateDispatcherQueueController( options, &dispatcher_queue_controller ); - todo_wine ok_(__FILE__, line)( hr == expected_hr, "got CreateDispatcherQueueController hr %#lx.\n", hr ); - if (FAILED(hr)) return; + if (hr == E_INVALIDARG) return;
hr = IDispatcherQueueController_get_DispatcherQueue( dispatcher_queue_controller, &dispatcher_queue ); todo_wine @@ -316,10 +315,8 @@ static void test_CreateDispatcherQueueController(void) HRESULT hr;
hr = CreateDispatcherQueueController( options, NULL ); - todo_wine ok( hr == E_POINTER || hr == 0x80000005 /* E_POINTER #if !defined(_WIN32) */, "got hr %#lx.\n", hr ); hr = CreateDispatcherQueueController( options, &dispatcher_queue_controller ); - todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); ok( dispatcher_queue_controller == (void *)0xdeadbeef, "CreateDispatcherQueueController returned IDispatcherQueueController %p.\n", dispatcher_queue_controller );