Compare commits

..

57 Commits
v9.12 ... v9.16

Author SHA1 Message Date
Alistair Leslie-Hughes
6c5cb54635 Release v9.16 2024-08-24 13:19:31 +10:00
Alistair Leslie-Hughes
03b53697da Updated dinput-scancode patchset 2024-08-24 12:46:03 +10:00
Elizabeth Figura
c901884ac0 ntdll-WRITECOPY: Remove patch 0010.
This is a hack specifically meant for upstream Wine; it was never meant to apply to Wine-Staging.

This very patch set is supposed to be a more complete and holistic hack/implementation of the same logic.

This hack only works for CEF, and breaks the existing tests that are fixed by the rest of ntdll-WRITECOPY.
2024-08-22 19:20:23 -05:00
Elizabeth Figura
5fad8dd101 Rebase against 6a7bfbab10d653f6724e2917e0552515520e4fb3. 2024-08-22 19:07:19 -05:00
Elizabeth Figura
ae46f56f2c ntdll-WRITECOPY: Install existing signal handlers earlier instead of using a special early signal handler. 2024-08-22 18:49:16 -05:00
Alistair Leslie-Hughes
5eeb4b76d6 Updated vkd3d-latest patchset 2024-08-21 08:05:40 +10:00
Alistair Leslie-Hughes
b9a08f8300 Rebase against 6e15604c48acd63dd8095a4ce2fd011cb3be96db. 2024-08-21 07:52:15 +10:00
Alistair Leslie-Hughes
41367bc540 Updated vkd3d-latest patchset 2024-08-20 07:49:47 +10:00
Alistair Leslie-Hughes
e780e2e62d Rebase against ba66d9c71519176bd499eb846ed11fb0ea421118. 2024-08-20 07:43:11 +10:00
Alistair Leslie-Hughes
a90554bb04 Rebase against 16a6b0ad65e9b8cdbb68fc9125951483781ca616. 2024-08-16 08:26:55 +10:00
Alistair Leslie-Hughes
7104b9b6ba Rebase against 75f8de6bd41c945abe230e8fd1d8645f30b7667f. 2024-08-15 08:35:27 +10:00
Alistair Leslie-Hughes
51d8ac0717 Rebase against eef229cc1eb77c3236ab4e210a6a276b65173e39.
Fixes regression with latest odbc32.
2024-08-14 07:58:19 +10:00
Alistair Leslie-Hughes
4af1f11315 Rebase against d98f067294918aa5cfeadb576652dd8fd1757c38. 2024-08-13 11:58:33 +10:00
Elizabeth Figura
cd2cce28cc eventfd_synchronization: Fix compile warnings.
Why, GCC, did you think this was a good idea?
2024-08-12 16:55:29 -05:00
Elizabeth Figura
761b7f72d0 dinput-regression-fix: Remove patch.
This is not the correct fix for the regression, and the regression is not in fact a regression.
2024-08-12 16:50:26 -05:00
Alistair Leslie-Hughes
92374493ee Release v9.15 2024-08-11 15:10:36 +10:00
Alistair Leslie-Hughes
a713da9181 Added add printdlg-properties_btn patchset 2024-08-11 15:03:10 +10:00
Alistair Leslie-Hughes
75f3eede59 Added dinput-regression-fix patchset 2024-08-11 15:00:14 +10:00
Alistair Leslie-Hughes
a7f29f1236 Rebase against 9c69ccf8ef2995548ef5fee9d0b68f68dec5dd62.
Added two patches to fix upstream regression with ODBC32.
2024-08-10 14:50:18 +10:00
Alistair Leslie-Hughes
1143543d4a Updated vkd3d-latest patchset 2024-08-09 07:54:11 +10:00
Alistair Leslie-Hughes
4cfe8f056a Rebase against 7df297968a932437c5ac50c67376f05265179cca. 2024-08-09 07:53:43 +10:00
Alistair Leslie-Hughes
c23ee1bf3b Updated winemapi-user-xdg-mail patchset
Corrected TRACE message.
2024-08-08 06:17:31 +10:00
Alistair Leslie-Hughes
d2636c432f Rebase against a891fcf66751921cf81db294b09a696c6b6999b8. 2024-08-07 16:02:00 +10:00
Alistair Leslie-Hughes
7624463e7c Updated eventfd_synchronization patchset
Move #define _GNU_SOURCE to after the config.h
2024-08-01 07:03:21 +10:00
Alistair Leslie-Hughes
06d80381a4 Rebase against 1dfac2a252d0036c3bae08bf47f00582343a80fb. 2024-07-31 11:38:10 +10:00
Alistair Leslie-Hughes
a59a98678f Release v9.14 2024-07-29 07:45:51 +10:00
Alistair Leslie-Hughes
db14a7bed3 Remove odbc-remove-unixodbc patchset
odbc32-fixes has all the changes required to make ODBC v2 drivers work.
2024-07-29 07:43:13 +10:00
Alistair Leslie-Hughes
6883402dec Update wine URL 2024-07-27 11:51:06 +10:00
Alistair Leslie-Hughes
b98458cadc Updated ntdll-WRITECOPY patchset
Check return value pointer.
2024-07-27 08:00:00 +10:00
Alistair Leslie-Hughes
37551c99a2 Updated workflow wine respository 2024-07-26 09:43:55 +10:00
Alistair Leslie-Hughes
bdc041f704 Updated vkd3d-latest patchset 2024-07-26 09:41:57 +10:00
Alistair Leslie-Hughes
d4f4b330b8 Rebase against 0c1c8c295b14626c2cb3c2fac65e1f29b1ea874e. 2024-07-25 11:33:20 +10:00
Alistair Leslie-Hughes
9b107c62cb Updated odbc32-fixes patchset
Fix some bad logic
2024-07-21 09:57:39 +10:00
Alistair Leslie-Hughes
9eb00790f0 Updated odbc32-fixes patchset 2024-07-20 13:18:39 +10:00
Alistair Leslie-Hughes
82ccf59f15 Rebase against 8d259957a2470190e109b1175cf61f4d95427fce. 2024-07-20 12:43:58 +10:00
Alistair Leslie-Hughes
2c482721e3 Updated odbc32-fixes patchset
Small correction to version.
2024-07-19 07:42:36 +10:00
Alistair Leslie-Hughes
215e6efd27 Updated odbc32-fixes patchset
Reordered the Alloc/Free handle patches together.

Fixed an issue with the Driver patchset (Thanks Daniel Lehman)
2024-07-18 16:30:12 +10:00
Alistair Leslie-Hughes
05d08d31c0 Updated vkd3d-latest patchset 2024-07-18 10:07:39 +10:00
Alistair Leslie-Hughes
73441d6d9b Updated odbc32-fixes patchset
More updates to support ODBC 2.0.
2024-07-18 10:00:20 +10:00
Alistair Leslie-Hughes
39ad9d8625 Rebase against ca938c795c0c7a2fa11384414809d9a328e3e96f. 2024-07-18 09:59:41 +10:00
Alistair Leslie-Hughes
fe62b910f5 Rebase against 88a28aa5757ae74d9997b470d70216f10974247f. 2024-07-17 08:25:49 +10:00
Alistair Leslie-Hughes
1d529ee294 Updated odbc32-fixes patchset
Fixes when writing based of the column handle.  Just check if we have been set
seem enough for now.
2024-07-16 10:11:19 +10:00
Alistair Leslie-Hughes
67a860f344 Rebase against 8070ed27bc4bb8c9c43c20734d340b62b379fcfc. 2024-07-16 09:23:21 +10:00
Alistair Leslie-Hughes
6bab3a7617 Updated odbc32-fixes patchset
Update patch to match latest MR patch

