Compare commits

...

47 Commits
v4.7 ... v4.9

Author SHA1 Message Date
Alistair Leslie-Hughes
7fd92efae8 Release v4.9 2019-05-26 10:26:29 +10:00
Zebediah Figura
968a9068f4 winebuild-Fake_Dlls: Also change fake DLL syscall thunks.
Thanks to Andrew Wesie.
2019-05-25 15:17:50 -05:00
Zebediah Figura
5e5b163eba winebuild-Fake_Dlls: another fixup
user_shared_data_init() copies the internal data to the external data, but at the same time kernel32 makes calls down to ntdll before this happens, so we need both of these.
2019-05-25 11:44:35 -05:00
Zebediah Figura
5bc08f5e70 winebuild-Fake_Dlls: fixup 2019-05-25 00:04:40 -05:00
Zebediah Figura
eb91fab43e ntdll-Junction_Points: Fix for bug 47169.
From Erich E. Hoover.
2019-05-24 19:29:03 -05:00
Zebediah Figura
5b59788752 winebuild-Fake_Dlls: Change layout of system call thunks.
Based on patches by Fabian Maurer.
2019-05-24 19:20:28 -05:00
Alistair Leslie-Hughes
5634d119e0 Rebase against 27bf52d12c0eb13ec797a5d81177954faac00fa4 2019-05-24 08:57:32 +10:00
Alistair Leslie-Hughes
52f92a42de Rebase against 9cfe6094773929d9dd61db51da094324337ecab0 2019-05-23 09:01:49 +10:00
Alistair Leslie-Hughes
6f185a694c Rebase against 6a610a325809d47f48bc72f3a757e1a62b193ea8 2019-05-22 08:24:22 +10:00
Alistair Leslie-Hughes
0bb3121273 Updated bcrypt-BCryptSecretAgreement patchset 2019-05-21 08:47:26 +10:00
Alistair Leslie-Hughes
77619384a4 Rebase against 21ae9ba1ba8ddba3ba49e916ef2b7fbd5ae9713d 2019-05-21 08:40:13 +10:00
Zebediah Figura
77ef8ff7ef Rebase against 61aea5a9879f41224022d4775cce28d28618ea89. 2019-05-17 16:51:57 -05:00
Alistair Leslie-Hughes
831b1f895e Updated include-macos-compile patchset 2019-05-17 10:45:44 +10:00
Alistair Leslie-Hughes
071fe01910 Rebase against 07e249e431c5009fa6ab8d274b4a8fe62a286358 2019-05-17 09:18:43 +10:00
Alistair Leslie-Hughes
1b7ebd3bb8 Rebase against 042e0625695a82aa71ddf825c693680d5d8aa0dd 2019-05-16 09:08:56 +10:00
Alistair Leslie-Hughes
6ce73c283d Rebase against 99114803b80f6e687f1d4ed11e0808b821cdbf22 2019-05-15 09:26:21 +10:00
Alistair Leslie-Hughes
f3e2363b52 Rebase against 40fef0fb71b079c1bf9667d80384cc43ec7f11fd 2019-05-14 08:20:42 +10:00
Alistair Leslie-Hughes
6e49a945cf Added comctl32-alpha-bitmaps patchset 2019-05-13 08:24:17 +10:00
Alistair Leslie-Hughes
92cc7818b2 Updated ntdll-Junction_Points patchset 2019-05-13 08:21:41 +10:00
Alistair Leslie-Hughes
3134cc0b2d Release v4.8 2019-05-11 11:27:45 +10:00
Alistair Leslie-Hughes
1308207a63 Rebase against aaf9c833ee1b9dca8cffcb2a60c96093fdd36405 2019-05-11 11:12:22 +10:00
Alistair Leslie-Hughes
082a898ad4 Updated ntdll-Junction_Points patchset 2019-05-10 09:55:20 +10:00
Alistair Leslie-Hughes
992845eae7 Rebase against 9bcaf9769c5ae834f0f6e8fe2b28a85b286833b0 2019-05-10 08:53:33 +10:00
Alistair Leslie-Hughes
247e77f2e8 Rebase against 08a899d433e5b638b5cc18d5c81330dea38d7c04 2019-05-09 10:22:04 +10:00
Alistair Leslie-Hughes
76004cd4c4 Updated winex11.drv-mouse-coorrds patchset 2019-05-09 08:49:02 +10:00
Zebediah Figura
770269393f Rebase against 622422e67bfd9da487102aee4ca42681a24a8e65. 2019-05-07 19:52:35 -05:00
Alistair Leslie-Hughes
29db3393bc Updated dinput-joy-directX3 patchset 2019-05-07 09:50:41 +10:00
Alistair Leslie-Hughes
b105021410 Rebase against 10dcee21c4b28b7f1cedc9ade01c09616521b628 2019-05-07 09:41:02 +10:00
Alistair Leslie-Hughes
5f18c8565c Remove winepulse-PulseAudio_Support_old patchset 2019-05-06 20:41:25 +10:00
Alistair Leslie-Hughes
f0f856a7ea Removed wined3d-Improved-RCP_Support patchset
This caused a major regression.
2019-05-06 16:26:21 +10:00
Alistair Leslie-Hughes
7332164d55 Remove wined3d-Interpolation_Modifiers patchset
This is fixed upstream for some time.
2019-05-06 16:23:48 +10:00
Alistair Leslie-Hughes
0a153ac1a0 Remove d3d11-dynamic-cpu-access patchset
This caused major regression and is unlikely to be updated to
work correctly.  Using the nouveau driver it a better solution then
trying to stay with the Legacy nVidia binary driver.
2019-05-06 15:08:08 +10:00
Zebediah Figura
90ef849e7b ntdll-RtlCreateUserThread: Add dependency on winebuild-Fake_Dlls.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47124
2019-05-05 00:30:54 -05:00
Zebediah Figura
9bfe1fe1f2 server-Desktop_Refcount: Swap dependency with ws2_32-WSACleanup.
To avoid a circular dependency.
2019-05-05 00:24:28 -05:00
Zebediah Figura
b1997e35c9 ws2_32-WSACleanup: Restore dependency on server-Desktop_Refcount.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47124
2019-05-04 23:52:03 -05:00
Zebediah Figura
8cbbf850d1 Rebase against b479382737f9ee110bc61b1dd765c5b81d56c900. 2019-05-03 23:09:43 -05:00
Alistair Leslie-Hughes
dc2e2153f3 Added dinput-joy-directX3 patchset 2019-05-03 11:57:31 +10:00
Alistair Leslie-Hughes
d6ab62c2be Added dinput-joy-mappings patchset 2019-05-03 10:37:32 +10:00
Alistair Leslie-Hughes
a3faa8ac8a Updated ddraw-Rendering_Targets patchset 2019-05-03 09:56:59 +10:00
Alistair Leslie-Hughes
c9f414b9e7 Rebase against 0ece679210897774b3b43e483658fe6511a84676 2019-05-03 09:40:08 +10:00
Alistair Leslie-Hughes
57370fd9ae Rebase against d48ffbdc014954907d3280a3b53eb9b478b10195 2019-05-02 08:42:59 +10:00
Alistair Leslie-Hughes
7d9b7bbdf5 Updated ntdll-Junction_Points patchset 2019-05-01 08:50:08 +10:00
Alistair Leslie-Hughes
05f918ddb4 Rebase against 8039941c52758113955d376bd7b6b6e1e5b5f76c 2019-05-01 08:14:20 +10:00
Alistair Leslie-Hughes
133bed10d3 Rebase against 5bd1b2652c844a2522131bd26feb95231f718986 2019-04-30 08:23:23 +10:00
Alistair Leslie-Hughes
00b434ec7f Added ntdll-aarch64-TEB patchset 2019-04-29 11:06:42 +10:00
Alistair Leslie-Hughes
8f33477760 Updated server-Desktop_Refcount patchset
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47091
2019-04-29 05:44:15 +10:00
Zebediah Figura
c48811407e eventfd_synchronization: Fix support for directory change notification objects.
I had misread the code at first and was under the impression these were also
pseudo-fds, but they are not, they are true fds and asyncs just manually
tinker with their signaled status.
2019-04-27 10:22:09 -05:00
134 changed files with 3764 additions and 5825 deletions

View File

