You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
77 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b22ec60228 | ||
|
15a75851db | ||
|
5cd91c5928 | ||
|
5e623ee4d9 | ||
|
2677244e40 | ||
|
65a5de8630 | ||
|
b2341b8d08 | ||
|
c4de5ab774 | ||
|
f3854126b1 | ||
|
c40429f3c9 | ||
|
d1af5f06fa | ||
|
af5ec899c3 | ||
|
3c781f3862 | ||
|
7257898858 | ||
|
3ad216bb25 | ||
|
32823d7014 | ||
|
efca1a6845 | ||
|
76177e1da2 | ||
|
dbaede0fc8 | ||
|
5353b4a5a4 | ||
|
910abaa327 | ||
|
6db72e951e | ||
|
b9514dd7b0 | ||
|
76a233502e | ||
|
c0993595fe | ||
|
49ba202882 | ||
|
80a4e6bdd7 | ||
|
0c4032f598 | ||
|
96bce84236 | ||
|
e0e48313df | ||
|
105afd2146 | ||
|
966293c5d3 | ||
|
b19d0ea3ca | ||
|
e745798070 | ||
|
bb54734bd3 | ||
|
12d8b79c63 | ||
|
986a011548 | ||
|
2c08a980e8 | ||
|
9686fe6647 | ||
|
b013afa660 | ||
|
bdb212523c | ||
|
d4f26a2f95 | ||
|
1261a0540c | ||
|
577b85bdc8 | ||
|
96a6d1cecc | ||
|
a90497bdef | ||
|
b6c5b6240b | ||
|
9c43bb8d2c | ||
|
f06f5c3b0c | ||
|
b2098faef8 | ||
|
4b0fe0c820 | ||
|
604d23df7c | ||
|
e65410b901 | ||
|
7b4727f89c | ||
|
5f4b99aa18 | ||
|
73c19719e0 | ||
|
eaff208f0d | ||
|
77452f30f8 | ||
|
7ad3349f66 | ||
|
8c909daf10 | ||
|
51fd657cdb | ||
|
634b0e2877 | ||
|
2660a14433 | ||
|
ad5fb8a69e | ||
|
b338f0c6d5 | ||
|
c9f8f08e41 | ||
|
a16141c94f | ||
|
d1fe864c5e | ||
|
57055bbf20 | ||
|
c55fed6a14 | ||
|
ddd669c75b | ||
|
252ee012a2 | ||
|
024a141714 | ||
|
5530538a2b | ||
|
b51fe90caa | ||
|
cb8a0d2ffd | ||
|
11313c0788 |
@@ -7,7 +7,7 @@ are part of **Wine Staging** and are licensed under the terms of the
|
||||
[LGPLv2.1](#gnu-lgpl-version-21), to stay compatible with Wine:
|
||||
|
||||
```
|
||||
Copyright (C) 2014-2016 the Wine Staging project authors.
|
||||
Copyright (C) 2014-2017 the Wine Staging project authors.
|
||||
|
||||
Wine Staging is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From b6efa0b8bb1bba73863ca985c13d46a5eaec4198 Mon Sep 17 00:00:00 2001
|
||||
From c178117abacbf8644ae05429999ff8e8f8585a7e Mon Sep 17 00:00:00 2001
|
||||
From: Hans Leidekker <hans@codeweavers.com>
|
||||
Date: Mon, 19 Dec 2016 19:38:52 +0100
|
||||
Subject: bcrypt: Add AES provider.
|
||||
@@ -7,11 +7,12 @@ Subject: bcrypt: Add AES provider.
|
||||
dlls/bcrypt/bcrypt.spec | 10 +-
|
||||
dlls/bcrypt/bcrypt_main.c | 347 ++++++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/bcrypt/tests/bcrypt.c | 18 +--
|
||||
dlls/ncrypt/ncrypt.spec | 10 +-
|
||||
include/bcrypt.h | 3 +
|
||||
4 files changed, 352 insertions(+), 26 deletions(-)
|
||||
5 files changed, 357 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index e299fe0..962953e 100644
|
||||
index e299fe0cce8..962953e509b 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -5,15 +5,15 @@
|
||||
@@ -52,7 +53,7 @@ index e299fe0..962953e 100644
|
||||
@ stub BCryptUnregisterConfigChangeNotify
|
||||
@ stub BCryptUnregisterProvider
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 6023c94..937bdf7 100644
|
||||
index 6023c942e49..5e066283f6e 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -49,6 +49,10 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
@@ -498,7 +499,7 @@ index 6023c94..937bdf7 100644
|
||||
{
|
||||
switch (reason)
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 3e41335..2668153 100644
|
||||
index 422f2cfd340..d2df74ed919 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -780,7 +780,7 @@ static void test_aes(void)
|
||||
@@ -510,7 +511,7 @@ index 3e41335..2668153 100644
|
||||
alg = NULL;
|
||||
ret = pBCryptOpenAlgorithmProvider(&alg, BCRYPT_AES_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
@@ -828,7 +828,6 @@ todo_wine {
|
||||
@@ -814,7 +814,6 @@ todo_wine {
|
||||
ret = pBCryptCloseAlgorithmProvider(alg, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
}
|
||||
@@ -518,7 +519,7 @@ index 3e41335..2668153 100644
|
||||
|
||||
static void test_BCryptGenerateSymmetricKey(void)
|
||||
{
|
||||
@@ -847,11 +846,6 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
@@ -833,11 +832,6 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = pBCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
|
||||
@@ -530,7 +531,7 @@ index 3e41335..2668153 100644
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
len = size = 0xdeadbeef;
|
||||
@@ -936,11 +930,6 @@ static void test_BCryptEncrypt(void)
|
||||
@@ -922,11 +916,6 @@ static void test_BCryptEncrypt(void)
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = pBCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
|
||||
@@ -542,7 +543,7 @@ index 3e41335..2668153 100644
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
len = 0xdeadbeef;
|
||||
@@ -1027,11 +1016,6 @@ static void test_BCryptDecrypt(void)
|
||||
@@ -1013,11 +1002,6 @@ static void test_BCryptDecrypt(void)
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = pBCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
|
||||
@@ -554,8 +555,51 @@ index 3e41335..2668153 100644
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
len = 0xdeadbeef;
|
||||
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
|
||||
index 04127608d68..60b7eb37075 100644
|
||||
--- a/dlls/ncrypt/ncrypt.spec
|
||||
+++ b/dlls/ncrypt/ncrypt.spec
|
||||
@@ -5,17 +5,17 @@
|
||||
@ stub BCryptConfigureContextFunction
|
||||
@ stub BCryptCreateContext
|
||||
@ stdcall BCryptCreateHash(ptr ptr ptr long ptr long long) bcrypt.BCryptCreateHash
|
||||
-@ stub BCryptDecrypt
|
||||
+@ stdcall BCryptDecrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptDecrypt
|
||||
@ stub BCryptDeleteContext
|
||||
@ stub BCryptDeriveKey
|
||||
@ stub BCryptDeriveKeyCapi
|
||||
@ stub BCryptDeriveKeyPBKDF2
|
||||
@ stdcall BCryptDestroyHash(ptr) bcrypt.BCryptDestroyHash
|
||||
-@ stub BCryptDestroyKey
|
||||
+@ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey
|
||||
@ stub BCryptDestroySecret
|
||||
@ stub BCryptDuplicateHash
|
||||
@ stub BCryptDuplicateKey
|
||||
-@ stub BCryptEncrypt
|
||||
+@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms
|
||||
@ stub BCryptEnumContextFunctionProviders
|
||||
@ stub BCryptEnumContextFunctions
|
||||
@@ -28,7 +28,7 @@
|
||||
@ stub BCryptFreeBuffer
|
||||
@ stdcall BCryptGenRandom(ptr ptr long long) bcrypt.BCryptGenRandom
|
||||
@ stub BCryptGenerateKeyPair
|
||||
-@ stub BCryptGenerateSymmetricKey
|
||||
+@ stdcall BCryptGenerateSymmetricKey(ptr ptr ptr long ptr long long) bcrypt.BCryptGenerateSymmetricKey
|
||||
@ stdcall BCryptGetFipsAlgorithmMode(ptr) bcrypt.BCryptGetFipsAlgorithmMode
|
||||
@ stdcall BCryptGetProperty(ptr wstr ptr long ptr long) bcrypt.BCryptGetProperty
|
||||
@ stdcall BCryptHash(ptr ptr long ptr long ptr long) bcrypt.BCryptHash
|
||||
@@ -49,7 +49,7 @@
|
||||
@ stub BCryptSecretAgreement
|
||||
@ stub BCryptSetAuditingInterface
|
||||
@ stub BCryptSetContextFunctionProperty
|
||||
-@ stub BCryptSetProperty
|
||||
+@ stdcall BCryptSetProperty(ptr wstr ptr long long) bcrypt.BCryptSetProperty
|
||||
@ stub BCryptSignHash
|
||||
@ stub BCryptUnregisterConfigChangeNotify
|
||||
@ stub BCryptUnregisterProvider
|
||||
diff --git a/include/bcrypt.h b/include/bcrypt.h
|
||||
index 05d0691..6af85e3 100644
|
||||
index 05d0691f9c3..6af85e36143 100644
|
||||
--- a/include/bcrypt.h
|
||||
+++ b/include/bcrypt.h
|
||||
@@ -74,6 +74,9 @@ typedef LONG NTSTATUS;
|
||||
@@ -569,5 +613,5 @@ index 05d0691..6af85e3 100644
|
||||
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
|
||||
{
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From ecff30df4deadc0df006a880a5528343a4ab788f Mon Sep 17 00:00:00 2001
|
||||
From 3439b4e5a1fd05c4fb68491c3814de2581e8a5aa Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 20 Dec 2016 02:36:57 +0100
|
||||
Subject: bcrypt: Add internal fallback implementation for hash calculations.
|
||||
@@ -17,7 +17,7 @@ Subject: bcrypt: Add internal fallback implementation for hash calculations.
|
||||
create mode 100644 dlls/bcrypt/sha512.c
|
||||
|
||||
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
|
||||
index ef9d7ea..38753bd 100644
|
||||
index ef9d7ead6bc..f54fc5cd482 100644
|
||||
--- a/dlls/bcrypt/Makefile.in
|
||||
+++ b/dlls/bcrypt/Makefile.in
|
||||
@@ -4,6 +4,9 @@ IMPORTLIB = bcrypt
|
||||
@@ -27,13 +27,13 @@ index ef9d7ea..38753bd 100644
|
||||
- bcrypt_main.c
|
||||
+ bcrypt_main.c \
|
||||
+ sha256.c \
|
||||
+ sha512.c \
|
||||
+ sha384.c
|
||||
+ sha384.c \
|
||||
+ sha512.c
|
||||
|
||||
RC_SRCS = version.rc
|
||||
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
|
||||
new file mode 100644
|
||||
index 0000000..8a8f6d1
|
||||
index 00000000000..8a8f6d170c4
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/bcrypt_internal.h
|
||||
@@ -0,0 +1,79 @@
|
||||
@@ -117,7 +117,7 @@ index 0000000..8a8f6d1
|
||||
+
|
||||
+#endif /* __BCRYPT_INTERNAL_H */
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index af2314a..9441cf0 100644
|
||||
index 1f22063dbda..fbaece21f47 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -36,6 +36,8 @@
|
||||
@@ -251,7 +251,7 @@ index af2314a..9441cf0 100644
|
||||
|
||||
diff --git a/dlls/bcrypt/sha256.c b/dlls/bcrypt/sha256.c
|
||||
new file mode 100644
|
||||
index 0000000..48c4a48
|
||||
index 00000000000..48c4a48d031
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/sha256.c
|
||||
@@ -0,0 +1,169 @@
|
||||
@@ -426,7 +426,7 @@ index 0000000..48c4a48
|
||||
+}
|
||||
diff --git a/dlls/bcrypt/sha384.c b/dlls/bcrypt/sha384.c
|
||||
new file mode 100644
|
||||
index 0000000..81e7e08
|
||||
index 00000000000..81e7e08fd07
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/sha384.c
|
||||
@@ -0,0 +1,41 @@
|
||||
@@ -473,7 +473,7 @@ index 0000000..81e7e08
|
||||
+}
|
||||
diff --git a/dlls/bcrypt/sha512.c b/dlls/bcrypt/sha512.c
|
||||
new file mode 100644
|
||||
index 0000000..fdd7867
|
||||
index 00000000000..fdd7867eab7
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/sha512.c
|
||||
@@ -0,0 +1,191 @@
|
||||
@@ -669,5 +669,5 @@ index 0000000..fdd7867
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 9331e2a78e8ec0ba29ed1041a9f851ffd39cc249 Mon Sep 17 00:00:00 2001
|
||||
From 3dc21336baced97a110773ac9e72db210a56af82 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 20 Dec 2016 03:59:19 +0100
|
||||
Subject: bcrypt: Implement BCryptDuplicateHash.
|
||||
@@ -7,10 +7,11 @@ FIXME: Should we check for NULL pointers?
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 2 +-
|
||||
dlls/bcrypt/bcrypt_main.c | 18 ++++++++++++++++++
|
||||
2 files changed, 19 insertions(+), 1 deletion(-)
|
||||
dlls/ncrypt/ncrypt.spec | 2 +-
|
||||
3 files changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index 962953e..9ecd21d 100644
|
||||
index 962953e509b..9ecd21d767c 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -11,7 +11,7 @@
|
||||
@@ -23,7 +24,7 @@ index 962953e..9ecd21d 100644
|
||||
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long)
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long)
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 3e2b22d..944a9ea 100644
|
||||
index 4f09948096c..3eb0135b37c 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -672,6 +672,24 @@ end:
|
||||
@@ -51,6 +52,19 @@ index 3e2b22d..944a9ea 100644
|
||||
NTSTATUS WINAPI BCryptDestroyHash( BCRYPT_HASH_HANDLE handle )
|
||||
{
|
||||
struct hash *hash = handle;
|
||||
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
|
||||
index 60b7eb37075..1a78853bf49 100644
|
||||
--- a/dlls/ncrypt/ncrypt.spec
|
||||
+++ b/dlls/ncrypt/ncrypt.spec
|
||||
@@ -13,7 +13,7 @@
|
||||
@ stdcall BCryptDestroyHash(ptr) bcrypt.BCryptDestroyHash
|
||||
@ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey
|
||||
@ stub BCryptDestroySecret
|
||||
-@ stub BCryptDuplicateHash
|
||||
+@ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash
|
||||
@ stub BCryptDuplicateKey
|
||||
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e930551dfa4e0bb97db71d056a4ed59f9e459e01 Mon Sep 17 00:00:00 2001
|
||||
From 6d590beb24ef04948fe8e05fff3a72c1d415a7c1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 26 Dec 2016 08:28:24 +0100
|
||||
Subject: bcrypt: Implement BCryptDuplicateKey.
|
||||
@@ -6,10 +6,11 @@ Subject: bcrypt: Implement BCryptDuplicateKey.
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 2 +-
|
||||
dlls/bcrypt/bcrypt_main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 50 insertions(+), 1 deletion(-)
|
||||
dlls/ncrypt/ncrypt.spec | 2 +-
|
||||
3 files changed, 51 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index 9ecd21d..f5911d2 100644
|
||||
index 9ecd21d767c..f5911d2cd40 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -12,7 +12,7 @@
|
||||
@@ -22,7 +23,7 @@ index 9ecd21d..f5911d2 100644
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long)
|
||||
@ stub BCryptEnumContextFunctionProviders
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 198b010..37d6909 100644
|
||||
index 198b010b27e..37d69095f7a 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -915,6 +915,24 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, UCHAR *secret,
|
||||
@@ -95,6 +96,19 @@ index 198b010..37d6909 100644
|
||||
NTSTATUS WINAPI BCryptDestroyKey( BCRYPT_KEY_HANDLE handle )
|
||||
{
|
||||
struct key *key = handle;
|
||||
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
|
||||
index 1a78853bf49..b14a332e18f 100644
|
||||
--- a/dlls/ncrypt/ncrypt.spec
|
||||
+++ b/dlls/ncrypt/ncrypt.spec
|
||||
@@ -14,7 +14,7 @@
|
||||
@ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey
|
||||
@ stub BCryptDestroySecret
|
||||
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash
|
||||
-@ stub BCryptDuplicateKey
|
||||
+@ stdcall BCryptDuplicateKey(ptr ptr ptr long long) bcrypt.BCryptDuplicateKey
|
||||
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms
|
||||
@ stub BCryptEnumContextFunctionProviders
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -1,132 +0,0 @@
|
||||
From 1b05fa6764dc8eb220ef9dd349801fa2e76914bd Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 17 Oct 2015 15:38:13 +0200
|
||||
Subject: comctl32/tests: Add tests for PROPSHEET_InsertPage.
|
||||
|
||||
---
|
||||
dlls/comctl32/tests/propsheet.c | 97 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 96 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
|
||||
index 6594298..8fdbae8 100644
|
||||
--- a/dlls/comctl32/tests/propsheet.c
|
||||
+++ b/dlls/comctl32/tests/propsheet.c
|
||||
@@ -806,7 +806,7 @@ static void test_PSM_ADDPAGE(void)
|
||||
psp.pfnDlgProc = page_dlg_proc_messages;
|
||||
psp.lParam = 0;
|
||||
|
||||
- /* two page with the same data */
|
||||
+ /* multiple pages with the same data */
|
||||
hpsp[0] = CreatePropertySheetPageA(&psp);
|
||||
hpsp[1] = CreatePropertySheetPageA(&psp);
|
||||
hpsp[2] = CreatePropertySheetPageA(&psp);
|
||||
@@ -878,6 +878,100 @@ if (0)
|
||||
DestroyWindow(hdlg);
|
||||
}
|
||||
|
||||
+static void test_PSM_INSERTPAGE(void)
|
||||
+{
|
||||
+ HPROPSHEETPAGE hpsp[5];
|
||||
+ PROPSHEETPAGEA psp;
|
||||
+ PROPSHEETHEADERA psh;
|
||||
+ HWND hdlg, tab;
|
||||
+ BOOL ret;
|
||||
+ DWORD r;
|
||||
+
|
||||
+ memset(&psp, 0, sizeof(psp));
|
||||
+ psp.dwSize = sizeof(psp);
|
||||
+ psp.dwFlags = 0;
|
||||
+ psp.hInstance = GetModuleHandleA(NULL);
|
||||
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST);
|
||||
+ U2(psp).pszIcon = NULL;
|
||||
+ psp.pfnDlgProc = page_dlg_proc_messages;
|
||||
+ psp.lParam = 0;
|
||||
+
|
||||
+ /* multiple pages with the same data */
|
||||
+ hpsp[0] = CreatePropertySheetPageA(&psp);
|
||||
+ hpsp[1] = CreatePropertySheetPageA(&psp);
|
||||
+ hpsp[2] = CreatePropertySheetPageA(&psp);
|
||||
+
|
||||
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR);
|
||||
+ hpsp[3] = CreatePropertySheetPageA(&psp);
|
||||
+
|
||||
+ psp.dwFlags = PSP_PREMATURE;
|
||||
+ hpsp[4] = CreatePropertySheetPageA(&psp);
|
||||
+
|
||||
+ memset(&psh, 0, sizeof(psh));
|
||||
+ psh.dwSize = PROPSHEETHEADERA_V1_SIZE;
|
||||
+ psh.dwFlags = PSH_MODELESS;
|
||||
+ psh.pszCaption = "test caption";
|
||||
+ psh.nPages = 1;
|
||||
+ psh.hwndParent = GetDesktopWindow();
|
||||
+ U3(psh).phpage = hpsp;
|
||||
+
|
||||
+ hdlg = (HWND)PropertySheetA(&psh);
|
||||
+ ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
|
||||
+
|
||||
+ /* add pages one by one */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 5, (LPARAM)hpsp[1]);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ /* try with invalid values */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, 0);
|
||||
+ ok(ret == FALSE, "got %d\n", ret);
|
||||
+
|
||||
+if (0)
|
||||
+{
|
||||
+ /* crashes on native */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)INVALID_HANDLE_VALUE);
|
||||
+}
|
||||
+
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)INVALID_HANDLE_VALUE, (LPARAM)hpsp[2]);
|
||||
+ ok(ret == FALSE, "got %d\n", ret);
|
||||
+
|
||||
+ /* check item count */
|
||||
+ tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 2, "got %d\n", r);
|
||||
+
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 3, "got %d\n", r);
|
||||
+
|
||||
+ /* add property sheet page that can't be created */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 4, "got %d\n", r);
|
||||
+
|
||||
+ /* select page that can't be created */
|
||||
+ ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 3, "got %d\n", r);
|
||||
+
|
||||
+ /* test PSP_PREMATURE flag with incorrect property sheet page */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
|
||||
+ ok(ret == FALSE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 3, "got %d\n", r);
|
||||
+
|
||||
+ DestroyPropertySheetPage(hpsp[4]);
|
||||
+ DestroyWindow(hdlg);
|
||||
+}
|
||||
+
|
||||
START_TEST(propsheet)
|
||||
{
|
||||
test_title();
|
||||
@@ -888,4 +982,5 @@ START_TEST(propsheet)
|
||||
test_custom_default_button();
|
||||
test_messages();
|
||||
test_PSM_ADDPAGE();
|
||||
+ test_PSM_INSERTPAGE();
|
||||
}
|
||||
--
|
||||
2.6.2
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,174 @@
|
||||
From 06cf41da9e0aeb09d3753132262d1b0e1207cd7f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 19 Jan 2017 16:54:42 +0100
|
||||
Subject: wined3d: Add wined3d_resource_map_info function.
|
||||
|
||||
---
|
||||
dlls/wined3d/buffer.c | 19 +++++++++++++++++++
|
||||
dlls/wined3d/resource.c | 8 ++++++++
|
||||
dlls/wined3d/texture.c | 31 +++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/wined3d.spec | 1 +
|
||||
dlls/wined3d/wined3d_private.h | 2 ++
|
||||
include/wine/wined3d.h | 9 +++++++++
|
||||
6 files changed, 70 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 6883b4010a0..1924752a421 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1405,6 +1405,24 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
|
||||
return wined3d_buffer_map(buffer, offset, size, (BYTE **)&map_desc->data, flags);
|
||||
}
|
||||
|
||||
+static HRESULT buffer_resource_sub_resource_map_info(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_map_info *info, DWORD flags)
|
||||
+{
|
||||
+ struct wined3d_buffer *buffer = buffer_from_resource(resource);
|
||||
+
|
||||
+ if (sub_resource_idx)
|
||||
+ {
|
||||
+ WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
|
||||
+ return E_INVALIDARG;
|
||||
+ }
|
||||
+
|
||||
+ info->row_pitch = buffer->desc.byte_width;
|
||||
+ info->slice_pitch = buffer->desc.byte_width;
|
||||
+ info->size = buffer->resource.size;
|
||||
+
|
||||
+ return WINED3D_OK;
|
||||
+}
|
||||
+
|
||||
static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
|
||||
{
|
||||
if (sub_resource_idx)
|
||||
@@ -1424,6 +1442,7 @@ static const struct wined3d_resource_ops buffer_resource_ops =
|
||||
buffer_resource_preload,
|
||||
buffer_unload,
|
||||
buffer_resource_sub_resource_map,
|
||||
+ buffer_resource_sub_resource_map_info,
|
||||
buffer_resource_sub_resource_unmap,
|
||||
};
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index ab64de07f41..51da49077ed 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -359,6 +359,14 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
|
||||
return wined3d_cs_map(resource->device->cs, resource, sub_resource_idx, map_desc, box, flags);
|
||||
}
|
||||
|
||||
+HRESULT CDECL wined3d_resource_map_info(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_map_info *info, DWORD flags)
|
||||
+{
|
||||
+ TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx);
|
||||
+
|
||||
+ return resource->resource_ops->resource_map_info(resource, sub_resource_idx, info, flags);
|
||||
+}
|
||||
+
|
||||
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
|
||||
{
|
||||
TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx);
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 8d5e37a4949..be301420858 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -2194,6 +2194,36 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+static HRESULT texture_resource_sub_resource_map_info(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_map_info *info, DWORD flags)
|
||||
+{
|
||||
+ const struct wined3d_format *format = resource->format;
|
||||
+ struct wined3d_texture_sub_resource *sub_resource;
|
||||
+ unsigned int fmt_flags = resource->format_flags;
|
||||
+ struct wined3d_texture *texture;
|
||||
+ unsigned int texture_level;
|
||||
+
|
||||
+ texture = texture_from_resource(resource);
|
||||
+ if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx)))
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
+ texture_level = sub_resource_idx % texture->level_count;
|
||||
+
|
||||
+ if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
|
||||
+ {
|
||||
+ info->row_pitch = wined3d_texture_get_level_width(texture, texture_level) * format->byte_count;
|
||||
+ info->slice_pitch = wined3d_texture_get_level_height(texture, texture_level) * info->row_pitch;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ wined3d_texture_get_pitch(texture, texture_level, &info->row_pitch, &info->slice_pitch);
|
||||
+ }
|
||||
+
|
||||
+ info->size = info->slice_pitch * wined3d_texture_get_level_depth(texture, texture_level);
|
||||
+
|
||||
+ return WINED3D_OK;
|
||||
+}
|
||||
+
|
||||
static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
|
||||
{
|
||||
struct wined3d_texture_sub_resource *sub_resource;
|
||||
@@ -2253,6 +2283,7 @@ static const struct wined3d_resource_ops texture_resource_ops =
|
||||
texture_resource_preload,
|
||||
wined3d_texture_unload,
|
||||
texture_resource_sub_resource_map,
|
||||
+ texture_resource_sub_resource_map_info,
|
||||
texture_resource_sub_resource_unmap,
|
||||
};
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
|
||||
index 05df9f3db7e..e51380304b1 100644
|
||||
--- a/dlls/wined3d/wined3d.spec
|
||||
+++ b/dlls/wined3d/wined3d.spec
|
||||
@@ -187,6 +187,7 @@
|
||||
@ cdecl wined3d_resource_get_parent(ptr)
|
||||
@ cdecl wined3d_resource_get_priority(ptr)
|
||||
@ cdecl wined3d_resource_map(ptr long ptr ptr long)
|
||||
+@ cdecl wined3d_resource_map_info(ptr long ptr long)
|
||||
@ cdecl wined3d_resource_preload(ptr)
|
||||
@ cdecl wined3d_resource_set_parent(ptr ptr)
|
||||
@ cdecl wined3d_resource_set_priority(ptr long)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index ff61d9d872b..65f95004b44 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2639,6 +2639,8 @@ struct wined3d_resource_ops
|
||||
void (*resource_unload)(struct wined3d_resource *resource);
|
||||
HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
|
||||
+ HRESULT (*resource_map_info)(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_map_info *info, DWORD flags);
|
||||
HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx);
|
||||
};
|
||||
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 8c8fbcbe7e5..fff39e2fa0f 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -1746,6 +1746,13 @@ struct wined3d_map_desc
|
||||
void *data;
|
||||
};
|
||||
|
||||
+struct wined3d_map_info
|
||||
+{
|
||||
+ UINT row_pitch;
|
||||
+ UINT slice_pitch;
|
||||
+ UINT size;
|
||||
+};
|
||||
+
|
||||
struct wined3d_sub_resource_data
|
||||
{
|
||||
const void *data;
|
||||
@@ -2431,6 +2438,8 @@ void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resour
|
||||
DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource);
|
||||
HRESULT __cdecl wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
|
||||
+HRESULT __cdecl wined3d_resource_map_info(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_map_info *info, DWORD flags);
|
||||
void __cdecl wined3d_resource_preload(struct wined3d_resource *resource);
|
||||
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
|
||||
DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority);
|
||||
--
|
||||
2.11.0
|
||||
|
File diff suppressed because it is too large
Load Diff
1
patches/d3d11-Deferred_Context/definition
Normal file
1
patches/d3d11-Deferred_Context/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: Add semi-stub for D3D11 deferred context implementation
|
@@ -0,0 +1,41 @@
|
||||
From d16a0f5f4bde197dbdda7b61d8c6b69bbc9be128 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 21 Jan 2017 22:43:12 +0100
|
||||
Subject: d3d11: Implement ResolveSubresource by copying sub resource (there is
|
||||
no multisample texture support yet).
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 777146d717e..9ad2b2ecaa5 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -1120,10 +1120,22 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D
|
||||
ID3D11Resource *src_resource, UINT src_subresource_idx,
|
||||
DXGI_FORMAT format)
|
||||
{
|
||||
- FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, src_resource %p, src_subresource_idx %u, "
|
||||
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
|
||||
+ struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource;
|
||||
+
|
||||
+ TRACE("iface %p, dst_resource %p, dst_subresource_idx %u, src_resource %p, src_subresource_idx %u, "
|
||||
"format %s stub!\n",
|
||||
iface, dst_resource, dst_subresource_idx, src_resource, src_subresource_idx,
|
||||
debug_dxgi_format(format));
|
||||
+
|
||||
+ wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource);
|
||||
+ wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource);
|
||||
+
|
||||
+ /* Multisampled textures are not supported yet, so simply copy the sub resource */
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx,
|
||||
+ 0, 0, 0, wined3d_src_resource, src_subresource_idx, NULL);
|
||||
+ wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_ExecuteCommandList(ID3D11DeviceContext *iface,
|
||||
--
|
||||
2.11.0
|
||||
|
1
patches/d3d11-ResolveSubresource/definition
Normal file
1
patches/d3d11-ResolveSubresource/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: Implement semi-stub for d3d11 context ResolveSubresource method.
|
@@ -0,0 +1,156 @@
|
||||
From 3dc821fe683d1e17976ca9367465c1412e1140b4 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 14 Jan 2017 07:50:36 +0100
|
||||
Subject: d3d8: Improve ValidateVertexShader stub.
|
||||
|
||||
---
|
||||
dlls/d3d8/d3d8_main.c | 43 ++++++++++++++++++++++---------------------
|
||||
dlls/d3d8/tests/device.c | 40 +++++++++++++++++++++++++---------------
|
||||
2 files changed, 47 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
|
||||
index 8ac704c364c..2ab0414b7f2 100644
|
||||
--- a/dlls/d3d8/d3d8_main.c
|
||||
+++ b/dlls/d3d8/d3d8_main.c
|
||||
@@ -58,38 +58,39 @@ IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
|
||||
|
||||
/***********************************************************************
|
||||
* ValidateVertexShader (D3D8.@)
|
||||
- *
|
||||
- * I've seen reserved1 and reserved2 always passed as 0's
|
||||
- * bool seems always passed as 0 or 1, but other values work as well...
|
||||
- * toto result?
|
||||
*/
|
||||
-HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
|
||||
+HRESULT WINAPI ValidateVertexShader(DWORD *vertexshader, DWORD *reserved1, DWORD *reserved2,
|
||||
+ BOOL return_error, char **errors)
|
||||
{
|
||||
- HRESULT ret;
|
||||
- static BOOL warned;
|
||||
-
|
||||
- if (TRACE_ON(d3d8) || !warned) {
|
||||
- FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
|
||||
- warned = TRUE;
|
||||
- }
|
||||
+ const char *message = "";
|
||||
+ HRESULT hr = E_FAIL;
|
||||
|
||||
- if (!vertexshader)
|
||||
- return E_FAIL;
|
||||
+ TRACE("(%p %p %p %d %p): semi-stub\n", vertexshader, reserved1, reserved2, return_error, errors);
|
||||
|
||||
- if (reserved1 || reserved2)
|
||||
- return E_FAIL;
|
||||
+ if (!vertexshader)
|
||||
+ {
|
||||
+ message = "(Global Validation Error) Version Token: Code pointer cannot be NULL.\n";
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
- switch(*vertexshader) {
|
||||
+ switch (*vertexshader)
|
||||
+ {
|
||||
case 0xFFFE0101:
|
||||
case 0xFFFE0100:
|
||||
- ret=S_OK;
|
||||
+ hr = S_OK;
|
||||
break;
|
||||
+
|
||||
default:
|
||||
WARN("Invalid shader version token %#x.\n", *vertexshader);
|
||||
- ret=E_FAIL;
|
||||
- }
|
||||
+ message = "(Global Validation Error) Version Token: Unsupported vertex shader version.\n";
|
||||
+ }
|
||||
|
||||
- return ret;
|
||||
+done:
|
||||
+ if (!return_error) message = "";
|
||||
+ if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, strlen(message) + 1)))
|
||||
+ strcpy(*errors, message);
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
|
||||
index 28c6af32e0c..1368ce3a2cf 100644
|
||||
--- a/dlls/d3d8/tests/device.c
|
||||
+++ b/dlls/d3d8/tests/device.c
|
||||
@@ -50,7 +50,7 @@ struct device_desc
|
||||
|
||||
static DEVMODEW registry_mode;
|
||||
|
||||
-static HRESULT (WINAPI *ValidateVertexShader)(DWORD *, DWORD *, DWORD *, int, DWORD *);
|
||||
+static HRESULT (WINAPI *ValidateVertexShader)(DWORD *, DWORD *, DWORD *, BOOL, char **);
|
||||
static HRESULT (WINAPI *ValidatePixelShader)(DWORD *, DWORD *, int, DWORD *);
|
||||
|
||||
static BOOL (WINAPI *pGetCursorInfo)(PCURSORINFO);
|
||||
@@ -4238,18 +4238,31 @@ static void test_validate_vs(void)
|
||||
0x00000009, 0xc0080000, 0x90e40000, 0xa0e40003, /* dp4 oPos.w, v0, c3 */
|
||||
0x0000ffff, /* end */
|
||||
};
|
||||
+ char *errors;
|
||||
HRESULT hr;
|
||||
|
||||
hr = ValidateVertexShader(0, 0, 0, 0, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
hr = ValidateVertexShader(0, 0, 0, 1, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidateVertexShader(0, 0, 0, 0, &errors);
|
||||
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(!strcmp(errors, ""), "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidateVertexShader(0, 0, 0, 1, &errors);
|
||||
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(strstr(errors, "Validation Error") != NULL, "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
+
|
||||
hr = ValidateVertexShader(vs, 0, 0, 0, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
-
|
||||
hr = ValidateVertexShader(vs, 0, 0, 1, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
- /* Seems to do some version checking. */
|
||||
+
|
||||
*vs = 0xfffe0100; /* vs_1_0 */
|
||||
hr = ValidateVertexShader(vs, 0, 0, 0, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
@@ -4257,21 +4270,18 @@ static void test_validate_vs(void)
|
||||
*vs = 0xfffe0102; /* bogus version */
|
||||
hr = ValidateVertexShader(vs, 0, 0, 1, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
- /* I've seen that applications always pass the 2nd and 3rd parameter as 0.
|
||||
- * Simple test with non-zero parameters. */
|
||||
- *vs = 0xfffe0101; /* vs_1_1 */
|
||||
- hr = ValidateVertexShader(vs, vs, 0, 1, 0);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidateVertexShader(vs, 0, 0, 0, &errors);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(!strcmp(errors, ""), "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
|
||||
- hr = ValidateVertexShader(vs, 0, vs, 1, 0);
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidateVertexShader(vs, 0, 0, 1, &errors);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
- /* I've seen the 4th parameter always passed as either 0 or 1, but passing
|
||||
- * other values doesn't seem to hurt. */
|
||||
- hr = ValidateVertexShader(vs, 0, 0, 12345, 0);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
- /* What is the 5th parameter? The following seems to work ok. */
|
||||
- hr = ValidateVertexShader(vs, 0, 0, 1, vs);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(strstr(errors, "Validation Error") != NULL, "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
}
|
||||
|
||||
static void test_validate_ps(void)
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,140 @@
|
||||
From 29d2dd7606178f391c8802f8d5767a7bd83c4e30 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 14 Jan 2017 07:54:39 +0100
|
||||
Subject: d3d8: Improve ValidatePixelShader stub.
|
||||
|
||||
---
|
||||
dlls/d3d8/d3d8_main.c | 37 +++++++++++++++++--------------------
|
||||
dlls/d3d8/tests/device.c | 34 ++++++++++++++++++++--------------
|
||||
2 files changed, 37 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
|
||||
index a562c1c7e30..41f411c30a8 100644
|
||||
--- a/dlls/d3d8/d3d8_main.c
|
||||
+++ b/dlls/d3d8/d3d8_main.c
|
||||
@@ -101,39 +101,36 @@ done:
|
||||
|
||||
/***********************************************************************
|
||||
* ValidatePixelShader (D3D8.@)
|
||||
- *
|
||||
- * PARAMS
|
||||
- * toto result?
|
||||
*/
|
||||
-HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
|
||||
+HRESULT WINAPI ValidatePixelShader(DWORD *pixelshader, DWORD *reserved1, BOOL return_error, char **errors)
|
||||
{
|
||||
- HRESULT ret;
|
||||
- static BOOL warned;
|
||||
-
|
||||
- if (TRACE_ON(d3d8) || !warned) {
|
||||
- FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
|
||||
- warned = TRUE;
|
||||
- }
|
||||
+ const char *message = "";
|
||||
+ HRESULT hr = E_FAIL;
|
||||
|
||||
- if (!pixelshader)
|
||||
- return E_FAIL;
|
||||
+ TRACE("(%p %p %d %p): semi-stub\n", pixelshader, reserved1, return_error, errors);
|
||||
|
||||
- if (reserved1)
|
||||
- return E_FAIL;
|
||||
+ if (!pixelshader)
|
||||
+ return E_FAIL;
|
||||
|
||||
- switch(*pixelshader) {
|
||||
+ switch (*pixelshader)
|
||||
+ {
|
||||
case 0xFFFF0100:
|
||||
case 0xFFFF0101:
|
||||
case 0xFFFF0102:
|
||||
case 0xFFFF0103:
|
||||
case 0xFFFF0104:
|
||||
- ret=S_OK;
|
||||
+ hr = S_OK;
|
||||
break;
|
||||
default:
|
||||
WARN("Invalid shader version token %#x.\n", *pixelshader);
|
||||
- ret=E_FAIL;
|
||||
- }
|
||||
- return ret;
|
||||
+ message = "(Global Validation Error) Version Token: Unsupported pixel shader version.\n";
|
||||
+ }
|
||||
+
|
||||
+ if (!return_error) message = "";
|
||||
+ if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, strlen(message) + 1)))
|
||||
+ strcpy(*errors, message);
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
void d3d8_resource_cleanup(struct d3d8_resource *resource)
|
||||
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
|
||||
index 1368ce3a2cf..9ff3be71776 100644
|
||||
--- a/dlls/d3d8/tests/device.c
|
||||
+++ b/dlls/d3d8/tests/device.c
|
||||
@@ -51,7 +51,7 @@ struct device_desc
|
||||
static DEVMODEW registry_mode;
|
||||
|
||||
static HRESULT (WINAPI *ValidateVertexShader)(DWORD *, DWORD *, DWORD *, BOOL, char **);
|
||||
-static HRESULT (WINAPI *ValidatePixelShader)(DWORD *, DWORD *, int, DWORD *);
|
||||
+static HRESULT (WINAPI *ValidatePixelShader)(DWORD *, DWORD *, BOOL, char **);
|
||||
|
||||
static BOOL (WINAPI *pGetCursorInfo)(PCURSORINFO);
|
||||
|
||||
@@ -4296,33 +4296,39 @@ static void test_validate_ps(void)
|
||||
0x00000005, 0x800f0000, 0xb0e40000, 0x80e40000, /* mul r0, t0, r0 */
|
||||
0x0000ffff, /* end */
|
||||
};
|
||||
+ char *errors;
|
||||
HRESULT hr;
|
||||
|
||||
hr = ValidatePixelShader(0, 0, 0, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
hr = ValidatePixelShader(0, 0, 1, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidatePixelShader(0, 0, 1, &errors);
|
||||
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(errors == (void *)0xdeadbeef, "Expected 0xdeadbeef, got %p.\n", errors);
|
||||
+
|
||||
hr = ValidatePixelShader(ps, 0, 0, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
-
|
||||
hr = ValidatePixelShader(ps, 0, 1, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
- /* Seems to do some version checking. */
|
||||
+
|
||||
*ps = 0xffff0105; /* bogus version */
|
||||
hr = ValidatePixelShader(ps, 0, 1, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
- /* I've seen that applications always pass the 2nd parameter as 0.
|
||||
- * Simple test with a non-zero parameter. */
|
||||
- *ps = 0xffff0101; /* ps_1_1 */
|
||||
- hr = ValidatePixelShader(ps, ps, 1, 0);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidatePixelShader(ps, 0, 0, &errors);
|
||||
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(!strcmp(errors, ""), "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidatePixelShader(ps, 0, 1, &errors);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
- /* I've seen the 3rd parameter always passed as either 0 or 1, but passing
|
||||
- * other values doesn't seem to hurt. */
|
||||
- hr = ValidatePixelShader(ps, 0, 12345, 0);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
- /* What is the 4th parameter? The following seems to work ok. */
|
||||
- hr = ValidatePixelShader(ps, 0, 1, ps);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(strstr(errors, "Validation Error") != NULL, "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
}
|
||||
|
||||
static void test_volume_get_container(void)
|
||||
--
|
||||
2.11.0
|
||||
|
1
patches/d3d8-ValidateShader/definition
Normal file
1
patches/d3d8-ValidateShader/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [40036] Improve stubs for Validate{Vertex,Pixel}Shader
|
@@ -1,4 +1,4 @@
|
||||
From 26a7497a9fb1184080a1622f6a834bed50d2a239 Mon Sep 17 00:00:00 2001
|
||||
From ff83c3ee1b422915d690411cda05db19ceacbdf1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 3 Jun 2015 22:57:21 +0200
|
||||
Subject: winex11.drv: Allow changing the opengl pixel format on the desktop
|
||||
@@ -18,7 +18,7 @@ it seems to be a suitable workaround as it fixes multiple applications.
|
||||
4 files changed, 48 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c
|
||||
index f5b1454..ac21f68 100644
|
||||
index e1d6d4c97c2..bf6a9a138dd 100644
|
||||
--- a/dlls/d3d10_1/tests/d3d10_1.c
|
||||
+++ b/dlls/d3d10_1/tests/d3d10_1.c
|
||||
@@ -226,8 +226,18 @@ static void test_create_device(void)
|
||||
@@ -43,10 +43,10 @@ index f5b1454..ac21f68 100644
|
||||
swapchain = (IDXGISwapChain *)0xdeadbeef;
|
||||
device = (ID3D10Device1 *)0xdeadbeef;
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 04a369c..ee506f5 100644
|
||||
index ac4393dd3b3..49356b398c1 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -805,10 +805,22 @@ static void test_create_device(void)
|
||||
@@ -1451,10 +1451,22 @@ static void test_create_device(void)
|
||||
hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION,
|
||||
&swapchain_desc, &swapchain, &device, &feature_level, &immediate_context);
|
||||
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr);
|
||||
@@ -74,10 +74,10 @@ index 04a369c..ee506f5 100644
|
||||
swapchain = (IDXGISwapChain *)0xdeadbeef;
|
||||
device = (ID3D11Device *)0xdeadbeef;
|
||||
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
|
||||
index 4302f76..342f8d2 100644
|
||||
index aa266a5186e..986000d0278 100644
|
||||
--- a/dlls/d3d9/tests/device.c
|
||||
+++ b/dlls/d3d9/tests/device.c
|
||||
@@ -11171,6 +11171,21 @@ static void test_get_render_target_data(void)
|
||||
@@ -11401,6 +11401,21 @@ static void test_render_target_device_mismatch(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@@ -99,19 +99,19 @@ index 4302f76..342f8d2 100644
|
||||
START_TEST(device)
|
||||
{
|
||||
WNDCLASSA wc = {0};
|
||||
@@ -11287,6 +11302,7 @@ START_TEST(device)
|
||||
test_check_device_format();
|
||||
@@ -11518,6 +11533,7 @@ START_TEST(device)
|
||||
test_miptree_layout();
|
||||
test_get_render_target_data();
|
||||
test_render_target_device_mismatch();
|
||||
+ test_desktop_window();
|
||||
|
||||
UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL));
|
||||
}
|
||||
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
|
||||
index 0f7534e..613d1df 100644
|
||||
index d89a19330f7..b5faac56ade 100644
|
||||
--- a/dlls/winex11.drv/opengl.c
|
||||
+++ b/dlls/winex11.drv/opengl.c
|
||||
@@ -1457,12 +1457,15 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change)
|
||||
@@ -1469,12 +1469,15 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change)
|
||||
|
||||
TRACE("(%p,%d)\n", hdc, format);
|
||||
|
||||
@@ -129,5 +129,5 @@ index 0f7534e..613d1df 100644
|
||||
if (!fmt)
|
||||
{
|
||||
--
|
||||
2.8.0
|
||||
2.11.0
|
||||
|
||||
|
@@ -0,0 +1,58 @@
|
||||
From 5c5620766e4e3be85bdec4aab689b9f5b42b2f2b Mon Sep 17 00:00:00 2001
|
||||
From: Matteo Bruni <mbruni@codeweavers.com>
|
||||
Date: Wed, 18 Jan 2017 21:35:28 +0100
|
||||
Subject: d3d9: Fix DrawIndexedPrimitiveUP with non-zero min_vertex_idx.
|
||||
|
||||
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
|
||||
---
|
||||
dlls/d3d9/device.c | 14 ++++++--------
|
||||
1 file changed, 6 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
|
||||
index e0bc5859c61..e646cb76c76 100644
|
||||
--- a/dlls/d3d9/device.c
|
||||
+++ b/dlls/d3d9/device.c
|
||||
@@ -2485,18 +2485,16 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
|
||||
UINT primitive_count, const void *index_data, D3DFORMAT index_format,
|
||||
const void *vertex_data, UINT vertex_stride)
|
||||
{
|
||||
- struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
||||
- HRESULT hr;
|
||||
UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
|
||||
+ struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
||||
UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
|
||||
+ UINT vtx_size = vertex_count * vertex_stride;
|
||||
UINT idx_size = idx_count * idx_fmt_size;
|
||||
struct wined3d_map_desc wined3d_map_desc;
|
||||
struct wined3d_box wined3d_box = {0};
|
||||
struct wined3d_resource *ib, *vb;
|
||||
- UINT ib_pos;
|
||||
-
|
||||
- UINT vtx_size = vertex_count * vertex_stride;
|
||||
- UINT vb_pos, align;
|
||||
+ UINT vb_pos, ib_pos, align;
|
||||
+ HRESULT hr;
|
||||
|
||||
TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
|
||||
"index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
|
||||
@@ -2536,7 +2534,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
|
||||
if (FAILED(hr = wined3d_resource_map(vb, 0, &wined3d_map_desc, &wined3d_box,
|
||||
vb_pos ? WINED3D_MAP_NOOVERWRITE : WINED3D_MAP_DISCARD)))
|
||||
goto done;
|
||||
- memcpy(wined3d_map_desc.data, vertex_data, vtx_size);
|
||||
+ memcpy(wined3d_map_desc.data, (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size);
|
||||
wined3d_resource_unmap(vb, 0);
|
||||
device->vertex_buffer_pos = vb_pos + vtx_size;
|
||||
|
||||
@@ -2568,7 +2566,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
|
||||
|
||||
wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer,
|
||||
wined3dformat_from_d3dformat(index_format), 0);
|
||||
- wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride);
|
||||
+ wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride - min_vertex_idx);
|
||||
|
||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type);
|
||||
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,58 @@
|
||||
From 6ab43f9745b48a8646b54c1a072a07ddd96e333b Mon Sep 17 00:00:00 2001
|
||||
From: Matteo Bruni <mbruni@codeweavers.com>
|
||||
Date: Wed, 18 Jan 2017 21:35:29 +0100
|
||||
Subject: d3d8: Fix DrawIndexedPrimitiveUP with non-zero min_vertex_idx.
|
||||
|
||||
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
|
||||
---
|
||||
dlls/d3d8/device.c | 14 ++++++--------
|
||||
1 file changed, 6 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
|
||||
index 43b8e2be4bb..805694b8536 100644
|
||||
--- a/dlls/d3d8/device.c
|
||||
+++ b/dlls/d3d8/device.c
|
||||
@@ -2124,18 +2124,16 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface
|
||||
UINT primitive_count, const void *index_data, D3DFORMAT index_format,
|
||||
const void *vertex_data, UINT vertex_stride)
|
||||
{
|
||||
- struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
|
||||
- HRESULT hr;
|
||||
UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
|
||||
+ struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
|
||||
UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
|
||||
+ UINT vtx_size = vertex_count * vertex_stride;
|
||||
UINT idx_size = idx_count * idx_fmt_size;
|
||||
struct wined3d_map_desc wined3d_map_desc;
|
||||
struct wined3d_box wined3d_box = {0};
|
||||
struct wined3d_resource *ib, *vb;
|
||||
- UINT ib_pos;
|
||||
-
|
||||
- UINT vtx_size = vertex_count * vertex_stride;
|
||||
- UINT vb_pos, align;
|
||||
+ UINT vb_pos, ib_pos, align;
|
||||
+ HRESULT hr;
|
||||
|
||||
TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
|
||||
"index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
|
||||
@@ -2168,7 +2166,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface
|
||||
if (FAILED(hr = wined3d_resource_map(vb, 0, &wined3d_map_desc, &wined3d_box,
|
||||
vb_pos ? WINED3D_MAP_NOOVERWRITE : WINED3D_MAP_DISCARD)))
|
||||
goto done;
|
||||
- memcpy(wined3d_map_desc.data, vertex_data, vtx_size);
|
||||
+ memcpy(wined3d_map_desc.data, (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size);
|
||||
wined3d_resource_unmap(vb, 0);
|
||||
device->vertex_buffer_pos = vb_pos + vtx_size;
|
||||
|
||||
@@ -2200,7 +2198,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface
|
||||
|
||||
wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer,
|
||||
wined3dformat_from_d3dformat(index_format), 0);
|
||||
- wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride);
|
||||
+ wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride - min_vertex_idx);
|
||||
|
||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type);
|
||||
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,123 @@
|
||||
From c50f96ff6353cc65ed3e39b43fd7e46cf2678c69 Mon Sep 17 00:00:00 2001
|
||||
From: Matteo Bruni <mbruni@codeweavers.com>
|
||||
Date: Wed, 18 Jan 2017 21:35:30 +0100
|
||||
Subject: d3d9/tests: Add a test for DrawIndexedPrimitiveUP().
|
||||
|
||||
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
|
||||
---
|
||||
dlls/d3d9/tests/visual.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 94 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
|
||||
index a1064127d5a..be544f3b5c7 100644
|
||||
--- a/dlls/d3d9/tests/visual.c
|
||||
+++ b/dlls/d3d9/tests/visual.c
|
||||
@@ -22244,6 +22244,99 @@ done:
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
+static void test_drawindexedprimitiveup(void)
|
||||
+{
|
||||
+ static const struct vertex
|
||||
+ {
|
||||
+ struct vec3 position;
|
||||
+ DWORD diffuse;
|
||||
+ }
|
||||
+ quad[] =
|
||||
+ {
|
||||
+ {{-1.0f, -1.0f, 0.1f}, 0xff00ff00},
|
||||
+ {{-1.0f, 1.0f, 0.1f}, 0xff0000ff},
|
||||
+ {{ 1.0f, -1.0f, 0.1f}, 0xffff0000},
|
||||
+ {{ 1.0f, 1.0f, 0.1f}, 0xff0000ff},
|
||||
+
|
||||
+ {{-1.0f, -1.0f, 0.1f}, 0xff0000ff},
|
||||
+ {{-1.0f, 1.0f, 0.1f}, 0xff00ff00},
|
||||
+ {{ 1.0f, -1.0f, 0.1f}, 0xffff0000},
|
||||
+ {{ 1.0f, 1.0f, 0.1f}, 0xff00ff00},
|
||||
+ };
|
||||
+ static const unsigned short indices[] = {0, 1, 2, 3, 4, 5, 6, 7};
|
||||
+ IDirect3DDevice9 *device;
|
||||
+ IDirect3D9 *d3d;
|
||||
+ ULONG refcount;
|
||||
+ D3DCOLOR color;
|
||||
+ HWND window;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ window = create_window();
|
||||
+ d3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
+ ok(!!d3d, "Failed to create a D3D object.\n");
|
||||
+
|
||||
+ if (!(device = create_device(d3d, window, window, TRUE)))
|
||||
+ {
|
||||
+ skip("Failed to create a D3D device.\n");
|
||||
+ IDirect3D9_Release(d3d);
|
||||
+ DestroyWindow(window);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPING, FALSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0);
|
||||
+ ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice9_BeginScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 4, 4, 2, indices + 4, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice9_EndScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
+
|
||||
+ color = getPixelColor(device, 160, 120);
|
||||
+ ok(color_match(color, 0x0040bf00, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 120);
|
||||
+ ok(color_match(color, 0x0040bf00, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 160, 360);
|
||||
+ ok(color_match(color, 0x00404080, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 360);
|
||||
+ ok(color_match(color, 0x00bf4000, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+
|
||||
+ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0);
|
||||
+ ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice9_BeginScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 0, 4, 2, indices, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice9_EndScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
+
|
||||
+ color = getPixelColor(device, 160, 120);
|
||||
+ ok(color_match(color, 0x004000bf, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 120);
|
||||
+ ok(color_match(color, 0x004000bf, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 160, 360);
|
||||
+ ok(color_match(color, 0x00408040, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 360);
|
||||
+ ok(color_match(color, 0x00bf0040, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+
|
||||
+ refcount = IDirect3DDevice9_Release(device);
|
||||
+ ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
+ IDirect3D9_Release(d3d);
|
||||
+ DestroyWindow(window);
|
||||
+}
|
||||
+
|
||||
START_TEST(visual)
|
||||
{
|
||||
D3DADAPTER_IDENTIFIER9 identifier;
|
||||
@@ -22372,4 +22465,5 @@ START_TEST(visual)
|
||||
test_evict_bound_resources();
|
||||
test_max_index16();
|
||||
test_backbuffer_resize();
|
||||
+ test_drawindexedprimitiveup();
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -0,0 +1,132 @@
|
||||
From 38c67dd093a7b64dc3730cf6b919f4bcf31c65f0 Mon Sep 17 00:00:00 2001
|
||||
From: Matteo Bruni <mbruni@codeweavers.com>
|
||||
Date: Wed, 18 Jan 2017 21:35:31 +0100
|
||||
Subject: d3d8/tests: Add a test for DrawIndexedPrimitiveUP().
|
||||
|
||||
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
|
||||
---
|
||||
dlls/d3d8/tests/visual.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 103 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c
|
||||
index c0ecc6a6fa6..57c89171b7d 100644
|
||||
--- a/dlls/d3d8/tests/visual.c
|
||||
+++ b/dlls/d3d8/tests/visual.c
|
||||
@@ -9700,6 +9700,108 @@ done:
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
+static void test_drawindexedprimitiveup(void)
|
||||
+{
|
||||
+ static const struct vertex
|
||||
+ {
|
||||
+ struct vec3 position;
|
||||
+ DWORD diffuse;
|
||||
+ }
|
||||
+ quad[] =
|
||||
+ {
|
||||
+ {{-1.0f, -1.0f, 0.1f}, 0xff00ff00},
|
||||
+ {{-1.0f, 1.0f, 0.1f}, 0xff0000ff},
|
||||
+ {{ 1.0f, -1.0f, 0.1f}, 0xffff0000},
|
||||
+ {{ 1.0f, 1.0f, 0.1f}, 0xff0000ff},
|
||||
+
|
||||
+ {{-1.0f, -1.0f, 0.1f}, 0xff0000ff},
|
||||
+ {{-1.0f, 1.0f, 0.1f}, 0xff00ff00},
|
||||
+ {{ 1.0f, -1.0f, 0.1f}, 0xffff0000},
|
||||
+ {{ 1.0f, 1.0f, 0.1f}, 0xff00ff00},
|
||||
+ };
|
||||
+ static const unsigned short indices[] = {0, 1, 2, 3, 4, 5, 6, 7};
|
||||
+ IDirect3DDevice8 *device;
|
||||
+ IDirect3D8 *d3d;
|
||||
+ ULONG refcount;
|
||||
+ D3DCOLOR color;
|
||||
+ HWND window;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ window = create_window();
|
||||
+ d3d = Direct3DCreate8(D3D_SDK_VERSION);
|
||||
+ ok(!!d3d, "Failed to create a D3D object.\n");
|
||||
+
|
||||
+ if (!(device = create_device(d3d, window, window, TRUE)))
|
||||
+ {
|
||||
+ skip("Failed to create a D3D device.\n");
|
||||
+ IDirect3D8_Release(d3d);
|
||||
+ DestroyWindow(window);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CLIPPING, FALSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
+ ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
+ ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
|
||||
+ ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0);
|
||||
+ ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice8_BeginScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 4, 4, 2, indices + 4, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_EndScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
+
|
||||
+ color = getPixelColor(device, 160, 120);
|
||||
+ ok(color_match(color, 0x0040bf00, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 120);
|
||||
+ ok(color_match(color, 0x0040bf00, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 160, 360);
|
||||
+ ok(color_match(color, 0x00404080, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 360);
|
||||
+ ok(color_match(color, 0x00bf4000, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+
|
||||
+ hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0);
|
||||
+ ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice8_BeginScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 0, 4, 2, indices, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice8_EndScene(device);
|
||||
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
+
|
||||
+ color = getPixelColor(device, 160, 120);
|
||||
+ ok(color_match(color, 0x004000bf, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 120);
|
||||
+ ok(color_match(color, 0x004000bf, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 160, 360);
|
||||
+ ok(color_match(color, 0x00408040, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = getPixelColor(device, 480, 360);
|
||||
+ ok(color_match(color, 0x00bf0040, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+
|
||||
+ refcount = IDirect3DDevice8_Release(device);
|
||||
+ ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
+ IDirect3D8_Release(d3d);
|
||||
+ DestroyWindow(window);
|
||||
+}
|
||||
+
|
||||
START_TEST(visual)
|
||||
{
|
||||
D3DADAPTER_IDENTIFIER8 identifier;
|
||||
@@ -9770,4 +9872,5 @@ START_TEST(visual)
|
||||
test_edge_antialiasing_blending();
|
||||
test_max_index16();
|
||||
test_backbuffer_resize();
|
||||
+ test_drawindexedprimitiveup();
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user