Enable the patchset.
2024-07-16 08:58:13 +10:00
Alistair Leslie-Hughes
3c0f797ca6 Added dxgi_getFrameStatistics patchset 2024-07-15 10:06:14 +10:00
Alistair Leslie-Hughes
577974c563 Updated vkd3d-latest patchset
Squash to previous wine-staging release.
2024-07-15 10:04:37 +10:00
Alistair Leslie-Hughes
a442564f05 Release v9.13 2024-07-15 07:43:36 +10:00
Alistair Leslie-Hughes
ad13b6a9e1 Added odbc32-fixes patchset
This fixes issue with the current odcb32 for writing to database
and support for ODBC v2.0.

This is a replacement for odbc-remove-unixodbc as ODBC32 now supports both unixODBC and native drivers.
2024-07-15 07:21:29 +10:00
Alistair Leslie-Hughes
12fb6d73ff Updated vkd3d-latest patchset 2024-07-11 09:54:47 +10:00
Alistair Leslie-Hughes
1f498520be Rebase against c1d5cae54b80449308dd8f9aaa85a1a6a5bd2025. 2024-07-11 08:13:42 +10:00
Alistair Leslie-Hughes
d2c868d8c9 Rebase against 8179609faddee580621529f8b1fffba9a50fb650. 2024-07-10 11:24:56 +10:00
Alistair Leslie-Hughes
f58c6016bd Updated vkd3d-latest patchset 2024-07-09 09:33:03 +10:00
Elizabeth Figura
e479cad86f Rebase against 6e3dcf6c5877867b98b0d01b85206fba780c39c9. 2024-07-08 17:43:50 -05:00
Alistair Leslie-Hughes
4f00617d21 Rebase against 6f2466ea0c20245955d0d2b13b5162a1fe62815b. 2024-07-06 09:31:16 +10:00
Elizabeth Figura
0e802db66f Rebase against 797df8df394d81a165328f9ac6b4039253a78718. 2024-07-04 18:08:56 -05:00
Alistair Leslie-Hughes
0d4b9f2f62 Rebase against 17f052c36a414a05fcb6a6e67bd3aac824fbed3e. 2024-07-02 11:15:09 +10:00
Alistair Leslie-Hughes
d1f022f686 Updated gdi32-rotation patchset
Fixed compile error, passing incompatible types.
2024-07-02 08:03:33 +10:00
123 changed files with 20602 additions and 17940 deletions

View File

@@ -36,7 +36,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/wine
cd wine
git init
git fetch git://source.winehq.org/git/wine.git $($GITHUB_WORKSPACE/staging/patchinstall.py --upstream-commit) --depth=1
git fetch https://gitlab.winehq.org/wine/wine.git $($GITHUB_WORKSPACE/staging/patchinstall.py --upstream-commit) --depth=1
git checkout $($GITHUB_WORKSPACE/staging/patchinstall.py --upstream-commit)
- name: Run patchinstall.py --all

View File

@@ -1,4 +1,4 @@
From f48fa2ff628c3262245593301a141dee31118fd4 Mon Sep 17 00:00:00 2001
From 6a4be6a3089d37ff825853d2644d826d80d59e4f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:44:31 +0200
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
@@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
1 file changed, 15 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 021f7941969..68cb4b25d85 100644
index bad1492e138..6f80e7b3a28 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -42,6 +42,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -43,6 +43,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
WINE_DECLARE_DEBUG_CHANNEL(snoop);
WINE_DECLARE_DEBUG_CHANNEL(loaddll);
WINE_DECLARE_DEBUG_CHANNEL(imports);
@@ -20,7 +20,7 @@ index 021f7941969..68cb4b25d85 100644
#ifdef _WIN64
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
@@ -3822,6 +3823,7 @@ void WINAPI LdrShutdownProcess(void)
@@ -3823,6 +3824,7 @@ void WINAPI LdrShutdownProcess(void)
process_detach();
}
@@ -28,7 +28,7 @@ index 021f7941969..68cb4b25d85 100644
/******************************************************************
* RtlExitUserProcess (NTDLL.@)
@@ -4244,6 +4246,9 @@ static void release_address_space(void)
@@ -4317,6 +4319,9 @@ static void release_address_space(void)
*/
void loader_init( CONTEXT *context, void **entry )
{
@@ -38,9 +38,9 @@ index 021f7941969..68cb4b25d85 100644
static int attach_done;
NTSTATUS status;
ULONG_PTR cookie, port = 0;
@@ -4317,6 +4322,16 @@ void loader_init( CONTEXT *context, void **entry )
if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
#endif
@@ -4397,6 +4402,16 @@ void loader_init( CONTEXT *context, void **entry )
wm = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
}
+ RtlInitUnicodeString( &staging_event_string, L"\\__wine_staging_warn_event" );
+ InitializeObjectAttributes( &staging_event_attr, &staging_event_string, OBJ_OPENIF, NULL, NULL );

View File

@@ -1,4 +1,4 @@
From 1e7b6a812b248a8344076a402fc97bd60da495d1 Mon Sep 17 00:00:00 2001
From 0173ca4b3352506b76801619ae5a05f338d6ff6e Mon Sep 17 00:00:00 2001
From: Jason Edmeades <us@edmeades.me.uk>
Date: Tue, 16 Jul 2019 13:49:18 +1000
Subject: [PATCH] cmd: Support for launching programs based on file association
@@ -15,10 +15,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646
1 file changed, 102 insertions(+), 37 deletions(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 12d3db1b012..0f222f3640b 100644
index ce48b16d7ec..2d20ee299fa 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1494,8 +1494,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1541,8 +1541,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
/* 1. If extension supplied, see if that file exists */
if (extensionsupplied) {
@@ -30,7 +30,7 @@ index 12d3db1b012..0f222f3640b 100644
}
}
@@ -1525,6 +1527,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1572,6 +1574,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
}
if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
@@ -38,17 +38,17 @@ index 12d3db1b012..0f222f3640b 100644
found = TRUE;
thisExt = NULL;
}
@@ -1546,6 +1549,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
/* Special case BAT and CMD */
if (ext && (!wcsicmp(ext, L".bat") || !wcsicmp(ext, L".cmd"))) {
@@ -1595,6 +1598,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
RETURN_CODE return_code;
BOOL oldinteractive = interactive;
+ WINE_TRACE("Calling batch program\n");
interactive = FALSE;
WCMD_batch(thisDir, command, NULL, INVALID_HANDLE_VALUE);
return_code = WCMD_batch(thisDir, command, NULL, INVALID_HANDLE_VALUE);
interactive = oldinteractive;
@@ -1554,48 +1558,109 @@ void WCMD_run_program (WCHAR *command, BOOL called)
context->skip_rest = TRUE;
}
@@ -1605,48 +1609,109 @@ void WCMD_run_program (WCHAR *command, BOOL called)
if (return_code != RETURN_CODE_ABORTED && return_code != RETURN_CODE_OLD_CHAINING)
errorlevel = return_code;
return;
- } else {
- DWORD exit_code;
@@ -193,5 +193,5 @@ index 12d3db1b012..0f222f3640b 100644
}
--
2.43.0
2.45.2

View File