@@ -1,25 +0,0 @@
From bd48f0d6b1476a77520f0bf5f82ac08e9dbf9acd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 22 Mar 2016 21:54:01 +0100
Subject: amstream: Avoid implicit cast of interface pointer.
---
dlls/amstream/mediastreamfilter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/amstream/mediastreamfilter.c b/dlls/amstream/mediastreamfilter.c
index 5abcb2f..a7ff6e8 100644
--- a/dlls/amstream/mediastreamfilter.c
+++ b/dlls/amstream/mediastreamfilter.c
@@ -42,7 +42,7 @@ typedef struct {
static inline IMediaStreamFilterImpl *impl_from_IMediaStreamFilter(IMediaStreamFilter *iface)
{
- return CONTAINING_RECORD(iface, IMediaStreamFilterImpl, filter);
+ return CONTAINING_RECORD((IBaseFilter *)iface, IMediaStreamFilterImpl, filter.IBaseFilter_iface);
}
/*** IUnknown methods ***/
--
2.7.4

View File

@@ -1,38 +0,0 @@
From 5487b4720e24aaa7a10719fc36bc23c851a48a9b Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong@codeweavers.com>
Date: Tue, 28 Apr 2015 22:35:26 +0800
Subject: server: Create primary group using DOMAIN_GROUP_RID_USERS.
---
dlls/advapi32/tests/security.c | 2 +-
server/token.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 25b34ba4..573119f 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2591,7 +2591,7 @@ static void test_process_security(void)
ok(res, "GetTokenInformation failed with error %d\n", GetLastError());
UserSid = user->User.Sid;
test_sid_str(UserSid);
- todo_wine ok(EqualPrefixSid(UsersSid, UserSid), "TokenPrimaryGroup Sid and TokenUser Sid don't match.\n");
+ ok(EqualPrefixSid(UsersSid, UserSid), "TokenPrimaryGroup Sid and TokenUser Sid don't match.\n");
CloseHandle( token );
if (!res)
diff --git a/server/token.c b/server/token.c
index e57cbc6..be8c53b 100644
--- a/server/token.c
+++ b/server/token.c
@@ -695,6 +695,7 @@ struct token *token_create_admin( void )
{ security_local_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
{ security_interactive_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
{ security_authenticated_user_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
+ { security_domain_users_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY|SE_GROUP_OWNER },
{ alias_admins_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY|SE_GROUP_OWNER },
{ alias_users_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
{ logon_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY|SE_GROUP_LOGON_ID },
--
2.3.5

View File

@@ -1,141 +0,0 @@
From 23ce6bcd9ebd67d6b5ed991bad555ecbc014a08d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 8 Feb 2016 04:55:07 +0100
Subject: avifil32: Correctly handle compressed frames when desired format is
specified.
---
dlls/avifil32/getframe.c | 102 +++++++++++++++++++++++------------------------
1 file changed, 50 insertions(+), 52 deletions(-)
diff --git a/dlls/avifil32/getframe.c b/dlls/avifil32/getframe.c
index 46b1683..7d98d2e 100644
--- a/dlls/avifil32/getframe.c
+++ b/dlls/avifil32/getframe.c
@@ -406,8 +406,6 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
lpbi->biSize + lpbi->biClrUsed * sizeof(RGBQUAD));
if (lpbi->biBitCount <= 8)
ICDecompressGetPalette(This->hic, This->lpInFormat, This->lpOutFormat);
-
- return AVIERR_OK;
} else {
if (bBestDisplay) {
ICGetDisplayFormat(This->hic, This->lpInFormat,
@@ -417,64 +415,64 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
AVIFILE_CloseCompressor(This);
return AVIERR_NOCOMPRESSOR;
}
+ }
- /* check output format */
- if (This->lpOutFormat->biClrUsed == 0 &&
- This->lpOutFormat->biBitCount <= 8)
- This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount;
- if (This->lpOutFormat->biSizeImage == 0 &&
- This->lpOutFormat->biCompression == BI_RGB) {
- This->lpOutFormat->biSizeImage =
- DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight;
- }
+ /* check output format */
+ if (This->lpOutFormat->biClrUsed == 0 &&
+ This->lpOutFormat->biBitCount <= 8)
+ This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount;
+ if (This->lpOutFormat->biSizeImage == 0 &&
+ This->lpOutFormat->biCompression == BI_RGB) {
+ This->lpOutFormat->biSizeImage =
+ DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight;
+ }
- if (lpBits == NULL) {
- DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
+ if (lpBits == NULL) {
+ DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
- size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
- This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
- if (This->lpOutFormat == NULL) {
- AVIFILE_CloseCompressor(This);
- return AVIERR_MEMORY;
- }
- This->lpOutBuffer = DIBPTR(This->lpOutFormat);
- } else
- This->lpOutBuffer = lpBits;
-
- /* for user size was irrelevant */
- if (dx == -1)
- dx = This->lpOutFormat->biWidth;
- if (dy == -1)
- dy = This->lpOutFormat->biHeight;
-
- /* need to resize? */
- if (x != 0 || y != 0) {
- if (dy == This->lpOutFormat->biHeight &&
- dx == This->lpOutFormat->biWidth)
- This->bResize = FALSE;
- else
- This->bResize = TRUE;
+ size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
+ This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
+ if (This->lpOutFormat == NULL) {
+ AVIFILE_CloseCompressor(This);
+ return AVIERR_MEMORY;
}
+ This->lpOutBuffer = DIBPTR(This->lpOutFormat);
+ } else
+ This->lpOutBuffer = lpBits;
+
+ /* for user size was irrelevant */
+ if (dx == -1)
+ dx = This->lpOutFormat->biWidth;
+ if (dy == -1)
+ dy = This->lpOutFormat->biHeight;
+
+ /* need to resize? */
+ if (x != 0 || y != 0) {
+ if (dy == This->lpOutFormat->biHeight &&
+ dx == This->lpOutFormat->biWidth)
+ This->bResize = FALSE;
+ else
+ This->bResize = TRUE;
+ }
- if (This->bResize) {
- This->x = x;
- This->y = y;
- This->dx = dx;
- This->dy = dy;
-
- if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0,
- 0,This->lpInFormat->biWidth,
- This->lpInFormat->biHeight,This->lpOutFormat,
- This->lpOutBuffer, x, y, dx, dy) == ICERR_OK)
- return AVIERR_OK;
- } else if (ICDecompressBegin(This->hic, This->lpInFormat,
- This->lpOutFormat) == ICERR_OK)
+ if (This->bResize) {
+ This->x = x;
+ This->y = y;
+ This->dx = dx;
+ This->dy = dy;
+
+ if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0,
+ 0,This->lpInFormat->biWidth,
+ This->lpInFormat->biHeight,This->lpOutFormat,
+ This->lpOutBuffer, x, y, dx, dy) == ICERR_OK)
return AVIERR_OK;
+ } else if (ICDecompressBegin(This->hic, This->lpInFormat,
+ This->lpOutFormat) == ICERR_OK)
+ return AVIERR_OK;
- AVIFILE_CloseCompressor(This);
+ AVIFILE_CloseCompressor(This);
- return AVIERR_COMPRESSOR;
- }
+ return AVIERR_COMPRESSOR;
}
static const struct IGetFrameVtbl igetframeVtbl = {
--
2.7.0

View File

@@ -1 +0,0 @@
Fixes: Correctly handle compressed frames when desired format is specified

View File

@@ -1,13 +1,15 @@
From 72d00367b9863fd84d47623b6811552e155fca84 Mon Sep 17 00:00:00 2001
From aff69d94c931851302d870316b05772193568e29 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 5 Feb 2019 10:00:26 +1100
Subject: [PATCH] bcrypt: Add BCryptDestroySecret/BCryptSecretAgreement stubs
Subject: [PATCH 1/2] bcrypt: Add BCryptDestroySecret/BCryptSecretAgreement
stubs
---
dlls/bcrypt/bcrypt.spec | 4 ++--
dlls/bcrypt/bcrypt_main.c | 16 ++++++++++++++++
dlls/ncrypt/ncrypt.spec | 4 ++--
include/bcrypt.h | 3 +++
3 files changed, 21 insertions(+), 2 deletions(-)
4 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index 052a099..dfe08e7 100644
@@ -32,10 +34,10 @@ index 052a099..dfe08e7 100644
@ stub BCryptSetContextFunctionProperty
@ stdcall BCryptSetProperty(ptr wstr ptr long long)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 80bd14b..36451c9 100644
index b9c51a1..18783f0 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1556,6 +1556,22 @@ NTSTATUS WINAPI BCryptDeriveKeyPBKDF2( BCRYPT_ALG_HANDLE handle,
@@ -1580,6 +1580,22 @@ NTSTATUS WINAPI BCryptDeriveKeyPBKDF2( BCRYPT_ALG_HANDLE handle, UCHAR *pwd, ULO
return STATUS_SUCCESS;
}
@@ -58,8 +60,30 @@ index 80bd14b..36451c9 100644
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
switch (reason)
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
index 85fa5c0..d4a32ed 100644
--- a/dlls/ncrypt/ncrypt.spec
+++ b/dlls/ncrypt/ncrypt.spec
@@ -12,7 +12,7 @@
@ stdcall BCryptDeriveKeyPBKDF2(ptr ptr long ptr long int64 ptr long long) bcrypt.BCryptDeriveKeyPBKDF2
@ stdcall BCryptDestroyHash(ptr) bcrypt.BCryptDestroyHash
@ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey
-@ stub BCryptDestroySecret
+@ stdcall BCryptDestroySecret(ptr) bcrypt.BCryptDestroySecret
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash
@ stdcall BCryptDuplicateKey(ptr ptr ptr long long) bcrypt.BCryptDuplicateKey
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt
@@ -46,7 +46,7 @@
@ stdcall BCryptRemoveContextFunction(long wstr long wstr) bcrypt.BCryptRemoveContextFunction
@ stdcall BCryptRemoveContextFunctionProvider(long wstr long wstr wstr) bcrypt.BCryptRemoveContextFunctionProvider
@ stub BCryptResolveProviders
-@ stub BCryptSecretAgreement
+@ stdcall BCryptSecretAgreement(ptr ptr ptr long) bcrypt.BCryptSecretAgreement
@ stub BCryptSetAuditingInterface
@ stub BCryptSetContextFunctionProperty
@ stdcall BCryptSetProperty(ptr wstr ptr long long) bcrypt.BCryptSetProperty
diff --git a/include/bcrypt.h b/include/bcrypt.h
index ba78c1d..866914c 100644
index a0b0d52..f0185d1 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -211,6 +211,7 @@ typedef PVOID BCRYPT_ALG_HANDLE;
@@ -70,7 +94,7 @@ index ba78c1d..866914c 100644
/* Flags for BCryptGenRandom */
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
@@ -228,6 +229,7 @@ NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR,
@@ -231,6 +232,7 @@ NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR,
NTSTATUS WINAPI BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, ULONGLONG, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
@@ -78,7 +102,7 @@ index ba78c1d..866914c 100644
NTSTATUS WINAPI BCryptDuplicateHash(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG);
NTSTATUS WINAPI BCryptEncrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
@@ -242,6 +244,7 @@ NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCH
@@ -245,6 +247,7 @@ NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCH
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptImportKeyPair(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG);
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);

View File

@@ -1,13 +1,14 @@
From 315b52406fbddcaf9289b2a47e8498fba49f8278 Mon Sep 17 00:00:00 2001
From 01c7d3e8e745c3b443e0a8e712f32eadc56f59a8 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 5 Feb 2019 10:09:59 +1100
Subject: [PATCH] bcrypt: Add BCryptDeriveKey stub
Subject: [PATCH 2/2] bcrypt: Add BCryptDeriveKey stub
---
dlls/bcrypt/bcrypt.spec | 2 +-
dlls/bcrypt/bcrypt_main.c | 7 +++++++
dlls/ncrypt/ncrypt.spec | 2 +-
include/bcrypt.h | 15 +++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index dfe08e7..4946ee5 100644
@@ -23,10 +24,10 @@ index dfe08e7..4946ee5 100644
@ stdcall BCryptDestroyHash(ptr)
@ stdcall BCryptDestroyKey(ptr)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 36451c9..ca2f274 100644
index 18783f0..399626d 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1572,6 +1572,13 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE secret)
@@ -1596,6 +1596,13 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE secret)
return STATUS_SUCCESS;
}
@@ -40,8 +41,21 @@ index 36451c9..ca2f274 100644
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
switch (reason)
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
index d4a32ed..d35f8a9 100644
--- a/dlls/ncrypt/ncrypt.spec
+++ b/dlls/ncrypt/ncrypt.spec
@@ -7,7 +7,7 @@
@ stdcall BCryptCreateHash(ptr ptr ptr long ptr long long) bcrypt.BCryptCreateHash
@ stdcall BCryptDecrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptDecrypt
@ stub BCryptDeleteContext
-@ stub BCryptDeriveKey
+@ stdcall BCryptDeriveKey(ptr wstr ptr ptr long ptr long) bcrypt.BCryptDeriveKey
@ stub BCryptDeriveKeyCapi
@ stdcall BCryptDeriveKeyPBKDF2(ptr ptr long ptr long int64 ptr long long) bcrypt.BCryptDeriveKeyPBKDF2
@ stdcall BCryptDestroyHash(ptr) bcrypt.BCryptDestroyHash
diff --git a/include/bcrypt.h b/include/bcrypt.h
index 866914c..a5abf23 100644
index f0185d1..b1799d0 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -204,6 +204,20 @@ typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER
@@ -65,7 +79,7 @@ index 866914c..a5abf23 100644
#define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b
#define BCRYPT_KEY_DATA_BLOB_VERSION1 1
@@ -226,6 +240,7 @@ typedef PVOID BCRYPT_SECRET_HANDLE;
@@ -229,6 +243,7 @@ typedef PVOID BCRYPT_SECRET_HANDLE;
NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG);
NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);

