From a9a84a48c1b3b6368fbe6690ed536ed53d1ab489 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Mon, 23 Nov 2015 09:51:23 +0000 Subject: [PATCH 1/1] [WINDOWSCODECS] Sync with Wine Staging 1.7.55. CORE-10536 svn path=/trunk/; revision=70065 --- .../dll/win32/windowscodecs/CMakeLists.txt | 2 +- reactos/dll/win32/windowscodecs/gifformat.c | 8 +++++-- reactos/dll/win32/windowscodecs/regsvr.c | 24 +++++++++---------- reactos/dll/win32/windowscodecs/tiffformat.c | 2 +- reactos/dll/win32/windowscodecs/ungif.c | 17 ++++++++++--- reactos/media/doc/README.WINE | 2 +- 6 files changed, 35 insertions(+), 20 deletions(-) diff --git a/reactos/dll/win32/windowscodecs/CMakeLists.txt b/reactos/dll/win32/windowscodecs/CMakeLists.txt index 3a03fee80b9..5b44d9167d4 100644 --- a/reactos/dll/win32/windowscodecs/CMakeLists.txt +++ b/reactos/dll/win32/windowscodecs/CMakeLists.txt @@ -63,6 +63,6 @@ add_library(windowscodecs SHARED set_module_type(windowscodecs win32dll) target_link_libraries(windowscodecs wine uuid ${PSEH_LIB}) -add_importlibs(windowscodecs ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(windowscodecs ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 advapi32_vista msvcrt kernel32 ntdll) add_pch(windowscodecs wincodecs_private.h SOURCE) add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/win32/windowscodecs/gifformat.c b/reactos/dll/win32/windowscodecs/gifformat.c index 1076813bd75..03385cf417c 100644 --- a/reactos/dll/win32/windowscodecs/gifformat.c +++ b/reactos/dll/win32/windowscodecs/gifformat.c @@ -1040,10 +1040,13 @@ static ULONG WINAPI GifDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { - IStream_Release(This->stream); + if (This->stream) + { + IStream_Release(This->stream); + DGifCloseFile(This->gif); + } This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->lock); - DGifCloseFile(This->gif); HeapFree(GetProcessHeap(), 0, This); } @@ -1420,6 +1423,7 @@ HRESULT GifDecoder_CreateInstance(REFIID iid, void** ppv) This->IWICBitmapDecoder_iface.lpVtbl = &GifDecoder_Vtbl; This->IWICMetadataBlockReader_iface.lpVtbl = &GifDecoder_BlockVtbl; + This->stream = NULL; This->ref = 1; This->initialized = FALSE; This->gif = NULL; diff --git a/reactos/dll/win32/windowscodecs/regsvr.c b/reactos/dll/win32/windowscodecs/regsvr.c index 18812d817a5..b8d4740ea64 100644 --- a/reactos/dll/win32/windowscodecs/regsvr.c +++ b/reactos/dll/win32/windowscodecs/regsvr.c @@ -361,11 +361,11 @@ static HRESULT unregister_decoders(struct regsvr_decoder const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = SHDeleteKeyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = SHDeleteKeyW(instance_key, buf); + res = RegDeleteTreeW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -539,11 +539,11 @@ static HRESULT unregister_encoders(struct regsvr_encoder const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = SHDeleteKeyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = SHDeleteKeyW(instance_key, buf); + res = RegDeleteTreeW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -696,11 +696,11 @@ static HRESULT unregister_converters(struct regsvr_converter const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = SHDeleteKeyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = SHDeleteKeyW(instance_key, buf); + res = RegDeleteTreeW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -906,11 +906,11 @@ static HRESULT unregister_metadatareaders(struct regsvr_metadatareader const *li for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = SHDeleteKeyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = SHDeleteKeyW(instance_key, buf); + res = RegDeleteTreeW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -1081,11 +1081,11 @@ static HRESULT unregister_pixelformats(struct regsvr_pixelformat const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = SHDeleteKeyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = SHDeleteKeyW(instance_key, buf); + res = RegDeleteTreeW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -2021,14 +2021,14 @@ static HRESULT unregister_categories(const struct regsvr_category *list) for (; res == ERROR_SUCCESS && list->clsid; list++) { StringFromGUID2(list->clsid, buf, 39); - res = SHDeleteKeyW(instance_key, buf); + res = RegDeleteTreeW(instance_key, buf); } RegCloseKey(instance_key); RegCloseKey(categories_key); StringFromGUID2(&CLSID_WICImagingCategories, buf, 39); - res = SHDeleteKeyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); RegCloseKey(coclass_key); diff --git a/reactos/dll/win32/windowscodecs/tiffformat.c b/reactos/dll/win32/windowscodecs/tiffformat.c index 2aa711c0419..86fd89cb7d5 100644 --- a/reactos/dll/win32/windowscodecs/tiffformat.c +++ b/reactos/dll/win32/windowscodecs/tiffformat.c @@ -210,7 +210,7 @@ typedef struct { IWICBitmapDecoder IWICBitmapDecoder_iface; LONG ref; IStream *stream; - CRITICAL_SECTION lock; /* Must be held when tiff is used or initiailzed is set */ + CRITICAL_SECTION lock; /* Must be held when tiff is used or initialized is set */ TIFF *tiff; BOOL initialized; } TiffDecoder; diff --git a/reactos/dll/win32/windowscodecs/ungif.c b/reactos/dll/win32/windowscodecs/ungif.c index b3468427a46..e4d3bd43d14 100644 --- a/reactos/dll/win32/windowscodecs/ungif.c +++ b/reactos/dll/win32/windowscodecs/ungif.c @@ -491,7 +491,10 @@ DGifGetLine(GifFileType * GifFile, * image until empty block (size 0) detected. We use GetCodeNext. */ do if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR) + { + WARN("GIF is not properly terminated\n"); break; + } while (Dummy != NULL) ; } return GIF_OK; @@ -927,9 +930,17 @@ DGifSlurp(GifFileType * GifFile) { Extensions->Function = Function; - /* Create an extension block with our data */ - if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR) - return (GIF_ERROR); + if (ExtData) + { + /* Create an extension block with our data */ + if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR) + return (GIF_ERROR); + } + else /* Empty extension block */ + { + if (AddExtensionBlock(Extensions, 0, NULL) == GIF_ERROR) + return (GIF_ERROR); + } while (ExtData != NULL) { int Len; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 3f5b6e53b1c..63b57f06409 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -200,7 +200,7 @@ reactos/dll/win32/version # Synced to WineStaging-1.7.55 reactos/dll/win32/vssapi # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.55 -reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.47 +reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.55 reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.7.47 reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.7.47 reactos/dll/win32/wing32 # Synced to WineStaging-1.7.55 -- 2.17.1