@@ -1,4 +1,4 @@
From bbd077ad0ba63001b1a785c2b3c740b5b01d3469 Mon Sep 17 00:00:00 2001
From 5d1a7ff33160080ad2aca22f689c5b4b446837d8 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 18 Jun 2024 09:14:56 +1000
Subject: [PATCH] cmd: Changed errorlevel type to DWORD
@@ -12,23 +12,23 @@ as an error with clang/mingw in the latest version.
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index f98ac902eba..147f94ac4bb 100644
index 1e92e88d191..9b8cfd389b9 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -440,7 +440,7 @@ void WCMD_choice (const WCHAR * args) {
@@ -442,7 +442,7 @@ RETURN_CODE WCMD_choice (const WCHAR * args)
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
errorlevel = (ptr - opt_c) + 1;
- TRACE("answer: %d\n", errorlevel);
+ TRACE("answer: %ld\n", errorlevel);
free(my_command);
return;
return errorlevel;
}
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
index dde5d1e12ec..f202e6ef9e4 100644
index 6c76070338c..d750aca5572 100644
--- a/programs/cmd/wcmd.h
+++ b/programs/cmd/wcmd.h
@@ -306,7 +306,7 @@ void WCMD_set_for_loop_variable(int var_idx, const WCHAR *value);
@@ -336,7 +336,7 @@ void WCMD_set_for_loop_variable(int var_idx, const WCHAR *value);
* variables and batch parameters substitution already done.
*/
extern WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
@@ -38,7 +38,7 @@ index dde5d1e12ec..f202e6ef9e4 100644
extern FOR_CONTEXT *forloopcontext;
extern BOOL delayedsubst;
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 702c3657a2b..0f8bdd3df14 100644
index 2df0d7c53d3..095be784f2c 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -36,7 +36,7 @@ extern const WCHAR inbuilt[][10];

View File

@@ -1 +1,2 @@
Fixes: [18154] cmd: Support for launching programs based on file association
Disabled: True

View File

@@ -1,4 +1,4 @@
From f6d47bb4eb5747fde7059271a560268080756791 Mon Sep 17 00:00:00 2001
From 96af775034dae1c0b133b315c45b7172090d3498 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 11 Jan 2015 16:29:30 +0100
Subject: [PATCH] d3dx9_36: Improve D3DXSaveTextureToFile to save simple
@@ -6,15 +6,15 @@ Subject: [PATCH] d3dx9_36: Improve D3DXSaveTextureToFile to save simple
---
dlls/d3dx9_36/d3dx9_private.h | 2 ++
dlls/d3dx9_36/surface.c | 62 +++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/surface.c | 63 +++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/texture.c | 5 +--
3 files changed, 65 insertions(+), 4 deletions(-)
3 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
index 001a7f26f4f..b322765d164 100644
index 34a9f6eec7f..878dff3fc01 100644
--- a/dlls/d3dx9_36/d3dx9_private.h
+++ b/dlls/d3dx9_36/d3dx9_private.h
@@ -182,6 +182,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO
@@ -178,6 +178,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO
IDirect3DSurface9 **temp_surface, BOOL write);
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect,
IDirect3DSurface9 *temp_surface, BOOL update);
@@ -24,10 +24,10 @@ index 001a7f26f4f..b322765d164 100644
const PALETTEENTRY *palette, D3DFORMAT format, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom,
uint32_t front, uint32_t back, struct d3dx_pixels *pixels);
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index fb49ca5665a..2a8bd97fe2d 100644
index 31bce97bbab..212d452c654 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -560,6 +560,68 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
@@ -574,6 +574,69 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
return D3D_OK;
}
@@ -93,14 +93,15 @@ index fb49ca5665a..2a8bd97fe2d 100644
+
+ return hr;
+}
HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette,
const D3DBOX *dst_box, const void *src_data, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key,
const D3DXIMAGE_INFO *src_info)
+
HRESULT load_cube_texture_from_dds(IDirect3DCubeTexture9 *cube_texture, const void *src_data,
const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info)
{
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 52cfb1e8c34..ccbe1fcef20 100644
index b42c9db3f2d..d84bac25cfe 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1858,10 +1858,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
@@ -1847,10 +1847,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
if (file_format == D3DXIFF_DDS)
@@ -113,5 +114,5 @@ index 52cfb1e8c34..ccbe1fcef20 100644
type = IDirect3DBaseTexture9_GetType(src_texture);
switch (type)
--
2.43.0
2.45.2

View File

@@ -1 +1,2 @@
Fixes: [26898] Support for DDS file format in D3DXSaveTextureToFileInMemory
Disabled: True

View File

@@ -0,0 +1,175 @@
From 77a518b61884ef4e06f4fe8b94dd5c855c5e8daf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 23 Aug 2024 08:49:13 +0200
Subject: [PATCH] dinput: Factor keyboard initialization and enumeration loops.
---
dlls/dinput/keyboard.c | 129 +++++++++++++++++++++++------------------
1 file changed, 72 insertions(+), 57 deletions(-)
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index 8ec9dd47150..d1fa242574e 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -185,12 +185,79 @@ HRESULT keyboard_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instan
return DI_OK;
}
+static BOOL enum_object( struct keyboard *impl, const DIPROPHEADER *filter, DWORD flags, enum_object_callback callback,
+ UINT index, DIDEVICEOBJECTINSTANCEW *instance, void *data )
+{
+ if (flags != DIDFT_ALL && !(flags & DIDFT_GETTYPE( instance->dwType ))) return DIENUM_CONTINUE;
+
+ switch (filter->dwHow)
+ {
+ case DIPH_DEVICE:
+ return callback( &impl->base, index, NULL, instance, data );
+ case DIPH_BYOFFSET:
+ if (filter->dwObj != instance->dwOfs) return DIENUM_CONTINUE;
+ return callback( &impl->base, index, NULL, instance, data );
+ case DIPH_BYID:
+ if ((filter->dwObj & 0x00ffffff) != (instance->dwType & 0x00ffffff)) return DIENUM_CONTINUE;
+ return callback( &impl->base, index, NULL, instance, data );
+ }
+
+ return DIENUM_CONTINUE;
+}
+
+static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
+ DWORD flags, enum_object_callback callback, void *data )
+{
+ BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
+ DIDEVICEOBJECTINSTANCEW instance =
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Key,
+ .dwOfs = DIK_ESCAPE,
+ .dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
+ };
+ DWORD index, i, dik;
+ BOOL ret;
+
+ for (i = 0, index = 0; i < 512; ++i)
+ {
+ if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
+ if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
+ instance.dwOfs = dik;
+ instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
+ ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
+ if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
+ }
+
+ return DIENUM_CONTINUE;
+}
+
+static BOOL init_object_properties( struct dinput_device *device, UINT index, struct hid_value_caps *caps,
+ const DIDEVICEOBJECTINSTANCEW *instance, void *data )
+{
+ struct object_properties *properties;
+ UINT dik = instance->dwOfs;
+
+ if (index == -1) return DIENUM_STOP;
+ properties = device->object_properties + index;
+
+ if (dik == DIK_NUMLOCK) properties->scan_code = 0x451de1;
+ else if (dik == DIK_PAUSE) properties->scan_code = 0x45;
+ else if (dik < 0x80) properties->scan_code = dik;
+ else properties->scan_code = (dik - 0x80) << 8 | 0x00e0;
+
+ return DIENUM_CONTINUE;
+}
+
HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out )
{
- DIDEVICEOBJECTINSTANCEW instance;
+ static const DIPROPHEADER filter =
+ {
+ .dwSize = sizeof(filter),
+ .dwHeaderSize = sizeof(filter),
+ .dwHow = DIPH_DEVICE,
+ };
struct keyboard *impl;
- DWORD i, index, dik;
- BYTE subtype;
HRESULT hr;
TRACE( "dinput %p, guid %s, out %p.\n", dinput, debugstr_guid( guid ), out );
@@ -207,20 +274,9 @@ HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirect
impl->base.caps.dwFirmwareRevision = 100;
impl->base.caps.dwHardwareRevision = 100;
if (dinput->dwVersion >= 0x0800) impl->base.use_raw_input = TRUE;
- subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
if (FAILED(hr = dinput_device_init_device_format( &impl->base.IDirectInputDevice8W_iface ))) goto failed;
-
- for (i = 0, index = 0; i < 512; ++i)
- {
- if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
- if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
-
- if (dik == DIK_NUMLOCK) impl->base.object_properties[index++].scan_code = 0x451de1;
- else if (dik == DIK_PAUSE) impl->base.object_properties[index++].scan_code = 0x45;
- else if (dik < 0x80) impl->base.object_properties[index++].scan_code = dik;
- else impl->base.object_properties[index++].scan_code = (dik - 0x80) << 8 | 0x00e0;
- }
+ enum_objects( impl, &filter, DIDFT_BUTTON, init_object_properties, NULL );
*out = &impl->base.IDirectInputDevice8W_iface;
return DI_OK;
@@ -248,52 +304,11 @@ static HRESULT keyboard_unacquire( IDirectInputDevice8W *iface )
return DI_OK;
}
-static BOOL try_enum_object( struct dinput_device *impl, const DIPROPHEADER *filter, DWORD flags, enum_object_callback callback,
- UINT index, DIDEVICEOBJECTINSTANCEW *instance, void *data )
-{
- if (flags != DIDFT_ALL && !(flags & DIDFT_GETTYPE( instance->dwType ))) return DIENUM_CONTINUE;
-
- switch (filter->dwHow)
- {
- case DIPH_DEVICE:
- return callback( impl, index, NULL, instance, data );
- case DIPH_BYOFFSET:
- if (filter->dwObj != instance->dwOfs) return DIENUM_CONTINUE;
- return callback( impl, index, NULL, instance, data );
- case DIPH_BYID:
- if ((filter->dwObj & 0x00ffffff) != (instance->dwType & 0x00ffffff)) return DIENUM_CONTINUE;
- return callback( impl, index, NULL, instance, data );
- }
-
- return DIENUM_CONTINUE;
-}
-
static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPHEADER *filter,
DWORD flags, enum_object_callback callback, void *context )
{
struct keyboard *impl = impl_from_IDirectInputDevice8W( iface );
- BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
- DIDEVICEOBJECTINSTANCEW instance =
- {
- .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
- .guidType = GUID_Key,
- .dwOfs = DIK_ESCAPE,
- .dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
- };
- DWORD index, i, dik;
- BOOL ret;
-
- for (i = 0, index = 0; i < 512; ++i)
- {
- if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
- if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
- instance.dwOfs = dik;
- instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
- ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
- if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
- }
-
- return DIENUM_CONTINUE;
+ return enum_objects( impl, filter, flags, callback, context );
}
static HRESULT keyboard_get_property( IDirectInputDevice8W *iface, DWORD property,
--
2.43.0

View File

@@ -1,6 +1,6 @@
From b2764b3d21a64c3c194b29b9cb71379456e03b06 Mon Sep 17 00:00:00 2001
From b9f850d5ba2d36ae39a2e88b31a687e2d9745c6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 7 Jul 2023 12:44:26 +0200
Date: Fri, 23 Aug 2024 08:51:44 +0200
Subject: [PATCH] dinput: Avoid duplicated objects in keyboard devices.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55205
@@ -9,10 +9,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55205
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index cbcbf94f0f6..3fd75bb10e6 100644
index d1fa242574e..d9c73cd7367 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -265,13 +265,15 @@ static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPH
@@ -216,13 +216,15 @@ static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
.dwOfs = DIK_ESCAPE,
.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
};
@@ -28,7 +28,7 @@ index cbcbf94f0f6..3fd75bb10e6 100644
+ mapped[dik] = TRUE;
instance.dwOfs = dik;
instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
--
2.40.1
2.43.0