View File

@@ -0,0 +1,251 @@
From ebbaf56bdb75f853dafdbbffba81233784ecb618 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sat, 4 May 2019 18:21:05 +0800
Subject: [PATCH 1/2] comctl32: Switch to using a structure for extra storage.
Content-Type: text/plain; charset=UTF-8
To: wine-devel@winehq.org
These patches aim to fix the bug 47018.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
dlls/comctl32/static.c | 92 ++++++++++++++++++++++++++++++++++--------
1 file changed, 76 insertions(+), 16 deletions(-)
diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c
index 5cc02ced97..d08710c06f 100644
--- a/dlls/comctl32/static.c
+++ b/dlls/comctl32/static.c
@@ -36,6 +36,7 @@
#include "winuser.h"
#include "commctrl.h"
+#include "wine/heap.h"
#include "wine/debug.h"
#include "comctl32.h"
@@ -50,10 +51,16 @@ static void STATIC_PaintBitmapfn( HWND hwnd, HDC hdc, DWORD style );
static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style );
static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style );
-/* offsets for GetWindowLong for static private information */
-#define HFONT_GWL_OFFSET 0
-#define HICON_GWL_OFFSET (sizeof(HFONT))
-#define STATIC_EXTRA_BYTES (HICON_GWL_OFFSET + sizeof(HICON))
+struct static_extra_info
+{
+ HFONT hfont;
+ union
+ {
+ HICON hicon;
+ HBITMAP hbitmap;
+ HENHMETAFILE hemf;
+ } image;
+};
typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style );
@@ -80,6 +87,18 @@ static const pfPaint staticPaintFunc[SS_TYPEMASK+1] =
STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */
};
+static struct static_extra_info *get_extra_ptr( HWND hwnd, BOOL force )
+{
+ struct static_extra_info *extra = (struct static_extra_info *)GetWindowLongPtrW( hwnd, 0 );
+ if (!extra && force)
+ {
+ extra = heap_alloc_zero( sizeof(*extra) );
+ if (extra)
+ SetWindowLongPtrW( hwnd, 0, (ULONG_PTR)extra );
+ }
+ return extra;
+}
+
static BOOL get_icon_size( HICON handle, SIZE *size )
{
ICONINFO info;
@@ -111,6 +130,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
{
HICON prevIcon;
SIZE size;
+ struct static_extra_info *extra;
if ((style & SS_TYPEMASK) != SS_ICON) return 0;
if (hicon && !get_icon_size( hicon, &size ))
@@ -118,7 +138,12 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
WARN("hicon != 0, but invalid\n");
return 0;
}
- prevIcon = (HICON)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hicon );
+
+ extra = get_extra_ptr( hwnd, TRUE );
+ if (!extra) return 0;
+
+ prevIcon = extra->image.hicon;
+ extra->image.hicon = hicon;
if (hicon && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
{
/* Windows currently doesn't implement SS_RIGHTJUST */
@@ -146,6 +171,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
{
HBITMAP hOldBitmap;
+ struct static_extra_info *extra;
if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP)
@@ -153,7 +179,12 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
WARN("hBitmap != 0, but it's not a bitmap\n");
return 0;
}
- hOldBitmap = (HBITMAP)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hBitmap );
+
+ extra = get_extra_ptr( hwnd, TRUE );
+ if (!extra) return 0;
+
+ hOldBitmap = extra->image.hbitmap;
+ extra->image.hbitmap = hBitmap;
if (hBitmap && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
{
BITMAP bm;
@@ -183,13 +214,23 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
*/
static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style )
{
+ HENHMETAFILE old_hemf;
+ struct static_extra_info *extra;
+
if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0;
if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE)
{
WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n");
return 0;
}
- return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile );
+
+ extra = get_extra_ptr( hwnd, TRUE );
+ if (!extra) return 0;
+
+ old_hemf = extra->image.hemf;
+ extra->image.hemf = hEnhMetaFile;
+
+ return old_hemf;
}
/***********************************************************************
@@ -200,6 +241,8 @@ static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile,
*/
static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style )
{
+ struct static_extra_info *extra;
+
switch (style & SS_TYPEMASK)
{
case SS_ICON:
@@ -215,7 +258,22 @@ static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style )
default:
return NULL;
}
- return (HANDLE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET );
+
+ extra = get_extra_ptr( hwnd, FALSE );
+ return extra ? extra->image.hbitmap : 0;
+}
+
+static void STATIC_SetFont( HWND hwnd, HFONT hfont )
+{
+ struct static_extra_info *extra = get_extra_ptr( hwnd, TRUE );
+ if (extra)
+ extra->hfont = hfont;
+}
+
+static HFONT STATIC_GetFont( HWND hwnd )
+{
+ struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
+ return extra ? extra->hfont : 0;
}
/***********************************************************************
@@ -327,6 +385,8 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
case WM_NCDESTROY:
if (style == SS_ICON)
{
+ struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
+ heap_free( extra );
/*
* FIXME
* DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
@@ -423,14 +483,14 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
case WM_SETFONT:
if (hasTextStyle( full_style ))
{
- SetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET, wParam );
+ STATIC_SetFont( hwnd, (HFONT)wParam );
if (LOWORD(lParam))
RedrawWindow( hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN );
}
break;
case WM_GETFONT:
- return GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
+ return (LRESULT)STATIC_GetFont( hwnd );
case WM_NCHITTEST:
if (full_style & SS_NOTIFY)
@@ -508,7 +568,7 @@ static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
dis.itemData = 0;
GetClientRect( hwnd, &dis.rcItem );
- font = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
+ font = STATIC_GetFont( hwnd );
if (font) oldFont = SelectObject( hdc, font );
SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd );
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
@@ -572,7 +632,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style )
format |= DT_SINGLELINE | DT_WORD_ELLIPSIS;
}
- if ((hFont = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET )))
+ if ((hFont = STATIC_GetFont( hwnd )))
hOldFont = SelectObject( hdc, hFont );
/* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned
@@ -668,7 +728,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style )
GetClientRect( hwnd, &rc );
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
- hIcon = (HICON)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET );
+ hIcon = STATIC_GetImage( hwnd, IMAGE_ICON, style );
if (!hIcon || !get_icon_size( hIcon, &size ))
{
FillRect(hdc, &rc, hbrush);
@@ -698,7 +758,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
- if ((hBitmap = (HBITMAP)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))
+ if ((hBitmap = STATIC_GetImage( hwnd, IMAGE_BITMAP, style ))
&& (GetObjectType(hBitmap) == OBJ_BITMAP)
&& (hMemDC = CreateCompatibleDC( hdc )))
{
@@ -742,7 +802,7 @@ static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style )
GetClientRect(hwnd, &rc);
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
FillRect(hdc, &rc, hbrush);
- if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
+ if ((hEnhMetaFile = STATIC_GetImage( hwnd, IMAGE_ENHMETAFILE, style )))
{
/* The control's current font is not selected into the
device context! */
@@ -779,7 +839,7 @@ void STATIC_Register(void)
wndClass.style = CS_DBLCLKS | CS_PARENTDC | CS_GLOBALCLASS;
wndClass.lpfnWndProc = STATIC_WindowProc;
wndClass.cbClsExtra = 0;
- wndClass.cbWndExtra = STATIC_EXTRA_BYTES;
+ wndClass.cbWndExtra = sizeof(struct static_extra_info *);
wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
wndClass.hbrBackground = NULL;
wndClass.lpszClassName = WC_STATICW;
--
2.20.1

View File

