windowscodecsext: Implement WICCreateColorTransform_Proxy and IWICColorTransform_Initialize_Proxy.

This commit is contained in:
Hans Leidekker 2013-02-11 14:30:10 +01:00 committed by Alexandre Julliard
parent 0cc78d97c1
commit e002d2eacf
7 changed files with 119 additions and 4 deletions

3
configure vendored
View File

@ -16184,7 +16184,8 @@ wine_fn_config_dll winaspi.dll16 enable_win16
wine_fn_config_dll windebug.dll16 enable_win16
wine_fn_config_dll windowscodecs enable_windowscodecs implib
wine_fn_config_test dlls/windowscodecs/tests windowscodecs_test
wine_fn_config_dll windowscodecsext enable_windowscodecsext
wine_fn_config_dll windowscodecsext enable_windowscodecsext implib
wine_fn_config_test dlls/windowscodecsext/tests windowscodecsext_test
wine_fn_config_dll winealsa.drv enable_winealsa_drv
wine_fn_config_dll winecoreaudio.drv enable_winecoreaudio_drv
wine_fn_config_lib winecrt0

View File

@ -3068,7 +3068,8 @@ WINE_CONFIG_DLL(winaspi.dll16,enable_win16)
WINE_CONFIG_DLL(windebug.dll16,enable_win16)
WINE_CONFIG_DLL(windowscodecs,,[implib])
WINE_CONFIG_TEST(dlls/windowscodecs/tests)
WINE_CONFIG_DLL(windowscodecsext)
WINE_CONFIG_DLL(windowscodecsext,,[implib])
WINE_CONFIG_TEST(dlls/windowscodecsext/tests)
WINE_CONFIG_DLL(winealsa.drv)
WINE_CONFIG_DLL(winecoreaudio.drv)
WINE_CONFIG_LIB(winecrt0)

View File

@ -1,4 +1,6 @@
MODULE = windowscodecsext.dll
IMPORTLIB = windowscodecsext
IMPORTS = ole32
C_SRCS = \
main.c

View File

@ -22,8 +22,12 @@
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "wincodec.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
@ -45,3 +49,39 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
return TRUE;
}
HRESULT WINAPI WICCreateColorTransform_Proxy(IWICColorTransform **ppIWICColorTransform)
{
HRESULT hr, init;
IWICImagingFactory *factory;
TRACE("(%p)\n", ppIWICColorTransform);
if (!ppIWICColorTransform) return E_INVALIDARG;
init = CoInitializeEx(NULL, COINIT_MULTITHREADED);
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory, (void **)&factory);
if (FAILED(hr))
{
if (SUCCEEDED(init)) CoUninitialize();
return hr;
}
hr = IWICImagingFactory_CreateColorTransformer(factory, ppIWICColorTransform);
IWICImagingFactory_Release(factory);
if (SUCCEEDED(init)) CoUninitialize();
return hr;
}
HRESULT WINAPI IWICColorTransform_Initialize_Proxy_W(IWICColorTransform *iface,
IWICBitmapSource *pIBitmapSource, IWICColorContext *pIContextSource,
IWICColorContext *pIContextDest, REFWICPixelFormatGUID pixelFmtDest)
{
TRACE("(%p,%p,%p,%p,%s)\n", iface, pIBitmapSource, pIContextSource, pIContextDest,
debugstr_guid(pixelFmtDest));
return IWICColorTransform_Initialize(iface, pIBitmapSource, pIContextSource,
pIContextDest, pixelFmtDest);
}

View File

@ -0,0 +1,7 @@
TESTDLL = windowscodecsext.dll
IMPORTS = windowscodecsext ole32
C_SRCS = \
transform.c
@MAKE_TEST_RULES@

View File

@ -0,0 +1,64 @@
/*
* Copyright 2013 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdio.h>
#include "windows.h"
#include "objbase.h"
#include "wincodec.h"
#include "wine/test.h"
HRESULT WINAPI WICCreateColorTransform_Proxy(IWICColorTransform**);
static void test_WICCreateColorTransform_Proxy(void)
{
HRESULT hr;
IWICColorTransform *transform;
hr = WICCreateColorTransform_Proxy( NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
transform = NULL;
hr = WICCreateColorTransform_Proxy( &transform );
ok( hr == S_OK, "got %08x\n", hr );
if (transform) IWICColorTransform_Release( transform );
hr = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
ok( hr == S_OK, "got %08x\n", hr );
transform = NULL;
hr = WICCreateColorTransform_Proxy( &transform );
ok( hr == S_OK, "got %08x\n", hr );
if (transform) IWICColorTransform_Release( transform );
CoUninitialize();
hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
ok( hr == S_OK, "got %08x\n", hr );
transform = NULL;
hr = WICCreateColorTransform_Proxy( &transform );
ok( hr == S_OK, "got %08x\n", hr );
if (transform) IWICColorTransform_Release( transform );
CoUninitialize();
}
START_TEST(transform)
{
test_WICCreateColorTransform_Proxy();
}

View File

@ -1,3 +1,3 @@
@ stub DllGetClassObject
@ stub IWICColorTransform_Initialize_Proxy
@ stub WICCreateColorTransform_Proxy
@ stdcall IWICColorTransform_Initialize_Proxy(ptr ptr ptr ptr ptr) IWICColorTransform_Initialize_Proxy_W
@ stdcall WICCreateColorTransform_Proxy(ptr)