View File

@@ -1,6 +1,6 @@
From bdf952bf0711a7cf22fee840197234bd413ae611 Mon Sep 17 00:00:00 2001
From c133a17f33a7cce87df6a56c7e265b1553726134 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 7 Jul 2023 12:45:04 +0200
Date: Fri, 23 Aug 2024 08:52:34 +0200
Subject: [PATCH] dinput: Enumerate lower keyboard scancodes values first.
Windows usually doesn't have scancodes higher than 0x7f, or extended
@@ -16,18 +16,18 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55205
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index 3fd75bb10e6..1f1db883b80 100644
index d9c73cd7367..407634967de 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -256,6 +256,7 @@ static BOOL try_enum_object( struct dinput_device *impl, const DIPROPHEADER *fil
static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPHEADER *filter,
DWORD flags, enum_object_callback callback, void *context )
@@ -208,6 +208,7 @@ static BOOL enum_object( struct keyboard *impl, const DIPROPHEADER *filter, DWOR
static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
DWORD flags, enum_object_callback callback, void *data )
{
+ static const UINT vsc_base[] = {0, 0x100, 0x80, 0x180};
struct keyboard *impl = impl_from_IDirectInputDevice8W( iface );
BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
DIDEVICEOBJECTINSTANCEW instance =
@@ -266,18 +267,21 @@ static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPH
{
@@ -217,18 +218,21 @@ static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
};
BOOL ret, mapped[0x100] = {0};
@@ -43,7 +43,7 @@ index 3fd75bb10e6..1f1db883b80 100644
- mapped[dik] = TRUE;
- instance.dwOfs = dik;
- instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
- ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
- ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
- if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
+ for (vsc = vsc_base[i]; vsc < vsc_base[i] + 0x80; vsc++)
+ {
@@ -53,12 +53,12 @@ index 3fd75bb10e6..1f1db883b80 100644
+ mapped[dik] = TRUE;
+ instance.dwOfs = dik;
+ instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
+ ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
+ ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
+ if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
+ }
}
return DIENUM_CONTINUE;
--
2.40.1
2.43.0

View File