@@ -0,0 +1,152 @@
From 334262255a66b05a852c90ebc722815b8a0eb7e9 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sat, 4 May 2019 19:46:35 +0800
Subject: [PATCH 2/2] comctl32: Paint 32-bpp bitmaps with an alpha channel
using GdiAlphaBlend.
Content-Type: text/plain; charset=UTF-8
To: wine-devel@winehq.org
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
dlls/comctl32/static.c | 83 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 79 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c
index d08710c06f..fe566645d3 100644
--- a/dlls/comctl32/static.c
+++ b/dlls/comctl32/static.c
@@ -60,6 +60,7 @@ struct static_extra_info
HBITMAP hbitmap;
HENHMETAFILE hemf;
} image;
+ BOOL image_has_alpha;
};
typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style );
@@ -163,6 +164,56 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
return prevIcon;
}
+static HBITMAP create_alpha_bitmap( HBITMAP hbitmap )
+{
+ HBITMAP alpha = 0;
+ BITMAPINFO *info = NULL;
+ BITMAP bm;
+ HDC src, dst;
+ void *bits;
+ DWORD i;
+ const unsigned char *ptr;
+ BOOL has_alpha = FALSE;
+
+ if (!GetObjectW( hbitmap, sizeof(bm), &bm )) return 0;
+ if (bm.bmBitsPixel != 32) return 0;
+
+ if (!(src = CreateCompatibleDC( 0 ))) return 0;
+ if (!(dst = CreateCompatibleDC( src ))) goto done;
+ if (!(info = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )))) goto done;
+ info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ info->bmiHeader.biWidth = bm.bmWidth;
+ info->bmiHeader.biHeight = -bm.bmHeight;
+ info->bmiHeader.biPlanes = 1;
+ info->bmiHeader.biBitCount = 32;
+ info->bmiHeader.biCompression = BI_RGB;
+ info->bmiHeader.biSizeImage = bm.bmWidth * bm.bmHeight * 4;
+ info->bmiHeader.biXPelsPerMeter = 0;
+ info->bmiHeader.biYPelsPerMeter = 0;
+ info->bmiHeader.biClrUsed = 0;
+ info->bmiHeader.biClrImportant = 0;
+ if (!(alpha = CreateDIBSection( dst, info, DIB_RGB_COLORS, &bits, NULL, 0 ))) goto done;
+
+ SelectObject( src, hbitmap );
+ SelectObject( dst, alpha );
+ BitBlt(dst, 0, 0, bm.bmWidth, bm.bmHeight, src, 0, 0, SRCCOPY);
+
+ for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4)
+ if ((has_alpha = (ptr[3] != 0))) break;
+
+done:
+ DeleteDC( src );
+ DeleteDC( dst );
+ HeapFree( GetProcessHeap(), 0, info );
+
+ if (!has_alpha)
+ {
+ DeleteObject( alpha );
+ alpha = 0;
+ }
+ return alpha;
+}
+
/***********************************************************************
* STATIC_SetBitmap
*
@@ -170,7 +221,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
*/
static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
{
- HBITMAP hOldBitmap;
+ HBITMAP hOldBitmap, alpha;
struct static_extra_info *extra;
if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
@@ -184,7 +235,18 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
if (!extra) return 0;
hOldBitmap = extra->image.hbitmap;
- extra->image.hbitmap = hBitmap;
+ alpha = create_alpha_bitmap( hBitmap );
+ if (alpha)
+ {
+ extra->image.hbitmap = alpha;
+ extra->image_has_alpha = TRUE;
+ }
+ else
+ {
+ extra->image.hbitmap = hBitmap;
+ extra->image_has_alpha = FALSE;
+ }
+
if (hBitmap && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
{
BITMAP bm;
@@ -386,7 +448,12 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
if (style == SS_ICON)
{
struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
- heap_free( extra );
+ if (extra)
+ {
+ if (extra->image_has_alpha)
+ DeleteObject( extra->image.hbitmap );
+ heap_free( extra );
+ }
/*
* FIXME
* DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
@@ -765,6 +832,8 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
BITMAP bm;
RECT rcClient;
LOGBRUSH brush;
+ BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
GetObjectW(hBitmap, sizeof(bm), &bm);
oldbitmap = SelectObject(hMemDC, hBitmap);
@@ -785,7 +854,13 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
rcClient.right = rcClient.left + bm.bmWidth;
rcClient.bottom = rcClient.top + bm.bmHeight;
}
- StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
+
+ if (extra->image_has_alpha)
+ GdiAlphaBlend(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
+ rcClient.bottom - rcClient.top, hMemDC,
+ 0, 0, bm.bmWidth, bm.bmHeight, blend);
+ else
+ StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
rcClient.bottom - rcClient.top, hMemDC,
0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
SelectObject(hMemDC, oldbitmap);
--
2.20.1

View File

@@ -0,0 +1 @@
Fixes: [47018] Paint 32-bpp bitmaps with an alpha channel using GdiAlphaBlend

View File

@@ -1,29 +1,30 @@
From 9774b93b25d11fe143fcf4ab7159135334916045 Mon Sep 17 00:00:00 2001
From 8a5768bc4dc64dd9a0df5d7b781a569622b8c9b6 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 27 Aug 2014 00:31:23 +0200
Subject: configure: Also add the absolute RPATH when linking against libwine.
Subject: [PATCH] configure: Also add the absolute RPATH when linking against
libwine.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2222c687d9..513bdef795 100644
index e6acb786a4d..bd3fe968839 100644
--- a/configure.ac
+++ b/configure.ac
@@ -943,10 +943,10 @@ case $host_os in
@@ -956,10 +956,10 @@ case $host_os in
WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000"
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
WINE_TRY_CFLAGS([-Wl,--rpath,\$ORIGIN/../lib],
- [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
+ [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`:\$(DESTDIR)\${libdir}"
LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"],
[WINE_TRY_CFLAGS([-fPIC -Wl,-R,\$ORIGIN/../lib],
[WINE_TRY_CFLAGS([-Wl,-R,\$ORIGIN/../lib],
- [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
+ [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`:\$(DESTDIR)\${libdir}"
LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"])])
WINE_TRY_CFLAGS([-Wl,--enable-new-dtags],
--
2.14.1
2.20.1

View File

@@ -1,14 +1,14 @@
From 05d2fdef11e728574c7551e3a96f3223407027f4 Mon Sep 17 00:00:00 2001
From 9f36741fe5895aaf8aa5a954b78db09e32c2db3a 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 | 1263 +++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 1127 insertions(+), 136 deletions(-)
dlls/d3d11/device.c | 1267 +++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 1129 insertions(+), 138 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index c930248..80f73de 100644
index 8f9a850..b7cdd49 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -25,6 +25,16 @@
@@ -28,18 +28,18 @@ index c930248..80f73de 100644
static void STDMETHODCALLTYPE d3d_null_wined3d_object_destroyed(void *parent) {}
static const struct wined3d_parent_ops d3d_null_wined3d_parent_ops =
@@ -2910,214 +2920,1182 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont
@@ -2886,218 +2896,1186 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont
wined3d_private_store_cleanup(&context->private_store);
}
-/* ID3D11Device methods */
+/* ID3D11DeviceContext - deferred context methods */
-static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID riid, void **out)
-static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID iid, void **out)
+static inline struct d3d11_deferred_context *impl_from_deferred_ID3D11DeviceContext(ID3D11DeviceContext *iface)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- return IUnknown_QueryInterface(device->outer_unk, riid, out);
- return IUnknown_QueryInterface(device->outer_unk, iid, out);
+ return CONTAINING_RECORD(iface, struct d3d11_deferred_context, ID3D11DeviceContext_iface);
}
@@ -129,11 +129,11 @@ index c930248..80f73de 100644
- HRESULT hr;
-
- TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
-
- if (FAILED(hr = d3d_texture2d_create(device, desc, data, &object)))
- return hr;
+ struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
- if (FAILED(hr = d3d_texture2d_create(device, desc, data, &object)))
- return hr;
-
- *texture = &object->ID3D11Texture2D_iface;
+ TRACE("iface %p, device %p.\n", iface, device);
@@ -150,13 +150,13 @@ index c930248..80f73de 100644
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_texture3d *object;
- HRESULT hr;
-
+ struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
- TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
-
- if (FAILED(hr = d3d_texture3d_create(device, desc, data, &object)))
- return hr;
+ struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
-
- *texture = &object->ID3D11Texture3D_iface;
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
@@ -204,14 +204,11 @@ index c930248..80f73de 100644
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d11_unordered_access_view *object;
- HRESULT hr;
-
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- if (FAILED(hr = d3d11_unordered_access_view_create(device, resource, desc, &object)))
- return hr;
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
+{
@@ -219,7 +216,8 @@ index c930248..80f73de 100644
+ iface, start_slot, view_count, views);
+}
- *view = &object->ID3D11UnorderedAccessView_iface;
- if (FAILED(hr = d3d11_unordered_access_view_create(device, resource, desc, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetShader(ID3D11DeviceContext *iface,
+ ID3D11PixelShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+{
@@ -227,36 +225,35 @@ index c930248..80f73de 100644
+ iface, shader, class_instances, class_instance_count);
+}
- return S_OK;
- *view = &object->ID3D11UnorderedAccessView_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+{
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShader(ID3D11DeviceContext *iface,
+ ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+{
+ FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n",
+ iface, shader, class_instances, class_instance_count);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device2 *iface,
- ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11RenderTargetView **view)
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShader(ID3D11DeviceContext *iface,
+ ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexed(ID3D11DeviceContext *iface,
+ UINT index_count, UINT start_index_location, INT base_vertex_location)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_rendertarget_view *object;
- HRESULT hr;
+ FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n",
+ iface, shader, class_instances, class_instance_count);
+}
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexed(ID3D11DeviceContext *iface,
+ UINT index_count, UINT start_index_location, INT base_vertex_location)
+{
+ FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n",
+ iface, index_count, start_index_location, base_vertex_location);
+}
- if (!resource)
- return E_INVALIDARG;
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *iface,
+ UINT vertex_count, UINT start_vertex_location)
+{
@@ -264,46 +261,46 @@ index c930248..80f73de 100644
+ iface, vertex_count, start_vertex_location);
+}
- if (FAILED(hr = d3d_rendertarget_view_create(device, resource, desc, &object)))
- return hr;
- if (!resource)
- return E_INVALIDARG;
+static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_Map(ID3D11DeviceContext *iface, ID3D11Resource *resource,
+ UINT subresource_idx, D3D11_MAP map_type, UINT map_flags, D3D11_MAPPED_SUBRESOURCE *mapped_subresource)
+{
+ FIXME("iface %p, resource %p, subresource_idx %u, map_type %u, map_flags %#x, mapped_subresource %p stub!\n",
+ iface, resource, subresource_idx, map_type, map_flags, mapped_subresource);
- *view = &object->ID3D11RenderTargetView_iface;
- if (FAILED(hr = d3d_rendertarget_view_create(device, resource, desc, &object)))
- return hr;
+ return E_NOTIMPL;
+}
- return S_OK;
- *view = &object->ID3D11RenderTargetView_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_Unmap(ID3D11DeviceContext *iface, ID3D11Resource *resource,
+ UINT subresource_idx)
+{
+ FIXME("iface %p, resource %p, subresource_idx %u stub!\n", iface, resource, subresource_idx);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
+{
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device2 *iface,
- ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11DepthStencilView **view)
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetInputLayout(ID3D11DeviceContext *iface,
+ ID3D11InputLayout *input_layout)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_depthstencil_view *object;
- HRESULT hr;
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetInputLayout(ID3D11DeviceContext *iface,
+ ID3D11InputLayout *input_layout)
+{
+ FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
+}
- if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object)))
- return hr;
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetVertexBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers, const UINT *strides, const UINT *offsets)
+{
@@ -311,7 +308,8 @@ index c930248..80f73de 100644
+ iface, start_slot, buffer_count, buffers, strides, offsets);
+}
- *view = &object->ID3D11DepthStencilView_iface;
- if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetIndexBuffer(ID3D11DeviceContext *iface,
+ ID3D11Buffer *buffer, DXGI_FORMAT format, UINT offset)
+{
@@ -319,7 +317,7 @@ index c930248..80f73de 100644
+ iface, buffer, debug_dxgi_format(format), offset);
+}
- return S_OK;
- *view = &object->ID3D11DepthStencilView_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexedInstanced(ID3D11DeviceContext *iface,
+ UINT instance_index_count, UINT instance_count, UINT start_index_location, INT base_vertex_location,
+ UINT start_instance_location)
@@ -328,36 +326,34 @@ index c930248..80f73de 100644
+ "base_vertex_location %d, start_instance_location %u stub!\n",
+ iface, instance_index_count, instance_count, start_index_location,
+ base_vertex_location, start_instance_location);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface,
+ UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location)
+{
+ FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, "
+ "start_instance_location %u stub!\n",
+ iface, instance_vertex_count, instance_count, start_vertex_location,
+ start_instance_location);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device2 *iface,
- const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code,
- SIZE_T shader_byte_code_length, ID3D11InputLayout **input_layout)
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface,
+ UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location)
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_input_layout *object;
- HRESULT hr;
+ FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, "
+ "start_instance_location %u stub!\n",
+ iface, instance_vertex_count, instance_count, start_vertex_location,
+ start_instance_location);
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- TRACE("iface %p, element_descs %p, element_count %u, shader_byte_code %p, shader_byte_code_length %lu, "
- "input_layout %p.\n", iface, element_descs, element_count, shader_byte_code,
- shader_byte_code_length, input_layout);
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
+{
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- if (FAILED(hr = d3d_input_layout_create(device, element_descs, element_count,
- shader_byte_code, shader_byte_code_length, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceContext *iface,
+ ID3D11GeometryShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+{
@@ -365,35 +361,44 @@ index c930248..80f73de 100644
+ iface, shader, class_instances, class_instance_count);
+}
- *input_layout = &object->ID3D11InputLayout_iface;
- if (FAILED(hr = d3d_input_layout_create(device, element_descs, element_count,
- shader_byte_code, shader_byte_code_length, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface,
+ D3D11_PRIMITIVE_TOPOLOGY topology)
+{
+ FIXME("iface %p, topology %u stub!\n", iface, topology);
+}
- return S_OK;
- *input_layout = &object->ID3D11InputLayout_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
+{
+ FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+{
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device2 *iface, const void *byte_code,
- SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11VertexShader **shader)
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+static void STDMETHODCALLTYPE d3d11_deferred_context_Begin(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_vertex_shader *object;
- HRESULT hr;
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
+ FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous);
+}
- TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n",
- iface, byte_code, byte_code_length, class_linkage, shader);
+static void STDMETHODCALLTYPE d3d11_deferred_context_Begin(ID3D11DeviceContext *iface,
+static void STDMETHODCALLTYPE d3d11_deferred_context_End(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous)
+{
+ FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous);
@@ -401,47 +406,44 @@ index c930248..80f73de 100644
- if (class_linkage)
- FIXME("Class linkage is not implemented yet.\n");
+static void STDMETHODCALLTYPE d3d11_deferred_context_End(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous)
+{
+ FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous);
+}
- if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object)))
- return hr;
+static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_GetData(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags)
+{
+ FIXME("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x stub!\n",
+ iface, asynchronous, data, data_size, data_flags);
- *shader = &object->ID3D11VertexShader_iface;
- if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object)))
- return hr;
+ return E_NOTIMPL;
+}
- return S_OK;
- *shader = &object->ID3D11VertexShader_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_SetPredication(ID3D11DeviceContext *iface,
+ ID3D11Predicate *predicate, BOOL value)
+{
+ FIXME("iface %p, predicate %p, value %#x stub!\n", iface, predicate, value);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
+{
+ FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device2 *iface, const void *byte_code,
- SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader)
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
+ FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
+}
+
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+{
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_geometry_shader *object;
- HRESULT hr;
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
+}
+
- TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n",
+static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11DeviceContext *iface,
+ UINT render_target_view_count, ID3D11RenderTargetView *const *render_target_views,
+ ID3D11DepthStencilView *depth_stencil_view)
@@ -1342,10 +1344,14 @@ index c930248..80f73de 100644
+ SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader)
+{
+ struct d3d_device *device = impl_from_ID3D11Device2(iface);
struct d3d_geometry_shader *object;
HRESULT hr;
+ struct d3d_geometry_shader *object;
+ HRESULT hr;
+
+ TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n",
iface, byte_code, byte_code_length, class_linkage, shader);
@@ -3389,9 +4367,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
if (class_linkage)
@@ -3365,9 +4343,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device2 *iface, UINT flags,
ID3D11DeviceContext **context)
{
@@ -1369,7 +1375,7 @@ index c930248..80f73de 100644
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID riid,
static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID iid,
--
1.9.1

View File

@@ -1,35 +0,0 @@
From 7596e7792cb59a129f06ff41c4da03baa4d64b96 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 27 Apr 2018 12:34:00 +1000
Subject: [PATCH] d3d11: D3D11_USAGE_DYNAMIC needs to have CPU access
Fix regression of b6f917b1023ea2b9591f6b72d34ff2afa34bd914
Reference (details on D3D11_USAGE_DYNAMIC usage)
https://msdn.microsoft.com/en-us/library/windows/desktop/ff476259(v=vs.85).aspx
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/d3d11/buffer.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index 09778e2..04d473b 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -453,6 +453,11 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
wined3d_desc.usage = wined3d_usage_from_d3d11(0, buffer->desc.Usage);
wined3d_desc.bind_flags = buffer->desc.BindFlags;
wined3d_desc.access = wined3d_access_from_d3d11(buffer->desc.Usage, buffer->desc.CPUAccessFlags);
+ if(buffer->desc.Usage == D3D11_USAGE_DYNAMIC)
+ {
+ TRACE("Setting Dynamic CPU access\n");
+ wined3d_desc.access |= WINED3D_RESOURCE_ACCESS_CPU;
+ }
wined3d_desc.misc_flags = buffer->desc.MiscFlags;
wined3d_desc.structure_byte_stride = buffer->desc.StructureByteStride;
--
1.9.1

View File

@@ -1,3 +0,0 @@
# Written for bug 45066, but causes regression on latest nVidia drivers.
Fixes: Enable CPU access for dynamic buffers.
Disabled: true

View File

@@ -1,21 +1,23 @@
From 51e513935e94ddd1113ad016be7eb4100829ddc6 Mon Sep 17 00:00:00 2001
From b78cfe9c6453db477e0ba69b343e3ed128b345bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 29 Jul 2015 17:09:50 +0200
Subject: [PATCH] ddraw: Create rendering targets in video memory if possible.
Based on a patch by Henri Verbeet.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/ddraw/ddraw.c | 6 +++---
dlls/ddraw/ddraw_private.h | 3 ++-
dlls/ddraw/device.c | 23 ++++++++++++++---------
dlls/ddraw/surface.c | 36 ++++++++++++++++++++++++++++++++++--
4 files changed, 53 insertions(+), 15 deletions(-)
dlls/ddraw/device.c | 23 +++++++++++++---------
dlls/ddraw/surface.c | 39 ++++++++++++++++++++++++++++++++++++--
4 files changed, 56 insertions(+), 15 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 8467fbf4c..b9e13a49b 100644
index 2f94e325db..82bf315fe7 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4235,7 +4235,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
@@ -4342,7 +4342,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
@@ -24,7 +26,7 @@ index 8467fbf4c..b9e13a49b 100644
{
*device = &object->IDirect3DDevice7_iface;
}
@@ -4264,7 +4264,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
@@ -4371,7 +4371,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
return CLASS_E_NOAGGREGATION;
wined3d_mutex_lock();
@@ -33,7 +35,7 @@ index 8467fbf4c..b9e13a49b 100644
{
*device = &device_impl->IDirect3DDevice3_iface;
}
@@ -4290,7 +4290,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
@@ -4397,7 +4397,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
@@ -43,7 +45,7 @@ index 8467fbf4c..b9e13a49b 100644
*device = &device_impl->IDirect3DDevice2_iface;
}
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index 19f21a892..e2fe323b6 100644
index 19f21a8923..e2fe323b68 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -304,6 +304,7 @@ struct d3d_device
@@ -64,7 +66,7 @@ index 19f21a892..e2fe323b6 100644
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device) DECLSPEC_HIDDEN;
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 003ce1d2e..c5e303ee0 100644
index 054e2dccc9..0170639de8 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -1850,7 +1850,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
@@ -94,7 +96,7 @@ index 003ce1d2e..c5e303ee0 100644
{
WARN("Surface %p is not in video memory.\n", target_impl);
IDirectDrawSurface_AddRef(target);
@@ -6963,7 +6963,7 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
@@ -6976,7 +6976,7 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
return WINED3D_ZB_TRUE;
}
@@ -103,7 +105,7 @@ index 003ce1d2e..c5e303ee0 100644
struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
{
static const D3DMATRIX ident =
@@ -6986,6 +6986,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
@@ -6999,6 +6999,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl;
device->ref = 1;
device->version = version;
@@ -111,7 +113,7 @@ index 003ce1d2e..c5e303ee0 100644
if (outer_unknown)
device->outer_unknown = outer_unknown;
@@ -7036,14 +7037,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
@@ -7049,14 +7050,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
return D3D_OK;
}
@@ -133,7 +135,7 @@ index 003ce1d2e..c5e303ee0 100644
if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|| (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
@@ -7066,7 +7071,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
@@ -7079,7 +7084,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
return DDERR_OUTOFMEMORY;
}
@@ -142,7 +144,7 @@ index 003ce1d2e..c5e303ee0 100644
{
WARN("Surface %p is not in video memory.\n", target);
return D3DERR_SURFACENOTINVIDMEM;
@@ -7084,7 +7089,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
@@ -7097,7 +7102,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
return DDERR_OUTOFMEMORY;
}
@@ -152,7 +154,7 @@ index 003ce1d2e..c5e303ee0 100644
WARN("Failed to initialize device, hr %#x.\n", hr);
heap_free(object);
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 4e2faef86..03b97f0d6 100644
index cac05c39dc..1fc78eeab7 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -226,7 +226,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
@@ -164,26 +166,29 @@ index 4e2faef86..03b97f0d6 100644
1, &This->device1, (IUnknown *)&This->IDirectDrawSurface_iface)))
{
This->device1 = NULL;
@@ -6166,7 +6166,39 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
@@ -6175,7 +6175,42 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if (desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY)
{
- wined3d_desc.access = WINED3D_RESOURCE_ACCESS_CPU
+ unsigned int bind_flags = 0;
+
+ if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
+ if (!(desc->dwFlags & DDSD_LPSURFACE))
+ {
+ bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
+ }
+ else if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
+ {
+ bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
+ }
+ if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
+ {
+ bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
+ }
+ else if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
+ {
+ bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
+ }
+
+ if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
+ bind_flags |= WINED3D_BIND_DEPTH_STENCIL;
+ else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
+ bind_flags |= WINED3D_BIND_RENDER_TARGET;
+ if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
+ bind_flags |= WINED3D_BIND_DEPTH_STENCIL;
+ else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
+ bind_flags |= WINED3D_BIND_RENDER_TARGET;
+ }
+ /*
+ * The ddraw RGB device allows to use system memory surfaces as rendering target.
+ * This does not cause problems because the RGB device does software rasterization

View File

@@ -0,0 +1,79 @@
From 3d90cc93c56571a6c1d7d25054094106595e7c03 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.
---
dlls/dinput/device.c | 2 +-
dlls/dinput/device_private.h | 2 ++
dlls/dinput/joystick.c | 18 ++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index ade7947..648a4cc 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -714,7 +714,7 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
return DI_OK;
}
-static BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username)
+BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username)
{
HKEY hkey;
WCHAR *guid_str;
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
index d9e2997..af8d99d 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;
extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
+extern BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username) DECLSPEC_HIDDEN;
+
extern HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df) DECLSPEC_HIDDEN;
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
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -28,6 +28,7 @@
#include <stdio.h>
+#include "device_private.h"
#include "joystick_private.h"
#include "wine/debug.h"
#include "winreg.h"
@@ -792,9 +793,26 @@ 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;
+ BOOL load_success = FALSE;
FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", This, lpdiaf, debugstr_w(lpszUserName), dwFlags);
+ /* 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);
+ else
+ lstrcpynW(username, lpszUserName, MAX_PATH);
+
+ load_success = load_mapping_settings((IDirectInputDeviceImpl *) This, lpdiaf, username);
+ }
+
+ if (load_success) return DI_OK;
+
for (i=0; i < lpdiaf->dwNumActions; i++)
{
DWORD inst = (0x000000ff & (lpdiaf->rgoAction[i].dwSemantic)) - 1;
--
1.9.1

View File

@@ -0,0 +1,305 @@
From 920014b62ddd2218477e3d82f45c4515742f9e28 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.
---
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(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 2150db7..a7cfe36 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)
return type | (0x0000ff00 & (obj_instance << 8));
}
+static void del_mapping_key(const WCHAR *device, const WCHAR *username, const WCHAR *guid) {
+ static const WCHAR subkey[] = {
+ 'S','o','f','t','w','a','r','e','\\',
+ 'W','i','n','e','\\',
+ 'D','i','r','e','c','t','I','n','p','u','t','\\',
+ '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)));
+ 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);
+}
+
/*
* get_mapping_key
* Retrieves an open registry key to save the mapping, parametrized for an username,
* specific device and specific action mapping guid.
*/
-static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WCHAR *guid)
+static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WCHAR *guid, BOOL create)
{
static const WCHAR subkey[] = {
'S','o','f','t','w','a','r','e','\\',
@@ -663,8 +681,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
sprintfW(keyname, subkey, username, device, guid);
/* The key used is HKCU\Software\Wine\DirectInput\Mappings\[username]\[device]\[mapping_guid] */
- if (RegCreateKeyW(HKEY_CURRENT_USER, keyname, &hkey))
- hkey = 0;
+ if (create) {
+ if (RegCreateKeyW(HKEY_CURRENT_USER, keyname, &hkey))
+ hkey = 0;
+ } else if (RegOpenKeyW(HKEY_CURRENT_USER, keyname, &hkey))
+ hkey = 0;
HeapFree(GetProcessHeap(), 0, keyname);
@@ -684,7 +705,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK)
return DI_SETTINGSNOTSAVED;
- hkey = get_mapping_key(didev.tszInstanceName, lpszUsername, guid_str);
+ del_mapping_key(didev.tszInstanceName, lpszUsername, guid_str);
+
+ hkey = get_mapping_key(didev.tszInstanceName, lpszUsername, guid_str, TRUE);
if (!hkey)
{
@@ -719,7 +742,7 @@ BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdia
HKEY hkey;
WCHAR *guid_str;
DIDEVICEINSTANCEW didev;
- int i, mapped = 0;
+ int i;
didev.dwSize = sizeof(didev);
IDirectInputDevice8_GetDeviceInfo(&This->IDirectInputDevice8W_iface, &didev);
@@ -727,7 +750,7 @@ BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdia
if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK)
return FALSE;
- hkey = get_mapping_key(didev.tszInstanceName, username, guid_str);
+ hkey = get_mapping_key(didev.tszInstanceName, username, guid_str, FALSE);
if (!hkey)
{
@@ -748,15 +771,21 @@ BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdia
{
lpdiaf->rgoAction[i].dwObjID = id;
lpdiaf->rgoAction[i].guidInstance = didev.guidInstance;
- 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;
+ }
+
}
RegCloseKey(hkey);
CoTaskMemFree(guid_str);
- return mapped > 0;
+ /* On Windows BuildActionMap can open empty mapping, so always return TRUE if get_mapping_key is success */
+ return TRUE;
}
HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df)
@@ -779,13 +808,18 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
load_success = load_mapping_settings(This, lpdiaf, username);
}
- if (load_success) return DI_OK;
+ if (load_success) {
+ /* Update dwCRC to track if action format has changed */
+ for (i=0; i < lpdiaf->dwNumActions; i++)
+ {
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwObjID << i * 2) | (lpdiaf->rgoAction[i].dwObjID >> (sizeof(lpdiaf->dwCRC) * 8 - i * 2));
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwSemantic << (i * 2 + 5)) | (lpdiaf->rgoAction[i].dwSemantic >> (sizeof(lpdiaf->dwCRC) * 8 - (i * 2 + 5)));
+ }
+ return DI_OK;
+ }
for (i=0; i < lpdiaf->dwNumActions; i++)
{
- /* Don't touch a user configured action */
- if (lpdiaf->rgoAction[i].dwHow == DIAH_USERCONFIG) continue;
-
if ((lpdiaf->rgoAction[i].dwSemantic & devMask) == devMask)
{
DWORD obj_id = semantic_to_obj_id(This, lpdiaf->rgoAction[i].dwSemantic);
@@ -816,6 +850,14 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
}
}
+ /* Update dwCRC to track if action format has changed */
+ lpdiaf->dwCRC = 0;
+ for (i=0; i < lpdiaf->dwNumActions; i++)
+ {
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwObjID << i * 2) | (lpdiaf->rgoAction[i].dwObjID >> (sizeof(lpdiaf->dwCRC) * 8 - i * 2));
+ lpdiaf->dwCRC ^= (lpdiaf->rgoAction[i].dwSemantic << (i * 2 + 5)) | (lpdiaf->rgoAction[i].dwSemantic >> (sizeof(lpdiaf->dwCRC) * 8 - (i * 2 + 5)));
+ }
+
if (!has_actions) return DI_NOEFFECT;
return IDirectInputDevice8WImpl_BuildActionMap(iface, lpdiaf, lpszUserName, dwFlags);
@@ -831,6 +873,7 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
DIPROPSTRING dps;
WCHAR username[MAX_PATH];
DWORD username_size = MAX_PATH;
+ DWORD new_crc = 0;
int i, action = 0, num_actions = 0;
unsigned int offset = 0;
@@ -841,12 +884,23 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L
data_format.dwFlags = DIDF_RELAXIS;
data_format.dwDataSize = lpdiaf->dwDataSize;
+ /* Calculate checksum for actionformat */
+ for (i=0; i < lpdiaf->dwNumActions; i++)
+ {
+ new_crc ^= (lpdiaf->rgoAction[i].dwObjID << i * 2) | (lpdiaf->rgoAction[i].dwObjID >> (sizeof(lpdiaf->dwCRC) * 8 - i * 2));
+ new_crc ^= (lpdiaf->rgoAction[i].dwSemantic << (i * 2 + 5)) | (lpdiaf->rgoAction[i].dwSemantic >> (sizeof(lpdiaf->dwCRC) * 8 - (i * 2 + 5)));
+ }
+
/* Count the actions */
for (i=0; i < lpdiaf->dwNumActions; i++)
if (IsEqualGUID(&This->guid, &lpdiaf->rgoAction[i].guidInstance))
num_actions++;
- if (num_actions == 0) return DI_NOEFFECT;
+ /* Should return DI_NOEFFECT if we dont have any actions and actionformat has not changed */
+ if (num_actions == 0 && lpdiaf->dwCRC == new_crc && !(dwFlags & DIDSAM_FORCESAVE)) return DI_NOEFFECT;
+
+ /* update dwCRC to track if action format has changed */
+ lpdiaf->dwCRC = new_crc;
This->num_actions = num_actions;
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index b146712..267f932 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -907,6 +907,8 @@ HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
hr = JoystickWGenericImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
+ lpdiaf->dwCRC = diafW.dwCRC;
+
HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
HeapFree(GetProcessHeap(), 0, lpszUserNameW);
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index 42c0759..5c5aa14 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -693,6 +693,8 @@ static HRESULT WINAPI SysKeyboardAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
hr = SysKeyboardWImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
+ lpdiaf->dwCRC = diafW.dwCRC;
+
HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
HeapFree(GetProcessHeap(), 0, lpszUserNameW);
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index f3ec8e4..0adba03 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -863,6 +863,8 @@ static HRESULT WINAPI SysMouseAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
hr = SysMouseWImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
+ lpdiaf->dwCRC = diafW.dwCRC;
+
HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
HeapFree(GetProcessHeap(), 0, lpszUserNameW);
diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
index 1bfb34a..46a1e4a 100644
--- a/dlls/dinput8/tests/device.c
+++ b/dlls/dinput8/tests/device.c
@@ -38,6 +38,8 @@ struct enum_data {
/* Dummy GUID */
static const GUID ACTION_MAPPING_GUID = { 0x1, 0x2, 0x3, { 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb } };
+static const GUID NULL_GUID = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };
+
enum {
DITEST_AXIS,
DITEST_BUTTON,
@@ -365,6 +367,17 @@ static void test_action_mapping(void)
hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
ok (hr == DI_NOEFFECT, "SetActionMap should have no effect with no actions to map hr=%08x\n", hr);
+ /* Test that after changing actionformat SetActionMap has effect and that second
+ * SetActionMap call with same empty actionformat has no effect */
+ af.dwDataSize = 4 * 1;
+ af.dwNumActions = 1;
+
+ hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
+ ok (hr != DI_NOEFFECT, "SetActionMap should have effect as actionformat has changed hr=%08x\n", hr);
+
+ hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
+ ok (hr == DI_NOEFFECT, "SetActionMap should have no effect with no actions to map hr=%08x\n", hr);
+
af.dwDataSize = 4 * ARRAY_SIZE(actionMapping);
af.dwNumActions = ARRAY_SIZE(actionMapping);
@@ -556,6 +569,43 @@ static void test_save_settings(void)
"Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[1], af.rgoAction[1].dwObjID);
ok (IsEqualGUID(&GUID_SysKeyboard, &af.rgoAction[1].guidInstance), "Action should be mapped to keyboard\n");
+ /* Save and load empty mapping */
+ af.rgoAction[0].dwObjID = 0;
+ af.rgoAction[0].dwHow = 0;
+ memset(&af.rgoAction[0].guidInstance, 0, sizeof(GUID));
+ af.rgoAction[1].dwObjID = 0;
+ af.rgoAction[1].dwHow = 0;
+ memset(&af.rgoAction[1].guidInstance, 0, sizeof(GUID));
+
+ hr = IDirectInputDevice8_SetActionMap(pKey, &af, NULL, DIDSAM_FORCESAVE);
+ ok (SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr);
+
+ if (hr == DI_SETTINGSNOTSAVED)
+ {
+ skip ("Can't test saving settings if SetActionMap returns DI_SETTINGSNOTSAVED\n");
+ return;
+ }
+
+ af.rgoAction[0].dwObjID = other_results[0];
+ af.rgoAction[0].dwHow = DIAH_USERCONFIG;
+ af.rgoAction[0].guidInstance = GUID_SysKeyboard;
+ af.rgoAction[1].dwObjID = other_results[1];
+ af.rgoAction[1].dwHow = DIAH_USERCONFIG;
+ af.rgoAction[1].guidInstance = GUID_SysKeyboard;
+
+ hr = IDirectInputDevice8_BuildActionMap(pKey, &af, NULL, 0);
+ ok (SUCCEEDED(hr), "BuildActionMap failed hr=%08x\n", hr);
+
+ ok (other_results[0] == af.rgoAction[0].dwObjID,
+ "Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[0], af.rgoAction[0].dwObjID);
+ ok (af.rgoAction[0].dwHow == DIAH_UNMAPPED, "dwHow should have been DIAH_UNMAPPED\n");
+ ok (IsEqualGUID(&NULL_GUID, &af.rgoAction[0].guidInstance), "Action should not be mapped\n");
+
+ ok (other_results[1] == af.rgoAction[1].dwObjID,
+ "Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[1], af.rgoAction[1].dwObjID);
+ ok (af.rgoAction[1].dwHow == DIAH_UNMAPPED, "dwHow should have been DIAH_UNMAPPED\n");
+ ok (IsEqualGUID(&NULL_GUID, &af.rgoAction[1].guidInstance), "Action should not be mapped\n");
+
IDirectInputDevice_Release(pKey);
IDirectInput_Release(pDI);
}
--
1.9.1

View File

@@ -0,0 +1,428 @@
From af785463a8e9fc8ff47ead4143151e9831cbbddf 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/device.c | 2 +-
dlls/dinput/device_private.h | 1 +
dlls/dinput/dinput_main.c | 27 +++++++
4 files changed, 156 insertions(+), 57 deletions(-)
diff --git a/dlls/dinput/config.c b/dlls/dinput/config.c
index bf44898..cd2c4b9 100644
--- a/dlls/dinput/config.c
+++ b/dlls/dinput/config.c
@@ -29,6 +29,9 @@ typedef struct {
IDirectInputDevice8W *lpdid;
DIDEVICEINSTANCEW ddi;
DIDEVICEOBJECTINSTANCEW ddo[256];
+ /* ActionFormat for every user.
+ * In same order as ConfigureDevicesData usernames */
+ DIACTIONFORMATW *user_afs;
} DeviceData;
typedef struct {
@@ -38,10 +41,11 @@ typedef struct {
typedef struct {
IDirectInput8W *lpDI;
- LPDIACTIONFORMATW lpdiaf;
LPDIACTIONFORMATW original_lpdiaf;
DIDevicesData devices_data;
int display_only;
+ int nusernames;
+ WCHAR **usernames;
} ConfigureDevicesData;
/*
@@ -57,27 +61,42 @@ static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pv
return DIENUM_CONTINUE;
}
-static BOOL CALLBACK count_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
+static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
{
- DIDevicesData *data = (DIDevicesData*) pvRef;
+ ConfigureDevicesData *data = (ConfigureDevicesData*) pvRef;
+ DeviceData *device;
+ int i, j;
- data->ndevices++;
- return DIENUM_CONTINUE;
-}
+ IDirectInputDevice_AddRef(lpdid);
-static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDevice8W *lpdid, DWORD dwFlags, DWORD dwRemaining, LPVOID pvRef)
-{
- DIDevicesData *data = (DIDevicesData*) pvRef;
- DeviceData *device = &data->devices[data->ndevices];
+ /* alloc array for devices if this is our first device */
+ if (!data->devices_data.ndevices)
+ data->devices_data.devices = HeapAlloc(GetProcessHeap(), 0, sizeof(DeviceData) * (dwRemaining + 1));
+ device = &data->devices_data.devices[data->devices_data.ndevices];
device->lpdid = lpdid;
device->ddi = *lpddi;
- IDirectInputDevice_AddRef(lpdid);
-
device->nobjects = 0;
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);
+ 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);
+ for (j = 0; j < user_af->dwNumActions; j++)
+ {
+ user_af->rgoAction[j].dwSemantic = data->original_lpdiaf->rgoAction[j].dwSemantic;
+ user_af->rgoAction[j].u.lptszActionName = data->original_lpdiaf->rgoAction[j].u.lptszActionName;
+ }
+ IDirectInputDevice8_BuildActionMap(lpdid, user_af, data->usernames[i], 0);
+ }
+
+ data->devices_data.ndevices++;
return DIENUM_CONTINUE;
}
@@ -170,10 +189,18 @@ static DeviceData* get_cur_device(HWND dialog)
return &data->devices_data.devices[sel];
}
-static LPDIACTIONFORMATW get_cur_lpdiaf(HWND dialog)
+static DIACTIONFORMATW *get_cur_lpdiaf(HWND dialog)
+{
+ ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtrW(dialog, DWLP_USER);
+ int controller_sel = SendDlgItemMessageW(dialog, IDC_CONTROLLERCOMBO, CB_GETCURSEL, 0, 0);
+ int player_sel = SendDlgItemMessageW(dialog, IDC_PLAYERCOMBO, CB_GETCURSEL, 0, 0);
+ return &data->devices_data.devices[controller_sel].user_afs[player_sel];
+}
+
+static DIACTIONFORMATW *get_original_lpdiaf(HWND dialog)
{
ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtrW(dialog, DWLP_USER);
- return data->lpdiaf;
+ return data->original_lpdiaf;
}
static int dialog_display_only(HWND dialog)
@@ -182,40 +209,36 @@ static int dialog_display_only(HWND dialog)
return data->display_only;
}
-static void init_devices(HWND dialog, IDirectInput8W *lpDI, DIDevicesData *data, LPDIACTIONFORMATW lpdiaf)
+static void init_devices(HWND dialog, ConfigureDevicesData *data)
{
int i;
- /* Count devices */
- data->ndevices = 0;
- IDirectInput8_EnumDevicesBySemantics(lpDI, NULL, lpdiaf, count_devices, (LPVOID) data, 0);
-
- /* Allocate devices */
- data->devices = HeapAlloc(GetProcessHeap(), 0, sizeof(DeviceData) * data->ndevices);
-
/* Collect and insert */
- data->ndevices = 0;
- IDirectInput8_EnumDevicesBySemantics(lpDI, NULL, lpdiaf, collect_devices, (LPVOID) data, 0);
+ data->devices_data.ndevices = 0;
+ IDirectInput8_EnumDevicesBySemantics(data->lpDI, NULL, data->original_lpdiaf, collect_devices, (LPVOID) data, 0);
- for (i=0; i < data->ndevices; i++)
- SendDlgItemMessageW(dialog, IDC_CONTROLLERCOMBO, CB_ADDSTRING, 0, (LPARAM) data->devices[i].ddi.tszProductName );
+ for (i = 0; i < data->devices_data.ndevices; i++)
+ SendDlgItemMessageW(dialog, IDC_CONTROLLERCOMBO, CB_ADDSTRING, 0, (LPARAM) data->devices_data.devices[i].ddi.tszProductName );
+ for (i = 0; i < data->nusernames; i++)
+ SendDlgItemMessageW(dialog, IDC_PLAYERCOMBO, CB_ADDSTRING, 0, (LPARAM) data->usernames[i]);
}
static void destroy_data(HWND dialog)
{
- int i;
+ int i, j;
ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtrW(dialog, DWLP_USER);
DIDevicesData *devices_data = &data->devices_data;
/* Free the devices */
for (i=0; i < devices_data->ndevices; i++)
+ {
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);
+ }
HeapFree(GetProcessHeap(), 0, devices_data->devices);
-
- /* Free the backup LPDIACTIONFORMATW */
- HeapFree(GetProcessHeap(), 0, data->original_lpdiaf->rgoAction);
- HeapFree(GetProcessHeap(), 0, data->original_lpdiaf);
}
static void fill_device_object_list(HWND dialog)
@@ -231,6 +254,7 @@ static void fill_device_object_list(HWND dialog)
/* Add each object */
for (i=0; i < device->nobjects; i++)
{
+ DWORD ddo_inst, ddo_type;
int action = -1;
item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -241,12 +265,20 @@ static void fill_device_object_list(HWND dialog)
/* Add the item */
SendDlgItemMessageW(dialog, IDC_DEVICEOBJECTSLIST, LVM_INSERTITEMW, 0, (LPARAM) &item);
+ ddo_inst = DIDFT_GETINSTANCE(device->ddo[i].dwType);
+ ddo_type = DIDFT_GETTYPE(device->ddo[i].dwType);
- /* Search for an assigned action for this device */
+ /* Search for an assigned action for this device */
for (j=0; j < lpdiaf->dwNumActions; j++)
{
+ DWORD af_inst = DIDFT_GETINSTANCE(lpdiaf->rgoAction[j].dwObjID);
+ DWORD af_type = DIDFT_GETTYPE(lpdiaf->rgoAction[j].dwObjID);
+ if (af_type == DIDFT_PSHBUTTON) af_type = DIDFT_BUTTON;
+ if (af_type == DIDFT_RELAXIS) af_type = DIDFT_AXIS;
+ /* NOTE previously compared dwType == dwObjId but default buildActionMap actions
+ * were PSHBUTTON and RELAXS and didnt show up on config */
if (IsEqualGUID(&lpdiaf->rgoAction[j].guidInstance, &device->ddi.guidInstance) &&
- lpdiaf->rgoAction[j].dwObjID == device->ddo[i].dwType)
+ ddo_inst == af_inst && ddo_type & af_type)
{
action = j;
break;
@@ -260,7 +292,7 @@ static void fill_device_object_list(HWND dialog)
static void show_suitable_actions(HWND dialog)
{
DeviceData *device = get_cur_device(dialog);
- LPDIACTIONFORMATW lpdiaf = get_cur_lpdiaf(dialog);
+ LPDIACTIONFORMATW lpdiaf = get_original_lpdiaf(dialog);
int i, added = 0;
int obj = lv_get_cur_item(dialog);
@@ -329,24 +361,35 @@ static void assign_action(HWND dialog)
lv_set_action(dialog, obj, action, lpdiaf);
}
-static void copy_actions(LPDIACTIONFORMATW to, LPDIACTIONFORMATW from)
+static void reset_actions(HWND dialog)
{
- DWORD i;
- for (i=0; i < from->dwNumActions; i++)
+ ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtrW(dialog, DWLP_USER);
+ DIDevicesData *ddata = (DIDevicesData*) &data->devices_data;
+ unsigned i, j;
+
+ for (i = 0; i < data->devices_data.ndevices; i++)
{
- to->rgoAction[i].guidInstance = from->rgoAction[i].guidInstance;
- to->rgoAction[i].dwObjID = from->rgoAction[i].dwObjID;
- to->rgoAction[i].dwHow = from->rgoAction[i].dwHow;
- to->rgoAction[i].u.lptszActionName = from->rgoAction[i].u.lptszActionName;
+ DeviceData *device = &ddata->devices[i];
+ for (j = 0; j < data->nusernames; j++)
+ IDirectInputDevice8_BuildActionMap(device->lpdid, &device->user_afs[j], data->usernames[j], DIDBAM_HWDEFAULTS);
}
}
-static void reset_actions(HWND dialog)
-{
+static void save_actions(HWND dialog) {
ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtrW(dialog, DWLP_USER);
- LPDIACTIONFORMATW to = data->lpdiaf, from = data->original_lpdiaf;
-
- copy_actions(to, from);
+ DIDevicesData *ddata = (DIDevicesData*) &data->devices_data;
+ unsigned i, j;
+ if (!data->display_only) {
+ for (i = 0; i < ddata->ndevices; i++)
+ {
+ DeviceData *device = &ddata->devices[i];
+ for (j = 0; j < data->nusernames; j++)
+ {
+ if (save_mapping_settings(device->lpdid, &device->user_afs[j], data->usernames[j]) != DI_OK)
+ MessageBoxA(dialog, "Could not save settings", 0, MB_ICONERROR);
+ }
+ }
+ }
}
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
ConfigureDevicesData *data = (ConfigureDevicesData*) lParam;
/* Initialize action format and enumerate devices */
- init_devices(dialog, data->lpDI, &data->devices_data, data->lpdiaf);
+ init_devices(dialog, data);
/* Store information in the window */
SetWindowLongPtrW(dialog, DWLP_USER, (LONG_PTR) data);
init_listview_columns(dialog);
- /* Create a backup action format for CANCEL and RESET operations */
- data->original_lpdiaf = HeapAlloc(GetProcessHeap(), 0, sizeof(*data->original_lpdiaf));
- data->original_lpdiaf->dwNumActions = data->lpdiaf->dwNumActions;
- data->original_lpdiaf->rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*data->lpdiaf->dwNumActions);
- copy_actions(data->original_lpdiaf, data->lpdiaf);
-
/* Select the first device and show its actions */
SendDlgItemMessageW(dialog, IDC_CONTROLLERCOMBO, CB_SETCURSEL, 0, 0);
+ SendDlgItemMessageW(dialog, IDC_PLAYERCOMBO, CB_SETCURSEL, 0, 0);
fill_device_object_list(dialog);
ShowCursor(TRUE);
@@ -414,6 +452,7 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
break;
case IDC_CONTROLLERCOMBO:
+ case IDC_PLAYERCOMBO:
switch (HIWORD(wParam))
{
@@ -424,12 +463,12 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
break;
case IDOK:
+ save_actions(dialog);
EndDialog(dialog, 0);
destroy_data(dialog);
break;
case IDCANCEL:
- reset_actions(dialog);
EndDialog(dialog, 0);
destroy_data(dialog);
break;
@@ -452,15 +491,47 @@ HRESULT _configure_devices(IDirectInput8W *iface,
LPVOID pvRefData
)
{
+ int i;
+ DWORD default_username_size = MAX_PATH;
+ WCHAR *default_username = 0;
ConfigureDevicesData data;
data.lpDI = iface;
- data.lpdiaf = lpdiCDParams->lprgFormats;
+ data.original_lpdiaf = lpdiCDParams->lprgFormats;
data.display_only = !(dwFlags & DICD_EDIT);
+ data.nusernames = lpdiCDParams->dwcUsers;
+ if (lpdiCDParams->lptszUserNames == NULL)
+ {
+ /* Get default user name */
+ default_username = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*MAX_PATH);
+ data.nusernames = 1;
+ data.usernames = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *));
+ data.usernames[0] = default_username;
+ GetUserNameW(default_username, &default_username_size);
+ }
+ else
+ {
+ WCHAR *p = lpdiCDParams->lptszUserNames;
+ data.usernames = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *)*data.nusernames);
+ for (i = 0; i < data.nusernames; i++)
+ {
+ if (*p)
+ {
+ data.usernames[i] = p;
+ while (*(p++));
+ }
+ else
+ /* Return if there is an empty string */
+ return DIERR_INVALIDPARAM;
+ }
+ }
InitCommonControls();
DialogBoxParamW(DINPUT_instance, (const WCHAR *)MAKEINTRESOURCE(IDD_CONFIGUREDEVICES),
lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data);
+ HeapFree(GetProcessHeap(), 0, default_username);
+ HeapFree(GetProcessHeap(), 0, data.usernames);
+
return DI_OK;
}
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index b441743..0c94326 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
return hkey;
}
-static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUsername)
+HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUsername)
{
WCHAR *guid_str = NULL;
DIDEVICEINSTANCEW didev;
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
index af8d99d..36b71f7 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;
extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
+extern HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUsername) DECLSPEC_HIDDEN;
extern BOOL load_mapping_settings(IDirectInputDeviceImpl *This, LPDIACTIONFORMATW lpdiaf, const WCHAR *username) DECLSPEC_HIDDEN;
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
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -1251,9 +1251,34 @@ static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
/* Copy parameters */
diCDParamsW.dwSize = sizeof(DICONFIGUREDEVICESPARAMSW);
+ diCDParamsW.dwcUsers = lpdiCDParams->dwcUsers;
diCDParamsW.dwcFormats = lpdiCDParams->dwcFormats;
diCDParamsW.lprgFormats = &diafW;
diCDParamsW.hwnd = lpdiCDParams->hwnd;
+ diCDParamsW.lptszUserNames = NULL;
+
+ if (lpdiCDParams->lptszUserNames) {
+ char *start = lpdiCDParams->lptszUserNames;
+ WCHAR *to = NULL;
+ int total_len = 0;
+ for (i = 0; i < lpdiCDParams->dwcUsers; i++)
+ {
+ char *end = start + 1;
+ int len;
+ while (*(end++));
+ len = MultiByteToWideChar(CP_ACP, 0, start, end - start, NULL, 0);
+ total_len += len + 2; /* length of string and two null char */
+ if (to)
+ to = HeapReAlloc(GetProcessHeap(), 0, to, sizeof(WCHAR) * total_len);
+ else
+ to = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * total_len);
+
+ MultiByteToWideChar(CP_ACP, 0, start, end - start, to + (total_len - len - 2), len);
+ to[total_len] = 0;
+ to[total_len - 1] = 0;
+ }
+ diCDParamsW.lptszUserNames = to;
+ }
diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiCDParams->lprgFormats->dwNumActions);
_copy_diactionformatAtoW(&diafW, lpdiCDParams->lprgFormats);
@@ -1281,6 +1306,8 @@ static HRESULT WINAPI IDirectInput8AImpl_ConfigureDevices(
HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
+ HeapFree(GetProcessHeap(), 0, (void*) diCDParamsW.lptszUserNames);
+
return hr;
}
--
1.9.1

