Skip to content

Commit 197ed01

Browse files
MishaProductionsHBelusca
authored andcommitted
[WINDOWSCODECS][WINDOWSCODECSEXT] Sync to wine-10.0 (reactos#7665)
1 parent 41d1898 commit 197ed01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+16270
-10425
lines changed

dll/win32/windowscodecs/CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
add_definitions(
33
-D__WINESRC__
4-
-D__ROS_LONG64__
54
-DENTRY_PREFIX=WIC_
65
-DPROXY_DELEGATION
76
-DWINE_REGISTER_DLL)
87

98
remove_definitions(-D_WIN32_WINNT=0x502)
9+
remove_definitions(-D_CRT_NON_CONFORMING_SWPRINTFS)
1010
add_definitions(-D_WIN32_WINNT=0x600)
1111

1212
include_directories(
@@ -27,13 +27,17 @@ list(APPEND SOURCE
2727
colorcontext.c
2828
colortransform.c
2929
converter.c
30+
ddsformat.c
31+
decoder.c
32+
encoder.c
3033
fliprotate.c
3134
gifformat.c
32-
icnsformat.c
3335
icoformat.c
3436
imgfactory.c
3537
info.c
36-
jpegformat.c
38+
libjpeg.c
39+
libpng.c
40+
libtiff.c
3741
main.c
3842
metadatahandler.c
3943
metadataquery.c
@@ -45,8 +49,9 @@ list(APPEND SOURCE
4549
scaler.c
4650
stream.c
4751
tgaformat.c
48-
tiffformat.c
49-
ungif.c)
52+
ungif.c
53+
uuid.c
54+
wincodecs_common.c)
5055

5156
if(MSVC)
5257
if(ARCH STREQUAL "i386")
@@ -79,7 +84,7 @@ if(MSVC)
7984
endif()
8085

8186
set_module_type(windowscodecs win32dll)
82-
target_link_libraries(windowscodecs wine uuid ${PSEH_LIB})
83-
add_importlibs(windowscodecs ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 advapi32_vista propsys msvcrt kernel32 ntdll)
87+
target_link_libraries(windowscodecs wine uuid ${PSEH_LIB} oldnames)
88+
add_importlibs(windowscodecs libjpeg libpng libtiff ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 advapi32_vista propsys msvcrt kernel32 ntdll)
8489
add_pch(windowscodecs precomp.h "${PCH_SKIP_SOURCE}")
8590
add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all)

dll/win32/windowscodecs/bitmap.c

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
1818
*/
1919

20-
#ifndef __REACTOS__
21-
#include "config.h"
22-
#endif
23-
2420
#include <stdarg.h>
2521

2622
#define COBJMACROS
@@ -34,6 +30,9 @@
3430
#include "wine/asm.h"
3531
#include "wine/debug.h"
3632

33+
#include "initguid.h"
34+
DEFINE_GUID(IID_CMetaBitmapRenderTarget, 0x0ccd7824,0xdc16,0x4d09,0xbc,0xa8,0x6b,0x09,0xc4,0xef,0x55,0x35);
35+
3736
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
3837

3938
/* WARNING: .NET Media Integration Layer (MIL) directly dereferences
@@ -82,11 +81,6 @@ static inline BitmapImpl *impl_from_IMILUnknown1(IMILUnknown1 *iface)
8281
return CONTAINING_RECORD(iface, BitmapImpl, IMILUnknown1_iface);
8382
}
8483

85-
static inline BitmapImpl *impl_from_IMILUnknown2(IMILUnknown2 *iface)
86-
{
87-
return CONTAINING_RECORD(iface, BitmapImpl, IMILUnknown2_iface);
88-
}
89-
9084
static inline BitmapLockImpl *impl_from_IWICBitmapLock(IWICBitmapLock *iface)
9185
{
9286
return CONTAINING_RECORD(iface, BitmapLockImpl, IWICBitmapLock_iface);
@@ -155,7 +149,7 @@ static ULONG WINAPI BitmapLockImpl_AddRef(IWICBitmapLock *iface)
155149
BitmapLockImpl *This = impl_from_IWICBitmapLock(iface);
156150
ULONG ref = InterlockedIncrement(&This->ref);
157151

158-
TRACE("(%p) refcount=%u\n", iface, ref);
152+
TRACE("(%p) refcount=%lu\n", iface, ref);
159153

160154
return ref;
161155
}
@@ -165,13 +159,13 @@ static ULONG WINAPI BitmapLockImpl_Release(IWICBitmapLock *iface)
165159
BitmapLockImpl *This = impl_from_IWICBitmapLock(iface);
166160
ULONG ref = InterlockedDecrement(&This->ref);
167161

168-
TRACE("(%p) refcount=%u\n", iface, ref);
162+
TRACE("(%p) refcount=%lu\n", iface, ref);
169163

170164
if (ref == 0)
171165
{
172166
BitmapImpl_ReleaseLock(This->parent);
173167
IWICBitmap_Release(&This->parent->IWICBitmap_iface);
174-
HeapFree(GetProcessHeap(), 0, This);
168+
free(This);
175169
}
176170

177171
return ref;
@@ -262,7 +256,10 @@ static HRESULT WINAPI BitmapImpl_QueryInterface(IWICBitmap *iface, REFIID iid,
262256
}
263257
else
264258
{
265-
FIXME("unknown interface %s\n", debugstr_guid(iid));
259+
if (IsEqualIID(&IID_CMetaBitmapRenderTarget, iid))
260+
WARN("Ignoring interface %s\n", debugstr_guid(iid));
261+
else
262+
FIXME("unknown interface %s\n", debugstr_guid(iid));
266263
*ppv = NULL;
267264
return E_NOINTERFACE;
268265
}
@@ -276,7 +273,7 @@ static ULONG WINAPI BitmapImpl_AddRef(IWICBitmap *iface)
276273
BitmapImpl *This = impl_from_IWICBitmap(iface);
277274
ULONG ref = InterlockedIncrement(&This->ref);
278275

279-
TRACE("(%p) refcount=%u\n", iface, ref);
276+
TRACE("(%p) refcount=%lu\n", iface, ref);
280277

281278
return ref;
282279
}
@@ -286,7 +283,7 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
286283
BitmapImpl *This = impl_from_IWICBitmap(iface);
287284
ULONG ref = InterlockedDecrement(&This->ref);
288285

289-
TRACE("(%p) refcount=%u\n", iface, ref);
286+
TRACE("(%p) refcount=%lu\n", iface, ref);
290287

291288
if (ref == 0)
292289
{
@@ -296,8 +293,8 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
296293
if (This->view)
297294
UnmapViewOfFile(This->view);
298295
else
299-
HeapFree(GetProcessHeap(), 0, This->data);
300-
HeapFree(GetProcessHeap(), 0, This);
296+
free(This->data);
297+
free(This);
301298
}
302299

303300
return ref;
@@ -378,7 +375,7 @@ static HRESULT WINAPI BitmapImpl_Lock(IWICBitmap *iface, const WICRect *prcLock,
378375
BitmapLockImpl *result;
379376
WICRect rc;
380377

381-
TRACE("(%p,%s,%x,%p)\n", iface, debug_wic_rect(prcLock), flags, ppILock);
378+
TRACE("(%p,%s,%lx,%p)\n", iface, debug_wic_rect(prcLock), flags, ppILock);
382379

383380
if (!(flags & (WICBitmapLockRead|WICBitmapLockWrite)) || !ppILock)
384381
return E_INVALIDARG;
@@ -401,13 +398,13 @@ static HRESULT WINAPI BitmapImpl_Lock(IWICBitmap *iface, const WICRect *prcLock,
401398
return E_FAIL;
402399
}
403400

404-
result = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapLockImpl));
401+
result = malloc(sizeof(BitmapLockImpl));
405402
if (!result)
406403
return E_OUTOFMEMORY;
407404

408405
if (!BitmapImpl_AcquireLock(This, flags & WICBitmapLockWrite))
409406
{
410-
HeapFree(GetProcessHeap(), 0, result);
407+
free(result);
411408
return WINCODEC_ERR_ALREADYLOCKED;
412409
}
413410

@@ -605,7 +602,7 @@ static HRESULT WINAPI IMILBitmapImpl_unknown1(IMILBitmap *iface, void **ppv)
605602
static HRESULT WINAPI IMILBitmapImpl_Lock(IMILBitmap *iface, const WICRect *rc, DWORD flags, IWICBitmapLock **lock)
606603
{
607604
BitmapImpl *This = impl_from_IMILBitmap(iface);
608-
TRACE("(%p,%p,%08x,%p)\n", iface, rc, flags, lock);
605+
TRACE("(%p,%p,%08lx,%p)\n", iface, rc, flags, lock);
609606
return IWICBitmap_Lock(&This->IWICBitmap_iface, rc, flags, lock);
610607
}
611608

@@ -675,7 +672,7 @@ static ULONG WINAPI IMILUnknown1Impl_Release(IMILUnknown1 *iface)
675672
return IWICBitmap_Release(&This->IWICBitmap_iface);
676673
}
677674

678-
DECLSPEC_HIDDEN void WINAPI IMILUnknown1Impl_unknown1(IMILUnknown1 *iface, void *arg)
675+
void WINAPI IMILUnknown1Impl_unknown1(IMILUnknown1 *iface, void *arg)
679676
{
680677
FIXME("(%p,%p): stub\n", iface, arg);
681678
}
@@ -686,7 +683,7 @@ static HRESULT WINAPI IMILUnknown1Impl_unknown2(IMILUnknown1 *iface, void *arg1,
686683
return E_NOTIMPL;
687684
}
688685

689-
DECLSPEC_HIDDEN HRESULT WINAPI IMILUnknown1Impl_unknown3(IMILUnknown1 *iface, void *arg)
686+
HRESULT WINAPI IMILUnknown1Impl_unknown3(IMILUnknown1 *iface, void *arg)
690687
{
691688
FIXME("(%p,%p): stub\n", iface, arg);
692689
return E_NOTIMPL;
@@ -716,7 +713,7 @@ static HRESULT WINAPI IMILUnknown1Impl_unknown7(IMILUnknown1 *iface, void *arg)
716713
return E_NOTIMPL;
717714
}
718715

719-
DECLSPEC_HIDDEN HRESULT WINAPI IMILUnknown1Impl_unknown8(IMILUnknown1 *iface)
716+
HRESULT WINAPI IMILUnknown1Impl_unknown8(IMILUnknown1 *iface)
720717
{
721718
FIXME("(%p): stub\n", iface);
722719
return E_NOTIMPL;
@@ -808,13 +805,13 @@ HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, UINT stride, UINT datasiz
808805
if (datasize < stride * uiHeight) return WINCODEC_ERR_INSUFFICIENTBUFFER;
809806
if (stride < ((bpp*uiWidth)+7)/8) return E_INVALIDARG;
810807

811-
This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapImpl));
808+
This = malloc(sizeof(BitmapImpl));
812809
if (!This) return E_OUTOFMEMORY;
813810

814811
if (view) data = (BYTE *)view + offset;
815-
else if (!(data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, datasize)))
812+
else if (!(data = calloc(1, datasize)))
816813
{
817-
HeapFree(GetProcessHeap(), 0, This);
814+
free(This);
818815
return E_OUTOFMEMORY;
819816
}
820817

@@ -835,7 +832,11 @@ HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, UINT stride, UINT datasiz
835832
This->bpp = bpp;
836833
memcpy(&This->pixelformat, pixelFormat, sizeof(GUID));
837834
This->dpix = This->dpiy = 0.0;
835+
#ifdef __REACTOS__
838836
InitializeCriticalSection(&This->cs);
837+
#else
838+
InitializeCriticalSectionEx(&This->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
839+
#endif
839840
This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapImpl.lock");
840841

841842
*ppIBitmap = &This->IWICBitmap_iface;

0 commit comments

Comments
 (0)