Compare commits

..

16 Commits
v4.17 ... v4.18

Author SHA1 Message Date
Alistair Leslie-Hughes
9807a02bb3 Release v4.18 2019-10-19 13:37:33 +11:00
Alistair Leslie-Hughes
eab8fd69f7 Rebase against 8c74027ba60a360f24cf232ee233e71262d8f1ff 2019-10-19 13:36:30 +11:00
Alistair Leslie-Hughes
b95882c061 Updated advapi32-LsaLookupSids patchset
Fix test in last rebase.
2019-10-18 10:10:00 +11:00
Alistair Leslie-Hughes
49b240d88c Rebase against 0fe003435e90dc32dd405a62af8fbcc20afc925d 2019-10-18 08:54:48 +11:00
Alistair Leslie-Hughes
c96aa29030 Added user32-InternalGetWindowIcon patchset 2019-10-14 10:40:38 +11:00
Alistair Leslie-Hughes
d432608737 Updated dinput-joy-mappings patchset 2019-10-11 14:20:41 +11:00
Alistair Leslie-Hughes
db09443c86 Updated ntdll-RtlIpv4StringToAddress reference 2019-10-11 13:34:43 +11:00
Alistair Leslie-Hughes
da73254259 Updated dinput-joy-mappings patchset
- Use heap_alloc/free
- Remove use of const buffers.
- Add "dinput: Dont allow Fixed actions to be changed."
2019-10-11 13:30:49 +11:00
Alistair Leslie-Hughes
a246130f81 Rebase against 89d9bcb1f19a03ffafa9a93a5f32049b4bfdaa00 2019-10-09 08:38:54 +11:00
Paul Gofman
042a633c8a Rebase against 15bf3eee2cf05ce98011458fc5e715f4524c4ebd 2019-10-04 02:11:27 +03:00
Zebediah Figura
cf04b8d6ac eventfd_synchronization: Cherry-pick some fixes. 2019-10-02 20:37:48 -05:00
Alistair Leslie-Hughes
6be963ebfd Rebase against 5e8eb5f4c54c3a6d3c92fd414372da2fbd5bd91a 2019-10-03 08:54:04 +10:00
Alistair Leslie-Hughes
5b066d6aed Disable user32-rawinput patchset
This is causing regressions across the board.
https://bugs.winehq.org/show_bug.cgi?id=47834

Star Craft 2, Borderlands, StarCitizen, Halo Online
2019-10-02 10:41:41 +10:00
Alistair Leslie-Hughes
c24cb89257 Rebase against b360cd67e8f7f8c01f09457bacb032fd4a248d0a 2019-10-02 10:11:40 +10:00
Paul Gofman
3d5bb83e05 Updated wined3d-zero-inf-shaders patchset.
Avoid infinity resulting from overflow in POW with multiply_setting set to 1.
2019-10-01 21:52:15 +03:00
Alistair Leslie-Hughes
0c7512f5f5 Updated user32-rawinput patchset 2019-09-29 18:06:18 +10:00
40 changed files with 892 additions and 440 deletions

View File

@@ -1,4 +1,4 @@
From 5e4c31d0796f2e559889d4f84cdb571130217e7d Mon Sep 17 00:00:00 2001
From 14f3c7debf91be0e5b36299f330541f3146d00ca Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 22 Mar 2016 21:58:40 +0100
Subject: [PATCH] dwrite: Avoid implicit cast of interface pointer.
@@ -9,10 +9,10 @@ Subject: [PATCH] dwrite: Avoid implicit cast of interface pointer.
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index f50133d..1bc7b59 100644
index be9ff88fe44..44c4426c9ff 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1815,7 +1815,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
@@ -1781,7 +1781,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontVtbl*)&dwritefontvtbl);
@@ -21,7 +21,7 @@ index f50133d..1bc7b59 100644
}
struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
@@ -1823,7 +1823,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
@@ -1789,7 +1789,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontFaceVtbl*)&dwritefontfacevtbl);
@@ -31,18 +31,18 @@ index f50133d..1bc7b59 100644
void get_logfont_from_font(IDWriteFont *iface, LOGFONTW *lf)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index f27fe9f..ee1eb5a 100644
index b9c712cd7fb..358d13963a7 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -5622,7 +5622,7 @@ static const IDWriteTextFormat2Vtbl dwritetextformatvtbl = {
@@ -5715,7 +5715,7 @@ static const IDWriteTextFormat3Vtbl dwritetextformatvtbl =
static struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextFormat *iface)
{
return (iface->lpVtbl == (IDWriteTextFormatVtbl*)&dwritetextformatvtbl) ?
- CONTAINING_RECORD(iface, struct dwrite_textformat, IDWriteTextFormat2_iface) : NULL;
+ CONTAINING_RECORD((IDWriteTextFormat2 *)iface, struct dwrite_textformat, IDWriteTextFormat2_iface) : NULL;
- CONTAINING_RECORD(iface, struct dwrite_textformat, IDWriteTextFormat3_iface) : NULL;
+ CONTAINING_RECORD((IDWriteTextFormat3 *)iface, struct dwrite_textformat, IDWriteTextFormat3_iface) : NULL;
}
HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style,
--
1.9.1
2.23.0

View File

@@ -1,7 +1,7 @@
From 83517396c266c2de290670128d678770f5d79cc9 Mon Sep 17 00:00:00 2001
From 486ec8b5ea1b39195d92cfdbfe3a334280780a14 Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong@codeweavers.com>
Date: Tue, 28 Apr 2015 23:00:08 +0800
Subject: advapi32: Fix name and use of DOMAIN_GROUP_RID_USERS.
Subject: [PATCH] advapi32: Fix name and use of DOMAIN_GROUP_RID_USERS.
---
dlls/advapi32/security.c | 7 +++++--
@@ -9,10 +9,10 @@ Subject: advapi32: Fix name and use of DOMAIN_GROUP_RID_USERS.
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index d27b2e7..2362dd5 100644
index a7707f15d39..73c1f054d5c 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -191,7 +191,7 @@ static const WCHAR Domain_Admins[] = { 'D','o','m','a','i','n',' ','A','d','m','
@@ -187,7 +187,7 @@ static const WCHAR Domain_Admins[] = { 'D','o','m','a','i','n',' ','A','d','m','
static const WCHAR Domain_Computers[] = { 'D','o','m','a','i','n',' ','C','o','m','p','u','t','e','r','s',0 };
static const WCHAR Domain_Controllers[] = { 'D','o','m','a','i','n',' ','C','o','n','t','r','o','l','l','e','r','s',0 };
static const WCHAR Domain_Guests[] = { 'D','o','m','a','i','n',' ','G','u','e','s','t','s',0 };
@@ -21,7 +21,7 @@ index d27b2e7..2362dd5 100644
static const WCHAR Enterprise_Admins[] = { 'E','n','t','e','r','p','r','i','s','e',' ','A','d','m','i','n','s',0 };
static const WCHAR ENTERPRISE_DOMAIN_CONTROLLERS[] = { 'E','N','T','E','R','P','R','I','S','E',' ','D','O','M','A','I','N',' ','C','O','N','T','R','O','L','L','E','R','S',0 };
static const WCHAR Everyone[] = { 'E','v','e','r','y','o','n','e',0 };
@@ -2206,7 +2206,10 @@ LookupAccountSidW(
@@ -1185,7 +1185,10 @@ LookupAccountSidW(
ac = Domain_Admins;
break;
case DOMAIN_GROUP_RID_USERS:
@@ -34,20 +34,23 @@ index d27b2e7..2362dd5 100644
case DOMAIN_GROUP_RID_GUESTS:
ac = Domain_Guests;
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 573119f..490ce26 100644
index 5f65ed385dd..a9d745cfe39 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2578,8 +2578,8 @@ static void test_process_security(void)
@@ -3003,11 +3003,11 @@ static void test_process_security(void)
dom_size = sizeof(domain);
ret = LookupAccountSidA( NULL, UsersSid, account, &acc_size, domain, &dom_size, &use );
ok(ret, "LookupAccountSid failed with %d\n", ret);
- todo_wine ok(use == SidTypeGroup, "expect SidTypeGroup, got %d\n", use);
- todo_wine ok(!strcmp(account, "None"), "expect None, got %s\n", account);
+ ok(use == SidTypeGroup, "expect SidTypeGroup, got %d\n", use);
+ ok(!strcmp(account, "None"), "expect None, got %s\n", account);
if (PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH)
skip("Non-English locale (test with hardcoded 'None')\n");
else
- todo_wine ok(!strcmp(account, "None"), "expect None, got %s\n", account);
+ ok(!strcmp(account, "None"), "expect None, got %s\n", account);
res = GetTokenInformation( token, TokenUser, NULL, 0, &size );
ok(!res, "Expected failure, got %d\n", res);
--
2.3.5
2.17.1

View File

@@ -1,15 +1,15 @@
From 50dfa70735f6a0f8cf9e77c70143a91555627a5a Mon Sep 17 00:00:00 2001
From 896b9be78dfd979ddea8f098ae66473956d4147c Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Sat, 24 Sep 2016 06:51:24 +0300
Subject: [PATCH] d3d11: Add stub deferred rendering context.
---
dlls/d3d11/device.c | 1267 +++++++++++++++++++++++++++++++++-----
dlls/d3d11/device.c | 1268 +++++++++++++++++++++++++++++++++-----
dlls/d3d11/tests/d3d11.c | 4 +-
2 files changed, 1132 insertions(+), 139 deletions(-)
2 files changed, 1132 insertions(+), 140 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 08579164bd..dca5a88caa 100644
index 31c7f35fc25..dca5a88caa0 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -22,6 +22,16 @@
@@ -1352,13 +1352,14 @@ index 08579164bd..dca5a88caa 100644
iface, byte_code, byte_code_length, class_linkage, shader);
if (class_linkage)
@@ -3362,9 +4340,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
@@ -3362,10 +4340,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device2 *iface, UINT flags,
ID3D11DeviceContext **context)
{
- FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context);
+ struct d3d11_deferred_context *object;
- *context = NULL;
- return E_NOTIMPL;
+ TRACE("iface %p, flags %#x, context %p.\n", iface, flags, context);
+
@@ -1378,7 +1379,7 @@ index 08579164bd..dca5a88caa 100644
static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID iid,
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index d58319df58..e653fb30b2 100644
index da4627d7a85..dadeac27662 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -2231,6 +2231,8 @@ static void test_create_deferred_context(void)
@@ -1400,5 +1401,5 @@ index d58319df58..e653fb30b2 100644
goto done;
refcount = get_refcount(device);
--
2.21.0
2.23.0

View File

@@ -1,53 +0,0 @@
From 5d633f126af17add8eaefc10c08e400616ff5fc9 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Tue, 4 Nov 2014 22:22:03 +0100
Subject: [PATCH] d3dx9_36: Align texture dimensions to block size for
compressed textures in D3DXCheckTextureRequirements.
---
dlls/d3dx9_36/tests/texture.c | 9 +++++++++
dlls/d3dx9_36/texture.c | 8 ++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c
index fc1589d25e..93a7fcd911 100644
--- a/dlls/d3dx9_36/tests/texture.c
+++ b/dlls/d3dx9_36/tests/texture.c
@@ -448,6 +448,15 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
ok(width == 4, "Got unexpected width %d.\n", width);
ok(height == 4, "Got unexpected height %d.\n", height);
ok(format == D3DFMT_DXT5, "Got unexpected format %u.\n", format);
+
+ width = 5; height = 5;
+ mipmaps = 1;
+ hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT);
+ ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK);
+ ok(width == 8, "Returned width %d, expected %d\n", width, 8);
+ ok(height == 8, "Returned height %d, expected %d\n", height, 8);
+ ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
+ ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5);
}
else
{
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 4ae924999e..a592b7ba1e 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -339,10 +339,10 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN
if (fmt->block_width != 1 || fmt->block_height != 1)
{
- if (w < fmt->block_width)
- w = fmt->block_width;
- if (h < fmt->block_height)
- h = fmt->block_height;
+ if (w % fmt->block_width)
+ w += fmt->block_width - w % fmt->block_width;
+ if (h % fmt->block_height)
+ h += fmt->block_height - h % fmt->block_height;
}
if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(w)))
--
2.21.0