View File

@@ -0,0 +1 @@
Fixes: [34108] dinput: Improve support for user Joystick configuration.

View File

@@ -1,51 +0,0 @@
From a82c1a7a7342200b8112dc4176ad5adf557787c0 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Sun, 31 Mar 2019 13:02:27 +0200
Subject: [PATCH 1/2] winejoystick: Add support for wheel axes
Wheel, gas, and brake are replacements for X, Y and Z in wheel-like
joysticks. Remap them internally to send inputs as X, Y, and Z.
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
---
dlls/winejoystick.drv/joystick_linux.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/winejoystick.drv/joystick_linux.c b/dlls/winejoystick.drv/joystick_linux.c
index 287f4be..7c24040 100644
--- a/dlls/winejoystick.drv/joystick_linux.c
+++ b/dlls/winejoystick.drv/joystick_linux.c
@@ -280,10 +280,13 @@ static const WCHAR ini[] = {'W','i','n','e',' ','J','o','y','s','t','i','c','k',
switch (jstck->axesMap[i]) {
case 0: /* X */
case 1: /* Y */
+ case 8: /* Wheel */
+ case 9: /* Gas */
lpCaps->wNumAxes++;
break;
case 2: /* Z */
case 6: /* Throttle */
+ case 10: /* Brake */
lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASZ;
break;
@@ -365,13 +368,16 @@ LRESULT driver_joyGetPosEx(DWORD_PTR dwDevID, LPJOYINFOEX lpInfo)
if (ev.type == (JS_EVENT_AXIS)) {
switch (jstck->axesMap[ev.number]) {
case 0: /* X */
+ case 8: /* Wheel */
jstck->x = ev.value;
break;
case 1: /* Y */
+ case 9: /* Gas */
jstck->y = ev.value;
break;
case 2: /* Z */
case 6: /* Throttle */
+ case 10: /* Brake */
jstck->z = ev.value;
break;
case 5: /* Rz */
--
1.9.1

View File

@@ -1,37 +0,0 @@
From dddcfcb92fb61c70738378b29db0ede050bcf162 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Sun, 31 Mar 2019 13:09:43 +0200
Subject: [PATCH 2/2] dinput: Map wheel, gas, and brake axes as well
The axes wheel, gas, and brake are just differently named replacements
for X, Y, and Z when using wheel-like joysticks.
Make those accessible by remapping them to X, Y, and Z internally.
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
---
dlls/dinput/joystick_linux.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 963e62f..c4efc93 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -239,6 +239,14 @@ static INT find_joystick_devices(void)
joydev.dev_axes_map[j] = j;
found_axes++;
}
+ else if (axes_map[j] <= 10)
+ {
+ /* Axes 8 through 10 are Wheel, Gas and Brake,
+ * remap to 0, 1 and 2
+ */
+ joydev.dev_axes_map[j] = axes_map[j] - 8;
+ found_axes++;
+ }
else if (axes_map[j] == 16 ||
axes_map[j] == 17)
{
--
1.9.1

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