Skip to content

Commit 05cf233

Browse files
patches: import more pending game patches from ge
1 parent 797414f commit 05cf233

6 files changed

+465
-0
lines changed

patches/protonprep-valve-staging.sh

+15
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,23 @@
4444
echo "WINE: -PENDING- Add WINE_DISABLE_SFN option. (Yakuza 5 cutscenes fix)"
4545
patch -Np1 < ../patches/wine-hotfixes/pending/ntdll_add_wine_disable_sfn.patch
4646

47+
echo "WINE: -PENDING- Add TCP_KEEP patch (Star Citizen Launcher 2.0 fix)"
48+
patch -Np1 < ../patches/wine-hotfixes/pending/TCP_KEEP-fixup.patch
49+
50+
echo "WINE: -PENDING- shell32: Implement some file_operation apis. (Solo Leveling netmarble launcher)"
51+
# https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
52+
patch -Np1 < ../patches/wine-hotfixes/pending/5671.patch
53+
54+
echo "WINE: -PENDING- ncrypt: NCryptDecrypt implementation (PSN Login for Ghost of Tsushima)"
55+
patch -Np1 < ../patches/wine-hotfixes/pending/NCryptDecrypt_implementation.patch
56+
57+
echo "WINE: -PENDING- DXGI_FORMAT_R8G8B8A8_UNORM: Suport for DXGI_FORMAT_R8G8B8A8_UNORM on d2d_wic_render_target_init (Alt:V GTA V coustom client)"
58+
patch -Np1 < ../patches/wine-hotfixes/pending/support_for_DXGI_FORMAT_R8G8B8A8_UNORM.patch
59+
4760
### END WINE PENDING UPSTREAM SECTION ###
4861

62+
echo "WINE: -PENDING- Add options to disable proton media converter."
63+
patch -Np1 < ../patches/wine-hotfixes/pending/add-envvar-to-gate-media-converter.patch
4964