View File

@@ -1,16 +1,16 @@
From 3d90cc93c56571a6c1d7d25054094106595e7c03 Mon Sep 17 00:00:00 2001
From 290d6b2b773e9729c38495ec8c1291b40678bc31 Mon Sep 17 00:00:00 2001
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Date: Tue, 30 Apr 2019 09:20:20 +1000
Subject: [PATCH] dinput: Load users Joystick mappings.
Subject: [PATCH 1/3] dinput: Load users Joystick mappings.
---
dlls/dinput/device.c | 2 +-
dlls/dinput/device_private.h | 2 ++
dlls/dinput/joystick.c | 18 ++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
dlls/dinput/joystick.c | 25 +++++++++++++++++++++++++
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index ade7947..648a4cc 100644
index 28329d03b5..d1bf934a82 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -714,7 +714,7 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
@@ -23,10 +23,10 @@ index ade7947..648a4cc 100644
HKEY hkey;
WCHAR *guid_str;
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
index d9e2997..af8d99d 100644
index 27e9c26286..ea794d7396 100644
--- a/dlls/dinput/device_private.h
+++ b/dlls/dinput/device_private.h
@@ -123,6 +123,8 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
@@ -125,6 +125,8 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
@@ -36,23 +36,26 @@ index d9e2997..af8d99d 100644
extern HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN;
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index 20d9ee4..62b57bc 100644
index 2220b5d576..8341e0313a 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -28,6 +28,7 @@
@@ -28,8 +28,10 @@
#include <stdio.h>
+#include "device_private.h"
#include "joystick_private.h"
#include "wine/debug.h"
+#include "wine/heap.h"
#include "winreg.h"
@@ -792,9 +793,26 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
WINE_DEFAULT_DEBUG_CHANNEL(dinput);
@@ -825,9 +827,32 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
unsigned int i, j;
BOOL has_actions = FALSE;
+ WCHAR username[MAX_PATH];
+ DWORD username_size = MAX_PATH;
+ WCHAR *username;
+ DWORD size;
+ BOOL load_success = FALSE;
FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", This, lpdiaf, debugstr_w(lpszUserName), dwFlags);
@@ -60,13 +63,19 @@ index 20d9ee4..62b57bc 100644
+ /* Unless asked the contrary by these flags, try to load a previous mapping */
+ if (!(dwFlags & DIDBAM_HWDEFAULTS))
+ {
+ /* Retrieve logged user name if necessary */
+ if (lpszUserName == NULL)
+ GetUserNameW(username, &username_size);
+ if (!lpszUserName)
+ GetUserNameW(NULL, &size);
+ else
+ lstrcpynW(username, lpszUserName, MAX_PATH);
+ size = lstrlenW(lpszUserName) + 1;
+
+ username = heap_alloc(size * sizeof(WCHAR));
+ if (!lpszUserName)
+ GetUserNameW(username, &size);
+ else
+ lstrcpynW(username, lpszUserName, size);
+
+ load_success = load_mapping_settings((IDirectInputDeviceImpl *) This, lpdiaf, username);
+ heap_free(username);
+ }
+
+ if (load_success) return DI_OK;
@@ -75,5 +84,5 @@ index 20d9ee4..62b57bc 100644
{
DWORD inst = (0x000000ff & (lpdiaf->rgoAction[i].dwSemantic)) - 1;
--
1.9.1
2.17.1

View File

@@ -1,21 +1,29 @@
From 920014b62ddd2218477e3d82f45c4515742f9e28 Mon Sep 17 00:00:00 2001
From bce769d9179ffbcbc634e73ad124528e28c5c7a8 Mon Sep 17 00:00:00 2001
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Date: Tue, 30 Apr 2019 09:20:54 +1000
Subject: [PATCH 2/3] dinput: Allow empty Joystick mappings.
Subject: [PATCH] dinput: Allow empty Joystick mappings.
---
dlls/dinput/device.c | 82 +++++++++++++++++++++++++++++++++++++--------
dlls/dinput/joystick.c | 2 ++
dlls/dinput/keyboard.c | 2 ++
dlls/dinput/mouse.c | 2 ++
dlls/dinput8/tests/device.c | 50 +++++++++++++++++++++++++++
5 files changed, 124 insertions(+), 14 deletions(-)
dlls/dinput/device.c | 82 ++++++++++++++++++++++++++++++-------
dlls/dinput/joystick.c | 4 +-
dlls/dinput/keyboard.c | 2 +
dlls/dinput/mouse.c | 2 +
dlls/dinput8/tests/device.c | 50 ++++++++++++++++++++++
5 files changed, 125 insertions(+), 15 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 2150db7..a7cfe36 100644
index d1bf934a827..6107ab26538 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -643,12 +643,30 @@ static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic)
@@ -30,6 +30,7 @@
#include <string.h>
#include "wine/debug.h"
#include "wine/unicode.h"
+#include "wine/heap.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
@@ -643,12 +644,29 @@ static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic)
return type | (0x0000ff00 & (obj_instance << 8));
}
@@ -27,14 +35,13 @@ index 2150db7..a7cfe36 100644
+ 'M','a','p','p','i','n','g','s','\\','%','s','\\','%','s','\\','%','s','\0'};
+ WCHAR *keyname;
+
+ keyname = HeapAlloc(GetProcessHeap(), 0,
+ sizeof(WCHAR) * (lstrlenW(subkey) + strlenW(username) + strlenW(device) + strlenW(guid)));
+ keyname = heap_alloc(sizeof(WCHAR) * (lstrlenW(subkey) + strlenW(username) + strlenW(device) + strlenW(guid)));
+ sprintfW(keyname, subkey, username, device, guid);
+
+ /* Remove old key mappings so there will be no overlapping mappings */
+ RegDeleteKeyW(HKEY_CURRENT_USER, keyname);
+
+ HeapFree(GetProcessHeap(), 0, keyname);
+ heap_free(keyname);
+}
+
/*
@@ -97,12 +104,12 @@ index 2150db7..a7cfe36 100644
- lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT;
- mapped += 1;
+ lpdiaf->rgoAction[i].dwHow = DIAH_USERCONFIG;
}
+ }
+ else
+ {
+ memset(&lpdiaf->rgoAction[i].guidInstance, 0, sizeof(GUID));
+ lpdiaf->rgoAction[i].dwHow = DIAH_UNMAPPED;
+ }
}
+
}
@@ -187,10 +194,19 @@ index 2150db7..a7cfe36 100644
This->num_actions = num_actions;
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index b146712..267f932 100644
index 66d6cfdffb9..73215dac0d5 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -907,6 +907,8 @@ HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
@@ -847,7 +847,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
else
lstrcpynW(username, lpszUserName, size);
- load_success = load_mapping_settings((IDirectInputDeviceImpl *) This, lpdiaf, username);
+ load_success = load_mapping_settings(&This->base, lpdiaf, username);
heap_free(username);
}
@@ -957,6 +957,8 @@ HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
hr = JoystickWGenericImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
@@ -200,10 +216,10 @@ index b146712..267f932 100644
HeapFree(GetProcessHeap(), 0, lpszUserNameW);
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index 42c0759..5c5aa14 100644
index b5e665933ec..0747f5d8c8b 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -693,6 +693,8 @@ static HRESULT WINAPI SysKeyboardAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
@@ -690,6 +690,8 @@ static HRESULT WINAPI SysKeyboardAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
hr = SysKeyboardWImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
@@ -213,10 +229,10 @@ index 42c0759..5c5aa14 100644
HeapFree(GetProcessHeap(), 0, lpszUserNameW);
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index f3ec8e4..0adba03 100644
index 52a766b2a1a..796f1fa2977 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -863,6 +863,8 @@ static HRESULT WINAPI SysMouseAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
@@ -862,6 +862,8 @@ static HRESULT WINAPI SysMouseAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
hr = SysMouseWImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
@@ -226,7 +242,7 @@ index f3ec8e4..0adba03 100644
HeapFree(GetProcessHeap(), 0, lpszUserNameW);
diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
index 1bfb34a..46a1e4a 100644
index f3e7b542355..bec2a6b863c 100644
--- a/dlls/dinput8/tests/device.c
+++ b/dlls/dinput8/tests/device.c
@@ -38,6 +38,8 @@ struct enum_data {
@@ -301,5 +317,5 @@ index 1bfb34a..46a1e4a 100644
IDirectInput_Release(pDI);
}
--
1.9.1
2.17.1

View File

@@ -1,20 +1,34 @@
From af785463a8e9fc8ff47ead4143151e9831cbbddf Mon Sep 17 00:00:00 2001
From ed590782f6149f56c0e4c6747cea5a297543047b Mon Sep 17 00:00:00 2001
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Date: Tue, 30 Apr 2019 09:21:24 +1000
Subject: [PATCH] dinput: Support username in Config dialog.
---
dlls/dinput/config.c | 183 ++++++++++++++++++++++++++++++-------------
dlls/dinput/config.c | 187 ++++++++++++++++++++++++-----------
dlls/dinput/device.c | 2 +-
dlls/dinput/device_private.h | 1 +
dlls/dinput/dinput_main.c | 27 +++++++
4 files changed, 156 insertions(+), 57 deletions(-)
dlls/dinput/dinput_main.c | 28 ++++++
4 files changed, 161 insertions(+), 57 deletions(-)
diff --git a/dlls/dinput/config.c b/dlls/dinput/config.c
index bf44898..cd2c4b9 100644
index bf44898589..c7a33d2da0 100644
--- a/dlls/dinput/config.c
+++ b/dlls/dinput/config.c
@@ -29,6 +29,9 @@ typedef struct {
@@ -18,17 +18,23 @@
#define NONAMELESSUNION
+
#include "wine/unicode.h"
#include "objbase.h"
#include "dinput_private.h"
#include "device_private.h"
#include "resource.h"
+#include "wine/heap.h"
+
typedef struct {
int nobjects;
IDirectInputDevice8W *lpdid;
DIDEVICEINSTANCEW ddi;
DIDEVICEOBJECTINSTANCEW ddo[256];
@@ -24,7 +38,7 @@ index bf44898..cd2c4b9 100644
} DeviceData;
typedef struct {
@@ -38,10 +41,11 @@ typedef struct {
@@ -38,10 +44,11 @@ typedef struct {
typedef struct {
IDirectInput8W *lpDI;
@@ -37,7 +51,7 @@ index bf44898..cd2c4b9 100644
} ConfigureDevicesData;
/*
@@ -57,27 +61,42 @@ static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pv
@@ -57,27 +64,42 @@ static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pv
return DIENUM_CONTINUE;
}
@@ -71,15 +85,15 @@ index bf44898..cd2c4b9 100644
IDirectInputDevice_EnumObjects(lpdid, collect_objects, (LPVOID) device, DIDFT_ALL);
- data->ndevices++;
+ device->user_afs = HeapAlloc(GetProcessHeap(), 0, sizeof(*device->user_afs)*data->nusernames);
+ memset(device->user_afs, 0, sizeof(*device->user_afs)*data->nusernames);
+ device->user_afs = heap_alloc(sizeof(*device->user_afs) * data->nusernames);
+ memset(device->user_afs, 0, sizeof(*device->user_afs) * data->nusernames);
+ for (i = 0; i < data->nusernames; i++)
+ {
+ DIACTIONFORMATW *user_af = &device->user_afs[i];
+ user_af->dwNumActions = data->original_lpdiaf->dwNumActions;
+ user_af->guidActionMap = data->original_lpdiaf->guidActionMap;
+ user_af->rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*data->original_lpdiaf->dwNumActions);
+ memset(user_af->rgoAction, 0, sizeof(DIACTIONW)*data->original_lpdiaf->dwNumActions);
+ user_af->rgoAction = heap_alloc(sizeof(DIACTIONW) * data->original_lpdiaf->dwNumActions);
+ memset(user_af->rgoAction, 0, sizeof(DIACTIONW) * data->original_lpdiaf->dwNumActions);
+ for (j = 0; j < user_af->dwNumActions; j++)
+ {
+ user_af->rgoAction[j].dwSemantic = data->original_lpdiaf->rgoAction[j].dwSemantic;
@@ -92,7 +106,7 @@ index bf44898..cd2c4b9 100644
return DIENUM_CONTINUE;
}
@@ -170,10 +189,18 @@ static DeviceData* get_cur_device(HWND dialog)
@@ -170,10 +192,18 @@ static DeviceData* get_cur_device(HWND dialog)
return &data->devices_data.devices[sel];
}
@@ -113,7 +127,7 @@ index bf44898..cd2c4b9 100644
}
static int dialog_display_only(HWND dialog)
@@ -182,40 +209,36 @@ static int dialog_display_only(HWND dialog)
@@ -182,40 +212,36 @@ static int dialog_display_only(HWND dialog)
return data->display_only;
}
@@ -155,8 +169,8 @@ index bf44898..cd2c4b9 100644
+ {
IDirectInputDevice8_Release(devices_data->devices[i].lpdid);
+ for (j=0; j < data->nusernames; j++)
+ HeapFree(GetProcessHeap(), 0, devices_data->devices[i].user_afs[j].rgoAction);
+ HeapFree(GetProcessHeap(), 0, devices_data->devices[i].user_afs);
+ heap_free(devices_data->devices[i].user_afs[j].rgoAction);
+ heap_free(devices_data->devices[i].user_afs);
+ }
HeapFree(GetProcessHeap(), 0, devices_data->devices);
@@ -167,7 +181,7 @@ index bf44898..cd2c4b9 100644
}
static void fill_device_object_list(HWND dialog)
@@ -231,6 +254,7 @@ static void fill_device_object_list(HWND dialog)
@@ -231,6 +257,7 @@ static void fill_device_object_list(HWND dialog)
/* Add each object */
for (i=0; i < device->nobjects; i++)
{
@@ -175,7 +189,7 @@ index bf44898..cd2c4b9 100644
int action = -1;
item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -241,12 +265,20 @@ static void fill_device_object_list(HWND dialog)
@@ -241,12 +268,20 @@ static void fill_device_object_list(HWND dialog)
/* Add the item */
SendDlgItemMessageW(dialog, IDC_DEVICEOBJECTSLIST, LVM_INSERTITEMW, 0, (LPARAM) &item);
@@ -198,7 +212,7 @@ index bf44898..cd2c4b9 100644
{
action = j;
break;
@@ -260,7 +292,7 @@ static void fill_device_object_list(HWND dialog)
@@ -260,7 +295,7 @@ static void fill_device_object_list(HWND dialog)
static void show_suitable_actions(HWND dialog)
{
DeviceData *device = get_cur_device(dialog);
@@ -207,7 +221,7 @@ index bf44898..cd2c4b9 100644
int i, added = 0;
int obj = lv_get_cur_item(dialog);
@@ -329,24 +361,35 @@ static void assign_action(HWND dialog)
@@ -329,24 +364,35 @@ static void assign_action(HWND dialog)
lv_set_action(dialog, obj, action, lpdiaf);
}
@@ -255,7 +269,7 @@ index bf44898..cd2c4b9 100644
}
static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -358,21 +401,16 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
@@ -358,21 +404,16 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
ConfigureDevicesData *data = (ConfigureDevicesData*) lParam;
/* Initialize action format and enumerate devices */
@@ -279,7 +293,7 @@ index bf44898..cd2c4b9 100644
fill_device_object_list(dialog);
ShowCursor(TRUE);
@@ -414,6 +452,7 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
@@ -414,6 +455,7 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
break;
case IDC_CONTROLLERCOMBO:
@@ -287,7 +301,7 @@ index bf44898..cd2c4b9 100644
switch (HIWORD(wParam))
{
@@ -424,12 +463,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
@@ -424,12 +466,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
break;
case IDOK:
@@ -301,13 +315,13 @@ index bf44898..cd2c4b9 100644
EndDialog(dialog, 0);
destroy_data(dialog);
break;
@@ -452,15 +491,47 @@ HRESULT _configure_devices(IDirectInput8W *iface,
@@ -452,15 +494,48 @@ HRESULT _configure_devices(IDirectInput8W *iface,
LPVOID pvRefData
)
{
+ int i;
+ DWORD default_username_size = MAX_PATH;
+ WCHAR *default_username = 0;
+ DWORD size;
+ WCHAR *username = NULL;
ConfigureDevicesData data;
data.lpDI = iface;
- data.lpdiaf = lpdiCDParams->lprgFormats;
@@ -317,16 +331,17 @@ index bf44898..cd2c4b9 100644
+ if (lpdiCDParams->lptszUserNames == NULL)
+ {
+ /* Get default user name */
+ default_username = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*MAX_PATH);
+ GetUserNameW(NULL, &size);
+ username = heap_alloc(size * sizeof(WCHAR) );
+ GetUserNameW(username, &size);
+ data.nusernames = 1;
+ data.usernames = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *));
+ data.usernames[0] = default_username;
+ GetUserNameW(default_username, &default_username_size);
+ data.usernames = heap_alloc(sizeof(WCHAR *));
+ data.usernames[0] = username;
+ }
+ else
+ {
+ WCHAR *p = lpdiCDParams->lptszUserNames;
+ data.usernames = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *)*data.nusernames);
+ data.usernames = heap_alloc(sizeof(WCHAR *) * data.nusernames);
+ for (i = 0; i < data.nusernames; i++)
+ {
+ if (*p)
@@ -345,13 +360,13 @@ index bf44898..cd2c4b9 100644
DialogBoxParamW(DINPUT_instance, (const WCHAR *)MAKEINTRESOURCE(IDD_CONFIGUREDEVICES),
lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data);
+ HeapFree(GetProcessHeap(), 0, default_username);
+ HeapFree(GetProcessHeap(), 0, data.usernames);
+ heap_free(username);
+ heap_free(data.usernames);
+
return DI_OK;
}
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index b441743..0c94326 100644
index 6107ab2653..30483fe691 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -692,7 +692,7 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
@@ -364,10 +379,10 @@ index b441743..0c94326 100644
WCHAR *guid_str = NULL;
DIDEVICEINSTANCEW didev;
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
index af8d99d..36b71f7 100644
index ea794d7396..114e3971ed 100644
--- a/dlls/dinput/device_private.h
+++ b/dlls/dinput/device_private.h
@@ -123,6 +123,7 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
@@ -125,6 +125,7 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
@@ -376,10 +391,18 @@ index af8d99d..36b71f7 100644
extern HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN;
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 198c6a8..ee319f0 100644
index 0855cb41cd..7af377026c 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -1251,9 +1251,34 @@ static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
@@ -39,6 +39,7 @@
#define NONAMELESSUNION
#include "wine/debug.h"
+#include "wine/heap.h"
#include "wine/unicode.h"
#include "wine/asm.h"
#include "windef.h"
@@ -1253,9 +1254,34 @@ static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
/* Copy parameters */
diCDParamsW.dwSize = sizeof(DICONFIGUREDEVICESPARAMSW);
@@ -414,15 +437,15 @@ index 198c6a8..ee319f0 100644
diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiCDParams->lprgFormats->dwNumActions);
_copy_diactionformatAtoW(&diafW, lpdiCDParams->lprgFormats);
@@ -1281,6 +1306,8 @@ static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
@@ -1283,6 +1309,8 @@ static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
+ HeapFree(GetProcessHeap(), 0, (void*) diCDParamsW.lptszUserNames);
+ heap_free((void*) diCDParamsW.lptszUserNames);
+
return hr;
}
--
1.9.1
2.17.1