@@ -0,0 +1,125 @@
From e31146d5dd91ef05298ae98f7db4868e73011865 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 23 May 2024 14:25:57 +1000
Subject: [PATCH] dxgi: Semi-stub IDXGISwapChain::GetFrameStatistics.
Not completely correct but does allow improved framerates. Mileage will vary.
---
dlls/dxgi/swapchain.c | 89 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 85 insertions(+), 4 deletions(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index 4797fcecd8d..4111a488407 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -587,12 +587,66 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapCh
return dxgi_get_output_from_window(swapchain->factory, window, output);
}
+static int get_display_frequency(void)
+{
+ DEVMODEW mode;
+ BOOL ret;
+
+ memset(&mode, 0, sizeof(mode));
+ mode.dmSize = sizeof(mode);
+ ret = EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &mode, 0);
+ if (ret && mode.dmFields & DM_DISPLAYFREQUENCY && mode.dmDisplayFrequency)
+ {
+ return mode.dmDisplayFrequency;
+ }
+ else
+ {
+ WARN("Failed to query display frequency, returning a fallback value.\n");
+ return 60;
+ }
+}
+
+static LARGE_INTEGER get_perf_req(void)
+{
+ LARGE_INTEGER performance_frequency;
+
+ QueryPerformanceFrequency(&performance_frequency);
+ return performance_frequency;
+}
+
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFrameStatistics(IDXGISwapChain4 *iface,
DXGI_FRAME_STATISTICS *stats)
{
- FIXME("iface %p, stats %p stub!\n", iface, stats);
+ struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
+ HRESULT hr = S_OK;
+ static BOOL once = 0;
+ const LARGE_INTEGER performance_frequency = get_perf_req();
+ int display_frequency = get_display_frequency();
- return E_NOTIMPL;
+ LARGE_INTEGER count;
+ TRACE("iface %p, stats %p Semi-stub\n", iface, stats);
+
+ if (!stats)
+ return E_INVALIDARG;
+
+ QueryPerformanceCounter(&count);
+
+ stats->PresentCount = swapchain->present_count;
+ stats->PresentRefreshCount = 0;
+ stats->SyncRefreshCount = 0;
+ stats->SyncQPCTime.QuadPart = count.QuadPart;
+ stats->SyncGPUTime.QuadPart = 0;
+
+ stats->PresentRefreshCount = performance_frequency.QuadPart / display_frequency;
+ stats->SyncRefreshCount = display_frequency;
+
+ if(!once)
+ {
+ once++;
+ hr = DXGI_ERROR_FRAME_STATISTICS_DISJOINT;
+ }
+
+ return hr;
}
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapChain4 *iface,
@@ -2704,9 +2758,36 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapCh
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapChain4 *iface,
DXGI_FRAME_STATISTICS *stats)
{
- FIXME("iface %p, stats %p stub!\n", iface, stats);
+ struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
+ HRESULT hr = S_OK;
+ static BOOL once = 0;
+ const LARGE_INTEGER performance_frequency = get_perf_req();
+ int display_frequency = get_display_frequency();
- return E_NOTIMPL;
+ LARGE_INTEGER count;
+ TRACE("iface %p, stats %p Semi-stub\n", iface, stats);
+
+ if (!stats)
+ return E_INVALIDARG;
+
+ QueryPerformanceCounter(&count);
+
+ stats->PresentCount = swapchain->frame_number;
+ stats->PresentRefreshCount = 0;
+ stats->SyncRefreshCount = 0;
+ stats->SyncQPCTime.QuadPart = count.QuadPart;
+ stats->SyncGPUTime.QuadPart = 0;
+
+ stats->PresentRefreshCount = performance_frequency.QuadPart / display_frequency;
+ stats->SyncRefreshCount = display_frequency;
+
+ if(!once)
+ {
+ once++;
+ hr = DXGI_ERROR_FRAME_STATISTICS_DISJOINT;
+ }
+
+ return hr;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapChain4 *iface,
--
2.43.0

View File

@@ -0,0 +1 @@
Fixes: [53696] d3d11: Semi-stub IDXGISwapChain::GetFrameStatistics.

View File

@@ -1,28 +1,30 @@
From cdced5d4d89a932fa456191551899e1919a1881e Mon Sep 17 00:00:00 2001
From 4865ed639a87ee06ffcf6a7a74b6c97ef448e7ab Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 12:34:42 -0500
Subject: [PATCH] ntdll: Implement NtWaitForMultipleObjects().
---
dlls/ntdll/unix/esync.c | 170 ++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/unix/esync.c | 172 ++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/unix/esync.h | 3 +
dlls/ntdll/unix/sync.c | 7 ++
3 files changed, 180 insertions(+)
3 files changed, 182 insertions(+)
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
index e031e9cb94f..75ceb95bc66 100644
index e031e9cb94f..85db837f16b 100644
--- a/dlls/ntdll/unix/esync.c
+++ b/dlls/ntdll/unix/esync.c
@@ -22,6 +22,8 @@
#pragma makedep unix
#endif
@@ -24,6 +24,10 @@
+#define _GNU_SOURCE
+
#include "config.h"
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include <assert.h>
@@ -34,6 +36,12 @@
#include <errno.h>
#include <fcntl.h>
@@ -34,6 +38,12 @@
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
@@ -35,7 +37,7 @@ index e031e9cb94f..75ceb95bc66 100644
#include <sys/types.h>
#include <unistd.h>
@@ -286,6 +294,168 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev )
@@ -286,6 +296,168 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev )
return STATUS_SUCCESS;
}
@@ -219,10 +221,10 @@ index c63491dcaad..92b609ebd27 100644
/* We have to synchronize on the fd cache mutex so that our calls to receive_fd
* don't race with theirs. It looks weird, I know.
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
index c85f985b4f3..79141999e33 100644
index dd938c95873..4361813e628 100644
--- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -1479,6 +1479,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO
@@ -1588,6 +1588,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO
if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1;
@@ -237,5 +239,5 @@ index c85f985b4f3..79141999e33 100644
select_op.wait.op = wait_any ? SELECT_WAIT : SELECT_WAIT_ALL;
for (i = 0; i < count; i++) select_op.wait.handles[i] = wine_server_obj_handle( handles[i] );
--
2.42.0
2.43.0

View File

@@ -1,4 +1,4 @@
From f1fcc584ff2bb975656b9f2f111d3e09b36293d0 Mon Sep 17 00:00:00 2001
From 27e2bc1b0d098abce9168ea46589024054817e25 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:01:56 -0500
Subject: [PATCH] server: Create eventfd file descriptors for message queues.
@@ -8,7 +8,7 @@ Subject: [PATCH] server: Create eventfd file descriptors for message queues.
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/server/queue.c b/server/queue.c
index 4d3f43b8d52..74a59b2ee84 100644
index ee575724e4e..60f0c043257 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -44,6 +44,7 @@
@@ -19,7 +19,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
@@ -148,6 +149,7 @@ struct msg_queue
@@ -144,6 +145,7 @@ struct msg_queue
int keystate_lock; /* owns an input keystate lock */
const queue_shm_t *shared; /* queue in session shared memory */
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
@@ -27,7 +27,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
};
struct hotkey
@@ -164,6 +166,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
@@ -160,6 +162,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *entry );
static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry );
static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry );
@@ -35,7 +35,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry );
static void msg_queue_destroy( struct object *obj );
static void msg_queue_poll_event( struct fd *fd, int event );
@@ -179,7 +182,7 @@ static const struct object_ops msg_queue_ops =
@@ -175,7 +178,7 @@ static const struct object_ops msg_queue_ops =
msg_queue_add_queue, /* add_queue */
msg_queue_remove_queue, /* remove_queue */
msg_queue_signaled, /* signaled */
@@ -44,7 +44,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
msg_queue_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -321,6 +324,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -313,6 +316,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
queue->last_get_msg = current_time;
queue->keystate_lock = 0;
queue->ignore_post_msg = 0;
@@ -52,7 +52,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -339,6 +343,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -335,6 +339,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
}
SHARED_WRITE_END;
@@ -62,7 +62,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
thread->queue = queue;
if ((desktop = get_thread_desktop( thread, 0 )))
@@ -672,6 +679,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
@@ -685,6 +692,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
if (queue->keystate_lock) unlock_input_keystate( queue->input );
queue->keystate_lock = 0;
}
@@ -72,7 +72,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
}
/* check if message is matched by the filter */
@@ -1213,6 +1223,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
@@ -1227,6 +1237,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
return ret || is_signaled( queue );
}
@@ -86,7 +86,7 @@ index 4d3f43b8d52..74a59b2ee84 100644
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry )
{
struct msg_queue *queue = (struct msg_queue *)obj;
@@ -1258,6 +1275,7 @@ static void msg_queue_destroy( struct object *obj )
@@ -1278,6 +1295,7 @@ static void msg_queue_destroy( struct object *obj )
if (queue->hooks) release_object( queue->hooks );
if (queue->fd) release_object( queue->fd );
if (queue->shared) free_shared_object( queue->shared );
@@ -94,8 +94,8 @@ index 4d3f43b8d52..74a59b2ee84 100644
}
static void msg_queue_poll_event( struct fd *fd, int event )
@@ -2962,6 +2980,9 @@ DECL_HANDLER(set_queue_mask)
if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0;
@@ -3000,6 +3018,9 @@ DECL_HANDLER(set_queue_mask)
}
else wake_up( &queue->obj, 0 );
}
+
@@ -104,19 +104,19 @@ index 4d3f43b8d52..74a59b2ee84 100644
}
}
@@ -2975,6 +2996,9 @@ DECL_HANDLER(get_queue_status)
reply->wake_bits = queue->wake_bits;
reply->changed_bits = queue->changed_bits;
queue->changed_bits &= ~req->clear_bits;
@@ -3020,6 +3041,9 @@ DECL_HANDLER(get_queue_status)
shared->changed_bits &= ~req->clear_bits;
}
SHARED_WRITE_END;
+
+ if (do_esync() && !is_signaled( queue ))
+ esync_clear( queue->esync_fd );
}
else reply->wake_bits = reply->changed_bits = 0;
}
@@ -3229,6 +3253,10 @@ DECL_HANDLER(get_message)
queue->wake_mask = req->wake_mask;
queue->changed_mask = req->changed_mask;
@@ -3286,6 +3310,10 @@ DECL_HANDLER(get_message)
SHARED_WRITE_END;
set_error( STATUS_PENDING ); /* FIXME */
+
+ if (do_esync() && !is_signaled( queue ))

