diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b57dfe44..b7b49658 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "812d03129dea53337367789bac8ab523b9fce21d" + echo "b3c5b7da9442af840431cd7f795da20989aad42a" } # Show version information @@ -321,7 +321,6 @@ patch_enable_all () enable_widl_SLTG_Typelib_Support="$1" enable_windowscodecs_GIF_Encoder="$1" enable_windowscodecs_IMILBitmapSource="$1" - enable_windowscodecs_JPEG_Decoder="$1" enable_windowscodecs_TIFF_Support="$1" enable_wine_inf_Directory_ContextMenuHandlers="$1" enable_wine_inf_Dummy_CA_Certificate="$1" @@ -1115,9 +1114,6 @@ patch_enable () windowscodecs-IMILBitmapSource) enable_windowscodecs_IMILBitmapSource="$2" ;; - windowscodecs-JPEG_Decoder) - enable_windowscodecs_JPEG_Decoder="$2" - ;; windowscodecs-TIFF_Support) enable_windowscodecs_TIFF_Support="$2" ;; @@ -1856,6 +1852,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_Wait_User_APC" -gt 1; then + abort "Patchset ntdll-Wait_User_APC 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 @@ -1866,6 +1865,7 @@ if test "$enable_server_Shared_Memory" -eq 1; then abort "Patchset server-Signal_Thread disabled, but server-Shared_Memory depends on that." fi enable_ntdll_Threading=1 + enable_ntdll_Wait_User_APC=1 enable_server_Key_State=1 enable_server_PeekMessage=1 enable_server_Signal_Thread=1 @@ -5498,7 +5498,7 @@ fi # Patchset server-Shared_Memory # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread +# | * ntdll-Threading, ntdll-Wait_User_APC, server-Key_State, server-PeekMessage, server-Signal_Thread # | # | Modified files: # | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/server.c, dlls/ntdll/thread.c, dlls/ntdll/virtual.c, dlls/user32/focus.c, @@ -5530,7 +5530,8 @@ fi # Patchset server-Object_Types # | # | This patchset has the following (direct or indirect) dependencies: -# | * server-Misc_ACL, ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread, server-Shared_Memory +# | * server-Misc_ACL, ntdll-Threading, ntdll-Wait_User_APC, server-Key_State, server-PeekMessage, server-Signal_Thread, +# | server-Shared_Memory # | # | This patchset fixes the following Wine bugs: # | * [#44629] Process Hacker can't enumerate handles @@ -5548,9 +5549,6 @@ if test "$enable_server_Object_Types" -eq 1; then patch_apply server-Object_Types/0002-ntdll-Implement-ObjectTypesInformation-in-NtQueryObj.patch patch_apply server-Object_Types/0003-server-Register-types-during-startup.patch patch_apply server-Object_Types/0004-server-Rename-ObjectType-to-Type.patch - patch_apply server-Object_Types/0005-server-Add-type-Token.patch - patch_apply server-Object_Types/0006-server-Add-type-Process.patch - patch_apply server-Object_Types/0007-server-Add-type-Thread.patch patch_apply server-Object_Types/0008-ntdll-Set-TypeIndex-for-ObjectTypeInformation-in-NtQ.patch patch_apply server-Object_Types/0009-ntdll-Set-object-type-for-System-Extended-HandleInfo.patch patch_apply server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch @@ -5559,9 +5557,6 @@ if test "$enable_server_Object_Types" -eq 1; then printf '%s\n' '+ { "Michael Müller", "ntdll: Implement ObjectTypesInformation in NtQueryObject.", 1 },'; printf '%s\n' '+ { "Michael Müller", "server: Register types during startup.", 1 },'; printf '%s\n' '+ { "Michael Müller", "server: Rename ObjectType to Type.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "server: Add type Token.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "server: Add type Process.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "server: Add type Thread.", 1 },'; printf '%s\n' '+ { "Michael Müller", "ntdll: Set TypeIndex for ObjectTypeInformation in NtQueryObject.", 1 },'; printf '%s\n' '+ { "Michael Müller", "ntdll: Set object type for System(Extended)HandleInformation in NtQuerySystemInformation.", 1 },'; printf '%s\n' '+ { "Michael Müller", "ntdll: Mimic object type behavior for different windows versions.", 1 },'; @@ -6539,18 +6534,6 @@ if test "$enable_windowscodecs_IMILBitmapSource" -eq 1; then ) >> "$patchlist" fi -# Patchset windowscodecs-JPEG_Decoder -# | -# | Modified files: -# | * dlls/windowscodecs/converter.c, dlls/windowscodecs/jpegformat.c -# | -if test "$enable_windowscodecs_JPEG_Decoder" -eq 1; then - patch_apply windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch - ( - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Move JPEG frame image data initialization from Frame::CopyPixels to Decoder::Initialize.", 2 },'; - ) >> "$patchlist" -fi - # Patchset windowscodecs-TIFF_Support # | # | This patchset has the following (direct or indirect) dependencies: diff --git a/patches/server-Inherited_ACLs/0001-server-Inherit-security-attributes-from-parent-direc.patch b/patches/server-Inherited_ACLs/0001-server-Inherit-security-attributes-from-parent-direc.patch index f16906f9..fb360dca 100644 --- a/patches/server-Inherited_ACLs/0001-server-Inherit-security-attributes-from-parent-direc.patch +++ b/patches/server-Inherited_ACLs/0001-server-Inherit-security-attributes-from-parent-direc.patch @@ -1,19 +1,19 @@ -From ae940533d113a6419605d09c874561af4cd292d4 Mon Sep 17 00:00:00 2001 +From 6b6b0104bb50897030fef3e9f49321f1ac33edae Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 14:08:36 -0600 Subject: server: Inherit security attributes from parent directories on creation. (try 7) --- - dlls/advapi32/tests/security.c | 8 +-- - server/file.c | 137 +++++++++++++++++++++++++++++++++++++++++ + dlls/advapi32/tests/security.c | 8 +- + server/file.c | 137 +++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index a85bb38..7be1db6 100644 +index 53bea200..fbde5213 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3280,7 +3280,7 @@ static void test_CreateDirectoryA(void) +@@ -3654,7 +3654,7 @@ static void test_CreateDirectoryA(void) (PSID *)&owner, NULL, &pDacl, NULL, &pSD); ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); test_inherited_dacl(pDacl, admin_sid, user_sid, INHERITED_ACE, @@ -22,7 +22,7 @@ index a85bb38..7be1db6 100644 LocalFree(pSD); CloseHandle(hTemp); -@@ -3349,7 +3349,7 @@ static void test_CreateDirectoryA(void) +@@ -3722,7 +3722,7 @@ static void test_CreateDirectoryA(void) (PSID *)&owner, NULL, &pDacl, NULL, &pSD); ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); test_inherited_dacl(pDacl, admin_sid, user_sid, INHERITED_ACE, @@ -31,7 +31,7 @@ index a85bb38..7be1db6 100644 LocalFree(pSD); CloseHandle(hTemp); -@@ -3414,7 +3414,7 @@ static void test_CreateDirectoryA(void) +@@ -3787,7 +3787,7 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); test_inherited_dacl(pDacl, admin_sid, user_sid, OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERITED_ACE, @@ -40,7 +40,7 @@ index a85bb38..7be1db6 100644 LocalFree(pSD); bret = RemoveDirectoryA(tmpfile); ok(bret == TRUE, "RemoveDirectoryA failed with error %u\n", GetLastError()); -@@ -3495,7 +3495,7 @@ static void test_CreateDirectoryA(void) +@@ -3868,7 +3868,7 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); test_inherited_dacl(pDacl, admin_sid, user_sid, OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERITED_ACE, @@ -50,7 +50,7 @@ index a85bb38..7be1db6 100644 CloseHandle(hTemp); diff --git a/server/file.c b/server/file.c -index 49f193d..6fbb71c 100644 +index 107fea65..7d80a003 100644 --- a/server/file.c +++ b/server/file.c @@ -71,6 +71,7 @@ struct file @@ -60,8 +60,8 @@ index 49f193d..6fbb71c 100644 +static struct security_descriptor *get_xattr_sd( int fd ); static void file_dump( struct object *obj, int verbose ); - static struct object_type *file_get_type( struct object *obj ); -@@ -225,11 +226,142 @@ static void set_xattr_sd( int fd, const struct security_descriptor *sd ) + static struct fd *file_get_fd( struct object *obj ); +@@ -223,11 +224,142 @@ static void set_xattr_sd( int fd, const struct security_descriptor *sd ) xattr_fset( fd, WINE_XATTR_SD, buffer, len ); } @@ -204,7 +204,7 @@ index 49f193d..6fbb71c 100644 struct object *obj = NULL; struct fd *fd; int flags; -@@ -258,6 +390,10 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si +@@ -256,6 +388,10 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si default: set_error( STATUS_INVALID_PARAMETER ); goto done; } @@ -215,7 +215,7 @@ index 49f193d..6fbb71c 100644 if (sd) { const SID *owner = sd_get_owner( sd ); -@@ -297,6 +433,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si +@@ -295,6 +431,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si release_object( fd ); done: @@ -224,5 +224,5 @@ index 49f193d..6fbb71c 100644 return obj; } -- -2.4.2 +2.20.1 diff --git a/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch b/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch index 8b4f248d..9970f96c 100644 --- a/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch +++ b/patches/server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch @@ -1,21 +1,21 @@ -From 2ea454b0c058d14647bb55593d1021454a3c09a4 Mon Sep 17 00:00:00 2001 +From 3bc077fcf2d73665b8838bf23e989ed248af823e Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Wed, 25 Jun 2014 11:49:12 -0600 Subject: [PATCH] server: Add default security descriptor ownership for processes. --- - dlls/advapi32/tests/security.c | 35 +++++++++++++++++++++++++++++++++++ - server/process.c | 26 +++++++++++++++++++++++++- + dlls/advapi32/tests/security.c | 35 ++++++++++++++++++++++++++++++++++ + server/process.c | 26 ++++++++++++++++++++++++- server/security.h | 1 + server/token.c | 2 ++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index c472491..6f7a7f1 100644 +index d9cae64d..3097a64f 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -4665,11 +4665,15 @@ static void test_acls(void) +@@ -4682,11 +4682,15 @@ static void test_acls(void) static void test_GetSecurityInfo(void) { @@ -31,7 +31,7 @@ index c472491..6f7a7f1 100644 ACL_SIZE_INFORMATION acl_size; PSECURITY_DESCRIPTOR pSD; ACCESS_ALLOWED_ACE *ace; -@@ -4796,6 +4800,37 @@ static void test_GetSecurityInfo(void) +@@ -4813,6 +4817,37 @@ static void test_GetSecurityInfo(void) } LocalFree(pSD); CloseHandle(obj); @@ -70,18 +70,18 @@ index c472491..6f7a7f1 100644 static void test_GetSidSubAuthority(void) diff --git a/server/process.c b/server/process.c -index 651ecdf..9a11e0a 100644 +index 77bd1e74..e3596942 100644 --- a/server/process.c +++ b/server/process.c -@@ -62,6 +62,7 @@ static int shutdown_stage; /* current stage in the shutdown process */ - static void process_dump( struct object *obj, int verbose ); +@@ -63,6 +63,7 @@ static void process_dump( struct object *obj, int verbose ); + static struct object_type *process_get_type( struct object *obj ); static int process_signaled( struct object *obj, struct wait_queue_entry *entry ); static unsigned int process_map_access( struct object *obj, unsigned int access ); +static struct security_descriptor *process_get_sd( struct object *obj ); static void process_poll_event( struct fd *fd, int event ); static void process_destroy( struct object *obj ); static void terminate_process( struct process *process, struct thread *skip, int exit_code ); -@@ -78,7 +79,7 @@ static const struct object_ops process_ops = +@@ -79,7 +80,7 @@ static const struct object_ops process_ops = no_signal, /* signal */ no_get_fd, /* get_fd */ process_map_access, /* map_access */ @@ -90,7 +90,7 @@ index 651ecdf..9a11e0a 100644 default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ no_link_name, /* link_name */ -@@ -672,6 +673,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access +@@ -658,6 +659,29 @@ static unsigned int process_map_access( struct object *obj, unsigned int access return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); } @@ -121,7 +121,7 @@ index 651ecdf..9a11e0a 100644 { struct process *process = get_fd_user( fd ); diff --git a/server/security.h b/server/security.h -index bc4a8f6..6c33714 100644 +index 873bbc6a..606dbb2a 100644 --- a/server/security.h +++ b/server/security.h @@ -47,6 +47,7 @@ extern const PSID security_local_user_sid; @@ -133,7 +133,7 @@ index bc4a8f6..6c33714 100644 diff --git a/server/token.c b/server/token.c -index b0849ad..9228e46 100644 +index e440d489..f236084b 100644 --- a/server/token.c +++ b/server/token.c @@ -83,6 +83,7 @@ static const SID_N(5) local_user_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORIT @@ -153,5 +153,5 @@ index b0849ad..9228e46 100644 static luid_t prev_luid_value = { 1000, 0 }; -- -1.9.1 +2.20.1 diff --git a/patches/server-Object_Types/0002-ntdll-Implement-ObjectTypesInformation-in-NtQueryObj.patch b/patches/server-Object_Types/0002-ntdll-Implement-ObjectTypesInformation-in-NtQueryObj.patch index 2d9ca47b..99ea6b2d 100644 --- a/patches/server-Object_Types/0002-ntdll-Implement-ObjectTypesInformation-in-NtQueryObj.patch +++ b/patches/server-Object_Types/0002-ntdll-Implement-ObjectTypesInformation-in-NtQueryObj.patch @@ -1,21 +1,21 @@ -From b3286b1c7ea9b507918c96f901d8e2c1311a4a1c Mon Sep 17 00:00:00 2001 +From df0394fbe1b04909081ab265eb8ec7f20ff4e8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 8 Mar 2017 02:12:37 +0100 Subject: ntdll: Implement ObjectTypesInformation in NtQueryObject. --- - dlls/ntdll/om.c | 51 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/ntdll/tests/om.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ - include/winternl.h | 30 +++++++++++++++++++++++++-- - server/directory.c | 19 ++++++++++++++++- - server/protocol.def | 9 ++++++++ + dlls/ntdll/om.c | 51 ++++++++++++++++++++++++++++++++++++++ + dlls/ntdll/tests/om.c | 57 +++++++++++++++++++++++++++++++++++++++++++ + include/winternl.h | 30 +++++++++++++++++++++-- + server/directory.c | 19 ++++++++++++++- + server/protocol.def | 9 +++++++ 5 files changed, 163 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index 0f21800df6..8911a28b20 100644 +index 0b562513..88a4f800 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c -@@ -43,6 +43,7 @@ +@@ -42,6 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -23,7 +23,7 @@ index 0f21800df6..8911a28b20 100644 /* * Generic object functions -@@ -188,6 +189,56 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, +@@ -187,6 +188,56 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, SERVER_END_REQ; } break; @@ -81,10 +81,10 @@ index 0f21800df6..8911a28b20 100644 { OBJECT_DATA_INFORMATION* p = ptr; diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c -index 9a1ba670ab..534cb514f9 100644 +index 3f627aad..dbe7be39 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c -@@ -74,6 +74,21 @@ static NTSTATUS (WINAPI *pNtOpenIoCompletion)( PHANDLE, ACCESS_MASK, POBJECT_ATT +@@ -79,6 +79,21 @@ static void (WINAPI *pRtlWakeAddressSingle)( const void * ); #define KEYEDEVENT_WAKE 0x0002 #define KEYEDEVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x0003) @@ -106,8 +106,8 @@ index 9a1ba670ab..534cb514f9 100644 static void test_case_sensitive (void) { static const WCHAR buffer1[] = {'\\','B','a','s','e','N','a','m','e','d','O','b','j','e','c','t','s','\\','t','e','s','t',0}; -@@ -1524,6 +1539,47 @@ static void test_query_object(void) - pRtlFreeUnicodeString( &session ); +@@ -1579,6 +1594,47 @@ static void test_query_object(void) + } +static void test_query_object_types(void) @@ -154,7 +154,7 @@ index 9a1ba670ab..534cb514f9 100644 static void test_type_mismatch(void) { HANDLE h; -@@ -2036,6 +2092,7 @@ START_TEST(om) +@@ -2178,6 +2234,7 @@ START_TEST(om) test_directory(); test_symboliclink(); test_query_object(); @@ -163,10 +163,10 @@ index 9a1ba670ab..534cb514f9 100644 test_event(); test_mutant(); diff --git a/include/winternl.h b/include/winternl.h -index 7ffe4f6c81..0a2e323c5b 100644 +index 0c8a5014..0b17c2f5 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -790,7 +790,7 @@ typedef enum _OBJECT_INFORMATION_CLASS { +@@ -826,7 +826,7 @@ typedef enum _OBJECT_INFORMATION_CLASS { ObjectBasicInformation, ObjectNameInformation, ObjectTypeInformation, @@ -175,7 +175,7 @@ index 7ffe4f6c81..0a2e323c5b 100644 ObjectDataInformation } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS; -@@ -1208,9 +1208,35 @@ typedef struct _OBJECT_NAME_INFORMATION { +@@ -1237,9 +1237,35 @@ typedef struct _OBJECT_NAME_INFORMATION { typedef struct __OBJECT_TYPE_INFORMATION { UNICODE_STRING TypeName; @@ -213,10 +213,10 @@ index 7ffe4f6c81..0a2e323c5b 100644 #ifdef __WINESRC__ DWORD_PTR ExitStatus; diff --git a/server/directory.c b/server/directory.c -index d903ff283c..ebec63e6c6 100644 +index 6aa3a55f..6e22a741 100644 --- a/server/directory.c +++ b/server/directory.c -@@ -72,6 +72,8 @@ static const struct object_ops object_type_ops = +@@ -71,6 +71,8 @@ static const struct object_ops object_type_ops = no_destroy /* destroy */ }; @@ -225,7 +225,7 @@ index d903ff283c..ebec63e6c6 100644 struct directory { -@@ -238,7 +240,8 @@ struct object_type *get_object_type( const struct unicode_str *name ) +@@ -236,7 +238,8 @@ struct object_type *get_object_type( const struct unicode_str *name ) { if (get_error() != STATUS_OBJECT_NAME_EXISTS) { @@ -235,7 +235,7 @@ index d903ff283c..ebec63e6c6 100644 make_object_static( &type->obj ); } clear_error(); -@@ -531,3 +534,17 @@ DECL_HANDLER(get_object_type) +@@ -529,3 +532,17 @@ DECL_HANDLER(get_object_type) } release_object( obj ); } @@ -254,10 +254,10 @@ index d903ff283c..ebec63e6c6 100644 + else set_error( STATUS_NO_MORE_ENTRIES ); +} diff --git a/server/protocol.def b/server/protocol.def -index 071129723f..98c4c58a4e 100644 +index 3ffb8940..0d866986 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -3548,6 +3548,15 @@ struct handle_info +@@ -3575,6 +3575,15 @@ struct handle_info @END @@ -274,5 +274,5 @@ index 071129723f..98c4c58a4e 100644 @REQ(unlink_object) obj_handle_t handle; /* handle to the object */ -- -2.11.0 +2.20.1 diff --git a/patches/server-Object_Types/0003-server-Register-types-during-startup.patch b/patches/server-Object_Types/0003-server-Register-types-during-startup.patch index 85b05fef..e4d12f7b 100644 --- a/patches/server-Object_Types/0003-server-Register-types-during-startup.patch +++ b/patches/server-Object_Types/0003-server-Register-types-during-startup.patch @@ -1,4 +1,4 @@ -From 35a8bfa127fa1195bbb6454a79d8ff1a794ee9d9 Mon Sep 17 00:00:00 2001 +From 8c50f607d19234b421ecc5278cb007b45b1d4df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 8 Mar 2017 03:32:43 +0100 Subject: server: Register types during startup. @@ -14,20 +14,22 @@ Subject: server: Register types during startup. server/mutex.c | 3 +-- server/named_pipe.c | 3 +-- server/object.c | 36 ++++++++++++++++++++++++++++++++++++ - server/object.h | 21 +++++++++++++++++++++ - server/process.c | 3 +-- + server/object.h | 24 ++++++++++++++++++++++++ + server/process.c | 6 ++---- server/registry.c | 3 +-- server/semaphore.c | 3 +-- server/symlink.c | 3 +-- + server/thread.c | 3 +-- server/timer.c | 3 +-- + server/token.c | 3 +-- server/winstation.c | 6 ++---- - 17 files changed, 75 insertions(+), 34 deletions(-) + 19 files changed, 81 insertions(+), 40 deletions(-) diff --git a/server/completion.c b/server/completion.c -index 72dbc5b821..af4a3f74e1 100644 +index 8b8983a1..b4c97b01 100644 --- a/server/completion.c +++ b/server/completion.c -@@ -110,8 +110,7 @@ static void completion_dump( struct object *obj, int verbose ) +@@ -109,8 +109,7 @@ static void completion_dump( struct object *obj, int verbose ) static struct object_type *completion_get_type( struct object *obj ) { @@ -38,10 +40,10 @@ index 72dbc5b821..af4a3f74e1 100644 } diff --git a/server/directory.c b/server/directory.c -index ebec63e6c6..98dd2defa3 100644 +index 6e22a741..65a77a89 100644 --- a/server/directory.c +++ b/server/directory.c -@@ -121,8 +121,7 @@ static void object_type_dump( struct object *obj, int verbose ) +@@ -119,8 +119,7 @@ static void object_type_dump( struct object *obj, int verbose ) static struct object_type *object_type_get_type( struct object *obj ) { @@ -51,7 +53,7 @@ index ebec63e6c6..98dd2defa3 100644 return get_object_type( &str ); } -@@ -133,8 +132,7 @@ static void directory_dump( struct object *obj, int verbose ) +@@ -131,8 +130,7 @@ static void directory_dump( struct object *obj, int verbose ) static struct object_type *directory_get_type( struct object *obj ) { @@ -62,10 +64,10 @@ index ebec63e6c6..98dd2defa3 100644 } diff --git a/server/event.c b/server/event.c -index 608fafb94d..04ebda60a5 100644 +index cfc0f6af..f30faa9b 100644 --- a/server/event.c +++ b/server/event.c -@@ -161,8 +161,7 @@ static void event_dump( struct object *obj, int verbose ) +@@ -159,8 +159,7 @@ static void event_dump( struct object *obj, int verbose ) static struct object_type *event_get_type( struct object *obj ) { @@ -75,7 +77,7 @@ index 608fafb94d..04ebda60a5 100644 return get_object_type( &str ); } -@@ -231,8 +230,7 @@ static void keyed_event_dump( struct object *obj, int verbose ) +@@ -229,8 +228,7 @@ static void keyed_event_dump( struct object *obj, int verbose ) static struct object_type *keyed_event_get_type( struct object *obj ) { @@ -86,12 +88,12 @@ index 608fafb94d..04ebda60a5 100644 } diff --git a/server/file.c b/server/file.c -index babbcc6a63..5c3ae775b3 100644 +index 7ca650f9..61bbd846 100644 --- a/server/file.c +++ b/server/file.c -@@ -456,8 +456,7 @@ static void file_dump( struct object *obj, int verbose ) +@@ -270,8 +270,7 @@ static void file_dump( struct object *obj, int verbose ) - static struct object_type *file_get_type( struct object *obj ) + struct object_type *file_get_type( struct object *obj ) { - static const WCHAR name[] = {'F','i','l','e'}; - static const struct unicode_str str = { name, sizeof(name) }; @@ -100,10 +102,10 @@ index babbcc6a63..5c3ae775b3 100644 } diff --git a/server/mailslot.c b/server/mailslot.c -index 04c4b9f50c..b69c957595 100644 +index 75a397db..6c998656 100644 --- a/server/mailslot.c +++ b/server/mailslot.c -@@ -349,8 +349,7 @@ static void mailslot_device_dump( struct object *obj, int verbose ) +@@ -350,8 +350,7 @@ static void mailslot_device_dump( struct object *obj, int verbose ) static struct object_type *mailslot_device_get_type( struct object *obj ) { @@ -114,10 +116,10 @@ index 04c4b9f50c..b69c957595 100644 } diff --git a/server/main.c b/server/main.c -index 313039a308..13af3b9feb 100644 +index f984bfc1..9739e3ac 100644 --- a/server/main.c +++ b/server/main.c -@@ -148,6 +148,7 @@ int main( int argc, char *argv[] ) +@@ -146,6 +146,7 @@ int main( int argc, char *argv[] ) init_directories(); init_registry(); init_shared_memory(); @@ -126,10 +128,10 @@ index 313039a308..13af3b9feb 100644 return 0; } diff --git a/server/mapping.c b/server/mapping.c -index 44fbe63793..9691dd832c 100644 +index 2a9c45ad..c3e99c86 100644 --- a/server/mapping.c +++ b/server/mapping.c -@@ -728,8 +728,7 @@ static void mapping_dump( struct object *obj, int verbose ) +@@ -970,8 +970,7 @@ static void mapping_dump( struct object *obj, int verbose ) static struct object_type *mapping_get_type( struct object *obj ) { @@ -140,10 +142,10 @@ index 44fbe63793..9691dd832c 100644 } diff --git a/server/mutex.c b/server/mutex.c -index a2a0a24bdc..7ca41316ab 100644 +index d1887e4b..d458dc6f 100644 --- a/server/mutex.c +++ b/server/mutex.c -@@ -142,8 +142,7 @@ static void mutex_dump( struct object *obj, int verbose ) +@@ -141,8 +141,7 @@ static void mutex_dump( struct object *obj, int verbose ) static struct object_type *mutex_get_type( struct object *obj ) { @@ -154,10 +156,10 @@ index a2a0a24bdc..7ca41316ab 100644 } diff --git a/server/named_pipe.c b/server/named_pipe.c -index bc4b6f08fd..e3ebb4571e 100644 +index 101ff632..ceb1a6cb 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c -@@ -524,8 +524,7 @@ static void named_pipe_device_dump( struct object *obj, int verbose ) +@@ -449,8 +449,7 @@ static void named_pipe_device_dump( struct object *obj, int verbose ) static struct object_type *named_pipe_device_get_type( struct object *obj ) { @@ -168,10 +170,10 @@ index bc4b6f08fd..e3ebb4571e 100644 } diff --git a/server/object.c b/server/object.c -index 7281ef82ec..e6d20196a9 100644 +index 4455718a..8b4a8429 100644 --- a/server/object.c +++ b/server/object.c -@@ -710,3 +710,39 @@ int no_close_handle( struct object *obj, struct process *process, obj_handle_t h +@@ -700,3 +700,39 @@ int no_close_handle( struct object *obj, struct process *process, obj_handle_t h void no_destroy( struct object *obj ) { } @@ -181,10 +183,10 @@ index 7281ef82ec..e6d20196a9 100644 + {type_ObjectType, sizeof(type_ObjectType)}, + {type_Directory, sizeof(type_Directory)}, + {type_SymbolicLink, sizeof(type_SymbolicLink)}, -+ /* Token */ ++ {type_Token, sizeof(type_Token)}, + {type_Job, sizeof(type_Job)}, -+ /* Process */ -+ /* Thread */ ++ {type_Process, sizeof(type_Process)}, ++ {type_Thread, sizeof(type_Thread)}, + {type_Event, sizeof(type_Event)}, + {type_Mutant, sizeof(type_Mutant)}, + {type_Semaphore, sizeof(type_Semaphore)}, @@ -212,10 +214,10 @@ index 7281ef82ec..e6d20196a9 100644 + } +} diff --git a/server/object.h b/server/object.h -index 498186bc92..be71c705c5 100644 +index b5c50e1c..f75ccc0c 100644 --- a/server/object.h +++ b/server/object.h -@@ -241,6 +241,27 @@ extern struct object_type *get_object_type( const struct unicode_str *name ); +@@ -233,6 +233,30 @@ extern struct object_type *get_object_type( const struct unicode_str *name ); extern int directory_link_name( struct object *obj, struct object_name *name, struct object *parent ); extern void init_directories(void); @@ -232,10 +234,13 @@ index 498186bc92..be71c705c5 100644 +static const WCHAR type_KeyedEvent[] = {'K','e','y','e','d','E','v','e','n','t'}; +static const WCHAR type_Mutant[] = {'M','u','t','a','n','t'}; +static const WCHAR type_ObjectType[] = {'O','b','j','e','c','t','T','y','p','e'}; ++static const WCHAR type_Process[] = {'P','r','o','c','e','s','s'}; +static const WCHAR type_Section[] = {'S','e','c','t','i','o','n'}; +static const WCHAR type_Semaphore[] = {'S','e','m','a','p','h','o','r','e'}; +static const WCHAR type_SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k'}; ++static const WCHAR type_Thread[] = {'T','h','r','e','a','d'}; +static const WCHAR type_Timer[] = {'T','i','m','e','r'}; ++static const WCHAR type_Token[] = {'T','o','k','e','n'}; +static const WCHAR type_WindowStation[] = {'W','i','n','d','o','w','S','t','a','t','i','o','n'}; + +extern void init_types(void); @@ -244,10 +249,10 @@ index 498186bc92..be71c705c5 100644 extern struct object *create_obj_symlink( struct object *root, const struct unicode_str *name, diff --git a/server/process.c b/server/process.c -index a59be6cfad..df1e9f1b0d 100644 +index e24ac30c..d0307022 100644 --- a/server/process.c +++ b/server/process.c -@@ -214,8 +214,7 @@ static struct job *get_job_obj( struct process *process, obj_handle_t handle, un +@@ -211,8 +211,7 @@ static struct job *get_job_obj( struct process *process, obj_handle_t handle, un static struct object_type *job_get_type( struct object *obj ) { @@ -257,11 +262,21 @@ index a59be6cfad..df1e9f1b0d 100644 return get_object_type( &str ); }; +@@ -634,8 +633,7 @@ static void process_dump( struct object *obj, int verbose ) + + static struct object_type *process_get_type( struct object *obj ) + { +- static const WCHAR name[] = {'P','r','o','c','e','s','s'}; +- static const struct unicode_str str = { name, sizeof(name) }; ++ static const struct unicode_str str = { type_Job, sizeof(type_Job) }; + return get_object_type( &str ); + } + diff --git a/server/registry.c b/server/registry.c -index 368a56abcf..3a45f4f081 100644 +index dffa3acf..d3f252fc 100644 --- a/server/registry.c +++ b/server/registry.c -@@ -314,8 +314,7 @@ static void key_dump( struct object *obj, int verbose ) +@@ -305,8 +305,7 @@ static void key_dump( struct object *obj, int verbose ) static struct object_type *key_get_type( struct object *obj ) { @@ -272,10 +287,10 @@ index 368a56abcf..3a45f4f081 100644 } diff --git a/server/semaphore.c b/server/semaphore.c -index 15e7392513..60940aaa76 100644 +index 08ff1536..07010434 100644 --- a/server/semaphore.c +++ b/server/semaphore.c -@@ -128,8 +128,7 @@ static void semaphore_dump( struct object *obj, int verbose ) +@@ -127,8 +127,7 @@ static void semaphore_dump( struct object *obj, int verbose ) static struct object_type *semaphore_get_type( struct object *obj ) { @@ -286,10 +301,10 @@ index 15e7392513..60940aaa76 100644 } diff --git a/server/symlink.c b/server/symlink.c -index ecc0e4300c..33efdaa699 100644 +index 9199bc55..eaceee77 100644 --- a/server/symlink.c +++ b/server/symlink.c -@@ -87,8 +87,7 @@ static void symlink_dump( struct object *obj, int verbose ) +@@ -86,8 +86,7 @@ static void symlink_dump( struct object *obj, int verbose ) static struct object_type *symlink_get_type( struct object *obj ) { @@ -299,11 +314,25 @@ index ecc0e4300c..33efdaa699 100644 return get_object_type( &str ); } +diff --git a/server/thread.c b/server/thread.c +index 45c45c6d..aa714e25 100644 +--- a/server/thread.c ++++ b/server/thread.c +@@ -373,8 +373,7 @@ static void dump_thread( struct object *obj, int verbose ) + + static struct object_type *thread_get_type( struct object *obj ) + { +- static const WCHAR name[] = {'T','h','r','e','a','d'}; +- static const struct unicode_str str = { name, sizeof(name) }; ++ static const struct unicode_str str = { type_Thread, sizeof(type_Thread) }; + return get_object_type( &str ); + } + diff --git a/server/timer.c b/server/timer.c -index 23c613b3cb..cb686b90f9 100644 +index 3a786fb4..c2a9728a 100644 --- a/server/timer.c +++ b/server/timer.c -@@ -190,8 +190,7 @@ static void timer_dump( struct object *obj, int verbose ) +@@ -189,8 +189,7 @@ static void timer_dump( struct object *obj, int verbose ) static struct object_type *timer_get_type( struct object *obj ) { @@ -313,11 +342,25 @@ index 23c613b3cb..cb686b90f9 100644 return get_object_type( &str ); } +diff --git a/server/token.c b/server/token.c +index f236084b..a6cec249 100644 +--- a/server/token.c ++++ b/server/token.c +@@ -172,8 +172,7 @@ static void token_dump( struct object *obj, int verbose ) + + static struct object_type *token_get_type( struct object *obj ) + { +- static const WCHAR name[] = {'T','o','k','e','n'}; +- static const struct unicode_str str = { name, sizeof(name) }; ++ static const struct unicode_str str = { type_Token, sizeof(type_Token) }; + return get_object_type( &str ); + } + diff --git a/server/winstation.c b/server/winstation.c -index 39131d538e..d449ec667d 100644 +index a0be0586..dbd091e2 100644 --- a/server/winstation.c +++ b/server/winstation.c -@@ -166,8 +166,7 @@ static void winstation_dump( struct object *obj, int verbose ) +@@ -141,8 +141,7 @@ static void winstation_dump( struct object *obj, int verbose ) static struct object_type *winstation_get_type( struct object *obj ) { @@ -327,7 +370,7 @@ index 39131d538e..d449ec667d 100644 return get_object_type( &str ); } -@@ -271,8 +270,7 @@ static void desktop_dump( struct object *obj, int verbose ) +@@ -246,8 +245,7 @@ static void desktop_dump( struct object *obj, int verbose ) static struct object_type *desktop_get_type( struct object *obj ) { @@ -338,5 +381,5 @@ index 39131d538e..d449ec667d 100644 } -- -2.11.0 +2.20.1 diff --git a/patches/server-Object_Types/0004-server-Rename-ObjectType-to-Type.patch b/patches/server-Object_Types/0004-server-Rename-ObjectType-to-Type.patch index 8d2eeed3..677a6089 100644 --- a/patches/server-Object_Types/0004-server-Rename-ObjectType-to-Type.patch +++ b/patches/server-Object_Types/0004-server-Rename-ObjectType-to-Type.patch @@ -1,4 +1,4 @@ -From 0498c01e0c379ccf5874b07fbbf3ec86b34f97ad Mon Sep 17 00:00:00 2001 +From 4d38c295f01f346087b3e0ee2214f9e031e21327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 8 Mar 2017 03:44:19 +0100 Subject: server: Rename ObjectType to Type. @@ -11,10 +11,10 @@ Subject: server: Rename ObjectType to Type. 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c -index 534cb514f9..02d83016e2 100644 +index dbe7be39..a94b9866 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c -@@ -1570,7 +1570,7 @@ static void test_query_object_types(void) +@@ -1625,7 +1625,7 @@ static void test_query_object_types(void) if (i == 0) { @@ -24,10 +24,10 @@ index 534cb514f9..02d83016e2 100644 } diff --git a/server/directory.c b/server/directory.c -index 98dd2defa3..b4f53e2edf 100644 +index 65a77a89..79bd46fc 100644 --- a/server/directory.c +++ b/server/directory.c -@@ -121,7 +121,7 @@ static void object_type_dump( struct object *obj, int verbose ) +@@ -119,7 +119,7 @@ static void object_type_dump( struct object *obj, int verbose ) static struct object_type *object_type_get_type( struct object *obj ) { @@ -37,10 +37,10 @@ index 98dd2defa3..b4f53e2edf 100644 } diff --git a/server/object.c b/server/object.c -index e6d20196a9..960422df1c 100644 +index 8b4a8429..f7182eca 100644 --- a/server/object.c +++ b/server/object.c -@@ -713,7 +713,7 @@ void no_destroy( struct object *obj ) +@@ -703,7 +703,7 @@ void no_destroy( struct object *obj ) static const struct unicode_str type_array[] = { @@ -48,24 +48,27 @@ index e6d20196a9..960422df1c 100644 + {type_Type, sizeof(type_Type)}, {type_Directory, sizeof(type_Directory)}, {type_SymbolicLink, sizeof(type_SymbolicLink)}, - /* Token */ + {type_Token, sizeof(type_Token)}, diff --git a/server/object.h b/server/object.h -index be71c705c5..0ed46b159d 100644 +index f75ccc0c..58ad2da1 100644 --- a/server/object.h +++ b/server/object.h -@@ -253,11 +253,11 @@ static const WCHAR type_Job[] = {'J','o','b'}; +@@ -245,7 +245,6 @@ static const WCHAR type_Job[] = {'J','o','b'}; static const WCHAR type_Key[] = {'K','e','y'}; static const WCHAR type_KeyedEvent[] = {'K','e','y','e','d','E','v','e','n','t'}; static const WCHAR type_Mutant[] = {'M','u','t','a','n','t'}; -static const WCHAR type_ObjectType[] = {'O','b','j','e','c','t','T','y','p','e'}; + static const WCHAR type_Process[] = {'P','r','o','c','e','s','s'}; static const WCHAR type_Section[] = {'S','e','c','t','i','o','n'}; static const WCHAR type_Semaphore[] = {'S','e','m','a','p','h','o','r','e'}; - static const WCHAR type_SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k'}; +@@ -253,6 +252,7 @@ static const WCHAR type_SymbolicLink[] = {'S','y','m','b','o','l','i','c','L',' + static const WCHAR type_Thread[] = {'T','h','r','e','a','d'}; static const WCHAR type_Timer[] = {'T','i','m','e','r'}; + static const WCHAR type_Token[] = {'T','o','k','e','n'}; +static const WCHAR type_Type[] = {'T','y','p','e'}; static const WCHAR type_WindowStation[] = {'W','i','n','d','o','w','S','t','a','t','i','o','n'}; extern void init_types(void); -- -2.11.0 +2.20.1 diff --git a/patches/server-Object_Types/0005-server-Add-type-Token.patch b/patches/server-Object_Types/0005-server-Add-type-Token.patch deleted file mode 100644 index e9a21762..00000000 --- a/patches/server-Object_Types/0005-server-Add-type-Token.patch +++ /dev/null @@ -1,73 +0,0 @@ -From d1072993c562826d5392168f6f7937436a55b43b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Wed, 8 Mar 2017 03:48:02 +0100 -Subject: server: Add type Token. - ---- - server/object.c | 2 +- - server/object.h | 1 + - server/token.c | 9 ++++++++- - 3 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/server/object.c b/server/object.c -index 6bdf7f6..8d564b8 100644 ---- a/server/object.c -+++ b/server/object.c -@@ -706,7 +706,7 @@ static const struct unicode_str type_array[] = - {type_Type, sizeof(type_Type)}, - {type_Directory, sizeof(type_Directory)}, - {type_SymbolicLink, sizeof(type_SymbolicLink)}, -- /* Token */ -+ {type_Token, sizeof(type_Token)}, - {type_Job, sizeof(type_Job)}, - /* Process */ - /* Thread */ -diff --git a/server/object.h b/server/object.h -index f13de48..7bc8855 100644 ---- a/server/object.h -+++ b/server/object.h -@@ -249,6 +249,7 @@ static const WCHAR type_Section[] = {'S','e','c','t','i','o','n'}; - static const WCHAR type_Semaphore[] = {'S','e','m','a','p','h','o','r','e'}; - static const WCHAR type_SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k'}; - static const WCHAR type_Timer[] = {'T','i','m','e','r'}; -+static const WCHAR type_Token[] = {'T','o','k','e','n'}; - static const WCHAR type_Type[] = {'T','y','p','e'}; - static const WCHAR type_WindowStation[] = {'W','i','n','d','o','w','S','t','a','t','i','o','n'}; - -diff --git a/server/token.c b/server/token.c -index b0875fc..2b0fc5f 100644 ---- a/server/token.c -+++ b/server/token.c -@@ -136,6 +136,7 @@ struct group - }; - - static void token_dump( struct object *obj, int verbose ); -+static struct object_type *token_get_type( struct object *obj ); - static unsigned int token_map_access( struct object *obj, unsigned int access ); - static void token_destroy( struct object *obj ); - -@@ -143,7 +144,7 @@ static const struct object_ops token_ops = - { - sizeof(struct token), /* size */ - token_dump, /* dump */ -- no_get_type, /* get_type */ -+ token_get_type, /* get_type */ - no_add_queue, /* add_queue */ - NULL, /* remove_queue */ - NULL, /* signaled */ -@@ -169,6 +170,12 @@ static void token_dump( struct object *obj, int verbose ) - token->token_id.low_part, token->primary, token->impersonation_level ); - } - -+static struct object_type *token_get_type( struct object *obj ) -+{ -+ static const struct unicode_str str = { type_Token, sizeof(type_Token) }; -+ return get_object_type( &str ); -+} -+ - static unsigned int token_map_access( struct object *obj, unsigned int access ) - { - if (access & GENERIC_READ) access |= TOKEN_READ; --- -2.7.4 - diff --git a/patches/server-Object_Types/0006-server-Add-type-Process.patch b/patches/server-Object_Types/0006-server-Add-type-Process.patch deleted file mode 100644 index 25b08c58..00000000 --- a/patches/server-Object_Types/0006-server-Add-type-Process.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 97057ab129833bd9fdcf683e05a44c0d06330edd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Wed, 8 Mar 2017 03:52:47 +0100 -Subject: server: Add type Process. - ---- - server/object.c | 2 +- - server/object.h | 1 + - server/process.c | 9 ++++++++- - 3 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/server/object.c b/server/object.c -index c2c877f692..f7c249689f 100644 ---- a/server/object.c -+++ b/server/object.c -@@ -718,7 +718,7 @@ static const struct unicode_str type_array[] = - {type_SymbolicLink, sizeof(type_SymbolicLink)}, - {type_Token, sizeof(type_Token)}, - {type_Job, sizeof(type_Job)}, -- /* Process */ -+ {type_Process, sizeof(type_Process)}, - /* Thread */ - {type_Event, sizeof(type_Event)}, - {type_Mutant, sizeof(type_Mutant)}, -diff --git a/server/object.h b/server/object.h -index 46a9f770ca..cca12b6cf0 100644 ---- a/server/object.h -+++ b/server/object.h -@@ -253,6 +253,7 @@ static const WCHAR type_Job[] = {'J','o','b'}; - static const WCHAR type_Key[] = {'K','e','y'}; - static const WCHAR type_KeyedEvent[] = {'K','e','y','e','d','E','v','e','n','t'}; - static const WCHAR type_Mutant[] = {'M','u','t','a','n','t'}; -+static const WCHAR type_Process[] = {'P','r','o','c','e','s','s'}; - static const WCHAR type_Section[] = {'S','e','c','t','i','o','n'}; - static const WCHAR type_Semaphore[] = {'S','e','m','a','p','h','o','r','e'}; - static const WCHAR type_SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k'}; -diff --git a/server/process.c b/server/process.c -index df1e9f1b0d..de3e926717 100644 ---- a/server/process.c -+++ b/server/process.c -@@ -60,6 +60,7 @@ static int shutdown_stage; /* current stage in the shutdown process */ - /* process operations */ - - static void process_dump( struct object *obj, int verbose ); -+static struct object_type *process_get_type( struct object *obj ); - static int process_signaled( struct object *obj, struct wait_queue_entry *entry ); - static unsigned int process_map_access( struct object *obj, unsigned int access ); - static struct security_descriptor *process_get_sd( struct object *obj ); -@@ -71,7 +72,7 @@ static const struct object_ops process_ops = - { - sizeof(struct process), /* size */ - process_dump, /* dump */ -- no_get_type, /* get_type */ -+ process_get_type, /* get_type */ - add_queue, /* add_queue */ - remove_queue, /* remove_queue */ - process_signaled, /* signaled */ -@@ -655,6 +656,12 @@ static void process_dump( struct object *obj, int verbose ) - fprintf( stderr, "Process id=%04x handles=%p\n", process->id, process->handles ); - } - -+static struct object_type *process_get_type( struct object *obj ) -+{ -+ static const struct unicode_str str = { type_Process, sizeof(type_Process) }; -+ return get_object_type( &str ); -+} -+ - static int process_signaled( struct object *obj, struct wait_queue_entry *entry ) - { - struct process *process = (struct process *)obj; --- -2.11.0 - diff --git a/patches/server-Object_Types/0007-server-Add-type-Thread.patch b/patches/server-Object_Types/0007-server-Add-type-Thread.patch deleted file mode 100644 index 52e7d062..00000000 --- a/patches/server-Object_Types/0007-server-Add-type-Thread.patch +++ /dev/null @@ -1,73 +0,0 @@ -From ef0142aadbcbd3e36ff3e2473dca76e68ba5ecba Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Wed, 8 Mar 2017 03:56:00 +0100 -Subject: server: Add type Thread. - ---- - server/object.c | 2 +- - server/object.h | 1 + - server/thread.c | 9 ++++++++- - 3 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/server/object.c b/server/object.c -index f7c249689f..37ac0adce6 100644 ---- a/server/object.c -+++ b/server/object.c -@@ -719,7 +719,7 @@ static const struct unicode_str type_array[] = - {type_Token, sizeof(type_Token)}, - {type_Job, sizeof(type_Job)}, - {type_Process, sizeof(type_Process)}, -- /* Thread */ -+ {type_Thread, sizeof(type_Thread)}, - {type_Event, sizeof(type_Event)}, - {type_Mutant, sizeof(type_Mutant)}, - {type_Semaphore, sizeof(type_Semaphore)}, -diff --git a/server/object.h b/server/object.h -index cca12b6cf0..3ba3f4b431 100644 ---- a/server/object.h -+++ b/server/object.h -@@ -257,6 +257,7 @@ static const WCHAR type_Process[] = {'P','r','o','c','e','s','s'}; - static const WCHAR type_Section[] = {'S','e','c','t','i','o','n'}; - static const WCHAR type_Semaphore[] = {'S','e','m','a','p','h','o','r','e'}; - static const WCHAR type_SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k'}; -+static const WCHAR type_Thread[] = {'T','h','r','e','a','d'}; - static const WCHAR type_Timer[] = {'T','i','m','e','r'}; - static const WCHAR type_Token[] = {'T','o','k','e','n'}; - static const WCHAR type_Type[] = {'T','y','p','e'}; -diff --git a/server/thread.c b/server/thread.c -index 53e94fda42..108444ebc5 100644 ---- a/server/thread.c -+++ b/server/thread.c -@@ -129,6 +129,7 @@ static const struct object_ops thread_apc_ops = - /* thread operations */ - - static void dump_thread( struct object *obj, int verbose ); -+static struct object_type *thread_get_type( struct object *obj ); - static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ); - static unsigned int thread_map_access( struct object *obj, unsigned int access ); - static void thread_poll_event( struct fd *fd, int event ); -@@ -138,7 +139,7 @@ static const struct object_ops thread_ops = - { - sizeof(struct thread), /* size */ - dump_thread, /* dump */ -- no_get_type, /* get_type */ -+ thread_get_type, /* get_type */ - add_queue, /* add_queue */ - remove_queue, /* remove_queue */ - thread_signaled, /* signaled */ -@@ -344,6 +345,12 @@ static void dump_thread( struct object *obj, int verbose ) - thread->id, thread->unix_pid, thread->unix_tid, thread->state ); - } - -+static struct object_type *thread_get_type( struct object *obj ) -+{ -+ static const struct unicode_str str = { type_Thread, sizeof(type_Thread) }; -+ return get_object_type( &str ); -+} -+ - static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ) - { - struct thread *mythread = (struct thread *)obj; --- -2.11.0 - diff --git a/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch b/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch index bf6f5aa9..18a607c8 100644 --- a/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch +++ b/patches/server-Object_Types/0010-ntdll-Mimic-object-type-behavior-for-different-windo.patch @@ -1,4 +1,4 @@ -From 860c03c4e27d50537c05c29b086eb91fc136668f Mon Sep 17 00:00:00 2001 +From 963a3aedc5b1539187d9aa5065ff16d6c60b6477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 8 Mar 2017 19:39:29 +0100 Subject: [PATCH] ntdll: Mimic object type behavior for different windows @@ -11,10 +11,10 @@ Subject: [PATCH] ntdll: Mimic object type behavior for different windows 3 files changed, 83 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 14c2435eeb..b9a2b93c26 100644 +index d194f863..452fad15 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c -@@ -127,6 +127,19 @@ struct smbios_chassis { +@@ -126,6 +126,19 @@ struct smbios_chassis { #define FIRM 0x4649524D #define RSMB 0x52534D42 @@ -34,7 +34,7 @@ index 14c2435eeb..b9a2b93c26 100644 /* * Token */ -@@ -2658,7 +2671,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( +@@ -2617,7 +2630,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( shi->Handle[i].OwnerPid = info[i].owner; shi->Handle[i].HandleValue = info[i].handle; shi->Handle[i].AccessMask = info[i].access; @@ -43,7 +43,7 @@ index 14c2435eeb..b9a2b93c26 100644 /* FIXME: Fill out HandleFlags, ObjectPointer */ } } -@@ -2710,7 +2723,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( +@@ -2669,7 +2682,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( shi->Handle[i].UniqueProcessId = info[i].owner; shi->Handle[i].HandleValue = info[i].handle; shi->Handle[i].GrantedAccess = info[i].access; @@ -53,10 +53,10 @@ index 14c2435eeb..b9a2b93c26 100644 } } diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index 629f785099..060b502d75 100644 +index c0479ea6..2156fad5 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c -@@ -186,7 +186,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, +@@ -185,7 +185,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, } if (status == STATUS_SUCCESS) { @@ -69,7 +69,7 @@ index 629f785099..060b502d75 100644 } } diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c -index 1c3114d29c..5a2ca9b740 100644 +index a94b9866..54ef3955 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -74,6 +74,7 @@ static NTSTATUS (WINAPI *pNtQuerySystemTime)( LARGE_INTEGER * ); @@ -80,8 +80,8 @@ index 1c3114d29c..5a2ca9b740 100644 #define KEYEDEVENT_WAIT 0x0001 #define KEYEDEVENT_WAKE 0x0002 -@@ -1624,13 +1625,31 @@ static void test_query_object(void) - pRtlFreeUnicodeString( &session ); +@@ -1594,13 +1595,31 @@ static void test_query_object(void) + } +static BOOL winver_equal_or_newer(WORD major, WORD minor) @@ -113,7 +113,7 @@ index 1c3114d29c..5a2ca9b740 100644 buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(OBJECT_TYPES_INFORMATION) ); ok( buffer != NULL, "Failed to allocate memory\n" ); -@@ -1658,11 +1677,54 @@ static void test_query_object_types(void) +@@ -1628,11 +1647,54 @@ static void test_query_object_types(void) ok( type->TypeName.Length == sizeof(typeW) && !strncmpW(typeW, type->TypeName.Buffer, 4), "Expected 'Type' as first type, got %s\n", wine_dbgstr_us(&type->TypeName) ); } @@ -168,7 +168,7 @@ index 1c3114d29c..5a2ca9b740 100644 } static void test_type_mismatch(void) -@@ -2254,6 +2316,7 @@ START_TEST(om) +@@ -2226,6 +2288,7 @@ START_TEST(om) pRtlWaitOnAddress = (void *)GetProcAddress(hntdll, "RtlWaitOnAddress"); pRtlWakeAddressAll = (void *)GetProcAddress(hntdll, "RtlWakeAddressAll"); pRtlWakeAddressSingle = (void *)GetProcAddress(hntdll, "RtlWakeAddressSingle"); @@ -177,5 +177,5 @@ index 1c3114d29c..5a2ca9b740 100644 test_case_sensitive(); test_namespace_pipe(); -- -2.19.1 +2.20.1 diff --git a/patches/server-Shared_Memory/definition b/patches/server-Shared_Memory/definition index d2a3d770..6f51b96c 100644 --- a/patches/server-Shared_Memory/definition +++ b/patches/server-Shared_Memory/definition @@ -2,3 +2,4 @@ Depends: ntdll-Threading Depends: server-Key_State Depends: server-PeekMessage Depends: server-Signal_Thread +Depends: ntdll-Wait_User_APC \ No newline at end of file diff --git a/patches/server-Stored_ACLs/0001-server-Unify-the-storage-of-security-attributes-for-.patch b/patches/server-Stored_ACLs/0001-server-Unify-the-storage-of-security-attributes-for-.patch index 75a3846a..8d38e80d 100644 --- a/patches/server-Stored_ACLs/0001-server-Unify-the-storage-of-security-attributes-for-.patch +++ b/patches/server-Stored_ACLs/0001-server-Unify-the-storage-of-security-attributes-for-.patch @@ -1,4 +1,4 @@ -From 206f6039e58d89affc810d0f1a2ef2ff956e16d1 Mon Sep 17 00:00:00 2001 +From 62ffab532847db3e0282ce516356d69657aa746f Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 17 Apr 2014 16:07:46 -0600 Subject: server: Unify the storage of security attributes for files and @@ -11,10 +11,10 @@ Subject: server: Unify the storage of security attributes for files and 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/server/change.c b/server/change.c -index 11d9b93..b073271 100644 +index 3dd52aa1..376091ea 100644 --- a/server/change.c +++ b/server/change.c -@@ -323,48 +323,15 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd, +@@ -417,48 +417,15 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd, unsigned int set_info ) { struct dir *dir = (struct dir *)obj; @@ -70,7 +70,7 @@ index 11d9b93..b073271 100644 static struct change_record *get_first_change_record( struct dir *dir ) diff --git a/server/file.c b/server/file.c -index 1f9aa1f..b0be2ec 100644 +index e5541f4b..e948b283 100644 --- a/server/file.c +++ b/server/file.c @@ -549,18 +549,13 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner ) @@ -110,7 +110,7 @@ index 1f9aa1f..b0be2ec 100644 { file_set_error(); return 0; -@@ -617,6 +612,21 @@ static struct object *file_open_file( struct object *obj, unsigned int access, +@@ -626,6 +621,21 @@ static struct object *file_open_file( struct object *obj, unsigned int access, return new_file; } @@ -133,11 +133,11 @@ index 1f9aa1f..b0be2ec 100644 { struct file *file = (struct file *)obj; diff --git a/server/file.h b/server/file.h -index 460656f..28f91f4 100644 +index 0621b479..341692bb 100644 --- a/server/file.h +++ b/server/file.h -@@ -129,6 +129,8 @@ extern struct file *create_file_for_fd_obj( struct fd *fd, unsigned int access, - extern void file_set_error(void); +@@ -149,6 +149,8 @@ extern void file_set_error(void); + extern struct object_type *file_get_type( struct object *obj ); extern struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID *group ); extern mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner ); +extern int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, @@ -146,5 +146,5 @@ index 460656f..28f91f4 100644 /* file mapping functions */ -- -2.4.2 +2.20.1 diff --git a/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch b/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch deleted file mode 100644 index f2c91598..00000000 --- a/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch +++ /dev/null @@ -1,208 +0,0 @@ -From bbfed73428278d26bd202fb559a14c11ec923c63 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Fri, 18 Aug 2017 12:17:52 +0800 -Subject: [PATCH] windowscodecs: Move JPEG frame image data initialization from - Frame::CopyPixels to Decoder::Initialize. (v2) - -This is how PNG decoder does things, and it avoids image data corruption -in some cases (presumably when libjpeg reuses existing scanline data). ---- - dlls/windowscodecs/jpegformat.c | 152 +++++++++++++++------------------------- - 1 file changed, 56 insertions(+), 96 deletions(-) - -diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c -index 54f77a7..1df898f 100644 ---- a/dlls/windowscodecs/jpegformat.c -+++ b/dlls/windowscodecs/jpegformat.c -@@ -50,6 +50,7 @@ - - #include "wincodecs_private.h" - -+#include "wine/heap.h" - #include "wine/debug.h" - #include "wine/library.h" - -@@ -155,6 +156,7 @@ typedef struct { - struct jpeg_error_mgr jerr; - struct jpeg_source_mgr source_mgr; - BYTE source_buffer[1024]; -+ UINT bpp, stride; - BYTE *image_data; - CRITICAL_SECTION lock; - } JpegDecoder; -@@ -303,6 +305,8 @@ static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream * - int ret; - LARGE_INTEGER seek; - jmp_buf jmpbuf; -+ UINT data_size, i; -+ - TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOptions); - - EnterCriticalSection(&This->lock); -@@ -381,6 +385,55 @@ static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream * - return E_FAIL; - } - -+ if (This->cinfo.out_color_space == JCS_GRAYSCALE) This->bpp = 8; -+ else if (This->cinfo.out_color_space == JCS_CMYK) This->bpp = 32; -+ else This->bpp = 24; -+ -+ This->stride = (This->bpp * This->cinfo.output_width + 7) / 8; -+ data_size = This->stride * This->cinfo.output_height; -+ -+ This->image_data = heap_alloc(data_size); -+ if (!This->image_data) -+ { -+ LeaveCriticalSection(&This->lock); -+ return E_OUTOFMEMORY; -+ } -+ -+ while (This->cinfo.output_scanline < This->cinfo.output_height) -+ { -+ UINT first_scanline = This->cinfo.output_scanline; -+ UINT max_rows; -+ JSAMPROW out_rows[4]; -+ JDIMENSION ret; -+ -+ max_rows = min(This->cinfo.output_height-first_scanline, 4); -+ for (i=0; iimage_data + This->stride * (first_scanline+i); -+ -+ ret = pjpeg_read_scanlines(&This->cinfo, out_rows, max_rows); -+ if (ret == 0) -+ { -+ ERR("read_scanlines failed\n"); -+ LeaveCriticalSection(&This->lock); -+ return E_FAIL; -+ } -+ } -+ -+ if (This->bpp == 24) -+ { -+ /* libjpeg gives us RGB data and we want BGR, so byteswap the data */ -+ reverse_bgr8(3, This->image_data, -+ This->cinfo.output_width, This->cinfo.output_height, -+ This->stride); -+ } -+ -+ if (This->cinfo.out_color_space == JCS_CMYK && This->cinfo.saw_Adobe_marker) -+ { -+ /* Adobe JPEG's have inverted CMYK data. */ -+ for (i=0; iimage_data[i] ^= 0xff; -+ } -+ - This->initialized = TRUE; - - LeaveCriticalSection(&This->lock); -@@ -590,104 +643,11 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, - const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) - { - JpegDecoder *This = impl_from_IWICBitmapFrameDecode(iface); -- UINT bpp; -- UINT stride; -- UINT data_size; -- UINT max_row_needed; -- jmp_buf jmpbuf; -- WICRect rect; -- TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer); -- -- if (!prc) -- { -- rect.X = 0; -- rect.Y = 0; -- rect.Width = This->cinfo.output_width; -- rect.Height = This->cinfo.output_height; -- prc = ▭ -- } -- else -- { -- if (prc->X < 0 || prc->Y < 0 || prc->X+prc->Width > This->cinfo.output_width || -- prc->Y+prc->Height > This->cinfo.output_height) -- return E_INVALIDARG; -- } -- -- if (This->cinfo.out_color_space == JCS_GRAYSCALE) bpp = 8; -- else if (This->cinfo.out_color_space == JCS_CMYK) bpp = 32; -- else bpp = 24; -- -- stride = (bpp * This->cinfo.output_width + 7) / 8; -- data_size = stride * This->cinfo.output_height; -- -- max_row_needed = prc->Y + prc->Height; -- if (max_row_needed > This->cinfo.output_height) return E_INVALIDARG; -- -- EnterCriticalSection(&This->lock); - -- if (!This->image_data) -- { -- This->image_data = HeapAlloc(GetProcessHeap(), 0, data_size); -- if (!This->image_data) -- { -- LeaveCriticalSection(&This->lock); -- return E_OUTOFMEMORY; -- } -- } -- -- This->cinfo.client_data = jmpbuf; -- -- if (setjmp(jmpbuf)) -- { -- LeaveCriticalSection(&This->lock); -- return E_FAIL; -- } -- -- while (max_row_needed > This->cinfo.output_scanline) -- { -- UINT first_scanline = This->cinfo.output_scanline; -- UINT max_rows; -- JSAMPROW out_rows[4]; -- UINT i; -- JDIMENSION ret; -- -- max_rows = min(This->cinfo.output_height-first_scanline, 4); -- for (i=0; iimage_data + stride * (first_scanline+i); -- -- ret = pjpeg_read_scanlines(&This->cinfo, out_rows, max_rows); -- -- if (ret == 0) -- { -- ERR("read_scanlines failed\n"); -- LeaveCriticalSection(&This->lock); -- return E_FAIL; -- } -- -- if (bpp == 24) -- { -- /* libjpeg gives us RGB data and we want BGR, so byteswap the data */ -- reverse_bgr8(3, This->image_data + stride * first_scanline, -- This->cinfo.output_width, This->cinfo.output_scanline - first_scanline, -- stride); -- } -- -- if (This->cinfo.out_color_space == JCS_CMYK && This->cinfo.saw_Adobe_marker) -- { -- DWORD *pDwordData = (DWORD*) (This->image_data + stride * first_scanline); -- DWORD *pDwordDataEnd = (DWORD*) (This->image_data + This->cinfo.output_scanline * stride); -- -- /* Adobe JPEG's have inverted CMYK data. */ -- while(pDwordData < pDwordDataEnd) -- *pDwordData++ ^= 0xffffffff; -- } -- -- } -- -- LeaveCriticalSection(&This->lock); -+ TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer); - -- return copy_pixels(bpp, This->image_data, -- This->cinfo.output_width, This->cinfo.output_height, stride, -+ return copy_pixels(This->bpp, This->image_data, -+ This->cinfo.output_width, This->cinfo.output_height, This->stride, - prc, cbStride, cbBufferSize, pbBuffer); - } - --- -1.9.1 - diff --git a/patches/windowscodecs-JPEG_Decoder/definition b/patches/windowscodecs-JPEG_Decoder/definition deleted file mode 100644 index b47c5ecf..00000000 --- a/patches/windowscodecs-JPEG_Decoder/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: Implement support for CMYK to BGR conversion in JPEG decoder diff --git a/patches/windowscodecs-TIFF_Support/0017-gdiplus-tests-Add-some-tests-for-loading-TIFF-images.patch b/patches/windowscodecs-TIFF_Support/0017-gdiplus-tests-Add-some-tests-for-loading-TIFF-images.patch index 526e25e7..09bc7b97 100644 --- a/patches/windowscodecs-TIFF_Support/0017-gdiplus-tests-Add-some-tests-for-loading-TIFF-images.patch +++ b/patches/windowscodecs-TIFF_Support/0017-gdiplus-tests-Add-some-tests-for-loading-TIFF-images.patch @@ -1,4 +1,4 @@ -From bee68edfabff94c5392499599c8bc9ab467f7a0d Mon Sep 17 00:00:00 2001 +From 36d71109397421a6f2fefd82cf431b0897ebb389 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 16 Dec 2016 18:10:30 +0800 Subject: [PATCH] gdiplus/tests: Add some tests for loading TIFF images in @@ -9,11 +9,11 @@ Subject: [PATCH] gdiplus/tests: Add some tests for loading TIFF images in 1 file changed, 181 insertions(+) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c -index f5ce0207dc..1c7a1aa141 100644 +index fc5dcbbe..dce61e16 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c -@@ -5482,6 +5482,186 @@ todo_wine - GdipDisposeImage((GpImage *)bitmap); +@@ -5483,6 +5483,186 @@ todo_wine + HeapFree(GetProcessHeap(), 0, data); } +#include "pshpack2.h" @@ -199,7 +199,7 @@ index f5ce0207dc..1c7a1aa141 100644 START_TEST(image) { HMODULE mod = GetModuleHandleA("gdiplus.dll"); -@@ -5506,6 +5686,7 @@ START_TEST(image) +@@ -5507,6 +5687,7 @@ START_TEST(image) pGdipBitmapGetHistogram = (void*)GetProcAddress(mod, "GdipBitmapGetHistogram"); pGdipImageSetAbort = (void*)GetProcAddress(mod, "GdipImageSetAbort"); @@ -208,5 +208,5 @@ index f5ce0207dc..1c7a1aa141 100644 test_png_color_formats(); test_supported_encoders(); -- -2.19.1 +2.20.1 diff --git a/patches/wined3d-Dual_Source_Blending/0003-wined3d-Implement-dual-source-blending.patch b/patches/wined3d-Dual_Source_Blending/0003-wined3d-Implement-dual-source-blending.patch index 37cc30e4..e7c5adfd 100644 --- a/patches/wined3d-Dual_Source_Blending/0003-wined3d-Implement-dual-source-blending.patch +++ b/patches/wined3d-Dual_Source_Blending/0003-wined3d-Implement-dual-source-blending.patch @@ -1,4 +1,4 @@ -From 3b9012921018024ac35f548a8169302fcc5ac437 Mon Sep 17 00:00:00 2001 +From 06902c666a0d67d2d32e584b5b2a6c9e4215f55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 18 Aug 2017 23:51:59 +0200 Subject: [PATCH] wined3d: Implement dual source blending. @@ -14,10 +14,10 @@ Subject: [PATCH] wined3d: Implement dual source blending. 7 files changed, 74 insertions(+), 9 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index 7a27b42..0fc2b7f 100644 +index 435320b7..5bb3aaaf 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c -@@ -28501,7 +28501,7 @@ static void test_dual_blending(void) +@@ -29281,7 +29281,7 @@ static void test_dual_blending(void) ID3D11DeviceContext_ClearRenderTargetView(context, rtv[1], white); ID3D11DeviceContext_Draw(context, 3, 0); @@ -27,10 +27,10 @@ index 7a27b42..0fc2b7f 100644 ID3D11BlendState_Release(blend_state); diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c -index d41c2c3..1ddae6c 100644 +index acfed24b..a1ba405b 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c -@@ -2899,6 +2899,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct +@@ -2910,6 +2910,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct gl_info->limits.buffers = min(MAX_RENDER_TARGET_VIEWS, gl_max); TRACE("Max draw buffers: %u.\n", gl_max); } @@ -43,7 +43,7 @@ index d41c2c3..1ddae6c 100644 if (gl_info->supported[ARB_MULTITEXTURE]) { if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) -@@ -3715,6 +3721,10 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, +@@ -3736,6 +3742,10 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, for (i = 0; i < gl_info->limits.buffers; ++i) d3d_info->valid_rt_mask |= (1u << i); @@ -55,10 +55,10 @@ index d41c2c3..1ddae6c 100644 { /* We do not want to deal with re-creating immutable texture storage diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 8199afa..c59cb8e 100644 +index 393b336c..927729ad 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -3153,10 +3153,19 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const +@@ -3159,10 +3159,19 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const else if (!context->render_offscreen) return context_generate_rt_mask_from_resource(rts[0]->resource); @@ -80,10 +80,10 @@ index 8199afa..c59cb8e 100644 { i = wined3d_bit_scan(&mask); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 32f82d6..b639586 100644 +index 660005f5..470cb0c3 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -3053,6 +3053,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * +@@ -3064,6 +3064,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * break; case WINED3DSPR_COLOROUT: @@ -91,7 +91,7 @@ index 32f82d6..b639586 100644 if (reg->idx[0].offset >= gl_info->limits.buffers) WARN("Write to render target %u, only %d supported.\n", reg->idx[0].offset, gl_info->limits.buffers); -@@ -7949,7 +7950,10 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context +@@ -7972,7 +7973,10 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context { const struct wined3d_shader_signature *output_signature = &shader->output_signature; @@ -103,7 +103,7 @@ index 32f82d6..b639586 100644 if (output_signature->element_count) { for (i = 0; i < output_signature->element_count; ++i) -@@ -7964,7 +7968,12 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context +@@ -7987,7 +7991,12 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context continue; } if (shader_glsl_use_explicit_attrib_location(gl_info)) @@ -117,7 +117,7 @@ index 32f82d6..b639586 100644 shader_addline(buffer, "out %s4 color_out%u;\n", component_type_info[output->component_type].glsl_vector_type, output->semantic_idx); } -@@ -7977,7 +7986,12 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context +@@ -8000,7 +8009,12 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context { i = wined3d_bit_scan(&mask); if (shader_glsl_use_explicit_attrib_location(gl_info)) @@ -132,10 +132,10 @@ index 32f82d6..b639586 100644 } } diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 0968172..4c5f7ab 100644 +index 83a793d5..2db4a3cb 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -4134,6 +4134,8 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 +@@ -4147,6 +4147,8 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 args->rt_alpha_swizzle |= 1u << i; } } @@ -145,7 +145,7 @@ index 0968172..4c5f7ab 100644 static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 2dd6ac2..a2e95a4 100644 +index f049ad9e..68bad2c6 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -533,12 +533,14 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st @@ -188,10 +188,10 @@ index 2dd6ac2..a2e95a4 100644 state->render_states[WINED3D_RS_SRCBLEND], state->render_states[WINED3D_RS_DESTBLEND], rt_format); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6686f98..e7d340c 100644 +index cd49789c..a95b1a42 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -190,6 +190,7 @@ struct wined3d_d3d_info +@@ -196,6 +196,7 @@ struct wined3d_d3d_info struct wined3d_d3d_limits limits; struct wined3d_ffp_attrib_ops ffp_attrib_ops; DWORD valid_rt_mask; @@ -199,7 +199,7 @@ index 6686f98..e7d340c 100644 DWORD wined3d_creation_flags; unsigned int xyzrhw : 1; unsigned int emulated_flatshading : 1; -@@ -1346,7 +1347,8 @@ struct ps_compile_args +@@ -1361,7 +1362,8 @@ struct ps_compile_args DWORD alpha_test_func : 3; DWORD render_offscreen : 1; DWORD rt_alpha_swizzle : 8; /* MAX_RENDER_TARGET_VIEWS, 8 */ @@ -209,9 +209,9 @@ index 6686f98..e7d340c 100644 }; enum fog_src_type -@@ -1910,7 +1912,8 @@ struct wined3d_context +@@ -1923,7 +1925,8 @@ struct wined3d_context DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */ - DWORD clip_distance_mask : 8; /* MAX_CLIP_DISTANCES, 8 */ + DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ DWORD num_untracked_materials : 2; /* Max value 2 */ - DWORD padding : 7; + DWORD last_was_dual_blend : 1; @@ -219,7 +219,7 @@ index 6686f98..e7d340c 100644 DWORD constant_update_mask; DWORD numbered_array_mask; -@@ -2537,6 +2540,7 @@ struct wined3d_fbo_ops +@@ -2552,6 +2555,7 @@ struct wined3d_fbo_ops struct wined3d_gl_limits { UINT buffers; @@ -227,7 +227,7 @@ index 6686f98..e7d340c 100644 UINT lights; UINT textures; UINT texture_coords; -@@ -2931,6 +2935,22 @@ struct wined3d_state +@@ -2954,6 +2958,22 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; }; @@ -251,5 +251,5 @@ index 6686f98..e7d340c 100644 { GLuint tex_1d; -- -1.9.1 +2.20.1 diff --git a/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch b/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch index d3ba4aaa..8fcc410f 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch @@ -1,4 +1,4 @@ -From 9fc5ac66917f68828d1a4fb0dd935be36cc57711 Mon Sep 17 00:00:00 2001 +From f928a3edbf09ab9e758fec84e77216fab4f3b4e4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 26 Aug 2017 00:59:29 +0200 Subject: [PATCH] wined3d: Implement hardware indexed vertex blending with 9 @@ -13,10 +13,10 @@ Subject: [PATCH] wined3d: Implement hardware indexed vertex blending with 9 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index c3864b9dd6..1cdeba9fc5 100644 +index b9e97da3..d78dc449 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c -@@ -20573,7 +20573,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char +@@ -20892,7 +20892,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); if (caps.MaxVertexBlendMatrixIndex < 7 || caps.MaxVertexBlendMatrices < 4) { @@ -26,7 +26,7 @@ index c3864b9dd6..1cdeba9fc5 100644 return; } diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index ad59e97e3f..8828749f5a 100644 +index 660005f5..873e5ff3 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -157,7 +157,7 @@ struct glsl_vs_program @@ -37,8 +37,8 @@ index ad59e97e3f..8828749f5a 100644 + GLint modelview_matrix_location[MAX_VERTEX_INDEX_BLENDS]; GLint projection_matrix_location; GLint normal_matrix_location; - GLint texture_matrix_location[MAX_TEXTURES]; -@@ -1850,7 +1850,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context + GLint texture_matrix_location[WINED3D_MAX_TEXTURES]; +@@ -1855,7 +1855,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context { struct wined3d_matrix mat; @@ -47,7 +47,7 @@ index ad59e97e3f..8828749f5a 100644 { if (prog->vs.modelview_matrix_location[i] == -1) break; -@@ -9110,8 +9110,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -9127,8 +9127,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr { {"vec4", "ffp_attrib_position"}, /* WINED3D_FFP_POSITION */ {"vec4", "ffp_attrib_blendweight"}, /* WINED3D_FFP_BLENDWEIGHT */ @@ -57,7 +57,7 @@ index ad59e97e3f..8828749f5a 100644 {"vec3", "ffp_attrib_normal"}, /* WINED3D_FFP_NORMAL */ {"float", "ffp_attrib_psize"}, /* WINED3D_FFP_PSIZE */ {"vec4", "ffp_attrib_diffuse"}, /* WINED3D_FFP_DIFFUSE */ -@@ -9123,6 +9122,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -9140,6 +9139,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr BOOL legacy_lighting = priv->legacy_lighting; GLuint shader_obj; unsigned int i; @@ -65,7 +65,7 @@ index ad59e97e3f..8828749f5a 100644 string_buffer_clear(buffer); -@@ -9141,7 +9141,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -9158,7 +9158,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr } shader_addline(buffer, "\n"); @@ -73,8 +73,8 @@ index ad59e97e3f..8828749f5a 100644 + shader_addline(buffer, "uniform mat4 ffp_modelview_matrix[%u];\n", MAX_VERTEX_INDEX_BLENDS); shader_addline(buffer, "uniform mat4 ffp_projection_matrix;\n"); shader_addline(buffer, "uniform mat3 ffp_normal_matrix;\n"); - shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", MAX_TEXTURES); -@@ -9233,7 +9233,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr + shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", WINED3D_MAX_TEXTURES); +@@ -9250,7 +9250,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "vec4 ec_pos = vec4(0.0);\n"); for (i = 0; i < settings->vertexblends + 1; ++i) @@ -86,7 +86,7 @@ index ad59e97e3f..8828749f5a 100644 shader_addline(buffer, "gl_Position = ffp_projection_matrix * ec_pos;\n"); if (settings->clipping) -@@ -9257,7 +9260,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -9274,7 +9277,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr else { for (i = 0; i < settings->vertexblends + 1; ++i) @@ -98,7 +98,7 @@ index ad59e97e3f..8828749f5a 100644 } if (settings->normalize) -@@ -10131,7 +10137,7 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info * +@@ -10114,7 +10120,7 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info * vs->pos_fixup_location = GL_EXTCALL(glGetUniformLocation(program_id, "pos_fixup")); vs->base_vertex_id_location = GL_EXTCALL(glGetUniformLocation(program_id, "base_vertex_id")); @@ -107,7 +107,7 @@ index ad59e97e3f..8828749f5a 100644 { string_buffer_sprintf(name, "ffp_modelview_matrix[%u]", i); vs->modelview_matrix_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer)); -@@ -10711,7 +10717,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const +@@ -10694,7 +10700,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW | WINED3D_SHADER_CONST_FFP_PROJ; @@ -116,16 +116,16 @@ index ad59e97e3f..8828749f5a 100644 { if (entry->vs.modelview_matrix_location[i] != -1) { -@@ -11680,7 +11686,7 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info, +@@ -11663,7 +11669,7 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info, caps->ffp_generic_attributes = TRUE; - caps->max_active_lights = MAX_ACTIVE_LIGHTS; + caps->max_active_lights = WINED3D_MAX_ACTIVE_LIGHTS; caps->max_vertex_blend_matrices = MAX_VERTEX_BLENDS; - caps->max_vertex_blend_matrix_index = 0; + caps->max_vertex_blend_matrix_index = MAX_VERTEX_INDEX_BLENDS - 1; caps->vertex_processing_caps = WINED3DVTXPCAPS_TEXGEN | WINED3DVTXPCAPS_MATERIALSOURCE7 | WINED3DVTXPCAPS_VERTEXFOG -@@ -12068,6 +12074,11 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] = +@@ -12051,6 +12057,11 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] = {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(1)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(1)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE }, {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(2)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(2)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE }, {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(3)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(3)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE }, @@ -138,10 +138,10 @@ index ad59e97e3f..8828749f5a 100644 {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_vertex_pipe_texmatrix}, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_vertex_pipe_texmatrix}, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index c6f4dde7e5..e74dea5ef4 100644 +index d77cb1ce..bd70801c 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -6248,6 +6248,9 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, +@@ -6245,6 +6245,9 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, break; } @@ -152,7 +152,7 @@ index c6f4dde7e5..e74dea5ef4 100644 && state->render_states[WINED3D_RS_CLIPPLANEENABLE]; settings->normal = !!(si->use_map & (1u << WINED3D_FFP_NORMAL)); diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c -index 863366b924..980d9acdf6 100644 +index cd8bb5e4..d37f3ce8 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -119,6 +119,15 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e @@ -172,7 +172,7 @@ index 863366b924..980d9acdf6 100644 switch(element->format) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0fea6003de..aa620b0c6a 100644 +index 01c1af6d..e0a07023 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -272,6 +272,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup @@ -183,7 +183,7 @@ index 0fea6003de..aa620b0c6a 100644 #define MAX_RENDER_TARGETS 8 struct min_lookup -@@ -2823,7 +2824,8 @@ struct wined3d_ffp_vs_settings +@@ -2827,7 +2828,8 @@ struct wined3d_ffp_vs_settings DWORD ortho_fog : 1; DWORD flatshading : 1; DWORD swizzle_map : 16; /* MAX_ATTRIBS, 16 */ @@ -191,9 +191,9 @@ index 0fea6003de..aa620b0c6a 100644 + DWORD vb_indices : 1; + DWORD padding : 1; - DWORD texgen[MAX_TEXTURES]; + DWORD texgen[WINED3D_MAX_TEXTURES]; }; -@@ -4507,6 +4509,20 @@ static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *forma +@@ -4569,6 +4571,20 @@ static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *forma return format->id == format->typeless_id && format->id != WINED3DFMT_UNKNOWN; } @@ -215,5 +215,5 @@ index 0fea6003de..aa620b0c6a 100644 { /* Check state->vertex_declaration to allow this to be used before the -- -2.14.1 +2.20.1 diff --git a/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch b/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch index 608ba628..acd66e1f 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch @@ -1,18 +1,18 @@ -From 3a66d16e9d18f441382862124e2f8721dfb5d6a1 Mon Sep 17 00:00:00 2001 +From b3c3b13e6910b831de236987c4ac7f2b03cd2bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 31 Aug 2017 01:00:04 +0200 Subject: wined3d: Fix calculation of normal when vertex blending is enabled. --- dlls/d3d9/tests/visual.c | 2 +- - dlls/wined3d/glsl_shader.c | 76 +++++++++++++++++++++------------------------- + dlls/wined3d/glsl_shader.c | 76 ++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index 388e876cce..c27be6beec 100644 +index 7c3b5de4..4edd6c57 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c -@@ -20693,7 +20693,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char +@@ -21012,7 +21012,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char while (point->x != -1 && point->y != -1) { color = getPixelColor(device, point->x, point->y); @@ -22,7 +22,7 @@ index 388e876cce..c27be6beec 100644 } diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 8828749f5a..c916ecff19 100644 +index 873e5ff3..5e3732a0 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -158,8 +158,8 @@ struct glsl_vs_program @@ -32,10 +32,10 @@ index 8828749f5a..c916ecff19 100644 + GLint normal_matrix_location[MAX_VERTEX_INDEX_BLENDS]; GLint projection_matrix_location; - GLint normal_matrix_location; - GLint texture_matrix_location[MAX_TEXTURES]; + GLint texture_matrix_location[WINED3D_MAX_TEXTURES]; GLint material_ambient_location; GLint material_diffuse_location; -@@ -1548,33 +1548,6 @@ static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_ma +@@ -1553,33 +1553,6 @@ static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_ma *out = temp; } @@ -69,7 +69,7 @@ index 8828749f5a..c916ecff19 100644 static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog) { -@@ -1772,6 +1745,23 @@ static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps +@@ -1777,6 +1750,23 @@ static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps GL_EXTCALL(glUniform4fv(ps->color_key_location, 2, &float_key[0].r)); } @@ -93,7 +93,7 @@ index 8828749f5a..c916ecff19 100644 /* Context activation is done by the caller (state handler). */ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state) -@@ -1784,6 +1774,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context +@@ -1789,6 +1779,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context float position_fixup[4 * WINED3D_MAX_VIEWPORTS]; struct shader_glsl_priv *priv = shader_priv; unsigned int constant_version; @@ -101,7 +101,7 @@ index 8828749f5a..c916ecff19 100644 DWORD update_mask; int i; -@@ -1843,7 +1834,9 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context +@@ -1848,7 +1839,9 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location[0], 1, FALSE, &mat._11)); checkGLcall("glUniformMatrix4fv"); @@ -112,7 +112,7 @@ index 8828749f5a..c916ecff19 100644 } if (update_mask & WINED3D_SHADER_CONST_FFP_VERTEXBLEND) -@@ -1858,6 +1851,10 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context +@@ -1863,6 +1856,10 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context get_modelview_matrix(context, state, i, &mat); GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location[i], 1, FALSE, &mat._11)); checkGLcall("glUniformMatrix4fv"); @@ -123,17 +123,17 @@ index 8828749f5a..c916ecff19 100644 } } -@@ -9142,8 +9139,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -9159,8 +9156,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "\n"); shader_addline(buffer, "uniform mat4 ffp_modelview_matrix[%u];\n", MAX_VERTEX_INDEX_BLENDS); + shader_addline(buffer, "uniform mat3 ffp_normal_matrix[%u];\n", MAX_VERTEX_INDEX_BLENDS); shader_addline(buffer, "uniform mat4 ffp_projection_matrix;\n"); - shader_addline(buffer, "uniform mat3 ffp_normal_matrix;\n"); - shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", WINED3D_MAX_TEXTURES); shader_addline(buffer, "uniform struct\n{\n"); -@@ -9253,17 +9250,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -9270,17 +9267,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "vec3 normal = vec3(0.0);\n"); if (settings->normal) { @@ -154,7 +154,7 @@ index 8828749f5a..c916ecff19 100644 } if (settings->normalize) -@@ -10142,8 +10132,12 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info * +@@ -10125,8 +10115,12 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info * string_buffer_sprintf(name, "ffp_modelview_matrix[%u]", i); vs->modelview_matrix_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer)); } @@ -165,9 +165,9 @@ index 8828749f5a..c916ecff19 100644 + } vs->projection_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_projection_matrix")); - vs->normal_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_normal_matrix")); - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { string_buffer_sprintf(name, "ffp_texture_matrix[%u]", i); -- -2.14.1 +2.20.1 diff --git a/patches/wined3d-Indexed_Vertex_Blending/0006-wined3d-Implement-software-processing-for-indexed-ve.patch b/patches/wined3d-Indexed_Vertex_Blending/0006-wined3d-Implement-software-processing-for-indexed-ve.patch index f7db2fe4..7c7f75e2 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0006-wined3d-Implement-software-processing-for-indexed-ve.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0006-wined3d-Implement-software-processing-for-indexed-ve.patch @@ -1,21 +1,21 @@ -From 5221861c923787581dc67b8dd4d0901e0536d304 Mon Sep 17 00:00:00 2001 +From 5e7d9e0d6a83ef9d175e2953a39f299a4b91975a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 31 Aug 2017 01:26:38 +0200 Subject: wined3d: Implement software processing for indexed vertex blending. --- - dlls/wined3d/context.c | 107 +++++++++++++++++++++++++++++++++++++++-- - dlls/wined3d/device.c | 16 ------ - dlls/wined3d/glsl_shader.c | 32 ++++++++---- + dlls/wined3d/context.c | 107 ++++++++++++++++++++++++++++++++- + dlls/wined3d/device.c | 16 ----- + dlls/wined3d/glsl_shader.c | 32 +++++++--- dlls/wined3d/utils.c | 7 ++- - dlls/wined3d/wined3d_private.h | 16 +++++- + dlls/wined3d/wined3d_private.h | 16 ++++- 5 files changed, 148 insertions(+), 30 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 15981ea..c54982a 100644 +index cf250162..272792fb 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -4476,6 +4476,101 @@ static void draw_primitive_arrays(struct wined3d_context *context, const struct +@@ -4508,6 +4508,101 @@ static void draw_primitive_arrays(struct wined3d_context *context, const struct } } @@ -117,7 +117,7 @@ index 15981ea..c54982a 100644 static unsigned int get_stride_idx(const void *idx_data, unsigned int idx_size, unsigned int base_vertex_idx, unsigned int start_idx, unsigned int vertex_idx) { -@@ -4504,6 +4599,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const +@@ -4536,6 +4631,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const BOOL specular_fog = FALSE; BOOL ps = use_ps(state); const void *ptr; @@ -125,7 +125,7 @@ index 15981ea..c54982a 100644 static unsigned int once; -@@ -4540,7 +4636,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const +@@ -4572,7 +4668,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const if (!(use_map & 1u << element_idx)) continue; @@ -134,7 +134,7 @@ index 15981ea..c54982a 100644 ops->generic[si->elements[element_idx].format->emit_idx](element_idx, ptr); } } -@@ -4652,7 +4748,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const +@@ -4684,7 +4780,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const if (normal) { @@ -143,7 +143,7 @@ index 15981ea..c54982a 100644 ops->normal[si->elements[WINED3D_FFP_NORMAL].format->emit_idx](ptr); } -@@ -4697,7 +4793,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const +@@ -4729,7 +4825,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const if (position) { @@ -152,7 +152,7 @@ index 15981ea..c54982a 100644 ops->position[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptr); } } -@@ -4919,6 +5015,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s +@@ -4958,6 +5054,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s WARN_(d3d_perf)("Using software emulation because manual fog coordinates are provided.\n"); emulation = TRUE; } @@ -165,10 +165,10 @@ index 15981ea..c54982a 100644 if (emulation) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 7e14b88..717a7d3 100644 +index 0d936bcb..dcae682a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3914,31 +3914,15 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -4027,31 +4027,15 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software) { @@ -201,10 +201,10 @@ index 7e14b88..717a7d3 100644 } diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index d53ad70..3cfa901 100644 +index 244b5eb3..8dec8114 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -8583,14 +8583,21 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -8955,14 +8955,21 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr } else { @@ -232,7 +232,7 @@ index d53ad70..3cfa901 100644 } shader_addline(buffer, "gl_Position = ffp_projection_matrix * ec_pos;\n"); -@@ -8608,10 +8615,17 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr +@@ -8980,10 +8987,17 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "vec3 normal = vec3(0.0);\n"); if (settings->normal) { @@ -254,10 +254,10 @@ index d53ad70..3cfa901 100644 if (settings->normalize) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 8a07b3e..870f261 100644 +index cb9efef0..a699cf5b 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -6245,7 +6245,12 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, +@@ -6533,7 +6533,12 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, } if (use_indexed_vertex_blending(state, si)) @@ -272,19 +272,19 @@ index 8a07b3e..870f261 100644 settings->clipping = state->render_states[WINED3D_RS_CLIPPING] && state->render_states[WINED3D_RS_CLIPPLANEENABLE]; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 92a5ef1..3d08572 100644 +index d84ed0d4..492b9190 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2743,7 +2743,7 @@ struct wined3d_ffp_vs_settings +@@ -2829,7 +2829,7 @@ struct wined3d_ffp_vs_settings DWORD flatshading : 1; DWORD swizzle_map : 16; /* MAX_ATTRIBS, 16 */ DWORD vb_indices : 1; - DWORD padding : 1; + DWORD sw_blending : 1; - DWORD texgen[MAX_TEXTURES]; + DWORD texgen[WINED3D_MAX_TEXTURES]; }; -@@ -4345,6 +4345,20 @@ static inline BOOL use_indexed_vertex_blending(const struct wined3d_state *state +@@ -4588,6 +4588,20 @@ static inline BOOL use_indexed_vertex_blending(const struct wined3d_state *state return TRUE; } @@ -306,5 +306,5 @@ index 92a5ef1..3d08572 100644 { /* Check state->vertex_declaration to allow this to be used before the -- -2.7.4 +2.20.1