View File

@@ -0,0 +1,33 @@
From 629a5f7eea3b17f56606d3b588a5fd96ded99fef Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 4 Oct 2019 16:24:06 +1000
Subject: [PATCH] dinput: Dont allow Fixed actions to be changed.
---
dlls/dinput/config.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/dinput/config.c b/dlls/dinput/config.c
index cd2c4b921e7..bfb535c9b2a 100644
--- a/dlls/dinput/config.c
+++ b/dlls/dinput/config.c
@@ -91,6 +91,7 @@ static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDev
for (j = 0; j < user_af->dwNumActions; j++)
{
user_af->rgoAction[j].dwSemantic = data->original_lpdiaf->rgoAction[j].dwSemantic;
+ user_af->rgoAction[j].dwFlags = data->original_lpdiaf->rgoAction[j].dwFlags;
user_af->rgoAction[j].u.lptszActionName = data->original_lpdiaf->rgoAction[j].u.lptszActionName;
}
IDirectInputDevice8_BuildActionMap(lpdid, user_af, data->usernames[i], 0);
@@ -334,6 +335,8 @@ static void assign_action(HWND dialog)
if (old_action == action) return;
if (obj < 0) return;
+ if (lpdiaf->rgoAction[old_action].dwFlags & DIA_APPFIXED) return;
+
type = device->ddo[obj].dwType;
/* Clear old action */
--
2.23.0