View File

@@ -1,4 +1,4 @@
From 57703c0423cf2b138b93dfaf4bd993d50235e55a Mon Sep 17 00:00:00 2001
From 7522f4cf4bb29413bce97be5e61ebaefb5276c77 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:11:23 -0500
Subject: [PATCH] server, ntdll: Implement message waits.
@@ -6,8 +6,8 @@ Subject: [PATCH] server, ntdll: Implement message waits.
---
dlls/ntdll/unix/esync.c | 51 +++++++++++++++++++++++++++++++++++++++--
server/protocol.def | 4 ++++
server/queue.c | 22 ++++++++++++++++++
3 files changed, 75 insertions(+), 2 deletions(-)
server/queue.c | 24 +++++++++++++++++++
3 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
index 399930c444b..06d7d8babc6 100644
@@ -105,10 +105,10 @@ index 399930c444b..06d7d8babc6 100644
{
struct stat st;
diff --git a/server/protocol.def b/server/protocol.def
index d4a7173776f..4a081973ca5 100644
index 56f2d263100..46cdbbed9b7 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3964,6 +3964,10 @@ enum esync_type
@@ -3968,6 +3968,10 @@ enum esync_type
unsigned int shm_idx;
@END
@@ -120,10 +120,10 @@ index d4a7173776f..4a081973ca5 100644
@REQ(set_keyboard_repeat)
int enable; /* whether to enable auto-repeat */
diff --git a/server/queue.c b/server/queue.c
index 6183c2fa686..260fb753799 100644
index 60f0c043257..d6b6f2f20aa 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -150,6 +150,7 @@ struct msg_queue
@@ -146,6 +146,7 @@ struct msg_queue
const queue_shm_t *shared; /* queue in session shared memory */
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
int esync_fd; /* esync file descriptor (signalled on message) */
@@ -131,7 +131,7 @@ index 6183c2fa686..260fb753799 100644
};
struct hotkey
@@ -325,6 +326,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -317,6 +318,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
queue->keystate_lock = 0;
queue->ignore_post_msg = 0;
queue->esync_fd = -1;
@@ -139,7 +139,7 @@ index 6183c2fa686..260fb753799 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -1170,6 +1172,10 @@ static int is_queue_hung( struct msg_queue *queue )
@@ -1183,6 +1185,10 @@ static int is_queue_hung( struct msg_queue *queue )
if (get_wait_queue_thread(entry)->queue == queue)
return 0; /* thread is waiting on queue -> not hung */
}
@@ -150,18 +150,20 @@ index 6183c2fa686..260fb753799 100644
return 1;
}
@@ -4025,6 +4031,21 @@ DECL_HANDLER(update_rawinput_devices)
@@ -4079,6 +4085,23 @@ DECL_HANDLER(update_rawinput_devices)
}
}
+DECL_HANDLER(esync_msgwait)
+{
+ struct msg_queue *queue = get_current_queue();
+ const queue_shm_t *queue_shm;
+
+ if (!queue) return;
+ queue_shm = queue->shared;
+ queue->esync_in_msgwait = req->in_msgwait;
+
+ if (current->process->idle_event && !(queue->wake_mask & QS_SMRESULT))
+ if (current->process->idle_event && !(queue_shm->wake_mask & QS_SMRESULT))
+ set_event( current->process->idle_event );
+
+ /* and start/stop waiting on the driver */
@@ -172,7 +174,7 @@ index 6183c2fa686..260fb753799 100644
DECL_HANDLER(set_keyboard_repeat)
{
struct desktop *desktop;
@@ -4043,3 +4064,4 @@ DECL_HANDLER(set_keyboard_repeat)
@@ -4097,3 +4120,4 @@ DECL_HANDLER(set_keyboard_repeat)
release_object( desktop );
}

View File

@@ -0,0 +1,126 @@
From fed04f8ef69b829fa2cf3c7051160a6f822912dd Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Mon, 12 Aug 2024 16:54:44 -0500
Subject: [PATCH] ntdll: Compile warning fixes for esync.
---
dlls/ntdll/unix/esync.c | 26 +++++++++++++-------------
dlls/ntdll/unix/esync.h | 4 ++--
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
index f4748e405ef..86809b610c7 100644
--- a/dlls/ntdll/unix/esync.c
+++ b/dlls/ntdll/unix/esync.c
@@ -73,29 +73,29 @@ int do_esync(void)
struct esync
{
- enum esync_type type;
+ LONG type;
int fd;
void *shm;
};
struct semaphore
{
- int max;
- int count;
+ LONG max;
+ LONG count;
};
C_ASSERT(sizeof(struct semaphore) == 8);
struct mutex
{
- DWORD tid;
- int count; /* recursion count */
+ LONG tid;
+ LONG count; /* recursion count */
};
C_ASSERT(sizeof(struct mutex) == 8);
struct event
{
- int signaled;
- int locked;
+ LONG signaled;
+ LONG locked;
};
C_ASSERT(sizeof(struct event) == 8);
@@ -182,7 +182,7 @@ static struct esync *add_to_list( HANDLE handle, enum esync_type type, int fd, v
}
}
- if (!InterlockedCompareExchange( (int *)&esync_list[entry][idx].type, type, 0 ))
+ if (!InterlockedCompareExchange( &esync_list[entry][idx].type, type, 0 ))
{
esync_list[entry][idx].fd = fd;
esync_list[entry][idx].shm = shm;
@@ -206,7 +206,7 @@ static struct esync *get_cached_object( HANDLE handle )
* message queue, etc.) */
static NTSTATUS get_object( HANDLE handle, struct esync **obj )
{
- NTSTATUS ret = STATUS_SUCCESS;
+ int ret = STATUS_SUCCESS;
enum esync_type type = 0;
unsigned int shm_idx = 0;
obj_handle_t fd_handle;
@@ -274,7 +274,7 @@ NTSTATUS esync_close( HANDLE handle )
if (entry < ESYNC_LIST_ENTRIES && esync_list[entry])
{
- if (InterlockedExchange((int *)&esync_list[entry][idx].type, 0))
+ if (InterlockedExchange(&esync_list[entry][idx].type, 0))
{
close( esync_list[entry][idx].fd );
return STATUS_SUCCESS;
@@ -370,7 +370,7 @@ static NTSTATUS open_esync( enum esync_type type, HANDLE *handle,
}
extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access,
- const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max)
+ const OBJECT_ATTRIBUTES *attr, int initial, int max)
{
TRACE("name %s, initial %d, max %d.\n",
attr ? debugstr_us(attr->ObjectName) : "<no name>", initial, max);
@@ -386,7 +386,7 @@ NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access,
return open_esync( ESYNC_SEMAPHORE, handle, access, attr );
}
-NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev )
+NTSTATUS esync_release_semaphore( HANDLE handle, unsigned int count, ULONG *prev )
{
struct esync *obj;
struct semaphore *semaphore;
@@ -800,7 +800,7 @@ static BOOL update_grabbed_object( struct esync *obj )
/* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we
* need to delegate to server_select(). */
-static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any,
+static NTSTATUS __esync_wait_objects( unsigned int count, const HANDLE *handles, BOOLEAN wait_any,
BOOLEAN alertable, const LARGE_INTEGER *timeout )
{
static const LARGE_INTEGER zero;
diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h
index 59f8809fc1a..9102cf911aa 100644
--- a/dlls/ntdll/unix/esync.h
+++ b/dlls/ntdll/unix/esync.h
@@ -23,11 +23,11 @@ extern void esync_init(void);
extern NTSTATUS esync_close( HANDLE handle );
extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access,
- const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max);
+ const OBJECT_ATTRIBUTES *attr, int initial, int max);
extern NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr );
extern NTSTATUS esync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len );
-extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev );
+extern NTSTATUS esync_release_semaphore( HANDLE handle, unsigned int count, ULONG *prev );
extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial );
--
2.45.2

