From 69a4e4baa2679972b1170a95cb9b86d08a493b54 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 27 Apr 2020 16:19:14 -0500 Subject: [PATCH] Rebase against 28ec2795186c7db83637b3b17e4fa95095ebb77d. --- ...ndline-option-patches-to-show-the-pa.patch | 28 +- ...on-to-create-new-tokens-for-elevatio.patch | 22 +- ...st-from-ddraw1_vtbl-and-ddraw_surfac.patch | 45 - ...ing-to-vtable-for-surface-and-palett.patch | 67 - patches/ddraw-Write_Vtable/definition | 2 - ...-memory-segments-to-store-semaphore-.patch | 16 +- ...rt-if-esync-is-enabled-for-the-serve.patch | 18 +- ...0001-ntdll-Implement-NtSetLdtEntries.patch | 14 +- ...to-update-user-shared-data-into-a-se.patch | 16 +- ...k-drive_c-as-case-insensitive-when-c.patch | 30 +- patches/patchinstall.sh | 103 +- ...e-wineserver-shared-memory-communica.patch | 22 +- patches/server-Shared_Memory/definition | 1 + ...d-initial-implementation-of-the-GIF-.patch | 1094 ----------------- ...itialize-empty-property-bag-in-GIF-e.patch | 70 -- ...-Add-registration-of-the-GIF-encoder.patch | 30 - ...x-IWICBitmapDecoder-CopyPalette-for-.patch | 27 - ...tter-follow-the-GIF-spec-and-don-t-s.patch | 30 - ...sts-Add-the-tests-for-GIF-encoder-an.patch | 130 -- ...rrectly-indicate-that-the-global-inf.patch | 32 - 20 files changed, 119 insertions(+), 1678 deletions(-) delete mode 100644 patches/ddraw-Write_Vtable/0001-ddraw-Remove-const-from-ddraw1_vtbl-and-ddraw_surfac.patch delete mode 100644 patches/ddraw-Write_Vtable/0002-ddraw-Allow-writing-to-vtable-for-surface-and-palett.patch delete mode 100644 patches/ddraw-Write_Vtable/definition delete mode 100644 patches/windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch delete mode 100644 patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch delete mode 100644 patches/windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch delete mode 100644 patches/windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch delete mode 100644 patches/windowscodecs-GIF_Encoder/0022-windowscodecs-Better-follow-the-GIF-spec-and-don-t-s.patch delete mode 100644 patches/windowscodecs-GIF_Encoder/0026-windowscodecs-tests-Add-the-tests-for-GIF-encoder-an.patch delete mode 100644 patches/windowscodecs-GIF_Encoder/0028-windowscodecs-Correctly-indicate-that-the-global-inf.patch diff --git a/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch b/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch index 7f82be4a..6d117bae 100644 --- a/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch +++ b/patches/Staging/0003-loader-Add-commandline-option-patches-to-show-the-pa.patch @@ -1,4 +1,4 @@ -From 63d2046a8f4388fbc7c12a07ae5f412fccc1b202 Mon Sep 17 00:00:00 2001 +From 449d193d2cc9255387903c16fe803219fa63f29a Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 29 May 2014 23:43:45 +0200 Subject: [PATCH] loader: Add commandline option --patches to show the patch @@ -33,10 +33,10 @@ index c29a1c26c26..8906e194272 100644 * wine_get_build_id (NTDLL.@) */ diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index e61a2578da5..52db67fd978 100644 +index 4f5fa8c21d4..f4784428e2e 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec -@@ -1571,6 +1571,7 @@ +@@ -1575,6 +1575,7 @@ # Version @ cdecl wine_get_version() NTDLL_wine_get_version @@ -45,22 +45,22 @@ index e61a2578da5..52db67fd978 100644 @ cdecl wine_get_host_version(ptr ptr) NTDLL_wine_get_host_version diff --git a/include/wine/library.h b/include/wine/library.h -index f338c4da190..1f992da6062 100644 +index 090b8349559..b8a4a2df576 100644 --- a/include/wine/library.h +++ b/include/wine/library.h -@@ -47,6 +47,7 @@ extern const char *wine_get_data_dir(void); - extern const char *wine_get_server_dir(void); - extern const char *wine_get_user_name(void); +@@ -42,6 +42,7 @@ extern "C" { + /* configuration */ + extern const char *wine_get_version(void); +extern const void *wine_get_patches(void); extern const char *wine_get_build_id(void); extern void wine_init_argv0_path( const char *argv0 ); extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var ); diff --git a/libs/wine/config.c b/libs/wine/config.c -index 2a3314cbfda..5b66c063db6 100644 +index f5b4c0de9af..e52739d55ad 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c -@@ -504,6 +504,12 @@ const char *wine_get_version(void) +@@ -515,6 +515,12 @@ const char *wine_get_version(void) return PACKAGE_VERSION; } @@ -74,12 +74,12 @@ index 2a3314cbfda..5b66c063db6 100644 const char *wine_get_build_id(void) { diff --git a/libs/wine/wine.map b/libs/wine/wine.map -index 7ea849b908e..a7359ee7872 100644 +index 1143b129734..55f874d3e74 100644 --- a/libs/wine/wine.map +++ b/libs/wine/wine.map -@@ -22,6 +22,7 @@ WINE_1.0 - wine_get_server_dir; - wine_get_user_name; +@@ -13,6 +13,7 @@ WINE_1.0 + wine_exec_wine_binary; + wine_get_build_id; wine_get_version; + wine_get_patches; wine_init; @@ -146,5 +146,5 @@ index 407c897892d..d97d6b28bf8 100644 -- -2.25.1 +2.26.2 diff --git a/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch b/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch index 173b519f..a5d0d0ba 100644 --- a/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch +++ b/patches/advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch @@ -1,4 +1,4 @@ -From 8fe522dadc480b57415a7b63e0752de113851231 Mon Sep 17 00:00:00 2001 +From bfd774b59dbfd3cc1f3b2d61d60797eb20654e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 5 Aug 2017 01:45:29 +0200 Subject: [PATCH] ntdll: Add function to create new tokens for elevation @@ -14,10 +14,10 @@ Subject: [PATCH] ntdll: Add function to create new tokens for elevation 6 files changed, 117 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 853da5c3fcf..33c1355c8b5 100644 +index fd60ec270ba..c50e83b5aa7 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec -@@ -1569,6 +1569,9 @@ +@@ -1573,6 +1573,9 @@ # Virtual memory @ cdecl __wine_locked_recvmsg(long ptr long) @@ -28,10 +28,10 @@ index 853da5c3fcf..33c1355c8b5 100644 @ cdecl wine_get_version() NTDLL_wine_get_version @ cdecl wine_get_patches() NTDLL_wine_get_patches diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index b62239de5b4..d494dc71263 100644 +index 2e26d189a1e..6af681e5bde 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -96,6 +96,9 @@ extern int __wine_main_argc; +@@ -104,6 +104,9 @@ extern int __wine_main_argc; extern char **__wine_main_argv; extern WCHAR **__wine_main_wargv; @@ -39,10 +39,10 @@ index b62239de5b4..d494dc71263 100644 +extern HANDLE CDECL __wine_create_default_token(BOOL admin); + /* server support */ - extern timeout_t server_start_time DECLSPEC_HIDDEN; - extern unsigned int server_cpus DECLSPEC_HIDDEN; + extern const char *build_dir DECLSPEC_HIDDEN; + extern const char *data_dir DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c -index 6d506c85306..9940e6cf7c9 100644 +index d2a3421ac58..d360491e770 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -124,6 +124,24 @@ HANDLE CDECL __wine_make_process_system(void) @@ -71,10 +71,10 @@ index 6d506c85306..9940e6cf7c9 100644 #define UNIMPLEMENTED_INFO_CLASS(c) \ diff --git a/server/protocol.def b/server/protocol.def -index efacadac42b..434cd11baf0 100644 +index f152afb97b6..68c66bc2fcb 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -3749,6 +3749,14 @@ struct handle_info +@@ -3754,6 +3754,14 @@ struct handle_info @END @@ -215,5 +215,5 @@ index c4f1cd943c2..970ed1838da 100644 + } +} -- -2.26.0 +2.26.2 diff --git a/patches/ddraw-Write_Vtable/0001-ddraw-Remove-const-from-ddraw1_vtbl-and-ddraw_surfac.patch b/patches/ddraw-Write_Vtable/0001-ddraw-Remove-const-from-ddraw1_vtbl-and-ddraw_surfac.patch deleted file mode 100644 index d3a22ff8..00000000 --- a/patches/ddraw-Write_Vtable/0001-ddraw-Remove-const-from-ddraw1_vtbl-and-ddraw_surfac.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 9ac9e58e5c76a02e3746c4e4bd16b43766b35066 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Fri, 2 Oct 2015 17:29:43 +0200 -Subject: ddraw: Remove const from ddraw1_vtbl and ddraw_surface1_vtbl. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bad Mojo Redux tries to hook ddraw1 and expects both interfaces to be writable. - -Signed-off-by: Michael Müller ---- - dlls/ddraw/ddraw.c | 2 +- - dlls/ddraw/surface.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c -index c94bfee..bcb1608 100644 ---- a/dlls/ddraw/ddraw.c -+++ b/dlls/ddraw/ddraw.c -@@ -4494,7 +4494,7 @@ static const struct IDirectDraw2Vtbl ddraw2_vtbl = - ddraw2_GetAvailableVidMem, - }; - --static const struct IDirectDrawVtbl ddraw1_vtbl = -+static struct IDirectDrawVtbl ddraw1_vtbl = - { - /* IUnknown */ - ddraw1_QueryInterface, -diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index 6b6ddb9..71bcba4 100644 ---- a/dlls/ddraw/surface.c -+++ b/dlls/ddraw/surface.c -@@ -5421,7 +5421,7 @@ static const struct IDirectDrawSurface2Vtbl ddraw_surface2_vtbl = - ddraw_surface2_PageUnlock, - }; - --static const struct IDirectDrawSurfaceVtbl ddraw_surface1_vtbl = -+static struct IDirectDrawSurfaceVtbl ddraw_surface1_vtbl = - { - /* IUnknown */ - ddraw_surface1_QueryInterface, --- -2.5.1 - diff --git a/patches/ddraw-Write_Vtable/0002-ddraw-Allow-writing-to-vtable-for-surface-and-palett.patch b/patches/ddraw-Write_Vtable/0002-ddraw-Allow-writing-to-vtable-for-surface-and-palett.patch deleted file mode 100644 index 739f9864..00000000 --- a/patches/ddraw-Write_Vtable/0002-ddraw-Allow-writing-to-vtable-for-surface-and-palett.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 4d068ed386b282bc2fc30c13ba0845dfa6f135ef Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Wed, 3 Apr 2019 10:36:47 +1100 -Subject: [PATCH] ddraw: Allow writing to vtable for surface and palette - -Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=46949 ---- - dlls/ddraw/palette.c | 2 +- - dlls/ddraw/surface.c | 8 ++++---- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/dlls/ddraw/palette.c b/dlls/ddraw/palette.c -index 87aec96443a..7cfd662f2ec 100644 ---- a/dlls/ddraw/palette.c -+++ b/dlls/ddraw/palette.c -@@ -218,7 +218,7 @@ static HRESULT WINAPI ddraw_palette_GetEntries(IDirectDrawPalette *iface, - return hr; - } - --static const struct IDirectDrawPaletteVtbl ddraw_palette_vtbl = -+static struct IDirectDrawPaletteVtbl ddraw_palette_vtbl = - { - /*** IUnknown ***/ - ddraw_palette_QueryInterface, -diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index 8820f211852..9c9cdb358bf 100644 ---- a/dlls/ddraw/surface.c -+++ b/dlls/ddraw/surface.c -@@ -5399,7 +5399,7 @@ static HRESULT WINAPI d3d_texture1_Load(IDirect3DTexture *iface, IDirect3DTextur - * The VTable - *****************************************************************************/ - --static const struct IDirectDrawSurface7Vtbl ddraw_surface7_vtbl = -+static struct IDirectDrawSurface7Vtbl ddraw_surface7_vtbl = - { - /* IUnknown */ - ddraw_surface7_QueryInterface, -@@ -5458,7 +5458,7 @@ static const struct IDirectDrawSurface7Vtbl ddraw_surface7_vtbl = - ddraw_surface7_GetLOD, - }; - --static const struct IDirectDrawSurface4Vtbl ddraw_surface4_vtbl = -+static struct IDirectDrawSurface4Vtbl ddraw_surface4_vtbl = - { - /* IUnknown */ - ddraw_surface4_QueryInterface, -@@ -5512,7 +5512,7 @@ static const struct IDirectDrawSurface4Vtbl ddraw_surface4_vtbl = - ddraw_surface4_ChangeUniquenessValue, - }; - --static const struct IDirectDrawSurface3Vtbl ddraw_surface3_vtbl = -+static struct IDirectDrawSurface3Vtbl ddraw_surface3_vtbl = - { - /* IUnknown */ - ddraw_surface3_QueryInterface, -@@ -5560,7 +5560,7 @@ static const struct IDirectDrawSurface3Vtbl ddraw_surface3_vtbl = - ddraw_surface3_SetSurfaceDesc, - }; - --static const struct IDirectDrawSurface2Vtbl ddraw_surface2_vtbl = -+static struct IDirectDrawSurface2Vtbl ddraw_surface2_vtbl = - { - /* IUnknown */ - ddraw_surface2_QueryInterface, --- -2.20.1 - diff --git a/patches/ddraw-Write_Vtable/definition b/patches/ddraw-Write_Vtable/definition deleted file mode 100644 index 1ec7d6e0..00000000 --- a/patches/ddraw-Write_Vtable/definition +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: [39534] Make ddraw1 and ddraw_surface1 vtable as writable. -Fixes: [46949] Make ddraw[2-7] and palette vtable as writable. diff --git a/patches/eventfd_synchronization/0042-ntdll-Use-shared-memory-segments-to-store-semaphore-.patch b/patches/eventfd_synchronization/0042-ntdll-Use-shared-memory-segments-to-store-semaphore-.patch index 6177ce79..d0b2aeda 100644 --- a/patches/eventfd_synchronization/0042-ntdll-Use-shared-memory-segments-to-store-semaphore-.patch +++ b/patches/eventfd_synchronization/0042-ntdll-Use-shared-memory-segments-to-store-semaphore-.patch @@ -1,4 +1,4 @@ -From 430aff7c0693c5529ce4af2d515bf48d6ba49e15 Mon Sep 17 00:00:00 2001 +From 3248f2b2ee3d8aeede1d3d51f8e3d570d982a69b Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 11 Jun 2018 13:10:36 -0500 Subject: [PATCH] ntdll: Use shared memory segments to store semaphore and @@ -16,7 +16,7 @@ since now we don't have to allocate separate structures. 3 files changed, 155 insertions(+), 199 deletions(-) diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c -index c1d8882d817..e8ee1cbc9ff 100644 +index c1d8882d817..ea71c960007 100644 --- a/dlls/ntdll/esync.c +++ b/dlls/ntdll/esync.c @@ -32,6 +32,7 @@ @@ -63,8 +63,8 @@ index c1d8882d817..e8ee1cbc9ff 100644 +{ + struct stat st; + -+ if (stat( wine_get_config_dir(), &st ) == -1) -+ ERR("Cannot stat %s\n", wine_get_config_dir()); ++ if (stat( config_dir, &st ) == -1) ++ ERR("Cannot stat %s\n", config_dir); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-esync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); @@ -670,10 +670,10 @@ index f79b9a06c90..88f491e5ab4 100644 extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 119d35731f4..2ac4ef6a23b 100644 +index f7f9910daf6..752a0b3b622 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -44,6 +44,7 @@ +@@ -51,6 +51,7 @@ #include "wine/server.h" #include "ntdll_misc.h" #include "ddk/wdm.h" @@ -681,7 +681,7 @@ index 119d35731f4..2ac4ef6a23b 100644 WINE_DEFAULT_DEBUG_CHANNEL(module); WINE_DECLARE_DEBUG_CHANNEL(relay); -@@ -4404,6 +4405,9 @@ void __wine_process_init(void) +@@ -4647,6 +4648,9 @@ void __wine_process_init(void) peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL ); peb->LoaderLock = &loader_section; @@ -692,5 +692,5 @@ index 119d35731f4..2ac4ef6a23b 100644 init_directories(); init_user_process_params( info_size ); -- -2.24.0 +2.26.2 diff --git a/patches/eventfd_synchronization/0074-ntdll-server-Abort-if-esync-is-enabled-for-the-serve.patch b/patches/eventfd_synchronization/0074-ntdll-server-Abort-if-esync-is-enabled-for-the-serve.patch index d9d72fcb..63fa6123 100644 --- a/patches/eventfd_synchronization/0074-ntdll-server-Abort-if-esync-is-enabled-for-the-serve.patch +++ b/patches/eventfd_synchronization/0074-ntdll-server-Abort-if-esync-is-enabled-for-the-serve.patch @@ -1,4 +1,4 @@ -From ba4c80e2a7abe2ba265f949312c78045bef5695c Mon Sep 17 00:00:00 2001 +From 4863e6b323f7ecc1fceaff42a573cd0b9a07f3d5 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 4 Aug 2018 15:15:12 -0500 Subject: [PATCH] ntdll, server: Abort if esync is enabled for the server but @@ -11,7 +11,7 @@ Subject: [PATCH] ntdll, server: Abort if esync is enabled for the server but 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c -index 8255810a924..fb1953fb90c 100644 +index 0625de9fff0..522704f757f 100644 --- a/dlls/ntdll/esync.c +++ b/dlls/ntdll/esync.c @@ -115,10 +115,29 @@ static void **shm_addrs; @@ -41,8 +41,8 @@ index 8255810a924..fb1953fb90c 100644 + return; + } + - if (stat( wine_get_config_dir(), &st ) == -1) - ERR("Cannot stat %s\n", wine_get_config_dir()); + if (stat( config_dir, &st ) == -1) + ERR("Cannot stat %s\n", config_dir); @@ -128,7 +147,14 @@ void esync_init(void) sprintf( shm_name, "/wine-%lx-esync", (unsigned long)st.st_ino ); @@ -61,10 +61,10 @@ index 8255810a924..fb1953fb90c 100644 pagesize = sysconf( _SC_PAGESIZE ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 2ac4ef6a23b..6df24c076c5 100644 +index 752a0b3b622..36c5092a4b1 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -4405,8 +4405,7 @@ void __wine_process_init(void) +@@ -4648,8 +4648,7 @@ void __wine_process_init(void) peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL ); peb->LoaderLock = &loader_section; @@ -75,10 +75,10 @@ index 2ac4ef6a23b..6df24c076c5 100644 init_unix_codepage(); init_directories(); diff --git a/server/esync.c b/server/esync.c -index 1fc9316b1b5..cb4de2daa77 100644 +index 11e5e482024..bc2ce61c9a2 100644 --- a/server/esync.c +++ b/server/esync.c -@@ -395,6 +395,18 @@ DECL_HANDLER(create_esync) +@@ -394,6 +394,18 @@ DECL_HANDLER(create_esync) const struct security_descriptor *sd; const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); @@ -98,5 +98,5 @@ index 1fc9316b1b5..cb4de2daa77 100644 if ((esync = create_esync( root, &name, objattr->attributes, req->initval, req->flags, req->type, sd ))) -- -2.24.0 +2.26.2 diff --git a/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch b/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch index 8a6246f6..0684b996 100644 --- a/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch +++ b/patches/ntdll-NtSetLdtEntries/0001-ntdll-Implement-NtSetLdtEntries.patch @@ -1,4 +1,4 @@ -From 72ace2e57404a068679a703268c505c5f5ac3b12 Mon Sep 17 00:00:00 2001 +From 43e419ddc34cac7cf7754aed353fcbfb0bd9619e Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 28 Apr 2016 18:14:36 +0800 Subject: [PATCH] ntdll: Implement NtSetLdtEntries. @@ -8,7 +8,7 @@ Subject: [PATCH] ntdll: Implement NtSetLdtEntries. 1 file changed, 79 insertions(+) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c -index b6a65a4207c..70b22367e18 100644 +index e068797ff57..8c5148d4a92 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -99,6 +99,7 @@ static BOOL (WINAPI *pSetThreadGroupAffinity)(HANDLE,const GROUP_AFFINITY*,GROUP @@ -19,7 +19,7 @@ index b6a65a4207c..70b22367e18 100644 static HANDLE create_target_process(const char *arg) { -@@ -1262,6 +1263,82 @@ static void test_GetThreadSelectorEntry(void) +@@ -1276,6 +1277,82 @@ static void test_GetThreadSelectorEntry(void) ok(entry.HighWord.Bits.Granularity == 1, "expected 1, got %u\n", entry.HighWord.Bits.Granularity); } @@ -102,7 +102,7 @@ index b6a65a4207c..70b22367e18 100644 #endif /* __i386__ */ static HANDLE finish_event; -@@ -2324,6 +2401,7 @@ static void init_funcs(void) +@@ -2338,6 +2415,7 @@ static void init_funcs(void) X(NtQueryInformationThread); X(RtlGetThreadErrorMode); X(NtSetInformationThread); @@ -110,14 +110,14 @@ index b6a65a4207c..70b22367e18 100644 } #undef X } -@@ -2379,6 +2457,7 @@ START_TEST(thread) - #ifdef __i386__ +@@ -2394,6 +2472,7 @@ START_TEST(thread) test_SetThreadContext(); test_GetThreadSelectorEntry(); + test_GetThreadContext(); + test_NtSetLdtEntries(); #endif test_QueueUserWorkItem(); test_RegisterWaitForSingleObject(); -- -2.26.0 +2.26.2 diff --git a/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch b/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch index 8d1a549d..db424a61 100644 --- a/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch +++ b/patches/ntdll-User_Shared_Data/0001-ntdll-Move-code-to-update-user-shared-data-into-a-se.patch @@ -1,4 +1,4 @@ -From aefe1725320bd3053c7c51020b92cc9dfc22c7b4 Mon Sep 17 00:00:00 2001 +From cfc04e8d11f8ed0cc7a7a0097c0ae888f1222f92 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 26 Nov 2014 10:46:09 +0100 Subject: [PATCH] ntdll: Move code to update user shared data into a separate @@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Move code to update user shared data into a separate 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index f6cfe4067..933c8e798 100644 +index c50e83b5aa7..97cb16d4c3a 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec -@@ -1583,3 +1583,6 @@ +@@ -1591,3 +1591,6 @@ # Filesystem @ cdecl wine_nt_to_unix_file_name(ptr ptr long long) @ cdecl wine_unix_to_nt_file_name(ptr ptr) @@ -21,7 +21,7 @@ index f6cfe4067..933c8e798 100644 +# User shared data +@ cdecl __wine_user_shared_data() diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 843df8905..a02f609e2 100644 +index 78c18bc2d84..cd9cd1b9754 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -275,7 +275,6 @@ TEB *thread_init(void) @@ -32,8 +32,8 @@ index 843df8905..a02f609e2 100644 NTSTATUS status; struct ntdll_thread_data *thread_data; -@@ -350,7 +349,26 @@ TEB *thread_init(void) - debug_init(); +@@ -351,7 +350,26 @@ TEB *thread_init(void) + init_paths(); set_process_name( __wine_main_argc, __wine_main_argv ); - /* initialize time values in user_shared_data */ @@ -60,7 +60,7 @@ index 843df8905..a02f609e2 100644 NtQuerySystemTime( &now ); user_shared_data->SystemTime.LowPart = now.u.LowPart; user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = now.u.HighPart; -@@ -358,12 +376,8 @@ TEB *thread_init(void) +@@ -359,12 +377,8 @@ TEB *thread_init(void) user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; user_shared_data->TickCountMultiplier = 1 << 24; @@ -75,5 +75,5 @@ index 843df8905..a02f609e2 100644 BOOL read_process_memory_stats(int unix_pid, VM_COUNTERS *pvmi) -- -2.25.0 +2.26.2 diff --git a/patches/ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch b/patches/ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch index b553fed8..78dac208 100644 --- a/patches/ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch +++ b/patches/ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch @@ -1,4 +1,4 @@ -From f794872f3ba2bd78afea1df2f353846a7f5e5788 Mon Sep 17 00:00:00 2001 +From acdd5aaf5d4f618a96f21710a8ee2f44a994194c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 24 May 2019 15:09:35 +0300 Subject: [PATCH] ntdll/server: Mark drive_c as case-insensitive when created @@ -13,10 +13,10 @@ Signed-off-by: Gabriel Ivăncescu 1 file changed, 45 insertions(+) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index dcb355a6534..aca93509639 100644 +index bc25e242a77..f2109dd1ef0 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -51,6 +51,12 @@ +@@ -54,6 +54,12 @@ #ifdef HAVE_SYS_MMAN_H #include #endif @@ -29,9 +29,9 @@ index dcb355a6534..aca93509639 100644 #ifdef HAVE_SYS_PRCTL_H # include #endif -@@ -86,6 +92,22 @@ +@@ -87,6 +93,22 @@ + WINE_DEFAULT_DEBUG_CHANNEL(server); - WINE_DECLARE_DEBUG_CHANNEL(winediag); +/* just in case... */ +#undef EXT2_IOC_GETFLAGS @@ -52,7 +52,7 @@ index dcb355a6534..aca93509639 100644 /* Some versions of glibc don't define this */ #ifndef SCM_RIGHTS #define SCM_RIGHTS 1 -@@ -1248,6 +1270,28 @@ static void start_server(void) +@@ -1380,6 +1402,28 @@ void init_paths(void) } @@ -81,14 +81,14 @@ index dcb355a6534..aca93509639 100644 /*********************************************************************** * setup_config_dir * -@@ -1291,6 +1335,7 @@ static int setup_config_dir(void) - /* create the drive symlinks */ - - mkdir( "drive_c", 0777 ); -+ set_case_insensitive( "drive_c" ); - symlink( "../drive_c", "dosdevices/c:" ); - symlink( "/", "dosdevices/z:" ); - +@@ -1416,6 +1460,7 @@ static int setup_config_dir(void) + if (!mkdir( "dosdevices", 0777 )) + { + mkdir( "drive_c", 0777 ); ++ set_case_insensitive( "drive_c" ); + symlink( "../drive_c", "dosdevices/c:" ); + symlink( "/", "dosdevices/z:" ); + } -- -2.17.1 +2.26.2 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 7ac9a278..415daee7 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "c44e0cf60ad1a967d80fafb427974332b35a0071" + echo "28ec2795186c7db83637b3b17e4fa95095ebb77d" } # Show version information @@ -119,7 +119,6 @@ patch_enable_all () enable_ddraw_Rendering_Targets="$1" enable_ddraw_Silence_FIXMEs="$1" enable_ddraw_Texture_Wrong_Caps="$1" - enable_ddraw_Write_Vtable="$1" enable_ddraw_version_check="$1" enable_dinput_SetActionMap_genre="$1" enable_dinput_axis_recalc="$1" @@ -465,9 +464,6 @@ patch_enable () ddraw-Texture_Wrong_Caps) enable_ddraw_Texture_Wrong_Caps="$2" ;; - ddraw-Write_Vtable) - enable_ddraw_Write_Vtable="$2" - ;; ddraw-version-check) enable_ddraw_version_check="$2" ;; @@ -1821,6 +1817,9 @@ if test "$enable_server_Shared_Memory" -eq 1; then if test "$enable_ntdll_Threading" -gt 1; then abort "Patchset ntdll-Threading disabled, but server-Shared_Memory depends on that." fi + if test "$enable_ntdll_ext4_case_folder" -gt 1; then + abort "Patchset ntdll-ext4-case-folder disabled, but server-Shared_Memory depends on that." + fi if test "$enable_server_Key_State" -gt 1; then abort "Patchset server-Key_State disabled, but server-Shared_Memory depends on that." fi @@ -1834,6 +1833,7 @@ if test "$enable_server_Shared_Memory" -eq 1; then abort "Patchset user32-rawinput-nolegacy disabled, but server-Shared_Memory depends on that." fi enable_ntdll_Threading=1 + enable_ntdll_ext4_case_folder=1 enable_server_Key_State=1 enable_server_PeekMessage=1 enable_server_Signal_Thread=1 @@ -2801,24 +2801,6 @@ if test "$enable_ddraw_Texture_Wrong_Caps" -eq 1; then ) >> "$patchlist" fi -# Patchset ddraw-Write_Vtable -# | -# | This patchset fixes the following Wine bugs: -# | * [#39534] Make ddraw1 and ddraw_surface1 vtable as writable. -# | * [#46949] Make ddraw[2-7] and palette vtable as writable. -# | -# | Modified files: -# | * dlls/ddraw/ddraw.c, dlls/ddraw/palette.c, dlls/ddraw/surface.c -# | -if test "$enable_ddraw_Write_Vtable" -eq 1; then - patch_apply ddraw-Write_Vtable/0001-ddraw-Remove-const-from-ddraw1_vtbl-and-ddraw_surfac.patch - patch_apply ddraw-Write_Vtable/0002-ddraw-Allow-writing-to-vtable-for-surface-and-palett.patch - ( - printf '%s\n' '+ { "Michael Müller", "ddraw: Remove const from ddraw1_vtbl and ddraw_surface1_vtbl.", 1 },'; - printf '%s\n' '+ { "Alistair Leslie-Hughes", "ddraw: Allow writing to vtable for surface and palette.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ddraw-version-check # | # | This patchset has the following (direct or indirect) dependencies: @@ -3457,6 +3439,21 @@ if test "$enable_ntdll_Threading" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-ext4-case-folder +# | +# | This patchset fixes the following Wine bugs: +# | * [#47099] Support for EXT4 case folding per directory. +# | +# | Modified files: +# | * dlls/ntdll/server.c +# | +if test "$enable_ntdll_ext4_case_folder" -eq 1; then + patch_apply ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch + ( + printf '%s\n' '+ { "Gabriel Ivăncescu", "ntdll/server: Mark drive_c as case-insensitive when created.", 1 },'; + ) >> "$patchlist" +fi + # Patchset server-Key_State # | # | This patchset fixes the following Wine bugs: @@ -3610,8 +3607,8 @@ fi # Patchset server-Shared_Memory # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse- -# | coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy +# | * ntdll-Threading, ntdll-ext4-case-folder, server-Key_State, server-PeekMessage, server-Signal_Thread, loader- +# | KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy # | # | Modified files: # | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/server.c, dlls/ntdll/thread.c, dlls/ntdll/virtual.c, dlls/user32/focus.c, @@ -3663,9 +3660,9 @@ fi # | This patchset has the following (direct or indirect) dependencies: # | * Staging, advapi32-CreateRestrictedToken, advapi32-Token_Integrity_Level, kernel32-K32GetPerformanceInfo, ntdll- # | Junction_Points, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, winebuild-Fake_Dlls, ntdll- -# | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, server-Key_State, server- -# | PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32 -# | -rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup +# | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, ntdll-ext4-case-folder, +# | server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32 +# | -rawinput-mouse, user32-rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup # | # | This patchset fixes the following Wine bugs: # | * [#36692] Many multi-threaded applications have poor performance due to heavy use of synchronization primitives @@ -5040,21 +5037,6 @@ if test "$enable_ntdll_avoid_fstatat" -eq 1; then ) >> "$patchlist" fi -# Patchset ntdll-ext4-case-folder -# | -# | This patchset fixes the following Wine bugs: -# | * [#47099] Support for EXT4 case folding per directory. -# | -# | Modified files: -# | * dlls/ntdll/server.c -# | -if test "$enable_ntdll_ext4_case_folder" -eq 1; then - patch_apply ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch - ( - printf '%s\n' '+ { "Gabriel Ivăncescu", "ntdll/server: Mark drive_c as case-insensitive when created.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-set_full_cpu_context # | # | Modified files: @@ -5342,9 +5324,9 @@ fi # | This patchset has the following (direct or indirect) dependencies: # | * Staging, advapi32-CreateRestrictedToken, advapi32-Token_Integrity_Level, kernel32-K32GetPerformanceInfo, ntdll- # | Junction_Points, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, winebuild-Fake_Dlls, ntdll- -# | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, server-Key_State, server- -# | PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32 -# | -rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup, eventfd_synchronization +# | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, ntdll-ext4-case-folder, +# | server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32 +# | -rawinput-mouse, user32-rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup, eventfd_synchronization # | # | This patchset fixes the following Wine bugs: # | * [#46967] GOG Galaxy doesn't run in virtual desktop. @@ -5432,8 +5414,8 @@ fi # Patchset server-Object_Types # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse- -# | coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy, server-Shared_Memory +# | * ntdll-Threading, ntdll-ext4-case-folder, server-Key_State, server-PeekMessage, server-Signal_Thread, loader- +# | KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy, server-Shared_Memory # | # | This patchset fixes the following Wine bugs: # | * [#44629] Process Hacker can't enumerate handles @@ -6296,28 +6278,12 @@ fi # Patchset windowscodecs-GIF_Encoder # | # | Modified files: -# | * dlls/gdiplus/tests/image.c, dlls/windowscodecs/clsfactory.c, dlls/windowscodecs/gifformat.c, -# | dlls/windowscodecs/regsvr.c, dlls/windowscodecs/tests/converter.c, dlls/windowscodecs/wincodecs_private.h, -# | dlls/windowscodecs/windowscodecs_wincodec.idl +# | * dlls/windowscodecs/tests/converter.c # | if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then patch_apply windowscodecs-GIF_Encoder/0007-windowscodecs-tests-Add-IWICBitmapEncoderInfo-test.patch - patch_apply windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch - patch_apply windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch - patch_apply windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch - patch_apply windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch - patch_apply windowscodecs-GIF_Encoder/0022-windowscodecs-Better-follow-the-GIF-spec-and-don-t-s.patch - patch_apply windowscodecs-GIF_Encoder/0026-windowscodecs-tests-Add-the-tests-for-GIF-encoder-an.patch - patch_apply windowscodecs-GIF_Encoder/0028-windowscodecs-Correctly-indicate-that-the-global-inf.patch ( printf '%s\n' '+ { "Alistair Leslie-Hughes", "windowscodecs/tests: Add IWICBitmapEncoderInfo test.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add initial implementation of the GIF encoder.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Initialize empty property bag in GIF encoder'\''s CreateNewFrame implementation.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add registration of the GIF encoder.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Fix IWICBitmapDecoder::CopyPalette for a not initialized case in the GIF decoder.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Better follow the GIF spec and don'\''t specify the local color table size if there is no local palette.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add the tests for GIF encoder and decoder.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Correctly indicate that the global info was written even without the global palette.", 1 },'; ) >> "$patchlist" fi @@ -7135,9 +7101,10 @@ fi # | This patchset has the following (direct or indirect) dependencies: # | * Staging, advapi32-CreateRestrictedToken, advapi32-Token_Integrity_Level, kernel32-K32GetPerformanceInfo, ntdll- # | Junction_Points, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, winebuild-Fake_Dlls, ntdll- -# | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, server-Key_State, server- -# | PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32 -# | -rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup, eventfd_synchronization, server-Desktop_Refcount +# | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, ntdll-ext4-case-folder, +# | server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32 +# | -rawinput-mouse, user32-rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup, eventfd_synchronization, server- +# | Desktop_Refcount # | # | Modified files: # | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, include/winsock.h, server/protocol.def, server/sock.c diff --git a/patches/server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch b/patches/server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch index 4e7065ac..9a6ad021 100644 --- a/patches/server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch +++ b/patches/server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch @@ -1,26 +1,26 @@ -From 43b9d13abbf16e59eb7e4b807a68a3c2426c2698 Mon Sep 17 00:00:00 2001 +From 882a6197012149fb44b3751dc24e3d2a222dd46b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 19 Mar 2015 02:55:36 +0100 -Subject: ntdll: Only enable wineserver shared memory communication when a - special environment variable is set. +Subject: [PATCH] ntdll: Only enable wineserver shared memory communication + when a special environment variable is set. --- dlls/ntdll/server.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index 0b8e007..6155b6e 100644 +index e138f7c212d..68910fde50c 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -81,6 +81,7 @@ +@@ -92,6 +92,7 @@ #include "ntdll_misc.h" WINE_DEFAULT_DEBUG_CHANNEL(server); +WINE_DECLARE_DEBUG_CHANNEL(winediag); - /* Some versions of glibc don't define this */ - #ifndef SCM_RIGHTS -@@ -968,6 +969,21 @@ static int server_get_shared_memory_fd( HANDLE thread, int *unix_fd ) + /* just in case... */ + #undef EXT2_IOC_GETFLAGS +@@ -1162,6 +1163,21 @@ static int server_get_shared_memory_fd( HANDLE thread, int *unix_fd ) return ret; } @@ -42,7 +42,7 @@ index 0b8e007..6155b6e 100644 /*********************************************************************** * server_get_shared_memory -@@ -980,6 +996,9 @@ void *server_get_shared_memory( HANDLE thread ) +@@ -1174,6 +1190,9 @@ void *server_get_shared_memory( HANDLE thread ) void *mem = NULL; int fd = -1; @@ -52,7 +52,7 @@ index 0b8e007..6155b6e 100644 /* The global memory block is only requested once. No locking is * required because this function is called very early during the * process initialization for the first time. */ -@@ -994,7 +1013,10 @@ void *server_get_shared_memory( HANDLE thread ) +@@ -1188,7 +1207,10 @@ void *server_get_shared_memory( HANDLE thread ) } if (!thread) @@ -64,5 +64,5 @@ index 0b8e007..6155b6e 100644 return mem; } -- -2.3.2 +2.26.2 diff --git a/patches/server-Shared_Memory/definition b/patches/server-Shared_Memory/definition index 80ccfe59..644589e6 100644 --- a/patches/server-Shared_Memory/definition +++ b/patches/server-Shared_Memory/definition @@ -6,3 +6,4 @@ Depends: server-Key_State Depends: server-PeekMessage Depends: server-Signal_Thread Depends: user32-rawinput-nolegacy +Depends: ntdll-ext4-case-folder diff --git a/patches/windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch b/patches/windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch deleted file mode 100644 index b3f9b998..00000000 --- a/patches/windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch +++ /dev/null @@ -1,1094 +0,0 @@ -From ad1e42eac7c54fd7dee27b37a1b5163180113455 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Sun, 16 Oct 2016 17:44:31 +0800 -Subject: [PATCH] windowscodecs: Add initial implementation of the GIF encoder. - ---- - dlls/windowscodecs/clsfactory.c | 1 + - dlls/windowscodecs/gifformat.c | 999 ++++++++++++++++++++++++- - dlls/windowscodecs/regsvr.c | 10 + - dlls/windowscodecs/wincodecs_private.h | 1 + - 4 files changed, 977 insertions(+), 34 deletions(-) - -diff --git a/dlls/windowscodecs/clsfactory.c b/dlls/windowscodecs/clsfactory.c -index 32083a2a3..2de518a00 100644 ---- a/dlls/windowscodecs/clsfactory.c -+++ b/dlls/windowscodecs/clsfactory.c -@@ -50,6 +50,7 @@ static const classinfo wic_classes[] = { - {&CLSID_WICPngEncoder, PngEncoder_CreateInstance}, - {&CLSID_WICBmpEncoder, BmpEncoder_CreateInstance}, - {&CLSID_WICGifDecoder, GifDecoder_CreateInstance}, -+ {&CLSID_WICGifEncoder, GifEncoder_CreateInstance}, - {&CLSID_WICIcoDecoder, IcoDecoder_CreateInstance}, - {&CLSID_WICJpegDecoder, JpegDecoder_CreateInstance}, - {&CLSID_WICJpegEncoder, JpegEncoder_CreateInstance}, -diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c -index df202ba45..1ebd5660f 100644 ---- a/dlls/windowscodecs/gifformat.c -+++ b/dlls/windowscodecs/gifformat.c -@@ -1,6 +1,6 @@ - /* - * Copyright 2009 Vincent Povirk for CodeWeavers -- * Copyright 2012 Dmitry Timoshkov -+ * Copyright 2012,2016 Dmitry Timoshkov - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -36,6 +36,40 @@ - - WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); - -+#include "pshpack1.h" -+ -+struct logical_screen_descriptor -+{ -+ char signature[6]; -+ USHORT width; -+ USHORT height; -+ BYTE packed; -+ /* global_color_table_flag : 1; -+ * color_resolution : 3; -+ * sort_flag : 1; -+ * global_color_table_size : 3; -+ */ -+ BYTE background_color_index; -+ BYTE pixel_aspect_ratio; -+}; -+ -+struct image_descriptor -+{ -+ USHORT left; -+ USHORT top; -+ USHORT width; -+ USHORT height; -+ BYTE packed; -+ /* local_color_table_flag : 1; -+ * interlace_flag : 1; -+ * sort_flag : 1; -+ * reserved : 2; -+ * local_color_table_size : 3; -+ */ -+}; -+ -+#include "poppack.h" -+ - static LPWSTR strdupAtoW(const char *src) - { - int len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0); -@@ -47,22 +81,7 @@ static LPWSTR strdupAtoW(const char *src) - static HRESULT load_LSD_metadata(IStream *stream, const GUID *vendor, DWORD options, - MetadataItem **items, DWORD *count) - { --#include "pshpack1.h" -- struct logical_screen_descriptor -- { -- char signature[6]; -- USHORT width; -- USHORT height; -- BYTE packed; -- /* global_color_table_flag : 1; -- * color_resolution : 3; -- * sort_flag : 1; -- * global_color_table_size : 3; -- */ -- BYTE background_color_index; -- BYTE pixel_aspect_ratio; -- } lsd_data; --#include "poppack.h" -+ struct logical_screen_descriptor lsd_data; - HRESULT hr; - ULONG bytesread, i; - MetadataItem *result; -@@ -147,23 +166,6 @@ HRESULT LSDReader_CreateInstance(REFIID iid, void **ppv) - return MetadataReader_Create(&LSDReader_Vtbl, iid, ppv); - } - --#include "pshpack1.h" --struct image_descriptor --{ -- USHORT left; -- USHORT top; -- USHORT width; -- USHORT height; -- BYTE packed; -- /* local_color_table_flag : 1; -- * interlace_flag : 1; -- * sort_flag : 1; -- * reserved : 2; -- * local_color_table_size : 3; -- */ --}; --#include "poppack.h" -- - static HRESULT load_IMD_metadata(IStream *stream, const GUID *vendor, DWORD options, - MetadataItem **items, DWORD *count) - { -@@ -1449,3 +1451,932 @@ HRESULT GifDecoder_CreateInstance(REFIID iid, void** ppv) - - return ret; - } -+ -+typedef struct GifEncoder -+{ -+ IWICBitmapEncoder IWICBitmapEncoder_iface; -+ LONG ref; -+ IStream *stream; -+ CRITICAL_SECTION lock; -+ BOOL initialized, info_written, committed; -+ UINT n_frames; -+ WICColor palette[256]; -+ UINT colors; -+} GifEncoder; -+ -+static inline GifEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface) -+{ -+ return CONTAINING_RECORD(iface, GifEncoder, IWICBitmapEncoder_iface); -+} -+ -+typedef struct GifFrameEncode -+{ -+ IWICBitmapFrameEncode IWICBitmapFrameEncode_iface; -+ LONG ref; -+ GifEncoder *encoder; -+ BOOL initialized, interlace, committed; -+ UINT width, height, lines; -+ double xres, yres; -+ WICColor palette[256]; -+ UINT colors; -+ BYTE *image_data; -+} GifFrameEncode; -+ -+static inline GifFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface) -+{ -+ return CONTAINING_RECORD(iface, GifFrameEncode, IWICBitmapFrameEncode_iface); -+} -+ -+static HRESULT WINAPI GifFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid, void **ppv) -+{ -+ TRACE("%p,%s,%p\n", iface, debugstr_guid(iid), ppv); -+ -+ if (!ppv) return E_INVALIDARG; -+ -+ if (IsEqualIID(&IID_IUnknown, iid) || -+ IsEqualIID(&IID_IWICBitmapFrameEncode, iid)) -+ { -+ IWICBitmapFrameEncode_AddRef(iface); -+ *ppv = iface; -+ return S_OK; -+ } -+ -+ *ppv = NULL; -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI GifFrameEncode_AddRef(IWICBitmapFrameEncode *iface) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ ULONG ref = InterlockedIncrement(&This->ref); -+ -+ TRACE("%p -> %u\n", iface, ref); -+ return ref; -+} -+ -+static ULONG WINAPI GifFrameEncode_Release(IWICBitmapFrameEncode *iface) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ ULONG ref = InterlockedDecrement(&This->ref); -+ -+ TRACE("%p -> %u\n", iface, ref); -+ -+ if (!ref) -+ { -+ IWICBitmapEncoder_Release(&This->encoder->IWICBitmapEncoder_iface); -+ HeapFree(GetProcessHeap(), 0, This->image_data); -+ HeapFree(GetProcessHeap(), 0, This); -+ } -+ -+ return ref; -+} -+ -+static HRESULT WINAPI GifFrameEncode_Initialize(IWICBitmapFrameEncode *iface, IPropertyBag2 *options) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%p\n", iface, options); -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (!This->initialized) -+ { -+ This->initialized = TRUE; -+ hr = S_OK; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_SetSize(IWICBitmapFrameEncode *iface, UINT width, UINT height) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%u,%u\n", iface, width, height); -+ -+ if (!width || !height) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->initialized) -+ { -+ HeapFree(GetProcessHeap(), 0, This->image_data); -+ -+ This->image_data = HeapAlloc(GetProcessHeap(), 0, width * height); -+ if (This->image_data) -+ { -+ This->width = width; -+ This->height = height; -+ hr = S_OK; -+ } -+ else -+ hr = E_OUTOFMEMORY; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_SetResolution(IWICBitmapFrameEncode *iface, double xres, double yres) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%f,%f\n", iface, xres, yres); -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->initialized) -+ { -+ This->xres = xres; -+ This->yres = yres; -+ hr = S_OK; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface, WICPixelFormatGUID *format) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%s\n", iface, debugstr_guid(format)); -+ -+ if (!format) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->initialized) -+ { -+ *format = GUID_WICPixelFormat8bppIndexed; -+ hr = S_OK; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_SetColorContexts(IWICBitmapFrameEncode *iface, UINT count, IWICColorContext **context) -+{ -+ FIXME("%p,%u,%p: stub\n", iface, count, context); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI GifFrameEncode_SetPalette(IWICBitmapFrameEncode *iface, IWICPalette *palette) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%p\n", iface, palette); -+ -+ if (!palette) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->initialized) -+ hr = IWICPalette_GetColors(palette, 256, This->palette, &This->colors); -+ else -+ hr = WINCODEC_ERR_NOTINITIALIZED; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface, IWICBitmapSource *thumbnail) -+{ -+ FIXME("%p,%p: stub\n", iface, thumbnail); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI GifFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, UINT lines, UINT stride, UINT size, BYTE *pixels) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%u,%u,%u,%p\n", iface, lines, stride, size, pixels); -+ -+ if (!pixels) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->initialized && This->image_data) -+ { -+ if (This->lines + lines <= This->height) -+ { -+ UINT i; -+ BYTE *src, *dst; -+ -+ src = pixels; -+ dst = This->image_data + This->lines * This->width; -+ -+ for (i = 0; i < lines; i++) -+ { -+ memcpy(dst, src, This->width); -+ src += stride; -+ dst += This->width; -+ } -+ -+ This->lines += lines; -+ hr = S_OK; -+ } -+ else -+ hr = E_INVALIDARG; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, WICRect *rc) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%p,%p\n", iface, source, rc); -+ -+ if (!source) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->initialized) -+ { -+ const GUID *format = &GUID_WICPixelFormat8bppIndexed; -+ -+ hr = configure_write_source(iface, source, rc, format, -+ This->width, This->height, This->xres, This->yres); -+ if (hr == S_OK) -+ hr = write_source(iface, source, rc, format, 8, FALSE /* FIXME */, This->width, This->height); -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ return hr; -+} -+ -+#define LZW_DICT_SIZE (1 << 12) -+ -+struct lzw_dict -+{ -+ short prefix[LZW_DICT_SIZE]; -+ unsigned char suffix[LZW_DICT_SIZE]; -+}; -+ -+struct lzw_state -+{ -+ struct lzw_dict dict; -+ short init_code_bits, code_bits, next_code, clear_code, eof_code; -+ unsigned bits_buf; -+ int bits_count; -+ int (*user_write_data)(void *user_ptr, void *data, int length); -+ void *user_ptr; -+}; -+ -+struct input_stream -+{ -+ unsigned len; -+ const BYTE *in; -+}; -+ -+struct output_stream -+{ -+ struct -+ { -+ unsigned char len; -+ char data[255]; -+ } gif_block; -+ IStream *out; -+}; -+ -+static int lzw_output_code(struct lzw_state *state, short code) -+{ -+ state->bits_buf |= code << state->bits_count; -+ state->bits_count += state->code_bits; -+ -+ while (state->bits_count >= 8) -+ { -+ unsigned char byte = (unsigned char)state->bits_buf; -+ if (state->user_write_data(state->user_ptr, &byte, 1) != 1) -+ return 0; -+ state->bits_buf >>= 8; -+ state->bits_count -= 8; -+ } -+ -+ return 1; -+} -+ -+static inline int lzw_output_clear_code(struct lzw_state *state) -+{ -+ return lzw_output_code(state, state->clear_code); -+} -+ -+static inline int lzw_output_eof_code(struct lzw_state *state) -+{ -+ return lzw_output_code(state, state->eof_code); -+} -+ -+static int lzw_flush_bits(struct lzw_state *state) -+{ -+ unsigned char byte; -+ -+ while (state->bits_count >= 8) -+ { -+ byte = (unsigned char)state->bits_buf; -+ if (state->user_write_data(state->user_ptr, &byte, 1) != 1) -+ return 0; -+ state->bits_buf >>= 8; -+ state->bits_count -= 8; -+ } -+ -+ if (state->bits_count) -+ { -+ static const char mask[8] = { 0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f }; -+ -+ byte = (unsigned char)state->bits_buf & mask[state->bits_count]; -+ if (state->user_write_data(state->user_ptr, &byte, 1) != 1) -+ return 0; -+ } -+ -+ state->bits_buf = 0; -+ state->bits_count = 0; -+ -+ return 1; -+} -+ -+static void lzw_dict_reset(struct lzw_state *state) -+{ -+ int i; -+ -+ state->code_bits = state->init_code_bits + 1; -+ state->next_code = (1 << state->init_code_bits) + 2; -+ -+ for(i = 0; i < LZW_DICT_SIZE; i++) -+ { -+ state->dict.prefix[i] = 1 << 12; /* impossible LZW code value */ -+ state->dict.suffix[i] = 0; -+ } -+} -+ -+static void lzw_state_init(struct lzw_state *state, short init_code_bits, void *user_write_data, void *user_ptr) -+{ -+ state->init_code_bits = init_code_bits; -+ state->clear_code = 1 << init_code_bits; -+ state->eof_code = state->clear_code + 1; -+ state->bits_buf = 0; -+ state->bits_count = 0; -+ state->user_write_data = user_write_data; -+ state->user_ptr = user_ptr; -+ -+ lzw_dict_reset(state); -+} -+ -+static int lzw_dict_add(struct lzw_state *state, short prefix, unsigned char suffix) -+{ -+ if (state->next_code < LZW_DICT_SIZE) -+ { -+ state->dict.prefix[state->next_code] = prefix; -+ state->dict.suffix[state->next_code] = suffix; -+ -+ if ((state->next_code & (state->next_code - 1)) == 0) -+ state->code_bits++; -+ -+ state->next_code++; -+ return state->next_code; -+ } -+ -+ return -1; -+} -+ -+static short lzw_dict_lookup(const struct lzw_state *state, short prefix, unsigned char suffix) -+{ -+ short i; -+ -+ for (i = 0; i < state->next_code; i++) -+ { -+ if (state->dict.prefix[i] == prefix && state->dict.suffix[i] == suffix) -+ return i; -+ } -+ -+ return -1; -+} -+ -+static inline int write_byte(struct output_stream *out, char byte) -+{ -+ if (out->gif_block.len == 255) -+ { -+ if (IStream_Write(out->out, &out->gif_block, sizeof(out->gif_block), NULL) != S_OK) -+ return 0; -+ -+ out->gif_block.len = 0; -+ } -+ -+ out->gif_block.data[out->gif_block.len++] = byte; -+ -+ return 1; -+} -+ -+static int write_data(void *user_ptr, void *user_data, int length) -+{ -+ unsigned char *data = user_data; -+ struct output_stream *out = user_ptr; -+ int len = length; -+ -+ while (len-- > 0) -+ { -+ if (!write_byte(out, *data++)) return 0; -+ } -+ -+ return length; -+} -+ -+static int flush_output_data(void *user_ptr) -+{ -+ struct output_stream *out = user_ptr; -+ -+ if (out->gif_block.len) -+ { -+ if (IStream_Write(out->out, &out->gif_block, out->gif_block.len + sizeof(out->gif_block.len), NULL) != S_OK) -+ return 0; -+ } -+ -+ /* write GIF block terminator */ -+ out->gif_block.len = 0; -+ return IStream_Write(out->out, &out->gif_block, sizeof(out->gif_block.len), NULL) == S_OK; -+} -+ -+static inline int read_byte(struct input_stream *in, unsigned char *byte) -+{ -+ if (in->len) -+ { -+ in->len--; -+ *byte = *in->in++; -+ return 1; -+ } -+ -+ return 0; -+} -+ -+static HRESULT gif_compress(IStream *out_stream, const BYTE *in_data, ULONG in_size) -+{ -+ struct input_stream in; -+ struct output_stream out; -+ struct lzw_state state; -+ short init_code_bits, prefix, code; -+ unsigned char suffix; -+ -+ in.in = in_data; -+ in.len = in_size; -+ -+ out.gif_block.len = 0; -+ out.out = out_stream; -+ -+ init_code_bits = suffix = 8; -+ if (IStream_Write(out.out, &suffix, sizeof(suffix), NULL) != S_OK) -+ return E_FAIL; -+ -+ lzw_state_init(&state, init_code_bits, write_data, &out); -+ -+ if (!lzw_output_clear_code(&state)) -+ return E_FAIL; -+ -+ if (read_byte(&in, &suffix)) -+ { -+ prefix = suffix; -+ -+ while (read_byte(&in, &suffix)) -+ { -+ code = lzw_dict_lookup(&state, prefix, suffix); -+ if (code == -1) -+ { -+ if (!lzw_output_code(&state, prefix)) -+ return E_FAIL; -+ -+ if (lzw_dict_add(&state, prefix, suffix) == -1) -+ { -+ if (!lzw_output_clear_code(&state)) -+ return E_FAIL; -+ lzw_dict_reset(&state); -+ } -+ -+ prefix = suffix; -+ } -+ else -+ prefix = code; -+ } -+ -+ if (!lzw_output_code(&state, prefix)) -+ return E_FAIL; -+ if (!lzw_output_eof_code(&state)) -+ return E_FAIL; -+ if (!lzw_flush_bits(&state)) -+ return E_FAIL; -+ } -+ -+ return flush_output_data(&out) ? S_OK : E_FAIL; -+} -+ -+static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface) -+{ -+ GifFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); -+ HRESULT hr; -+ -+ TRACE("%p\n", iface); -+ -+ EnterCriticalSection(&This->encoder->lock); -+ -+ if (This->image_data && This->lines == This->height && !This->committed) -+ { -+ BYTE gif_palette[256][3]; -+ -+ hr = S_OK; -+ -+ if (!This->encoder->info_written) -+ { -+ struct logical_screen_descriptor lsd; -+ -+ /* Logical Screen Descriptor */ -+ memcpy(lsd.signature, "GIF89a", 6); -+ lsd.width = This->width; -+ lsd.height = This->height; -+ lsd.packed = 0; -+ if (This->encoder->colors) -+ lsd.packed |= 0x80; /* global color table flag */ -+ lsd.packed |= 0x07 << 4; /* color resolution */ -+ lsd.packed |= 0x07; /* global color table size */ -+ lsd.background_color_index = 0; /* FIXME */ -+ lsd.pixel_aspect_ratio = 0; -+ hr = IStream_Write(This->encoder->stream, &lsd, sizeof(lsd), NULL); -+ if (hr == S_OK && This->encoder->colors) -+ { -+ UINT i; -+ -+ /* Global Color Table */ -+ memset(gif_palette, 0, sizeof(gif_palette)); -+ for (i = 0; i < This->encoder->colors; i++) -+ { -+ gif_palette[i][0] = (This->encoder->palette[i] >> 16) & 0xff; -+ gif_palette[i][1] = (This->encoder->palette[i] >> 8) & 0xff; -+ gif_palette[i][2] = This->encoder->palette[i] & 0xff; -+ } -+ hr = IStream_Write(This->encoder->stream, gif_palette, sizeof(gif_palette), NULL); -+ if (hr == S_OK) -+ This->encoder->info_written = TRUE; -+ } -+ -+ /* FIXME: write GCE, APE, etc. GIF extensions */ -+ } -+ -+ if (hr == S_OK) -+ { -+ char image_separator = 0x2c; -+ -+ hr = IStream_Write(This->encoder->stream, &image_separator, sizeof(image_separator), NULL); -+ if (hr == S_OK) -+ { -+ struct image_descriptor imd; -+ -+ /* Image Descriptor */ -+ imd.left = 0; -+ imd.top = 0; -+ imd.width = This->width; -+ imd.height = This->height; -+ imd.packed = 0; -+ if (This->colors) -+ imd.packed |= 0x80; /* local color table flag */ -+ /* FIXME: interlace flag */ -+ imd.packed |= 0x07; /* local color table size */ -+ hr = IStream_Write(This->encoder->stream, &imd, sizeof(imd), NULL); -+ if (hr == S_OK && This->colors) -+ { -+ UINT i; -+ -+ /* Local Color Table */ -+ memset(gif_palette, 0, sizeof(gif_palette)); -+ for (i = 0; i < This->colors; i++) -+ { -+ gif_palette[i][0] = (This->palette[i] >> 16) & 0xff; -+ gif_palette[i][1] = (This->palette[i] >> 8) & 0xff; -+ gif_palette[i][2] = This->palette[i] & 0xff; -+ } -+ hr = IStream_Write(This->encoder->stream, gif_palette, sizeof(gif_palette), NULL); -+ if (hr == S_OK) -+ { -+ /* Image Data */ -+ hr = gif_compress(This->encoder->stream, This->image_data, This->width * This->height); -+ if (hr == S_OK) -+ This->committed = TRUE; -+ } -+ } -+ } -+ } -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->encoder->lock); -+ return hr; -+} -+ -+static HRESULT WINAPI GifFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface, IWICMetadataQueryWriter **writer) -+{ -+ FIXME("%p, %p: stub\n", iface, writer); -+ return E_NOTIMPL; -+} -+ -+static const IWICBitmapFrameEncodeVtbl GifFrameEncode_Vtbl = -+{ -+ GifFrameEncode_QueryInterface, -+ GifFrameEncode_AddRef, -+ GifFrameEncode_Release, -+ GifFrameEncode_Initialize, -+ GifFrameEncode_SetSize, -+ GifFrameEncode_SetResolution, -+ GifFrameEncode_SetPixelFormat, -+ GifFrameEncode_SetColorContexts, -+ GifFrameEncode_SetPalette, -+ GifFrameEncode_SetThumbnail, -+ GifFrameEncode_WritePixels, -+ GifFrameEncode_WriteSource, -+ GifFrameEncode_Commit, -+ GifFrameEncode_GetMetadataQueryWriter -+}; -+ -+static HRESULT WINAPI GifEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, void **ppv) -+{ -+ TRACE("%p,%s,%p\n", iface, debugstr_guid(iid), ppv); -+ -+ if (!ppv) return E_INVALIDARG; -+ -+ if (IsEqualIID(&IID_IUnknown, iid) || -+ IsEqualIID(&IID_IWICBitmapEncoder, iid)) -+ { -+ IWICBitmapEncoder_AddRef(iface); -+ *ppv = iface; -+ return S_OK; -+ } -+ -+ *ppv = NULL; -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI GifEncoder_AddRef(IWICBitmapEncoder *iface) -+{ -+ GifEncoder *This = impl_from_IWICBitmapEncoder(iface); -+ ULONG ref = InterlockedIncrement(&This->ref); -+ -+ TRACE("%p -> %u\n", iface, ref); -+ return ref; -+} -+ -+static ULONG WINAPI GifEncoder_Release(IWICBitmapEncoder *iface) -+{ -+ GifEncoder *This = impl_from_IWICBitmapEncoder(iface); -+ ULONG ref = InterlockedDecrement(&This->ref); -+ -+ TRACE("%p -> %u\n", iface, ref); -+ -+ if (!ref) -+ { -+ if (This->stream) IStream_Release(This->stream); -+ This->lock.DebugInfo->Spare[0] = 0; -+ DeleteCriticalSection(&This->lock); -+ HeapFree(GetProcessHeap(), 0, This); -+ } -+ -+ return ref; -+} -+ -+static HRESULT WINAPI GifEncoder_Initialize(IWICBitmapEncoder *iface, IStream *stream, WICBitmapEncoderCacheOption option) -+{ -+ GifEncoder *This = impl_from_IWICBitmapEncoder(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%p,%#x\n", iface, stream, option); -+ -+ if (!stream) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->lock); -+ -+ if (!This->initialized) -+ { -+ IStream_AddRef(stream); -+ This->stream = stream; -+ This->initialized = TRUE; -+ hr = S_OK; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI GifEncoder_GetContainerFormat(IWICBitmapEncoder *iface, GUID *format) -+{ -+ if (!format) return E_INVALIDARG; -+ -+ *format = GUID_ContainerFormatGif; -+ return S_OK; -+} -+ -+static HRESULT WINAPI GifEncoder_GetEncoderInfo(IWICBitmapEncoder *iface, IWICBitmapEncoderInfo **info) -+{ -+ IWICComponentInfo *comp_info; -+ HRESULT hr; -+ -+ TRACE("%p,%p\n", iface, info); -+ -+ if (!info) return E_INVALIDARG; -+ -+ hr = CreateComponentInfo(&CLSID_WICGifEncoder, &comp_info); -+ if (hr == S_OK) -+ { -+ hr = IWICComponentInfo_QueryInterface(comp_info, &IID_IWICBitmapEncoderInfo, (void **)info); -+ IWICComponentInfo_Release(comp_info); -+ } -+ return hr; -+} -+ -+static HRESULT WINAPI GifEncoder_SetColorContexts(IWICBitmapEncoder *iface, UINT count, IWICColorContext **context) -+{ -+ FIXME("%p,%u,%p: stub\n", iface, count, context); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI GifEncoder_SetPalette(IWICBitmapEncoder *iface, IWICPalette *palette) -+{ -+ GifEncoder *This = impl_from_IWICBitmapEncoder(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%p\n", iface, palette); -+ -+ if (!palette) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->lock); -+ -+ if (This->initialized) -+ hr = IWICPalette_GetColors(palette, 256, This->palette, &This->colors); -+ else -+ hr = WINCODEC_ERR_NOTINITIALIZED; -+ -+ LeaveCriticalSection(&This->lock); -+ return hr; -+} -+ -+static HRESULT WINAPI GifEncoder_SetThumbnail(IWICBitmapEncoder *iface, IWICBitmapSource *thumbnail) -+{ -+ TRACE("%p,%p\n", iface, thumbnail); -+ return WINCODEC_ERR_UNSUPPORTEDOPERATION; -+} -+ -+static HRESULT WINAPI GifEncoder_SetPreview(IWICBitmapEncoder *iface, IWICBitmapSource *preview) -+{ -+ TRACE("%p,%p\n", iface, preview); -+ return WINCODEC_ERR_UNSUPPORTEDOPERATION; -+} -+ -+static HRESULT WINAPI GifEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBitmapFrameEncode **frame, IPropertyBag2 **options) -+{ -+ GifEncoder *This = impl_from_IWICBitmapEncoder(iface); -+ HRESULT hr; -+ -+ TRACE("%p,%p,%p\n", iface, frame, options); -+ -+ if (!frame) return E_INVALIDARG; -+ -+ EnterCriticalSection(&This->lock); -+ -+ if (This->initialized && !This->committed) -+ { -+ GifFrameEncode *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(*ret)); -+ if (ret) -+ { -+ This->n_frames++; -+ -+ ret->IWICBitmapFrameEncode_iface.lpVtbl = &GifFrameEncode_Vtbl; -+ ret->ref = 1; -+ ret->encoder = This; -+ ret->initialized = FALSE; -+ ret->interlace = FALSE; /* FIXME: read from the properties */ -+ ret->committed = FALSE; -+ ret->width = 0; -+ ret->height = 0; -+ ret->lines = 0; -+ ret->xres = 0.0; -+ ret->yres = 0.0; -+ ret->colors = 0; -+ ret->image_data = NULL; -+ IWICBitmapEncoder_AddRef(iface); -+ *frame = &ret->IWICBitmapFrameEncode_iface; -+ -+ hr = S_OK; -+ } -+ else -+ hr = E_OUTOFMEMORY; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->lock); -+ -+ return hr; -+ -+} -+ -+static HRESULT WINAPI GifEncoder_Commit(IWICBitmapEncoder *iface) -+{ -+ GifEncoder *This = impl_from_IWICBitmapEncoder(iface); -+ HRESULT hr; -+ -+ TRACE("%p\n", iface); -+ -+ EnterCriticalSection(&This->lock); -+ -+ if (This->initialized && !This->committed) -+ { -+ char gif_trailer = 0x3b; -+ -+ /* FIXME: write text, comment GIF extensions */ -+ -+ hr = IStream_Write(This->stream, &gif_trailer, sizeof(gif_trailer), NULL); -+ if (hr == S_OK) -+ This->committed = TRUE; -+ } -+ else -+ hr = WINCODEC_ERR_WRONGSTATE; -+ -+ LeaveCriticalSection(&This->lock); -+ return hr; -+} -+ -+static HRESULT WINAPI GifEncoder_GetMetadataQueryWriter(IWICBitmapEncoder *iface, IWICMetadataQueryWriter **writer) -+{ -+ FIXME("%p,%p: stub\n", iface, writer); -+ return E_NOTIMPL; -+} -+ -+static const IWICBitmapEncoderVtbl GifEncoder_Vtbl = -+{ -+ GifEncoder_QueryInterface, -+ GifEncoder_AddRef, -+ GifEncoder_Release, -+ GifEncoder_Initialize, -+ GifEncoder_GetContainerFormat, -+ GifEncoder_GetEncoderInfo, -+ GifEncoder_SetColorContexts, -+ GifEncoder_SetPalette, -+ GifEncoder_SetThumbnail, -+ GifEncoder_SetPreview, -+ GifEncoder_CreateNewFrame, -+ GifEncoder_Commit, -+ GifEncoder_GetMetadataQueryWriter -+}; -+ -+HRESULT GifEncoder_CreateInstance(REFIID iid, void **ppv) -+{ -+ GifEncoder *This; -+ HRESULT ret; -+ -+ TRACE("%s,%p\n", debugstr_guid(iid), ppv); -+ -+ *ppv = NULL; -+ -+ This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); -+ if (!This) return E_OUTOFMEMORY; -+ -+ This->IWICBitmapEncoder_iface.lpVtbl = &GifEncoder_Vtbl; -+ This->ref = 1; -+ This->stream = NULL; -+ InitializeCriticalSection(&This->lock); -+ This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifEncoder.lock"); -+ This->initialized = FALSE; -+ This->info_written = FALSE; -+ This->committed = FALSE; -+ This->n_frames = 0; -+ This->colors = 0; -+ -+ ret = IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv); -+ IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface); -+ -+ return ret; -+} -diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c -index d215e3080..5d317768e 100644 ---- a/dlls/windowscodecs/regsvr.c -+++ b/dlls/windowscodecs/regsvr.c -@@ -1404,6 +1404,16 @@ static struct regsvr_encoder const encoder_list[] = { - ".bmp,.dib,.rle", - bmp_encode_formats - }, -+ { &CLSID_WICGifEncoder, -+ "The Wine Project", -+ "GIF Encoder", -+ "1.0.0.0", -+ &GUID_VendorMicrosoft, -+ &GUID_ContainerFormatGif, -+ "image/gif", -+ ".gif", -+ gif_formats -+ }, - { &CLSID_WICJpegEncoder, - "The Wine Project", - "JPEG Encoder", -diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h -index 7686e8071..3e29b3a06 100644 ---- a/dlls/windowscodecs/wincodecs_private.h -+++ b/dlls/windowscodecs/wincodecs_private.h -@@ -143,6 +143,7 @@ extern HRESULT PngEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN - extern HRESULT BmpEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; - extern HRESULT DibDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; - extern HRESULT GifDecoder_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; -+extern HRESULT GifEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; - extern HRESULT IcoDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; - extern HRESULT JpegDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; - extern HRESULT JpegEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; --- -2.25.1 - diff --git a/patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch b/patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch deleted file mode 100644 index 53668d17..00000000 --- a/patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch +++ /dev/null @@ -1,70 +0,0 @@ -From b71e5960bb9cc8926ab03d7c2abf70ad976f9732 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Mon, 17 Oct 2016 15:27:47 +0800 -Subject: windowscodecs: Initialize empty property bag in GIF encoder's - CreateNewFrame implementation. - -gdiplus depends on IPropertyBag2 being initialized, otherwise it crashes. ---- - dlls/gdiplus/tests/image.c | 14 ++++++-------- - dlls/windowscodecs/gifformat.c | 10 ++++++++++ - 2 files changed, 16 insertions(+), 8 deletions(-) - -diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c -index 8c123b9..8cbbb5b 100644 ---- a/dlls/gdiplus/tests/image.c -+++ b/dlls/gdiplus/tests/image.c -@@ -4637,14 +4637,13 @@ static void test_supported_encoders(void) - { - LPCWSTR mime; - const GUID *format; -- BOOL todo; - } td[] = - { -- { bmp_mimetype, &ImageFormatBMP, FALSE }, -- { jpeg_mimetype, &ImageFormatJPEG, FALSE }, -- { gif_mimetype, &ImageFormatGIF, TRUE }, -- { tiff_mimetype, &ImageFormatTIFF, FALSE }, -- { png_mimetype, &ImageFormatPNG, FALSE } -+ { bmp_mimetype, &ImageFormatBMP }, -+ { jpeg_mimetype, &ImageFormatJPEG }, -+ { gif_mimetype, &ImageFormatGIF }, -+ { tiff_mimetype, &ImageFormatTIFF }, -+ { png_mimetype, &ImageFormatPNG } - }; - GUID format, clsid; - BOOL ret; -@@ -4670,8 +4669,7 @@ static void test_supported_encoders(void) - ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); - - status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); -- todo_wine_if (td[i].todo) -- ok(status == Ok, "GdipSaveImageToStream error %d\n", status); -+ ok(status == Ok, "GdipSaveImageToStream error %d\n", status); - - IStream_Release(stream); - } -diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c -index b5c56aa..6052726 100644 ---- a/dlls/windowscodecs/gifformat.c -+++ b/dlls/windowscodecs/gifformat.c -@@ -2296,6 +2296,16 @@ static HRESULT WINAPI GifEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBi - *frame = &ret->IWICBitmapFrameEncode_iface; - - hr = S_OK; -+ -+ if (options) -+ { -+ hr = CreatePropertyBag2(NULL, 0, options); -+ if (hr != S_OK) -+ { -+ IWICBitmapFrameEncode_Release(*frame); -+ *frame = NULL; -+ } -+ } - } - else - hr = E_OUTOFMEMORY; --- -2.9.0 - diff --git a/patches/windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch b/patches/windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch deleted file mode 100644 index d7b5dd68..00000000 --- a/patches/windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 82ead58d02badf4e84124277868942b089d9b7ba Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Thu, 27 Oct 2016 14:48:45 +0800 -Subject: windowscodecs: Add registration of the GIF encoder. - ---- - dlls/windowscodecs/windowscodecs_wincodec.idl | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/dlls/windowscodecs/windowscodecs_wincodec.idl b/dlls/windowscodecs/windowscodecs_wincodec.idl -index fd7ff01..1681b1d 100644 ---- a/dlls/windowscodecs/windowscodecs_wincodec.idl -+++ b/dlls/windowscodecs/windowscodecs_wincodec.idl -@@ -70,6 +70,13 @@ coclass WICBmpEncoder { interface IWICBitmapEncoder; } - coclass WICGifDecoder { interface IWICBitmapDecoder; } - - [ -+ helpstring("WIC GIF Encoder"), -+ threading(both), -+ uuid(114f5598-0b22-40a0-86a1-c83ea495adbd) -+] -+coclass WICGifEncoder { interface IWICBitmapEncoder; } -+ -+[ - helpstring("WIC ICO Decoder"), - threading(both), - uuid(c61bfcdf-2e0f-4aad-a8d7-e06bafebcdfe) --- -2.9.0 - diff --git a/patches/windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch b/patches/windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch deleted file mode 100644 index 44980ef4..00000000 --- a/patches/windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From fe01c9d286b55485fc241f42a617a3a75f2553c4 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Thu, 27 Oct 2016 14:50:03 +0800 -Subject: windowscodecs: Fix IWICBitmapDecoder::CopyPalette for a not - initialized case in the GIF decoder. - ---- - dlls/windowscodecs/gifformat.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c -index 6052726..3dac59e 100644 ---- a/dlls/windowscodecs/gifformat.c -+++ b/dlls/windowscodecs/gifformat.c -@@ -1198,6 +1198,9 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalet - - TRACE("(%p,%p)\n", iface, palette); - -+ if (!This->gif) -+ return WINCODEC_ERR_WRONGSTATE; -+ - cm = This->gif->SColorMap; - if (cm) - { --- -2.9.0 - diff --git a/patches/windowscodecs-GIF_Encoder/0022-windowscodecs-Better-follow-the-GIF-spec-and-don-t-s.patch b/patches/windowscodecs-GIF_Encoder/0022-windowscodecs-Better-follow-the-GIF-spec-and-don-t-s.patch deleted file mode 100644 index b6d09369..00000000 --- a/patches/windowscodecs-GIF_Encoder/0022-windowscodecs-Better-follow-the-GIF-spec-and-don-t-s.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 855d2b2c5a978f441a2f2f1343fb53b03b3568c9 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Thu, 27 Oct 2016 14:52:43 +0800 -Subject: windowscodecs: Better follow the GIF spec and don't specify the local - color table size if there is no local palette. - ---- - dlls/windowscodecs/gifformat.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c -index 3dac59e..9d0ae6b 100644 ---- a/dlls/windowscodecs/gifformat.c -+++ b/dlls/windowscodecs/gifformat.c -@@ -2070,9 +2070,11 @@ static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface) - imd.height = This->height; - imd.packed = 0; - if (This->colors) -+ { - imd.packed |= 0x80; /* local color table flag */ -+ imd.packed |= 0x07; /* local color table size */ -+ } - /* FIXME: interlace flag */ -- imd.packed |= 0x07; /* local color table size */ - hr = IStream_Write(This->encoder->stream, &imd, sizeof(imd), NULL); - if (hr == S_OK && This->colors) - { --- -2.9.0 - diff --git a/patches/windowscodecs-GIF_Encoder/0026-windowscodecs-tests-Add-the-tests-for-GIF-encoder-an.patch b/patches/windowscodecs-GIF_Encoder/0026-windowscodecs-tests-Add-the-tests-for-GIF-encoder-an.patch deleted file mode 100644 index 173f5b8d..00000000 --- a/patches/windowscodecs-GIF_Encoder/0026-windowscodecs-tests-Add-the-tests-for-GIF-encoder-an.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 59176c773e3e710418c79641ca3c11d81ce98849 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Thu, 27 Oct 2016 15:17:19 +0800 -Subject: [PATCH] windowscodecs/tests: Add the tests for GIF encoder and - decoder. - ---- - dlls/windowscodecs/tests/converter.c | 59 +++++++++++++++++++++++++--- - 1 file changed, 54 insertions(+), 5 deletions(-) - -diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c -index 7d956a69..09125603 100644 ---- a/dlls/windowscodecs/tests/converter.c -+++ b/dlls/windowscodecs/tests/converter.c -@@ -1071,6 +1071,40 @@ static void check_png_format(IStream *stream, const WICPixelFormatGUID *format) - ok(0, "unknown PNG pixel format %s\n", wine_dbgstr_guid(format)); - } - -+static void check_gif_format(IStream *stream, const WICPixelFormatGUID *format) -+{ -+#include "pshpack1.h" -+ struct logical_screen_descriptor -+ { -+ char signature[6]; -+ USHORT width; -+ USHORT height; -+ BYTE packed; -+ /* global_color_table_flag : 1; -+ * color_resolution : 3; -+ * sort_flag : 1; -+ * global_color_table_size : 3; -+ */ -+ BYTE background_color_index; -+ BYTE pixel_aspect_ratio; -+ } lsd; -+#include "poppack.h" -+ UINT color_resolution; -+ HRESULT hr; -+ -+ memset(&lsd, 0, sizeof(lsd)); -+ hr = IStream_Read(stream, &lsd, sizeof(lsd), NULL); -+ ok(hr == S_OK, "IStream_Read error %#x\n", hr); -+ -+ ok(!memcmp(lsd.signature, "GIF89a", 6), "wrong GIF signature %.6s\n", lsd.signature); -+ -+ ok(lsd.width == 32, "wrong width %u\n", lsd.width); -+ ok(lsd.height == 2, "wrong height %u\n", lsd.height); -+ color_resolution = 1 << (((lsd.packed >> 4) & 0x07) + 1); -+ ok(color_resolution == 256, "wrong color resolution %u\n", color_resolution); -+ ok(lsd.pixel_aspect_ratio == 0, "wrong pixel_aspect_ratio %u\n", lsd.pixel_aspect_ratio); -+} -+ - static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format) - { - HRESULT hr; -@@ -1086,6 +1120,8 @@ static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WIC - check_bmp_format(stream, format); - else if (IsEqualGUID(encoder, &CLSID_WICTiffEncoder)) - check_tiff_format(stream, format); -+ else if (IsEqualGUID(encoder, &CLSID_WICGifEncoder)) -+ check_gif_format(stream, format); - else - ok(0, "unknown encoder %s\n", wine_dbgstr_guid(encoder)); - -@@ -1204,7 +1240,7 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls - - hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICBitmapEncoder, (void**)&encoder); -- ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr); -+ ok(SUCCEEDED(hr), "CoCreateInstance(%s) failed, hr=%x\n", wine_dbgstr_guid(clsid_encoder), hr); - if (SUCCEEDED(hr)) - { - hglobal = GlobalAlloc(GMEM_MOVEABLE, 0); -@@ -1231,7 +1267,10 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls - if (palette) - { - hr = IWICBitmapEncoder_SetPalette(encoder, palette); -- ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#x\n", hr); -+ if (IsEqualGUID(clsid_encoder, &CLSID_WICGifEncoder)) -+ ok(hr == S_OK, "SetPalette failed, hr=%#x\n", hr); -+ else -+ ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#x\n", hr); - hr = S_OK; - } - -@@ -1384,13 +1423,19 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls - ok(hr == S_OK, "CreatePalette error %#x\n", hr); - - hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette); -- ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr); -+ if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder)) -+ ok(hr == WINCODEC_ERR_WRONGSTATE, "wrong error %#x\n", hr); -+ else -+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr); - - hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand); - ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr); - - hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette); -- ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr); -+ if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder)) -+ ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING) /* XP */, "CopyPalette failed, hr=%#x\n", hr); -+ else -+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr); - - hr = S_OK; - i=0; -@@ -1449,7 +1494,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls - } - } - else if (IsEqualGUID(clsid_decoder, &CLSID_WICBmpDecoder) || -- IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder)) -+ IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder) || -+ IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder)) - { - if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormatBlackWhite) || - IsEqualGUID(&pixelformat, &GUID_WICPixelFormat8bppIndexed)) -@@ -1789,6 +1835,9 @@ START_TEST(converter) - test_default_converter(); - test_converter_8bppIndexed(); - -+ test_encoder(&testdata_8bppIndexed, &CLSID_WICGifEncoder, -+ &testdata_8bppIndexed, &CLSID_WICGifDecoder, "GIF encoder 8bppIndexed"); -+ - test_encoder(&testdata_BlackWhite, &CLSID_WICPngEncoder, - &testdata_BlackWhite, &CLSID_WICPngDecoder, "PNG encoder BlackWhite"); - test_encoder(&testdata_1bppIndexed, &CLSID_WICPngEncoder, --- -2.19.1 - diff --git a/patches/windowscodecs-GIF_Encoder/0028-windowscodecs-Correctly-indicate-that-the-global-inf.patch b/patches/windowscodecs-GIF_Encoder/0028-windowscodecs-Correctly-indicate-that-the-global-inf.patch deleted file mode 100644 index 41ca38bb..00000000 --- a/patches/windowscodecs-GIF_Encoder/0028-windowscodecs-Correctly-indicate-that-the-global-inf.patch +++ /dev/null @@ -1,32 +0,0 @@ -From ae0320150d2baec0415219ef3991431eb2ccc7af Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Sun, 6 Nov 2016 16:28:12 +0800 -Subject: [PATCH] windowscodecs: Correctly indicate that the global info - was written even without the global palette. - ---- - dlls/windowscodecs/gifformat.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c -index 58144ca..6851296 100644 ---- a/dlls/windowscodecs/gifformat.c -+++ b/dlls/windowscodecs/gifformat.c -@@ -2041,11 +2041,12 @@ static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface) - gif_palette[i][2] = This->encoder->palette[i] & 0xff; - } - hr = IStream_Write(This->encoder->stream, gif_palette, sizeof(gif_palette), NULL); -- if (hr == S_OK) -- This->encoder->info_written = TRUE; - } - - /* FIXME: write GCE, APE, etc. GIF extensions */ -+ -+ if (hr == S_OK) -+ This->encoder->info_written = TRUE; - } - - if (hr == S_OK) --- -1.9.1 -