5065
popd
5166

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
From b020348b843b6ed4fff718877913103d9c27ce49 Mon Sep 17 00:00:00 2001
2+
From: Etaash Mathamsetty <[email protected]>
3+
Date: Tue, 14 May 2024 19:48:18 -0400
4+
Subject: [PATCH 1/4] shell32: Fake success file_operation_SetOperationFlags.
5+
6+
---
7+
dlls/shell32/shlfileop.c | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
11+
index a7e88c813d2..63779600ced 100644
12+
--- a/dlls/shell32/shlfileop.c
13+
+++ b/dlls/shell32/shlfileop.c
14+
@@ -1874,7 +1874,7 @@ static HRESULT WINAPI file_operation_SetOperationFlags(IFileOperation *iface, DW
15+
{
16+
FIXME("(%p, %lx): stub.\n", iface, flags);
17+
18+
- return E_NOTIMPL;
19+
+ return S_OK;
20+
}
21+
22+
static HRESULT WINAPI file_operation_SetProgressMessage(IFileOperation *iface, LPCWSTR message)
23+
--
24+
GitLab
25+
26+
27+
From 8201fd2217ed72858141f376468b0c1f56eff8ce Mon Sep 17 00:00:00 2001
28+
From: Etaash Mathamsetty <[email protected]>
29+
Date: Tue, 14 May 2024 19:50:29 -0400
30+
Subject: [PATCH 2/4] shell32: Add semi-stub for file_operation_MoveItem.
31+
32+
---
33+
dlls/shell32/shlfileop.c | 37 +++++++++++++++++++++++++++++++++++--
34+
1 file changed, 35 insertions(+), 2 deletions(-)
35+
36+
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
37+
index 63779600ced..c3602a46928 100644
38+
--- a/dlls/shell32/shlfileop.c
39+
+++ b/dlls/shell32/shlfileop.c
40+
@@ -1937,9 +1937,42 @@ static HRESULT WINAPI file_operation_RenameItems(IFileOperation *iface, IUnknown
41+
static HRESULT WINAPI file_operation_MoveItem(IFileOperation *iface, IShellItem *item, IShellItem *folder,
42+
LPCWSTR name, IFileOperationProgressSink *sink)
43+
{
44+
- FIXME("(%p, %p, %p, %s, %p): stub.\n", iface, item, folder, debugstr_w(name), sink);
45+
+ LPWSTR source;
46+
+ LPWSTR dest;
47+
+ HRESULT hr;
48+
+ BOOL ret;
49+
+ FIXME("(%p, %p, %p, %s, %p): semi-stub.\n", iface, item, folder, debugstr_w(name), sink);
50+
51+
- return E_NOTIMPL;
52+
+ hr = IShellItem_GetDisplayName(item, SIGDN_FILESYSPATH, &source);
53+
+
54+
+ if (FAILED(hr))
55+
+ return hr;
56+
+
57+
+ hr = IShellItem_GetDisplayName(folder, SIGDN_FILESYSPATH, &dest);
58+
+
59+
+ if (FAILED(hr))
60+
+ {
61+
+ CoTaskMemFree(source);
62+
+ return hr;
63+
+ }
64+
+
65+
+ dest = CoTaskMemRealloc(dest, (lstrlenW(dest) + lstrlenW(name) + 2) * sizeof(WCHAR));
66+
+
67+
+ if (!dest)
68+
+ {
69+
+ CoTaskMemFree(source);
70+
+ return E_OUTOFMEMORY;
71+
+ }
72+
+
73+
+ wcscat(dest, L"\\");
74+
+ wcscat(dest, name);
75+
+
76+
+ ret = MoveFileW(source, dest);
77+
+
78+
+ CoTaskMemFree(source);
79+
+ CoTaskMemFree(dest);
80+
+
81+
+ return ret ? S_OK : E_FAIL;
82+
}
83+
84+
static HRESULT WINAPI file_operation_MoveItems(IFileOperation *iface, IUnknown *items, IShellItem *folder)
85+
--
86+
GitLab
87+
88+
89+
From cc808a4a2e2cf1fb577642f88468983c77592e44 Mon Sep 17 00:00:00 2001
90+
From: Etaash Mathamsetty <[email protected]>
91+
Date: Tue, 14 May 2024 19:52:15 -0400
92+
Subject: [PATCH 3/4] shell32: Fake success for
93+
file_operation_PerformOperations.
94+
95+
---
96+
dlls/shell32/shlfileop.c | 2 +-
97+
1 file changed, 1 insertion(+), 1 deletion(-)
98+
99+
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
100+
index c3602a46928..4ed9c64a3ce 100644
101+
--- a/dlls/shell32/shlfileop.c
102+
+++ b/dlls/shell32/shlfileop.c
103+
@@ -2025,7 +2025,7 @@ static HRESULT WINAPI file_operation_PerformOperations(IFileOperation *iface)
104+
{
105+
FIXME("(%p): stub.\n", iface);
106+
107+
- return E_NOTIMPL;
108+
+ return S_OK;
109+
}
110+
111+
static HRESULT WINAPI file_operation_GetAnyOperationsAborted(IFileOperation *iface, BOOL *aborted)
112+
--
113+
GitLab
114+
115+
116+
From 71f2f49ab41aeb9ff9acab744bfbb1e5e0c2cd93 Mon Sep 17 00:00:00 2001
117+
From: Etaash Mathamsetty <[email protected]>
118+
Date: Tue, 14 May 2024 19:52:58 -0400
119+
Subject: [PATCH 4/4] shell32: Fake success for
120+
file_operation_GetAnyOperationsAborted.
121+
122+
---
123+
dlls/shell32/shlfileop.c | 4 +++-
124+
1 file changed, 3 insertions(+), 1 deletion(-)
125+
126+
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
127+
index 4ed9c64a3ce..f4b3ae1c25b 100644
128+
--- a/dlls/shell32/shlfileop.c
129+
+++ b/dlls/shell32/shlfileop.c
130+
@@ -2032,7 +2032,9 @@ static HRESULT WINAPI file_operation_GetAnyOperationsAborted(IFileOperation *ifa
131+
{
132+
FIXME("(%p, %p): stub.\n", iface, aborted);
133+
134+
- return E_NOTIMPL;
135+
+ *aborted = FALSE;
136+
+
137+
+ return S_OK;
138+
}
139+
140+
static const IFileOperationVtbl file_operation_vtbl =
141+
--
142+
GitLab
143+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c
2+
index 3511f8f2d3f..656c80a5cb9 100644
3+
--- a/dlls/ncrypt/main.c
4+
+++ b/dlls/ncrypt/main.c
5+
@@ -212,9 +212,22 @@ SECURITY_STATUS WINAPI NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE provider, NCR
6+
SECURITY_STATUS WINAPI NCryptDecrypt(NCRYPT_KEY_HANDLE key, BYTE *input, DWORD insize, void *padding,
7+
BYTE *output, DWORD outsize, DWORD *result, DWORD flags)
8+
{
9+
- FIXME("(%#Ix, %p, %lu, %p, %p, %lu, %p, %#lx): stub\n", key, input, insize, padding,
10+
+ struct object *key_object = (struct object *)key;
11+
+
12+
+ FIXME("(%#Ix, %p, %lu, %p, %p, %lu, %p, %#lx):\n", key, input, insize, padding,
13+
output, outsize, result, flags);
14+
- return NTE_NOT_SUPPORTED;
15+
+
16+
+ if (flags & ~(NCRYPT_NO_PADDING_FLAG | NCRYPT_PAD_OAEP_FLAG
17+
+ | NCRYPT_PAD_PKCS1_FLAG | NCRYPT_SILENT_FLAG))
18+
+ {
19+
+ FIXME("Flags %lx not supported\n", flags);
20+
+ return NTE_BAD_FLAGS;
21+
+ }
22+
+
23+
+ if (key_object->type != KEY) return NTE_INVALID_HANDLE;
24+
+
25+
+ return map_ntstatus(BCryptDecrypt(key_object->key.bcrypt_key, input, insize, padding,
26+
+ NULL, 0, output, outsize, result, flags));
27+
}
28+
29+
SECURITY_STATUS WINAPI NCryptDeleteKey(NCRYPT_KEY_HANDLE key, DWORD flags)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
From 6d2a900487bb9a41f16de4f0092cc9345580e356 Mon Sep 17 00:00:00 2001
2+
From: Florian Will <[email protected]>
3+
Date: Thu, 29 Feb 2024 13:15:02 +0100
4+
Subject: [PATCH 1/3] include: Add TCP_KEEPCNT and TCP_KEEPINTVL definitions.
5+
6+
---
7+
include/ws2ipdef.h | 4 ++++
8+
1 file changed, 4 insertions(+)
9+
10+
diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h
11+
index fcb1f56c005..72e2dad2fa5 100644
12+
--- a/include/ws2ipdef.h
13+
+++ b/include/ws2ipdef.h
14+
@@ -313,6 +313,8 @@ typedef struct WS(in6_pktinfo) {
15+
#define TCP_OFFLOAD_PREFERENCE 11
16+
#define TCP_CONGESTION_ALGORITHM 12
17+
#define TCP_DELAY_FIN_ACK 13
18+
+#define TCP_KEEPCNT 16
19+
+#define TCP_KEEPINTVL 17
20+
#else
21+
/* WS_TCP_NODELAY is defined elsewhere */
22+
#define WS_TCP_EXPEDITED_1122 2
23+
@@ -327,6 +329,8 @@ typedef struct WS(in6_pktinfo) {
24+
#define WS_TCP_OFFLOAD_PREFERENCE 11
25+
#define WS_TCP_CONGESTION_ALGORITHM 12
26+
#define WS_TCP_DELAY_FIN_ACK 13
27+
+#define WS_TCP_KEEPCNT 16
28+
+#define WS_TCP_KEEPINTVL 17
29+
#endif /* USE_WS_PREFIX */
30+
31+
#define PROTECTION_LEVEL_UNRESTRICTED 10
32+
--
33+
GitLab
34+
35+
36+
From 8dc5242e2998afed87bc57db5798eea85877094e Mon Sep 17 00:00:00 2001
37+
From: Florian Will <[email protected]>
38+
Date: Thu, 29 Feb 2024 13:48:32 +0100
39+
Subject: [PATCH 3/3] ws2_32: Implement TCP_KEEP{ALIVE,CNT,INTVL} options.
40+
41+
---
42+
dlls/ntdll/unix/socket.c | 28 ++++++++++++++++++
43+
dlls/ws2_32/socket.c | 63 ++++++++++++++++++++++++++++++++++++++++
44+
dlls/ws2_32/tests/sock.c | 18 ++++++------
45+
include/wine/afd.h | 6 ++++
46+
4 files changed, 106 insertions(+), 9 deletions(-)
47+
48+
diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c
49+
index 4e6781df607..4b0dca37e7d 100644
50+
--- a/dlls/ntdll/unix/socket.c
51+
+++ b/dlls/ntdll/unix/socket.c
52+
@@ -2507,6 +2507,34 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
53+
case IOCTL_AFD_WINE_SET_TCP_NODELAY:
54+
return do_setsockopt( handle, io, IPPROTO_TCP, TCP_NODELAY, in_buffer, in_size );
55+
56+
+#if defined(TCP_KEEPIDLE)
57+
+ /* TCP_KEEPALIVE on Windows is often called TCP_KEEPIDLE on Unix */
58+
+ case IOCTL_AFD_WINE_GET_TCP_KEEPALIVE:
59+
+ return do_getsockopt( handle, io, IPPROTO_TCP, TCP_KEEPIDLE, out_buffer, out_size );
60+
+
61+
+ case IOCTL_AFD_WINE_SET_TCP_KEEPALIVE:
62+
+ return do_setsockopt( handle, io, IPPROTO_TCP, TCP_KEEPIDLE, in_buffer, in_size );
63+
+#elif defined(TCP_KEEPALIVE)
64+
+ /* Mac */
65+
+ case IOCTL_AFD_WINE_GET_TCP_KEEPALIVE:
66+
+ return do_getsockopt( handle, io, IPPROTO_TCP, TCP_KEEPALIVE, out_buffer, out_size );
67+
+
68+
+ case IOCTL_AFD_WINE_SET_TCP_KEEPALIVE:
69+
+ return do_setsockopt( handle, io, IPPROTO_TCP, TCP_KEEPALIVE, in_buffer, in_size );
70+
+#endif
71+
+
72+
+ case IOCTL_AFD_WINE_GET_TCP_KEEPINTVL:
73+
+ return do_getsockopt( handle, io, IPPROTO_TCP, TCP_KEEPINTVL, out_buffer, out_size );
74+
+
75+
+ case IOCTL_AFD_WINE_SET_TCP_KEEPINTVL:
76+
+ return do_setsockopt( handle, io, IPPROTO_TCP, TCP_KEEPINTVL, in_buffer, in_size );
77+
+
78+
+ case IOCTL_AFD_WINE_GET_TCP_KEEPCNT:
79+
+ return do_getsockopt( handle, io, IPPROTO_TCP, TCP_KEEPCNT, out_buffer, out_size );
80+
+
81+
+ case IOCTL_AFD_WINE_SET_TCP_KEEPCNT:
82+
+ return do_setsockopt( handle, io, IPPROTO_TCP, TCP_KEEPCNT, in_buffer, in_size );
83+
+
84+
default:
85+
{
86+
if ((code >> 16) == FILE_DEVICE_NETWORK)
87+
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
88+
index 6aab249a1b8..eb84558cbac 100644
89+
--- a/dlls/ws2_32/socket.c
90+
+++ b/dlls/ws2_32/socket.c
91+
@@ -1931,6 +1931,36 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
92+
*optlen = 1;
93+
return server_getsockopt( s, IOCTL_AFD_WINE_GET_TCP_NODELAY, optval, optlen );
94+
95+
+ case TCP_KEEPALIVE:
96+
+ if (*optlen < sizeof(DWORD) || !optval)
97+
+ {
98+
+ *optlen = 0;
99+
+ SetLastError( WSAEFAULT );
100+
+ return SOCKET_ERROR;
101+
+ }
102+
+ *optlen = sizeof(DWORD);
103+
+ return server_getsockopt( s, IOCTL_AFD_WINE_GET_TCP_KEEPALIVE, optval, optlen );
104+
+
105+
+ case TCP_KEEPCNT:
106+
+ if (*optlen < sizeof(DWORD) || !optval)
107+
+ {
108+
+ *optlen = 0;
109+
+ SetLastError( WSAEFAULT );
110+
+ return SOCKET_ERROR;
111+
+ }
112+
+ *optlen = sizeof(DWORD);
113+
+ return server_getsockopt( s, IOCTL_AFD_WINE_GET_TCP_KEEPCNT, optval, optlen );
114+
+
115+
+ case TCP_KEEPINTVL:
116+
+ if (*optlen < sizeof(DWORD) || !optval)
117+
+ {
118+
+ *optlen = 0;
119+
+ SetLastError( WSAEFAULT );
120+
+ return SOCKET_ERROR;
121+
+ }
122+
+ *optlen = sizeof(DWORD);
123+
+ return server_getsockopt( s, IOCTL_AFD_WINE_GET_TCP_KEEPINTVL, optval, optlen );
124+
+
125+
default:
126+
FIXME( "unrecognized TCP option %#x\n", optname );
127+
SetLastError( WSAENOPROTOOPT );
128+
@@ -3325,6 +3355,12 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int
129+
break; /* case NSPROTO_IPX */
130+
131+
case IPPROTO_TCP:
132+
+ if (optlen < 0)
133+
+ {
134+
+ SetLastError(WSAENOBUFS);
135+
+ return SOCKET_ERROR;
136+
+ }
137+
+
138+
switch(optname)
139+
{
140+
case TCP_NODELAY:
141+
@@ -3336,6 +3372,33 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int
142+
value = *optval;
143+
return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_NODELAY, (char*)&value, sizeof(value) );
144+
145+
+ case TCP_KEEPALIVE:
146+
+ if (optlen < sizeof(DWORD) || !optval)
147+
+ {
148+
+ SetLastError( WSAEFAULT );
149+
+ return SOCKET_ERROR;
150+
+ }
151+
+ value = *(DWORD*)optval;
152+
+ return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_KEEPALIVE, (char*)&value, sizeof(value) );
153+
+
154+
+ case TCP_KEEPCNT:
155+
+ if (optlen < sizeof(DWORD) || !optval)
156+
+ {
157+
+ SetLastError( WSAEFAULT );
158+
+ return SOCKET_ERROR;
159+
+ }
160+
+ value = *(DWORD*)optval;
161+
+ return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_KEEPCNT, (char*)&value, sizeof(value) );
162+
+
163+
+ case TCP_KEEPINTVL:
164+
+ if (optlen < sizeof(DWORD) || !optval)
165+
+ {
166+
+ SetLastError( WSAEFAULT );
167+
+ return SOCKET_ERROR;
168+
+ }
169+
+ value = *(DWORD*)optval;
170+
+ return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_KEEPINTVL, (char*)&value, sizeof(value) );
171+
+
172+
default:
173+
FIXME("Unknown IPPROTO_TCP optname 0x%08x\n", optname);
174+
SetLastError(WSAENOPROTOOPT);
175+
diff --git a/include/wine/afd.h b/include/wine/afd.h
176+
index 788adb4a495..aba559ebd8a 100644
177+
--- a/include/wine/afd.h
178+
+++ b/include/wine/afd.h
179+
@@ -285,6 +285,12 @@ C_ASSERT( sizeof(struct afd_get_events_params) == 56 );
180+
#define IOCTL_AFD_WINE_SET_IP_RECVTOS WINE_AFD_IOC(296)
181+
#define IOCTL_AFD_WINE_GET_SO_EXCLUSIVEADDRUSE WINE_AFD_IOC(297)
182+
#define IOCTL_AFD_WINE_SET_SO_EXCLUSIVEADDRUSE WINE_AFD_IOC(298)
183+
+#define IOCTL_AFD_WINE_GET_TCP_KEEPALIVE WINE_AFD_IOC(299)
184+
+#define IOCTL_AFD_WINE_SET_TCP_KEEPALIVE WINE_AFD_IOC(300)
185+
+#define IOCTL_AFD_WINE_GET_TCP_KEEPCNT WINE_AFD_IOC(301)
186+
+#define IOCTL_AFD_WINE_SET_TCP_KEEPCNT WINE_AFD_IOC(302)
187+
+#define IOCTL_AFD_WINE_GET_TCP_KEEPINTVL WINE_AFD_IOC(303)
188+
+#define IOCTL_AFD_WINE_SET_TCP_KEEPINTVL WINE_AFD_IOC(304)
189+
190+
struct afd_iovec
191+
{
192+
--
193+
GitLab
194+

0 commit comments

Comments
 (0)