[WINDOWSCODECS] Sync with Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Mon, 23 Nov 2015 09:51:23 +0000 (09:51 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Mon, 23 Nov 2015 09:51:23 +0000 (09:51 +0000)
svn path=/trunk/; revision=70065

reactos/dll/win32/windowscodecs/CMakeLists.txt
reactos/dll/win32/windowscodecs/gifformat.c
reactos/dll/win32/windowscodecs/regsvr.c
reactos/dll/win32/windowscodecs/tiffformat.c
reactos/dll/win32/windowscodecs/ungif.c
reactos/media/doc/README.WINE

index 3a03fee..5b44d91 100644 (file)
@@ -63,6 +63,6 @@ add_library(windowscodecs SHARED
 
 set_module_type(windowscodecs win32dll)
 target_link_libraries(windowscodecs wine uuid ${PSEH_LIB})
 
 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)
 add_pch(windowscodecs wincodecs_private.h SOURCE)
 add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all)
index 1076813..03385cf 100644 (file)
@@ -1040,10 +1040,13 @@ static ULONG WINAPI GifDecoder_Release(IWICBitmapDecoder *iface)
 
     if (ref == 0)
     {
 
     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);
         This->lock.DebugInfo->Spare[0] = 0;
         DeleteCriticalSection(&This->lock);
-        DGifCloseFile(This->gif);
         HeapFree(GetProcessHeap(), 0, This);
     }
 
         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->IWICBitmapDecoder_iface.lpVtbl = &GifDecoder_Vtbl;
     This->IWICMetadataBlockReader_iface.lpVtbl = &GifDecoder_BlockVtbl;
+    This->stream = NULL;
     This->ref = 1;
     This->initialized = FALSE;
     This->gif = NULL;
     This->ref = 1;
     This->initialized = FALSE;
     This->gif = NULL;
index 18812d8..b8d4740 100644 (file)
@@ -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);
 
     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;
 
        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;
     }
        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);
 
     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;
 
        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;
     }
        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);
 
     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;
 
        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;
     }
        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);
 
     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;
 
        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;
     }
        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);
 
     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;
 
         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;
     }
         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);
     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);
     }
 
     RegCloseKey(instance_key);
     RegCloseKey(categories_key);
 
     StringFromGUID2(&CLSID_WICImagingCategories, buf, 39);
-    res = SHDeleteKeyW(coclass_key, buf);
+    res = RegDeleteTreeW(coclass_key, buf);
 
     RegCloseKey(coclass_key);
 
 
     RegCloseKey(coclass_key);
 
index 2aa711c..86fd89c 100644 (file)
@@ -210,7 +210,7 @@ typedef struct {
     IWICBitmapDecoder IWICBitmapDecoder_iface;
     LONG ref;
     IStream *stream;
     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;
     TIFF *tiff;
     BOOL initialized;
 } TiffDecoder;
index b346842..e4d3bd4 100644 (file)
@@ -491,7 +491,10 @@ DGifGetLine(GifFileType * GifFile,
              * image until empty block (size 0) detected. We use GetCodeNext. */
             do
                 if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR)
              * 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;
                     break;
+                }
             while (Dummy != NULL) ;
         }
         return GIF_OK;
             while (Dummy != NULL) ;
         }
         return GIF_OK;
@@ -927,9 +930,17 @@ DGifSlurp(GifFileType * GifFile) {
 
               Extensions->Function = Function;
 
 
               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;
 
               while (ExtData != NULL) {
                   int Len;
index 3f5b6e5..63b57f0 100644 (file)
@@ -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/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
 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