View File

@@ -0,0 +1,26 @@
From 9e4df70f7282b04849153b3fa2edf15dc24eaf4f Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Tue, 23 Jul 2019 18:39:06 -0500
Subject: [PATCH] server: Only signal the APC fd for user APCs.
Otherwise we might incorrectly return WAIT_IO_COMPLETION to the user when a system APC runs.
---
server/thread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/thread.c b/server/thread.c
index fc751c2cb..2e77e5ff2 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1057,7 +1057,7 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
{
wake_thread( thread );
- if (do_esync())
+ if (do_esync() && queue == &thread->user_apc)
esync_wake_fd( thread->esync_apc_fd );
}
--
2.23.0

View File

@@ -0,0 +1,43 @@
From 836f1b6b0560bd178efb8d52900b4b136f87ae30 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Tue, 23 Jul 2019 17:22:20 -0500
Subject: [PATCH] ntdll: Check the APC fd first.
---
dlls/ntdll/esync.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c
index fc621ccfb..0adb4ad77 100644
--- a/dlls/ntdll/esync.c
+++ b/dlls/ntdll/esync.c
@@ -1046,6 +1046,14 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles,
ret = do_poll( fds, pollcount, timeout ? &end : NULL );
if (ret > 0)
{
+ /* We must check this first! The server may set an event that
+ * we're waiting on, but we need to return STATUS_USER_APC. */
+ if (alertable)
+ {
+ if (fds[pollcount - 1].revents & POLLIN)
+ goto userapc;
+ }
+
/* Find out which object triggered the wait. */
for (i = 0; i < count; i++)
{
@@ -1089,11 +1097,6 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles,
return count - 1;
}
}
- if (alertable)
- {
- if (fds[i++].revents & POLLIN)
- goto userapc;
- }
/* If we got here, someone else stole (or reset, etc.) whatever
* we were waiting for. So keep waiting. */
--
2.23.0

View File