View File

@@ -1,18 +1,24 @@
From 5dcb80fe0d35101804bb978e507e6db361a949af Mon Sep 17 00:00:00 2001
From fdc9d34400af31765d20ca7b070e53d7eec710e4 Mon Sep 17 00:00:00 2001
From: Daniel Wendt <daniel.wendt@linux.com>
Date: Tue, 10 Dec 2013 14:55:32 +0100
Subject: [PATCH] gdi32: fix for rotated ellipse
Bug: http://bugs.winehq.org/show_bug.cgi?id=35331
---
dlls/win32u/dibdrv/graphics.c | 60 ++++++++++++++++++++++++-----------
1 file changed, 42 insertions(+), 18 deletions(-)
dlls/win32u/dibdrv/graphics.c | 63 ++++++++++++++++++++++++-----------
1 file changed, 44 insertions(+), 19 deletions(-)
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c
index 3a6f8184009..b5231636261 100644
index 21d2eabbc9e..1eeea1d68ea 100644
--- a/dlls/win32u/dibdrv/graphics.c
+++ b/dlls/win32u/dibdrv/graphics.c
@@ -1535,6 +1535,23 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
@@ -1531,10 +1531,28 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
DC *dc = get_physdev_dc( dev );
RECT rect;
POINT pt[2], *points;
- int i, end, count;
+ int i, end;
+ ULONG count;
BOOL ret = TRUE;
HRGN outline = 0, interior = 0;
@@ -36,7 +42,7 @@ index 3a6f8184009..b5231636261 100644
if (!get_pen_device_rect( dc, pdev, &rect, left, top, right, bottom )) return TRUE;
pt[0].x = pt[0].y = 0;
@@ -1555,23 +1572,6 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
@@ -1555,23 +1573,6 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
return FALSE;
}
@@ -60,7 +66,7 @@ index 3a6f8184009..b5231636261 100644
count = ellipse_first_quadrant( ellipse_width, ellipse_height, points );
if (dc->attr->arc_direction == AD_CLOCKWISE)
@@ -1615,13 +1615,37 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
@@ -1615,13 +1616,37 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
}
count = end + 1;
@@ -74,7 +80,7 @@ index 3a6f8184009..b5231636261 100644
+ }
+
+ if (pdev->brush.style != BS_NULL &&
+ !(interior = ULongToHandle(NtGdiPolyPolyDraw( ULongToHandle(ALTERNATE), points, (const UINT *)&count, 1, NtGdiPolyPolygonRgn ))))
+ !(interior = ULongToHandle(NtGdiPolyPolyDraw( ULongToHandle(ALTERNATE), points, &count, 1, NtGdiPolyPolygonRgn ))))
+ {
+ free( points );
+ if (outline) NtGdiDeleteObjectApp( outline );
@@ -100,5 +106,5 @@ index 3a6f8184009..b5231636261 100644
NtGdiDeleteObjectApp( interior );
}
--
2.33.0
2.43.0

View File

@@ -1,7 +1,7 @@
From 48cbd1c62bb0d2945334dfea222a7e19ea149c64 Mon Sep 17 00:00:00 2001
From be1665ad0d88598c409f6a1d699562c2dd0d525a Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 29 May 2019 16:01:45 -0600
Subject: wcmd: Add junction point support to mklink.
Subject: [PATCH] wcmd: Add junction point support to mklink.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@@ -9,7 +9,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index dd3ae5b509b..53734b1e940 100644
index 5b15c0f397a..6d7512275ce 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -31,6 +31,9 @@
@@ -22,8 +22,8 @@ index dd3ae5b509b..53734b1e940 100644
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
@@ -4997,6 +5000,49 @@ void WCMD_color (void) {
}
@@ -4091,6 +4094,49 @@ RETURN_CODE WCMD_color(void)
return errorlevel = return_code;
}
+BOOL WCMD_create_junction(WCHAR *link, WCHAR *target) {
@@ -72,15 +72,15 @@ index dd3ae5b509b..53734b1e940 100644
/****************************************************************************
* WCMD_mklink
*/
@@ -5045,7 +5091,7 @@ void WCMD_mklink(WCHAR *args)
else if(!junction)
ret = CreateSymbolicLinkW(file1, file2, isdir);
else
- WINE_TRACE("Juction links currently not supported.\n");
+ ret = WCMD_create_junction(file1, file2);
@@ -4141,7 +4187,7 @@ RETURN_CODE WCMD_mklink(WCHAR *args)
else if(!junction)
ret = CreateSymbolicLinkW(file1, file2, isdir);
else
- TRACE("Junction links currently not supported.\n");
+ ret = WCMD_create_junction(file1, file2);
}
if(!ret)
WCMD_output_stderr(WCMD_LoadMessage(WCMD_READFAIL), file1);
if (ret) return errorlevel = NO_ERROR;
--
2.17.1
2.43.0

