From e479cad86f1f7de5d2a0a0d1398e7733c0aaef3e Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Mon, 8 Jul 2024 17:43:50 -0500 Subject: [PATCH] Rebase against 6e3dcf6c5877867b98b0d01b85206fba780c39c9. --- ...dd-tests-for-ACL-inheritance-in-Crea.patch | 18 ++--- ...dd-ACL-inheritance-tests-for-creatin.patch | 16 ++-- ...ecessary-wineserver-calls-in-PeekMes.patch | 76 ------------------- staging/upstream-commit | 2 +- 4 files changed, 18 insertions(+), 94 deletions(-) delete mode 100644 patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch diff --git a/patches/server-File_Permissions/0004-advapi32-tests-Add-tests-for-ACL-inheritance-in-Crea.patch b/patches/server-File_Permissions/0004-advapi32-tests-Add-tests-for-ACL-inheritance-in-Crea.patch index fd5eb596..0aff2765 100644 --- a/patches/server-File_Permissions/0004-advapi32-tests-Add-tests-for-ACL-inheritance-in-Crea.patch +++ b/patches/server-File_Permissions/0004-advapi32-tests-Add-tests-for-ACL-inheritance-in-Crea.patch @@ -1,7 +1,7 @@ -From f4aabbf2f835d78815017e2ea2cbeb9a22dc9d88 Mon Sep 17 00:00:00 2001 +From ef6629a87b28873892be0eae5796309e93317853 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 3 Apr 2015 03:58:59 +0200 -Subject: [PATCH 1/2] advapi32/tests: Add tests for ACL inheritance in +Subject: [PATCH] advapi32/tests: Add tests for ACL inheritance in CreateDirectoryA. --- @@ -9,10 +9,10 @@ Subject: [PATCH 1/2] advapi32/tests: Add tests for ACL inheritance in 1 file changed, 70 insertions(+) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index e2823fea63a..8188a358052 100644 +index 0917b144648..b6b0678d6f5 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3874,6 +3874,76 @@ static void test_CreateDirectoryA(void) +@@ -3758,6 +3758,76 @@ static void test_CreateDirectoryA(void) } CloseHandle(hTemp); @@ -22,7 +22,7 @@ index e2823fea63a..8188a358052 100644 + bret = CreateDirectoryA(tmpfile, NULL); + ok(bret == TRUE, "CreateDirectoryA failed with error %lx\n", GetLastError()); + -+ error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, ++ error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); @@ -52,7 +52,7 @@ index e2823fea63a..8188a358052 100644 + ok(bret == TRUE, "CreateDirectoryA failed with error %lx\n", GetLastError()); + HeapFree(GetProcessHeap(), 0, pDacl); + -+ error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, ++ error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %d\n", error); @@ -74,11 +74,11 @@ index e2823fea63a..8188a358052 100644 + pDacl = HeapAlloc(GetProcessHeap(), 0, 100); + bret = InitializeAcl(pDacl, 100, ACL_REVISION); + ok(bret, "Failed to initialize ACL.\n"); -+ bret = pAddAccessAllowedAceEx(pDacl, ACL_REVISION, 0, GENERIC_ALL, user_sid); ++ bret = AddAccessAllowedAceEx(pDacl, ACL_REVISION, 0, GENERIC_ALL, user_sid); + ok(bret, "Failed to add Current User to ACL.\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor.\n"); -+ error = pSetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, ++ error = SetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, + NULL, pDacl, NULL); + ok(error == ERROR_SUCCESS, "SetNamedSecurityInfoA failed with error %ld\n", error); + HeapFree(GetProcessHeap(), 0, pDacl); @@ -90,5 +90,5 @@ index e2823fea63a..8188a358052 100644 free(user); bret = RemoveDirectoryA(tmpdir); -- -2.43.0 +2.45.2 diff --git a/patches/server-File_Permissions/0005-advapi32-tests-Add-ACL-inheritance-tests-for-creatin.patch b/patches/server-File_Permissions/0005-advapi32-tests-Add-ACL-inheritance-tests-for-creatin.patch index 62e40c24..62dbef1d 100644 --- a/patches/server-File_Permissions/0005-advapi32-tests-Add-ACL-inheritance-tests-for-creatin.patch +++ b/patches/server-File_Permissions/0005-advapi32-tests-Add-ACL-inheritance-tests-for-creatin.patch @@ -1,4 +1,4 @@ -From 303af824dcdd63c1afe27aa8690d4f3a5d962189 Mon Sep 17 00:00:00 2001 +From 5160a85f6e42c289334e25ffae56900a0ff45259 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 3 Apr 2015 03:59:05 +0200 Subject: [PATCH] advapi32/tests: Add ACL inheritance tests for creating @@ -9,10 +9,10 @@ Subject: [PATCH] advapi32/tests: Add ACL inheritance tests for creating 1 file changed, 76 insertions(+) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 1726236f424..641fb79e634 100644 +index b6b0678d6f5..5cf21bc79ba 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3936,6 +3936,82 @@ static void test_CreateDirectoryA(void) +@@ -3828,6 +3828,82 @@ static void test_CreateDirectoryA(void) bret = RemoveDirectoryA(tmpfile); ok(bret == TRUE, "RemoveDirectoryA failed with error %lx\n", GetLastError()); @@ -28,12 +28,12 @@ index 1726236f424..641fb79e634 100644 + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + -+ status = pNtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, ++ status = NtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE, NULL, 0); + ok(!status, "NtCreateFile failed with %08lx\n", status); + RtlFreeUnicodeString(&tmpfileW); + -+ error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, ++ error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); @@ -63,7 +63,7 @@ index 1726236f424..641fb79e634 100644 + attr.SecurityDescriptor = pSD; + attr.SecurityQualityOfService = NULL; + -+ status = pNtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, ++ status = NtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE, NULL, 0); + ok(!status, "NtCreateFile failed with %08lx\n", status); + RtlFreeUnicodeString(&tmpfileW); @@ -80,7 +80,7 @@ index 1726236f424..641fb79e634 100644 + acl_size.AceCount); + LocalFree(pSD); + -+ error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, ++ error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); @@ -96,5 +96,5 @@ index 1726236f424..641fb79e634 100644 free(user); bret = RemoveDirectoryA(tmpdir); -- -2.43.0 +2.45.2 diff --git a/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch b/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch deleted file mode 100644 index 18cafe2a..00000000 --- a/patches/server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch +++ /dev/null @@ -1,76 +0,0 @@ -From a18943341e17fef24e9b7f8dd85458a2e33bedab Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Thu, 19 Mar 2015 02:07:24 +0100 -Subject: [PATCH] user32: Avoid unnecessary wineserver calls in - PeekMessage/GetMessage. - ---- - dlls/user32/message.c | 14 ++++++++++++++ - dlls/user32/user_private.h | 5 +++++ - 2 files changed, 19 insertions(+) - -diff --git a/dlls/user32/message.c b/dlls/user32/message.c -index cbe9920384f..cdb8f4047a1 100644 ---- a/dlls/user32/message.c -+++ b/dlls/user32/message.c -@@ -2756,6 +2756,18 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, - unsigned int hw_id = 0; /* id of previous hardware message */ - void *buffer; - size_t buffer_size = 256; -+ shmlocal_t *shm = wine_get_shmlocal(); -+ -+ /* From time to time we are forced to do a wineserver call in -+ * order to update last_msg_time stored for each server thread. */ -+ if (shm && GetTickCount() - thread_info->last_get_msg < 500) -+ { -+ int filter = flags >> 16; -+ if (!filter) filter = QS_ALLINPUT; -+ filter |= QS_SENDMESSAGE; -+ if (filter & QS_INPUT) filter |= QS_INPUT; -+ if (!(shm->queue_bits & filter)) return FALSE; -+ } - - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, buffer_size ))) return -1; - -@@ -2770,6 +2782,8 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, - - thread_info->msg_source = prev_source; - -+ if (shm) thread_info->last_get_msg = GetTickCount(); -+ - SERVER_START_REQ( get_message ) - { - req->flags = flags; -diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h -index c11aae707c9..74f56925211 100644 ---- a/dlls/user32/user_private.h -+++ b/dlls/user32/user_private.h -@@ -169,6 +169,8 @@ struct wm_char_mapping_data - MSG get_msg; - }; - -+#include -+ - /* this is the structure stored in TEB->Win32ClientInfo */ - /* no attempt is made to keep the layout compatible with the Windows one */ - struct user_thread_info -@@ -189,6 +191,7 @@ struct user_thread_info - DWORD GetMessageTimeVal; /* Value for GetMessageTime */ - DWORD GetMessagePosVal; /* Value for GetMessagePos */ - ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ -+ DWORD last_get_msg; /* Last time of Get/PeekMessage call */ - struct user_key_state_info *key_state; /* Cache of global key state */ - HWND top_window; /* Desktop window */ - HWND msg_window; /* HWND_MESSAGE parent window */ -@@ -197,6 +200,8 @@ struct user_thread_info - - C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); - -+#include -+ - extern INT global_key_state_counter DECLSPEC_HIDDEN; - extern BOOL (WINAPI *imm_register_window)(HWND) DECLSPEC_HIDDEN; - extern void (WINAPI *imm_unregister_window)(HWND) DECLSPEC_HIDDEN; --- -2.17.1 - diff --git a/staging/upstream-commit b/staging/upstream-commit index c15d84cb..7cdeb3e0 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -6f2466ea0c20245955d0d2b13b5162a1fe62815b +6e3dcf6c5877867b98b0d01b85206fba780c39c9