@@ -0,0 +1,52 @@
From c1804983dc8e9509c088c35914212cda1bd5a48a Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Wed, 7 Aug 2019 17:14:54 -0500
Subject: [PATCH] ntdll/esync: Lock accessing the shm_addrs array.
---
dlls/ntdll/esync.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c
index 0adb4ad77..2f030c141 100644
--- a/dlls/ntdll/esync.c
+++ b/dlls/ntdll/esync.c
@@ -155,10 +155,22 @@ void esync_init(void)
shm_addrs_size = 128;
}
+static RTL_CRITICAL_SECTION shm_addrs_section;
+static RTL_CRITICAL_SECTION_DEBUG shm_addrs_debug =
+{
+ 0, 0, &shm_addrs_section,
+ { &shm_addrs_debug.ProcessLocksList, &shm_addrs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": shm_addrs_section") }
+};
+static RTL_CRITICAL_SECTION shm_addrs_section = { &shm_addrs_debug, -1, 0, 0, 0, 0 };
+
static void *get_shm( unsigned int idx )
{
int entry = (idx * 8) / pagesize;
int offset = (idx * 8) % pagesize;
+ void *ret;
+
+ RtlEnterCriticalSection(&shm_addrs_section);
if (entry >= shm_addrs_size)
{
@@ -180,7 +192,11 @@ static void *get_shm( unsigned int idx )
munmap( addr, pagesize ); /* someone beat us to it */
}
- return (void *)((unsigned long)shm_addrs[entry] + offset);
+ ret = (void *)((unsigned long)shm_addrs[entry] + offset);
+
+ RtlLeaveCriticalSection(&shm_addrs_section);
+
+ return ret;
}
/* We'd like lookup to be fast. To that end, we use a static list indexed by handle.
--
2.23.0

View File

@@ -0,0 +1,206 @@
From c41dc5b8c422be3914cd31c239ec586a091b8a3b Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 10 Jun 2019 11:25:34 -0400
Subject: [PATCH] ntdll: Get rid of the per-event spinlock for auto-reset
events.
It's not necessary. Much like semaphores, the shm state is just a hint.
---
dlls/ntdll/esync.c | 74 +++++++++++++++++++++++++++++++++++-----------
server/esync.c | 32 +++++++++++++-------
2 files changed, 78 insertions(+), 28 deletions(-)
diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c
index 2f030c141..87f303403 100644
--- a/dlls/ntdll/esync.c
+++ b/dlls/ntdll/esync.c
@@ -570,6 +570,14 @@ static inline void small_pause(void)
* problem at all.
*/
+/* Removing this spinlock is harder than it looks. esync_wait_objects() can
+ * deal with inconsistent state well enough, and a race between SetEvent() and
+ * ResetEvent() gives us license to yield either result as long as we act
+ * consistently, but that's not enough. Notably, esync_wait_objects() should
+ * probably act like a fence, so that the second half of esync_set_event() does
+ * not seep past a subsequent reset. That's one problem, but no guarantee there
+ * aren't others. */
+
NTSTATUS esync_set_event( HANDLE handle, LONG *prev )
{
static const uint64_t value = 1;
@@ -583,21 +591,36 @@ NTSTATUS esync_set_event( HANDLE handle, LONG *prev )
if ((ret = get_object( handle, &obj ))) return ret;
event = obj->shm;
- /* Acquire the spinlock. */
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
- small_pause();
+ if (obj->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Acquire the spinlock. */
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
+ small_pause();
+ }
+
+ /* For manual-reset events, as long as we're in a lock, we can take the
+ * optimization of only calling write() if the event wasn't already
+ * signaled.
+ *
+ * For auto-reset events, esync_wait_objects() must grab the kernel object.
+ * Thus if we got into a race so that the shm state is signaled but the
+ * eventfd is unsignaled (i.e. reset shm, set shm, set fd, reset fd), we
+ * *must* signal the fd now, or any waiting threads will never wake up. */
/* Only bother signaling the fd if we weren't already signaled. */
- if (!(current = interlocked_xchg( &event->signaled, 1 )))
+ if (!(current = interlocked_xchg( &event->signaled, 1 )) || obj->type == ESYNC_AUTO_EVENT)
{
if (write( obj->fd, &value, sizeof(value) ) == -1)
- return FILE_GetNtStatus();
+ ERR("write: %s\n", strerror(errno));
}
if (prev) *prev = current;
- /* Release the spinlock. */
- event->locked = 0;
+ if (obj->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Release the spinlock. */
+ event->locked = 0;
+ }
return STATUS_SUCCESS;
}
@@ -615,21 +638,34 @@ NTSTATUS esync_reset_event( HANDLE handle, LONG *prev )
if ((ret = get_object( handle, &obj ))) return ret;
event = obj->shm;
- /* Acquire the spinlock. */
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
- small_pause();
+ if (obj->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Acquire the spinlock. */
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
+ small_pause();
+ }
- /* Only bother signaling the fd if we weren't already signaled. */
- if ((current = interlocked_xchg( &event->signaled, 0 )))
+ /* For manual-reset events, as long as we're in a lock, we can take the
+ * optimization of only calling read() if the event was already signaled.
+ *
+ * For auto-reset events, we have no guarantee that the previous "signaled"
+ * state is actually correct. We need to leave both states unsignaled after
+ * leaving this function, so we always have to read(). */
+ if ((current = interlocked_xchg( &event->signaled, 0 )) || obj->type == ESYNC_AUTO_EVENT)
{
- /* we don't care about the return value */
- read( obj->fd, &value, sizeof(value) );
+ if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN)
+ {
+ ERR("read: %s\n", strerror(errno));
+ }
}
if (prev) *prev = current;
- /* Release the spinlock. */
- event->locked = 0;
+ if (obj->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Release the spinlock. */
+ event->locked = 0;
+ }
return STATUS_SUCCESS;
}
@@ -844,8 +880,9 @@ static void update_grabbed_object( struct esync *obj )
else if (obj->type == ESYNC_AUTO_EVENT)
{
struct event *event = obj->shm;
- /* We don't have to worry about a race between this and read(), for
- * reasons described near esync_set_event(). */
+ /* We don't have to worry about a race between this and read(), since
+ * this is just a hint, and the real state is in the kernel object.
+ * This might already be 0, but that's okay! */
event->signaled = 0;
}
}
@@ -1094,6 +1131,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles,
}
else
{
+ /* FIXME: Could we check the poll or shm state first? Should we? */
if ((size = read( fds[i].fd, &value, sizeof(value) )) == sizeof(value))
{
/* We found our object. */
diff --git a/server/esync.c b/server/esync.c
index 4521993d4..84d0951cb 100644
--- a/server/esync.c
+++ b/server/esync.c
@@ -396,9 +396,12 @@ void esync_set_event( struct esync *esync )
if (debug_level)
fprintf( stderr, "esync_set_event() fd=%d\n", esync->fd );
- /* Acquire the spinlock. */
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
- small_pause();
+ if (esync->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Acquire the spinlock. */
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
+ small_pause();
+ }
if (!interlocked_xchg( &event->signaled, 1 ))
{
@@ -406,8 +409,11 @@ void esync_set_event( struct esync *esync )
perror( "esync: write" );
}
- /* Release the spinlock. */
- event->locked = 0;
+ if (esync->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Release the spinlock. */
+ event->locked = 0;
+ }
}
void esync_reset_event( struct esync *esync )
@@ -421,9 +427,12 @@ void esync_reset_event( struct esync *esync )
if (debug_level)
fprintf( stderr, "esync_reset_event() fd=%d\n", esync->fd );
- /* Acquire the spinlock. */
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
- small_pause();
+ if (esync->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Acquire the spinlock. */
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
+ small_pause();
+ }
/* Only bother signaling the fd if we weren't already signaled. */
if (interlocked_xchg( &event->signaled, 0 ))
@@ -432,8 +441,11 @@ void esync_reset_event( struct esync *esync )
read( esync->fd, &value, sizeof(value) );
}
- /* Release the spinlock. */
- event->locked = 0;
+ if (esync->type == ESYNC_MANUAL_EVENT)
+ {
+ /* Release the spinlock. */
+ event->locked = 0;
+ }
}
DECL_HANDLER(create_esync)
--
2.23.0

View File

@@ -1,4 +1,4 @@
From 8289235edb964f494c221044e36f2ea4294721ae Mon Sep 17 00:00:00 2001
From b0eec9e5d8736bfa86096fd2d69cfb73dba7a5fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 1 Apr 2016 01:29:51 +0200
Subject: [PATCH] fsutil: Add fsutil program with support for creating hard
@@ -14,7 +14,7 @@ Subject: [PATCH] fsutil: Add fsutil program with support for creating hard
create mode 100644 programs/fsutil/resources.h
diff --git a/programs/fsutil/Makefile.in b/programs/fsutil/Makefile.in
index 64307e83ac..e10bd433ba 100644
index 64307e83aca..e10bd433baa 100644
--- a/programs/fsutil/Makefile.in
+++ b/programs/fsutil/Makefile.in
@@ -1,6 +1,9 @@
@@ -29,7 +29,7 @@ index 64307e83ac..e10bd433ba 100644
+RC_SRCS = fsutil.rc
diff --git a/programs/fsutil/fsutil.rc b/programs/fsutil/fsutil.rc
new file mode 100644
index 0000000000..593f8175a2
index 00000000000..593f8175a23
--- /dev/null
+++ b/programs/fsutil/fsutil.rc
@@ -0,0 +1,34 @@
@@ -68,7 +68,7 @@ index 0000000000..593f8175a2
+ STRING_HARDLINK_CREATE_USAGE, "Syntax: fsutil hardlink create old new\n\n"
+}
diff --git a/programs/fsutil/main.c b/programs/fsutil/main.c
index 2bce87edc8..6f7974ad1d 100644
index eb4e3412976..ffef8aecbb1 100644
--- a/programs/fsutil/main.c
+++ b/programs/fsutil/main.c
@@ -1,5 +1,6 @@
@@ -191,7 +191,7 @@ index 2bce87edc8..6f7974ad1d 100644
+ return ret;
+}
+
int wmain(int argc, WCHAR *argv[])
int __cdecl wmain(int argc, WCHAR *argv[])
{
- int i;
+ static const WCHAR hardlinkW[]={'h','a','r','d','l','i','n','k',0};
@@ -222,7 +222,7 @@ index 2bce87edc8..6f7974ad1d 100644
}
diff --git a/programs/fsutil/resources.h b/programs/fsutil/resources.h
new file mode 100644
index 0000000000..b85826ac42
index 00000000000..b85826ac421
--- /dev/null
+++ b/programs/fsutil/resources.h
@@ -0,0 +1,25 @@
@@ -252,5 +252,5 @@ index 0000000000..b85826ac42
+#define STRING_HARDLINK_USAGE 104
+#define STRING_HARDLINK_CREATE_USAGE 105
--
2.23.0.rc1
2.17.1