View File

@@ -0,0 +1,63 @@
From 96831bd0bda656192510397cd18cb2c4bff5d8f4 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Thu, 22 Aug 2024 18:42:33 -0500
Subject: [PATCH 03/10] ntdll: Install signal handlers a bit earlier.
The wine-staging WRITECOPY implementation needs to be able to handle write faults while relocating builtin modules loaded during process initialization.
Note that the comment about debug events isn't relevant anymore because these exceptions all happen on the Unix stack anyway.
Probably there's a better solution involving simply not write-protecting these pages until we get to PE code, but that's not worth writing when this whole patch set is moribund anyway.
---
dlls/ntdll/unix/loader.c | 1 +
dlls/ntdll/unix/server.c | 5 -----
dlls/ntdll/unix/signal_i386.c | 5 ++++-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 92f2e2eb3a3..a6ea16bb7bb 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1866,6 +1866,7 @@ static void start_main_thread(void)
set_load_order_app_name( main_wargv[0] );
init_thread_stack( teb, 0, 0, 0 );
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
+ signal_init_process();
load_ntdll();
load_wow64_ntdll( main_image_info.Machine );
load_apiset_dll();
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index 27dbf1331aa..80504e3459c 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -1674,11 +1674,6 @@ void server_init_process_done(void)
send_server_task_port();
#endif
- /* Install signal handlers; this cannot be done earlier, since we cannot
- * send exceptions to the debugger before the create process event that
- * is sent by init_process_done */
- signal_init_process();
-
/* always send the native TEB */
if (!(teb = NtCurrentTeb64())) teb = NtCurrentTeb();
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
index 61d41ec3589..b838a7a8669 100644
--- a/dlls/ntdll/unix/signal_i386.c
+++ b/dlls/ntdll/unix/signal_i386.c
@@ -719,7 +719,10 @@ static inline void *init_handler( const ucontext_t *sigcontext )
{
struct x86_thread_data *thread_data = (struct x86_thread_data *)&teb->GdiTebBatch;
set_fs( thread_data->fs );
- set_gs( thread_data->gs );
+ /* FIXME ZF: This is a bit of a hack, but it doesn't matter,
+ * since this patch set goes in the wrong direction anyway. */
+ if (thread_data->gs)
+ set_gs( thread_data->gs );
}
#endif
--
2.45.2

View File

@@ -1,178 +0,0 @@
From c9d4a9c3a65b1ff1a0c4b4042394f2fab3b2019a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 4 Oct 2014 02:53:22 +0200
Subject: [PATCH] ntdll: Setup a temporary signal handler during process
startup to handle page faults. (v2)
---
dlls/ntdll/unix/loader.c | 2 ++
dlls/ntdll/unix/signal_arm.c | 6 ++++
dlls/ntdll/unix/signal_arm64.c | 6 ++++
dlls/ntdll/unix/signal_i386.c | 52 +++++++++++++++++++++++++++++++++
dlls/ntdll/unix/signal_x86_64.c | 6 ++++
dlls/ntdll/unix/unix_private.h | 1 +
dlls/ntdll/unix/virtual.c | 2 +-
7 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index fa1a943fd51..5a8b0f57e42 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -2142,6 +2142,8 @@ DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] )
#endif
virtual_init();
+ signal_init_early();
+
init_environment();
#ifdef __APPLE__
diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c
index 5115fa7ec3a..8e23007e936 100644
--- a/dlls/ntdll/unix/signal_arm.c
+++ b/dlls/ntdll/unix/signal_arm.c
@@ -1615,6 +1615,12 @@ void signal_init_process(void)
exit(1);
}
+/**********************************************************************
+ * signal_init_early
+ */
+void signal_init_early(void)
+{
+}
/***********************************************************************
* call_init_thunk
diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c
index f96ec330796..eaecf988c54 100644
--- a/dlls/ntdll/unix/signal_arm64.c
+++ b/dlls/ntdll/unix/signal_arm64.c
@@ -1623,6 +1623,12 @@ void signal_init_process(void)
exit(1);
}
+/**********************************************************************
+ * signal_init_early
+ */
+void signal_init_early(void)
+{
+}
/***********************************************************************
* syscall_dispatcher_return_slowpath
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
index c64a8b1efe2..cc1eff1f40b 100644
--- a/dlls/ntdll/unix/signal_i386.c
+++ b/dlls/ntdll/unix/signal_i386.c
@@ -1895,6 +1895,30 @@ static BOOL handle_syscall_trap( ucontext_t *sigcontext )
}
+/**********************************************************************
+ * segv_handler_early
+ *
+ * Handler for SIGSEGV and related errors. Used only during the initialization
+ * of the process to handle virtual faults.
+ */
+static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext )
+{
+ ucontext_t *ucontext = sigcontext;
+
+ switch (TRAP_sig(ucontext))
+ {
+ case TRAP_x86_PAGEFLT: /* Page fault */
+ if (!virtual_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09,
+ NULL))
+ return;
+ /* fall-through */
+ default:
+ WINE_ERR( "Got unexpected trap %d during process initialization\n", TRAP_sig(ucontext) );
+ abort_thread(1);
+ break;
+ }
+}
+
/**********************************************************************
* segv_handler
*
@@ -2465,6 +2489,34 @@ void signal_init_process(void)
exit(1);
}
+/**********************************************************************
+ * signal_init_early
+ */
+void signal_init_early(void)
+{
+ struct sigaction sig_act;
+
+ sig_act.sa_mask = server_block_set;
+ sig_act.sa_flags = SA_SIGINFO | SA_RESTART;
+#ifdef SA_ONSTACK
+ sig_act.sa_flags |= SA_ONSTACK;
+#endif
+#ifdef __ANDROID__
+ sig_act.sa_flags |= SA_RESTORER;
+ sig_act.sa_restorer = rt_sigreturn;
+#endif
+ sig_act.sa_sigaction = segv_handler_early;
+ if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error;
+ if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error;
+#ifdef SIGBUS
+ if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error;
+#endif
+ return;
+
+error:
+ perror("sigaction");
+ exit(1);
+}
/***********************************************************************
* call_init_thunk
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index a28762915be..d22515ab921 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2659,6 +2659,12 @@ void signal_init_process(void)
exit(1);
}
+/**********************************************************************
+ * signal_init_early
+ */
+void signal_init_early(void)
+{
+}
/***********************************************************************
* call_init_thunk
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index fadad6ae824..d8eaabef781 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -277,6 +277,7 @@ extern void signal_init_threading(void);
extern NTSTATUS signal_alloc_thread( TEB *teb );
extern void signal_free_thread( TEB *teb );
extern void signal_init_process(void);
+extern void signal_init_early(void);
extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE entry, void *arg,
BOOL suspend, TEB *teb );
extern SYSTEM_SERVICE_TABLE KeServiceDescriptorTable[4];
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index e0099f1a5c2..fd0b382b368 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -3961,7 +3961,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
}
#endif
- if (!is_inside_signal_stack( stack ) && (vprot & VPROT_GUARD))
+ if (stack && !is_inside_signal_stack( stack ) && (vprot & VPROT_GUARD))
{
struct thread_stack_info stack_info;
if (!is_inside_thread_stack( page, &stack_info ))
--
2.43.0

Some files were not shown because too many files have changed in this diff Show More