View File

@@ -1,18 +1,18 @@
From 6addfba7928c62ea5a1a7e9717c564f745523957 Mon Sep 17 00:00:00 2001
From e9f5574ee2a3b6a0b2668747aef7d95c176ece8f Mon Sep 17 00:00:00 2001
From: Mark Jansen <mark.jansen@reactos.org>
Date: Sun, 24 Sep 2017 22:45:22 +0200
Subject: kernel32/tests: Add tests for job object accounting
Subject: [PATCH] kernel32/tests: Add tests for job object accounting
Signed-off-by: Mark Jansen <mark.jansen@reactos.org>
---
dlls/kernel32/tests/process.c | 95 +++++++++++++++++++++++++++++++++++++++++++
dlls/kernel32/tests/process.c | 95 +++++++++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index 07daea82aec..5379684e28d 100644
index f181536e7a6..4c2709cce0e 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -2364,6 +2364,69 @@ static void _create_process(int line, const char *command, LPPROCESS_INFORMATION
@@ -2423,6 +2423,69 @@ static void _create_process(int line, const char *command, LPPROCESS_INFORMATION
ok_(__FILE__, line)(ret, "CreateProcess error %u\n", GetLastError());
}
@@ -82,7 +82,7 @@ index 07daea82aec..5379684e28d 100644
static void test_IsProcessInJob(void)
{
@@ -2390,11 +2453,15 @@ static void test_IsProcessInJob(void)
@@ -2449,11 +2512,15 @@ static void test_IsProcessInJob(void)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %u\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
@@ -96,9 +96,9 @@ index 07daea82aec..5379684e28d 100644
+ test_assigned_proc(job2, 0);
+ test_accounting(job2, 0, 0, 0);
out = TRUE;
ret = pIsProcessInJob(pi.hProcess, NULL, &out);
@@ -2408,11 +2475,15 @@ static void test_IsProcessInJob(void)
ret = pAssignProcessToJobObject(job, pi.hProcess);
ok(ret, "AssignProcessToJobObject error %u\n", GetLastError());
@@ -2462,11 +2529,15 @@ static void test_IsProcessInJob(void)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %u\n", GetLastError());
ok(out, "IsProcessInJob returned out=%u\n", out);
@@ -114,7 +114,7 @@ index 07daea82aec..5379684e28d 100644
out = FALSE;
ret = pIsProcessInJob(pi.hProcess, NULL, &out);
@@ -2428,6 +2499,8 @@ static void test_IsProcessInJob(void)
@@ -2482,6 +2553,8 @@ static void test_IsProcessInJob(void)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %u\n", GetLastError());
ok(out, "IsProcessInJob returned out=%u\n", out);
@@ -123,7 +123,7 @@ index 07daea82aec..5379684e28d 100644
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -2444,11 +2517,15 @@ static void test_TerminateJobObject(void)
@@ -2498,11 +2571,15 @@ static void test_TerminateJobObject(void)
job = pCreateJobObjectW(NULL, NULL);
ok(job != NULL, "CreateJobObject error %u\n", GetLastError());
@@ -139,7 +139,7 @@ index 07daea82aec..5379684e28d 100644
ret = pTerminateJobObject(job, 123);
ok(ret, "TerminateJobObject error %u\n", GetLastError());
@@ -2456,6 +2533,8 @@ static void test_TerminateJobObject(void)
@@ -2510,6 +2587,8 @@ static void test_TerminateJobObject(void)
dwret = WaitForSingleObject(pi.hProcess, 1000);
ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret);
if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0);
@@ -148,7 +148,7 @@ index 07daea82aec..5379684e28d 100644
ret = GetExitCodeProcess(pi.hProcess, &dwret);
ok(ret, "GetExitCodeProcess error %u\n", GetLastError());
@@ -2475,6 +2554,8 @@ static void test_TerminateJobObject(void)
@@ -2529,6 +2608,8 @@ static void test_TerminateJobObject(void)
ret = pAssignProcessToJobObject(job, pi.hProcess);
ok(!ret, "AssignProcessToJobObject unexpectedly succeeded\n");
expect_eq_d(ERROR_ACCESS_DENIED, GetLastError());
@@ -157,7 +157,7 @@ index 07daea82aec..5379684e28d 100644
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -2661,11 +2742,15 @@ static void test_KillOnJobClose(void)
@@ -2715,11 +2796,15 @@ static void test_KillOnJobClose(void)
return;
}
ok(ret, "SetInformationJobObject error %u\n", GetLastError());
@@ -173,7 +173,7 @@ index 07daea82aec..5379684e28d 100644
CloseHandle(job);
@@ -2769,6 +2854,8 @@ static HANDLE test_AddSelfToJob(void)
@@ -2823,6 +2908,8 @@ static HANDLE test_AddSelfToJob(void)
ret = pAssignProcessToJobObject(job, GetCurrentProcess());
ok(ret, "AssignProcessToJobObject error %u\n", GetLastError());
@@ -182,7 +182,7 @@ index 07daea82aec..5379684e28d 100644
return job;
}
@@ -2796,6 +2883,8 @@ static void test_jobInheritance(HANDLE job)
@@ -2850,6 +2937,8 @@ static void test_jobInheritance(HANDLE job)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %u\n", GetLastError());
ok(out, "IsProcessInJob returned out=%u\n", out);
@@ -191,7 +191,7 @@ index 07daea82aec..5379684e28d 100644
dwret = WaitForSingleObject(pi.hProcess, 1000);
ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret);
@@ -2824,6 +2913,8 @@ static void test_BreakawayOk(HANDLE job)
@@ -2878,6 +2967,8 @@ static void test_BreakawayOk(HANDLE job)
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, &si, &pi);
ok(!ret, "CreateProcessA expected failure\n");
expect_eq_d(ERROR_ACCESS_DENIED, GetLastError());
@@ -200,7 +200,7 @@ index 07daea82aec..5379684e28d 100644
if (ret)
{
@@ -2846,6 +2937,8 @@ static void test_BreakawayOk(HANDLE job)
@@ -2900,6 +2991,8 @@ static void test_BreakawayOk(HANDLE job)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %u\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
@@ -209,7 +209,7 @@ index 07daea82aec..5379684e28d 100644
dwret = WaitForSingleObject(pi.hProcess, 1000);
ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret);
@@ -2863,6 +2956,8 @@ static void test_BreakawayOk(HANDLE job)
@@ -2917,6 +3010,8 @@ static void test_BreakawayOk(HANDLE job)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %u\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
@@ -219,5 +219,5 @@ index 07daea82aec..5379684e28d 100644
dwret = WaitForSingleObject(pi.hProcess, 1000);
ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret);
--
2.14.1
2.23.0

View File

@@ -1,36 +1,37 @@
From 04ccb4bc45d41ab247076f3d83329236a1c30125 Mon Sep 17 00:00:00 2001
From 495a42ea564348e860c036803c89ce3650dd0a27 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 3 Jan 2015 20:55:43 -0700
Subject: kernel32: Consider the working directory first when launching
Subject: [PATCH] kernel32: Consider the working directory first when launching
executables with CreateProcess.
---
dlls/kernel32/process.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
dlls/kernel32/process.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 98ea09b..a5433d7 100644
index 0a2192b246..ed78c0a01b 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -441,9 +441,17 @@ static HANDLE open_exe_file( const WCHAR *name, BOOL *is_64bit )
@@ -439,6 +439,7 @@ static HANDLE open_exe_file( const WCHAR *name, BOOL *is_64bit )
*/
static BOOL find_exe_file( const WCHAR *name, WCHAR *buffer, int buflen, HANDLE *handle )
{
+ WCHAR cur_dir[MAX_PATH];
+
TRACE("looking for %s\n", debugstr_w(name) );
WCHAR *load_path;
BOOL ret;
- if (!SearchPathW( NULL, name, exeW, buflen, buffer, NULL ) &&
+ /* The working directory takes precedence over other locations for CreateProcess unless the
+ * 'NoDefaultCurrentDirectoryInExePath' environment variable is set (and the executable name
+ * does not contain a backslash). */
+ if ((NeedCurrentDirectoryForExePathW( name ) && GetCurrentDirectoryW( MAX_PATH, cur_dir) &&
+ !SearchPathW( cur_dir, name, exeW, buflen, buffer, NULL )) &&
+ /* not found in the working directory, try the system search path */
+ !SearchPathW( NULL, name, exeW, buflen, buffer, NULL ) &&
/* no builtin found, try native without extension in case it is a Unix app */
!SearchPathW( NULL, name, NULL, buflen, buffer, NULL )) return FALSE;
@@ -446,7 +447,10 @@ static BOOL find_exe_file( const WCHAR *name, WCHAR *buffer, int buflen, HANDLE
TRACE("looking for %s in %s\n", debugstr_w(name), debugstr_w(load_path) );
- ret = (SearchPathW( load_path, name, exeW, buflen, buffer, NULL ) ||
+ ret = (NeedCurrentDirectoryForExePathW( name ) && GetCurrentDirectoryW( MAX_PATH, cur_dir) &&
+ SearchPathW( cur_dir, name, exeW, buflen, buffer, NULL )) ||
+ /* not found in the working directory, try the system search path */
+ (SearchPathW( load_path, name, exeW, buflen, buffer, NULL ) ||
/* no builtin found, try native without extension in case it is a Unix app */
SearchPathW( load_path, name, NULL, buflen, buffer, NULL ));
RtlReleasePath( load_path );
--
2.7.4
2.21.0

View File

@@ -1,43 +1,44 @@
From 76e5668f6371a5e3fe8bc524fc25080e375fb680 Mon Sep 17 00:00:00 2001
From 54e9832efd935277864c1faa0cb070676d2079a9 Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Tue, 19 Apr 2016 07:36:41 +0200
Subject: [PATCH 3/3] kernel32: Make system DEP policy affect
Subject: [PATCH] kernel32: Make system DEP policy affect
GetProcessDEPPolicy().
---
dlls/kernel32/process.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
dlls/kernel32/process.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 6bf31516ca..2446491b10 100644
index 958b437cea..d7a444a314 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -4629,14 +4629,21 @@ BOOL WINAPI GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
if (flags)
{
*flags = 0;
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE)
- *flags |= PROCESS_DEP_ENABLE;
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
- *flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
+ if (system_DEP_policy != AlwaysOff)
+ {
+ if (dep_flags & MEM_EXECUTE_OPTION_DISABLE || system_DEP_policy == AlwaysOn)
+ *flags |= PROCESS_DEP_ENABLE;
+ if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
+ *flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
+ }
}
if (permanent)
@@ -3904,13 +3904,21 @@ BOOL WINAPI GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
if (flags)
{
*flags = 0;
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE)
- *flags |= PROCESS_DEP_ENABLE;
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
- *flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
+ if (system_DEP_policy != AlwaysOff)
+ {
*permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
+ if (system_DEP_policy == AlwaysOn || system_DEP_policy == AlwaysOff)
+ *permanent = TRUE;
+ if (dep_flags & MEM_EXECUTE_OPTION_DISABLE || system_DEP_policy == AlwaysOn)
+ *flags |= PROCESS_DEP_ENABLE;
+ if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
+ *flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
+ }
}
if (status) SetLastError( RtlNtStatusToDosError(status) );
- if (permanent) *permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
+ if (permanent)
+ {
+ *permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
+ if (system_DEP_policy == AlwaysOn || system_DEP_policy == AlwaysOff)
+ *permanent = TRUE;
+ }
return TRUE;
}
--
2.17.1
2.23.0

View File

@@ -1,32 +1,46 @@
From c9e0926469230f97d3cee6bc22b7d27099f1d555 Mon Sep 17 00:00:00 2001
From e319578c8c47d7a2f7303f39de7f20e0d10e6675 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 30 May 2015 02:23:15 +0200
Subject: [PATCH] ntdll: Add support for hiding wine version information from
applications.
---
dlls/ntdll/loader.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++-
dlls/ntdll/loader.c | 99 ++++++++++++++++++++++++++++++++++++++++-
dlls/ntdll/ntdll_misc.h | 5 +++
2 files changed, 100 insertions(+), 1 deletion(-)
2 files changed, 103 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 7588d5a..8073434 100644
index 174569d3cf..2dc0202b36 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -68,9 +68,12 @@ typedef void (CALLBACK *LDRENUMPROC)(LDR_MODULE *, void *, BOOLEAN *);
@@ -68,6 +68,7 @@ typedef void (CALLBACK *LDRENUMPROC)(LDR_MODULE *, void *, BOOLEAN *);
const WCHAR system_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
's','y','s','t','e','m','3','2','\\',0};
+
/* system search path */
static const WCHAR system_path[] =
{'C',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2',';',
@@ -76,6 +77,9 @@ static const WCHAR system_path[] =
static const WCHAR dotW[] = {'.',0};
+#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
+
+
static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */
static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
+static BOOL hide_wine_exports = FALSE; /* try to hide ntdll wine exports from applications */
@@ -92,6 +96,8 @@ struct dll_dir_entry
static struct list dll_dir_list = LIST_INIT( dll_dir_list ); /* extra dirs from LdrAddDllDirectory */
+static BOOL hide_wine_exports = FALSE; /* try to hide ntdll wine exports from applications */
+
struct ldr_notification
{
@@ -1602,6 +1605,96 @@ NTSTATUS WINAPI LdrUnlockLoaderLock( ULONG flags, ULONG_PTR magic )
struct list entry;
@@ -1707,6 +1713,96 @@ NTSTATUS WINAPI LdrUnlockLoaderLock( ULONG flags, ULONG_PTR magic )
}
@@ -123,7 +137,7 @@ index 7588d5a..8073434 100644
/******************************************************************
* LdrGetProcedureAddress (NTDLL.@)
*/
@@ -1622,7 +1715,7 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
@@ -1727,7 +1823,7 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
void *proc = name ? find_named_export( module, exports, exp_size, name->Buffer, -1, load_path )
: find_ordinal_export( module, exports, exp_size, ord - exports->Base, load_path );
@@ -132,7 +146,7 @@ index 7588d5a..8073434 100644
{
*address = proc;
ret = STATUS_SUCCESS;
@@ -3576,6 +3669,7 @@ void __wine_process_init(void)
@@ -4289,6 +4385,7 @@ void __wine_process_init(void)
NtCurrentTeb()->Peb->LoaderLock = &loader_section;
update_user_process_params( &wm->ldr.FullDllName );
version_init( wm->ldr.FullDllName.Buffer );
@@ -141,10 +155,10 @@ index 7588d5a..8073434 100644
LdrQueryImageFileExecutionOptions( &wm->ldr.FullDllName, globalflagW, REG_DWORD,
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index c21ec79..0dba878 100644
index a111530534..e7bf510c28 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -260,6 +260,11 @@ extern SYSTEM_CPU_INFORMATION cpu_info DECLSPEC_HIDDEN;
@@ -269,6 +269,11 @@ extern SYSTEM_CPU_INFORMATION cpu_info DECLSPEC_HIDDEN;
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
@@ -157,5 +171,5 @@ index c21ec79..0dba878 100644
extern BOOL read_process_time(int unix_pid, int unix_tid, unsigned long clk_tck,
LARGE_INTEGER *kernel, LARGE_INTEGER *user) DECLSPEC_HIDDEN;
--
1.9.1
2.21.0

View File

@@ -1,20 +1,20 @@
From 641f298192f9c21e2e02f0e5296771454d3467d3 Mon Sep 17 00:00:00 2001
From b53336eeca65aa2dbf11c2d80a731ca904fe81de Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:02:11 -0700
Subject: kernel32,ntdll: Add support for deleting junction points with
Subject: [PATCH] kernel32,ntdll: Add support for deleting junction points with
RemoveDirectory.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/kernel32/path.c | 20 +++++++++++++-------
dlls/kernel32/path.c | 19 +++++++++++++------
dlls/ntdll/tests/file.c | 34 +++++++++++++++++++++++++++++++++-
2 files changed, 46 insertions(+), 8 deletions(-)
2 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index 5fed28da0e..5ef66b5913 100644
index b580e367561..9fa7d4c9f27 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -1696,6 +1696,7 @@ BOOL WINAPI CreateDirectoryExW( LPCWSTR template, LPCWSTR path, LPSECURITY_ATTRI
@@ -1058,6 +1058,7 @@ BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBU
*/
BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
{
@@ -22,15 +22,14 @@ index 5fed28da0e..5ef66b5913 100644
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nt_name;
ANSI_STRING unix_name;
@@ -1729,16 +1730,21 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
@@ -1089,15 +1090,21 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
}
status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE );
- RtlFreeUnicodeString( &nt_name );
- if (status != STATUS_SUCCESS)
- if (!set_ntstatus( status ))
+ if (status == STATUS_SUCCESS)
{
- SetLastError( RtlNtStatusToDosError(status) );
- NtClose( handle );
- return FALSE;
+ status = NtQueryAttributesFile( &attr, &info );
@@ -43,7 +42,7 @@ index 5fed28da0e..5ef66b5913 100644
+ RtlFreeAnsiString( &unix_name );
}
+ else
+ SetLastError( RtlNtStatusToDosError(status) );
+ set_ntstatus( status );
+ RtlFreeUnicodeString( &nt_name );
- if (!(ret = (rmdir( unix_name.Buffer ) != -1))) FILE_SetDosError();
@@ -52,10 +51,10 @@ index 5fed28da0e..5ef66b5913 100644
return ret;
}
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index e1f216370d..71e7dd56f3 100644
index d7b2f9aa0d9..e8cdb661772 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -4869,7 +4869,7 @@ static void test_reparse_points(void)
@@ -4938,7 +4938,7 @@ static void test_reparse_points(void)
REPARSE_GUID_DATA_BUFFER guid_buffer;
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
@@ -64,7 +63,7 @@ index e1f216370d..71e7dd56f3 100644
INT buffer_len, string_len;
IO_STATUS_BLOCK iosb;
UNICODE_STRING nameW;
@@ -4958,6 +4958,38 @@ static void test_reparse_points(void)
@@ -5027,6 +5027,38 @@ static void test_reparse_points(void)
"Junction point folder's access time does not match.\n");
CloseHandle(handle);
@@ -104,5 +103,5 @@ index e1f216370d..71e7dd56f3 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
--
2.17.1
2.23.0

View File

@@ -1,19 +1,19 @@
From f8bce6f4c951b6d5b1b3473b272a3fe20df0aa39 Mon Sep 17 00:00:00 2001
From 647e8f79cc877f9baaf9cf29f7d6d9999c3960c9 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 13 Mar 2019 16:02:05 -0600
Subject: kernel32: Implement CreateSymbolicLink[A|W] with ntdll reparse
points.
Subject: [PATCH] kernel32: Implement CreateSymbolicLink[A|W] with ntdll
reparse points.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/kernel32/path.c | 124 +++++++++++++++++++++++++++++++--
dlls/kernel32/tests/path.c | 94 +++++++++++++++++++++++++
dlls/kernel32/tests/path.c | 96 +++++++++++++++++++++++++
dlls/msvcp120/tests/msvcp120.c | 75 +++++++++-----------
dlls/msvcp140/tests/msvcp140.c | 63 +++++++----------
4 files changed, 275 insertions(+), 81 deletions(-)
4 files changed, 277 insertions(+), 81 deletions(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index 227473f71a..fd69cdede4 100644
index 31da8fed4f..2e57a3b38c 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -34,6 +34,8 @@
@@ -25,7 +25,7 @@ index 227473f71a..fd69cdede4 100644
#include "kernel_private.h"
#include "wine/unicode.h"
@@ -2087,8 +2089,106 @@ WCHAR * CDECL wine_get_dos_file_name( LPCSTR str )
@@ -1260,8 +1262,106 @@ WCHAR * CDECL wine_get_dos_file_name( LPCSTR str )
*/
BOOLEAN WINAPI CreateSymbolicLinkW(LPCWSTR link, LPCWSTR target, DWORD flags)
{
@@ -134,7 +134,7 @@ index 227473f71a..fd69cdede4 100644
}
/*************************************************************************
@@ -2096,8 +2196,24 @@ BOOLEAN WINAPI CreateSymbolicLinkW(LPCWSTR link, LPCWSTR target, DWORD flags)
@@ -1269,8 +1369,24 @@ BOOLEAN WINAPI CreateSymbolicLinkW(LPCWSTR link, LPCWSTR target, DWORD flags)
*/
BOOLEAN WINAPI CreateSymbolicLinkA(LPCSTR link, LPCSTR target, DWORD flags)
{
@@ -162,10 +162,10 @@ index 227473f71a..fd69cdede4 100644
/*************************************************************************
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index f15cc09ee5..346591990f 100644
index 71577793b0..11b5ea35f0 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -81,6 +81,9 @@ static void (WINAPI *pReleaseActCtx)(HANDLE);
@@ -92,6 +92,9 @@ static void (WINAPI *pReleaseActCtx)(HANDLE);
static BOOL (WINAPI *pCheckNameLegalDOS8Dot3W)(const WCHAR *, char *, DWORD, BOOL *, BOOL *);
static BOOL (WINAPI *pCheckNameLegalDOS8Dot3A)(const char *, char *, DWORD, BOOL *, BOOL *);
@@ -175,16 +175,23 @@ index f15cc09ee5..346591990f 100644
/* a structure to deal with wine todos somewhat cleanly */
typedef struct {
DWORD shortlen;
@@ -2202,6 +2205,7 @@ static void init_pointers(void)
@@ -2217,11 +2220,14 @@ static void init_pointers(void)
MAKEFUNC(ReleaseActCtx);
MAKEFUNC(CheckNameLegalDOS8Dot3W);
MAKEFUNC(CheckNameLegalDOS8Dot3A);
+ MAKEFUNC(CreateSymbolicLinkW);
+
mod = GetModuleHandleA("ntdll.dll");
MAKEFUNC(LdrGetDllPath);
MAKEFUNC(RtlGetExePath);
MAKEFUNC(RtlGetSearchPath);
MAKEFUNC(RtlReleasePath);
+
#undef MAKEFUNC
}
@@ -2458,6 +2462,95 @@ static void test_SetSearchPathMode(void)
RemoveDirectoryA( dir );
@@ -2744,6 +2750,95 @@ static void test_LdrGetDllPath(void)
SetEnvironmentVariableW( pathW, old_path );
}
+static void test_CreateSymbolicLink(void)
@@ -279,17 +286,17 @@ index f15cc09ee5..346591990f 100644
START_TEST(path)
{
CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive;
@@ -2492,4 +2585,5 @@ START_TEST(path)
test_GetFullPathNameW();
test_CheckNameLegalDOS8Dot3();
test_SetSearchPathMode();
@@ -2781,4 +2876,5 @@ START_TEST(path)
test_RtlGetSearchPath();
test_RtlGetExePath();
test_LdrGetDllPath();
+ test_CreateSymbolicLink();
}
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index c416a1020b..e0c97ebcaa 100644
index 8f7b75aab4..77d8c37754 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -1636,15 +1636,14 @@ static void test_tr2_sys__Stat(void)
@@ -1622,15 +1622,14 @@ static void test_tr2_sys__Stat(void)
char const *path;
enum file_type ret;
int err_code;
@@ -312,7 +319,7 @@ index c416a1020b..e0c97ebcaa 100644
};
WCHAR testW[] = {'t','r','2','_','t','e','s','t','_','d','i','r',0};
WCHAR testW2[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','f','1',0};
@@ -1689,16 +1688,14 @@ static void test_tr2_sys__Stat(void)
@@ -1675,16 +1674,14 @@ static void test_tr2_sys__Stat(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
err_code = 0xdeadbeef;
val = p_tr2_sys__Stat(tests[i].path, &err_code);
@@ -331,7 +338,7 @@ index c416a1020b..e0c97ebcaa 100644
ok(tests[i].err_code == err_code, "tr2_sys__Lstat(): test %d err_code expect: %d, got %d\n",
i+1, tests[i].err_code, err_code);
}
@@ -1713,8 +1710,8 @@ static void test_tr2_sys__Stat(void)
@@ -1699,8 +1696,8 @@ static void test_tr2_sys__Stat(void)
ok(ERROR_SUCCESS == err_code, "tr2_sys__Lstat_wchar(): err_code expect ERROR_SUCCESS, got %d\n", err_code);
if(ret) {
@@ -342,7 +349,7 @@ index c416a1020b..e0c97ebcaa 100644
}
ok(DeleteFileA("tr2_test_dir/f1"), "expect tr2_test_dir/f1 to exist\n");
ok(RemoveDirectoryA("tr2_test_dir"), "expect tr2_test_dir to exist\n");
@@ -1944,16 +1941,15 @@ static void test_tr2_sys__Symlink(void)
@@ -1930,16 +1927,15 @@ static void test_tr2_sys__Symlink(void)
char const *existing_path;
char const *new_path;
int last_error;
@@ -367,7 +374,7 @@ index c416a1020b..e0c97ebcaa 100644
};
ret = p_tr2_sys__Make_dir("tr2_test_dir");
@@ -1978,18 +1974,17 @@ static void test_tr2_sys__Symlink(void)
@@ -1964,18 +1960,17 @@ static void test_tr2_sys__Symlink(void)
}
ok(errno == 0xdeadbeef, "tr2_sys__Symlink(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno);
@@ -392,7 +399,7 @@ index c416a1020b..e0c97ebcaa 100644
ret = p_tr2_sys__Remove_dir("tr2_test_dir");
ok(ret == 1, "tr2_sys__Remove_dir(): expect 1 got %d\n", ret);
}
@@ -2003,15 +1998,14 @@ static void test_tr2_sys__Unlink(void)
@@ -1989,15 +1984,14 @@ static void test_tr2_sys__Unlink(void)
struct {
char const *path;
int last_error;
@@ -415,7 +422,7 @@ index c416a1020b..e0c97ebcaa 100644
};
GetCurrentDirectoryA(MAX_PATH, current_path);
@@ -2040,9 +2034,8 @@ static void test_tr2_sys__Unlink(void)
@@ -2026,9 +2020,8 @@ static void test_tr2_sys__Unlink(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
errno = 0xdeadbeef;
ret = p_tr2_sys__Unlink(tests[i].path);
@@ -538,5 +545,5 @@ index 04406240e0..46b2b8595d 100644
}
--
2.17.1
2.21.0

View File

@@ -1,3 +1,4 @@
Fixes: [46149] ntdll: Implement RtlIpv4StringToAddress(Ex)A/W
#Fixes: [46149] ntdll: Implement RtlIpv4StringToAddress(Ex)A/W
Fixes: [46788] ntdll: Implement RtlIpv6AddressToStringA

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