mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against f2cb86decb334fc72ff5422122ba190bc9b6046e
This commit is contained in:
parent
e38104d365
commit
3d050ca9b9
@ -1,200 +0,0 @@
|
||||
From d056be40dd9cd96ec2ef6efa85fe9a630948a305 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 26 Dec 2016 07:46:57 +0100
|
||||
Subject: [PATCH 17/36] bcrypt: Implement BCryptEncrypt for AES GCM mode.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 60 +++++++++++++++++++++++++++++++++++++++-------
|
||||
dlls/bcrypt/tests/bcrypt.c | 18 +++++++-------
|
||||
2 files changed, 61 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index fa80318..dfdb7b2 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -63,6 +63,12 @@ MAKE_FUNCPTR(gnutls_global_set_log_level);
|
||||
MAKE_FUNCPTR(gnutls_perror);
|
||||
#undef MAKE_FUNCPTR
|
||||
|
||||
+#if GNUTLS_VERSION_MAJOR < 3
|
||||
+#define GNUTLS_CIPHER_AES_192_CBC 92
|
||||
+#define GNUTLS_CIPHER_AES_128_GCM 93
|
||||
+#define GNUTLS_CIPHER_AES_256_GCM 94
|
||||
+#endif
|
||||
+
|
||||
static void gnutls_log( int level, const char *msg )
|
||||
{
|
||||
TRACE( "<%d> %s", level, msg );
|
||||
@@ -848,6 +854,7 @@ struct key
|
||||
{
|
||||
struct object hdr;
|
||||
enum alg_id alg_id;
|
||||
+ enum mode_id mode;
|
||||
ULONG block_size;
|
||||
gnutls_cipher_hd_t handle;
|
||||
UCHAR *secret;
|
||||
@@ -858,6 +865,7 @@ struct key
|
||||
{
|
||||
struct object hdr;
|
||||
enum alg_id alg_id;
|
||||
+ enum mode_id mode;
|
||||
ULONG block_size;
|
||||
CCCryptorRef ref_encrypt;
|
||||
CCCryptorRef ref_decrypt;
|
||||
@@ -868,6 +876,7 @@ struct key
|
||||
struct key
|
||||
{
|
||||
struct object hdr;
|
||||
+ enum mode_id mode;
|
||||
ULONG block_size;
|
||||
};
|
||||
#endif
|
||||
@@ -923,6 +932,7 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
memcpy( buffer, secret, secret_len );
|
||||
|
||||
key->alg_id = alg->id;
|
||||
+ key->mode = alg->mode;
|
||||
key->handle = 0; /* initialized on first use */
|
||||
key->secret = buffer;
|
||||
key->secret_len = secret_len;
|
||||
@@ -935,9 +945,13 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
switch (key->alg_id)
|
||||
{
|
||||
case ALG_ID_AES:
|
||||
- FIXME( "handle block size and chaining mode\n" );
|
||||
- return GNUTLS_CIPHER_AES_128_CBC;
|
||||
-
|
||||
+ WARN( "handle block size\n" );
|
||||
+ switch (key->mode)
|
||||
+ {
|
||||
+ case MODE_ID_GCM: return GNUTLS_CIPHER_AES_128_GCM;
|
||||
+ case MODE_ID_CBC:
|
||||
+ default: return GNUTLS_CIPHER_AES_128_CBC;
|
||||
+ }
|
||||
default:
|
||||
FIXME( "algorithm %u not supported\n", key->alg_id );
|
||||
return GNUTLS_CIPHER_UNKNOWN;
|
||||
@@ -1019,6 +1033,14 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
switch (alg->id)
|
||||
{
|
||||
case ALG_ID_AES:
|
||||
+ switch (alg->mode)
|
||||
+ {
|
||||
+ case MODE_ID_CBC:
|
||||
+ break;
|
||||
+ default:
|
||||
+ FIXME( "mode %u not supported\n", alg->mode );
|
||||
+ return STATUS_NOT_SUPPORTED;
|
||||
+ }
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1031,6 +1053,7 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
memcpy( buffer, secret, secret_len );
|
||||
|
||||
key->alg_id = alg->id;
|
||||
+ key->mode = alg->mode;
|
||||
key->ref_encrypt = NULL; /* initialized on first use */
|
||||
key->ref_decrypt = NULL;
|
||||
key->secret = buffer;
|
||||
@@ -1112,6 +1135,7 @@ static NTSTATUS key_destroy( struct key *key )
|
||||
static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
+ key->mode = MODE_ID_CBC;
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -1260,17 +1284,37 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
padding, iv, iv_len, output, output_len, ret_len, flags );
|
||||
|
||||
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
- if (padding)
|
||||
- {
|
||||
- FIXME( "padding info not implemented\n" );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
if (flags & ~BCRYPT_BLOCK_PADDING)
|
||||
{
|
||||
FIXME( "flags %08x not implemented\n", flags );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+ if (key->mode == MODE_ID_GCM)
|
||||
+ {
|
||||
+ BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
|
||||
+
|
||||
+ if (!auth_info) return STATUS_INVALID_PARAMETER;
|
||||
+ if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
|
||||
+ if (!auth_info->pbTag) return STATUS_INVALID_PARAMETER;
|
||||
+ if (auth_info->cbTag < 12 || auth_info->cbTag > 16) return STATUS_INVALID_PARAMETER;
|
||||
+ if (auth_info->dwFlags & BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG)
|
||||
+ FIXME( "call chaining not implemented\n" );
|
||||
+
|
||||
+ if ((status = key_set_params( key, auth_info->pbNonce, auth_info->cbNonce )))
|
||||
+ return status;
|
||||
+
|
||||
+ *ret_len = input_len;
|
||||
+ if (flags & BCRYPT_BLOCK_PADDING) return STATUS_INVALID_PARAMETER;
|
||||
+ if (!output) return STATUS_SUCCESS;
|
||||
+ if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
|
||||
+
|
||||
+ if ((status = key_encrypt( key, input, input_len, output, output_len )))
|
||||
+ return status;
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+
|
||||
if ((status = key_set_params( key, iv, iv_len ))) return status;
|
||||
|
||||
*ret_len = input_len;
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 70d9e0c..355a414 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -751,12 +751,12 @@ static void test_BCryptEncrypt(void)
|
||||
memset(ciphertext, 0xff, sizeof(ciphertext));
|
||||
memset(tag, 0xff, sizeof(tag));
|
||||
ret = pBCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, 0);
|
||||
- todo_wine ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
- todo_wine ok(size == 32, "got %u\n", size);
|
||||
- todo_wine ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
|
||||
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
+ ok(size == 32, "got %u\n", size);
|
||||
+ ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
|
||||
todo_wine ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
|
||||
for (i = 0; i < 32; i++)
|
||||
- todo_wine ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
|
||||
+ ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
|
||||
for (i = 0; i < 16; i++)
|
||||
todo_wine ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
|
||||
|
||||
@@ -766,12 +766,12 @@ static void test_BCryptEncrypt(void)
|
||||
memset(ciphertext, 0xff, sizeof(ciphertext));
|
||||
memset(tag, 0xff, sizeof(tag));
|
||||
ret = pBCryptEncrypt(key, data2, 24, &auth_info, ivbuf, 16, ciphertext, 24, &size, 0);
|
||||
- todo_wine ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
- todo_wine ok(size == 24, "got %u\n", size);
|
||||
- todo_wine ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
|
||||
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
+ ok(size == 24, "got %u\n", size);
|
||||
+ ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
|
||||
todo_wine ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
|
||||
for (i = 0; i < 24; i++)
|
||||
- todo_wine ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
|
||||
+ ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
|
||||
for (i = 0; i < 16; i++)
|
||||
todo_wine ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
|
||||
|
||||
@@ -784,7 +784,7 @@ static void test_BCryptEncrypt(void)
|
||||
memcpy(ivbuf, iv, sizeof(iv));
|
||||
memset(ciphertext, 0, sizeof(ciphertext));
|
||||
ret = pBCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 48, &size, BCRYPT_BLOCK_PADDING);
|
||||
- todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
|
||||
+ ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
|
||||
|
||||
ret = pBCryptDestroyKey(key);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,83 +0,0 @@
|
||||
From 4ec53bd02df73020b29b0a9fed5b0915d95a66e3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 26 Dec 2016 07:53:10 +0100
|
||||
Subject: [PATCH 18/36] bcrypt: Implement BCryptDecrypt for AES GCM mode.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 28 +++++++++++++++++++++++-----
|
||||
dlls/bcrypt/tests/bcrypt.c | 8 ++++----
|
||||
2 files changed, 27 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 387f448516..17cc92dded 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1352,17 +1352,35 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
padding, iv, iv_len, output, output_len, ret_len, flags );
|
||||
|
||||
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
- if (padding)
|
||||
- {
|
||||
- FIXME( "padding info not implemented\n" );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
- }
|
||||
if (flags & ~BCRYPT_BLOCK_PADDING)
|
||||
{
|
||||
FIXME( "flags %08x not supported\n", flags );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+ if (key->mode == MODE_ID_GCM)
|
||||
+ {
|
||||
+ BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
|
||||
+
|
||||
+ if (!auth_info) return STATUS_INVALID_PARAMETER;
|
||||
+ if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
|
||||
+ if (!auth_info->pbTag) return STATUS_INVALID_PARAMETER;
|
||||
+ if (auth_info->cbTag < 12 || auth_info->cbTag > 16) return STATUS_INVALID_PARAMETER;
|
||||
+
|
||||
+ if ((status = key_set_params( key, auth_info->pbNonce, auth_info->cbNonce )))
|
||||
+ return status;
|
||||
+
|
||||
+ *ret_len = input_len;
|
||||
+ if (flags & BCRYPT_BLOCK_PADDING) return STATUS_INVALID_PARAMETER;
|
||||
+ if (!output) return STATUS_SUCCESS;
|
||||
+ if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
|
||||
+
|
||||
+ if ((status = key_decrypt( key, input, input_len, output, output_len )))
|
||||
+ return status;
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+
|
||||
if ((status = key_set_params( key, iv, iv_len ))) return status;
|
||||
|
||||
*ret_len = input_len;
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 355a414bca..89a3c40850 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -969,16 +969,16 @@ static void test_BCryptDecrypt(void)
|
||||
memcpy(ivbuf, iv, sizeof(iv));
|
||||
memset(plaintext, 0, sizeof(plaintext));
|
||||
ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
|
||||
- todo_wine ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
- todo_wine ok(size == 32, "got %u\n", size);
|
||||
- todo_wine ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
|
||||
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
+ ok(size == 32, "got %u\n", size);
|
||||
+ ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
|
||||
|
||||
/* test with wrong tag */
|
||||
memcpy(ivbuf, iv, sizeof(iv));
|
||||
auth_info.pbTag = iv; /* wrong tag */
|
||||
ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
|
||||
todo_wine ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
|
||||
- todo_wine ok(size == 32, "got %u\n", size);
|
||||
+ ok(size == 32, "got %u\n", size);
|
||||
|
||||
ret = pBCryptDestroyKey(key);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,168 +0,0 @@
|
||||
From a511e42c71c2c04ee257f78cece073d08a51d32d 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:02:36 +0100
|
||||
Subject: [PATCH 19/36] bcrypt: Add support for computing/comparing cipher tag.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/bcrypt/tests/bcrypt.c | 10 +++++-----
|
||||
2 files changed, 51 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 02a0106..5daddff 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -50,6 +50,9 @@ static HINSTANCE instance;
|
||||
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
|
||||
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
|
||||
+/* Not present in gnutls version < 3.0 */
|
||||
+static int (*pgnutls_cipher_tag)(gnutls_cipher_hd_t handle, void * tag, size_t tag_size);
|
||||
+
|
||||
static void *libgnutls_handle;
|
||||
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
|
||||
MAKE_FUNCPTR(gnutls_cipher_decrypt2);
|
||||
@@ -69,6 +72,11 @@ MAKE_FUNCPTR(gnutls_perror);
|
||||
#define GNUTLS_CIPHER_AES_256_GCM 94
|
||||
#endif
|
||||
|
||||
+static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void * tag, size_t tag_size)
|
||||
+{
|
||||
+ return GNUTLS_E_UNKNOWN_CIPHER_TYPE;
|
||||
+}
|
||||
+
|
||||
static void gnutls_log( int level, const char *msg )
|
||||
{
|
||||
TRACE( "<%d> %s", level, msg );
|
||||
@@ -102,6 +110,12 @@ static BOOL gnutls_initialize(void)
|
||||
LOAD_FUNCPTR(gnutls_perror)
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
+ if (!(pgnutls_cipher_tag = wine_dlsym( libgnutls_handle, "gnutls_cipher_tag", NULL, 0 )))
|
||||
+ {
|
||||
+ WARN("gnutls_cipher_tag not found\n");
|
||||
+ pgnutls_cipher_tag = compat_gnutls_cipher_tag;
|
||||
+ }
|
||||
+
|
||||
if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS)
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
@@ -1018,6 +1032,19 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ if ((ret = pgnutls_cipher_tag( key->handle, tag, len )))
|
||||
+ {
|
||||
+ pgnutls_perror( ret );
|
||||
+ return STATUS_INTERNAL_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
+
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
if (key->handle) pgnutls_cipher_deinit( key->handle );
|
||||
@@ -1123,6 +1150,12 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
+{
|
||||
+ FIXME( "not implemented on Mac\n" );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+}
|
||||
+
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
if (key->ref_encrypt) CCCryptorRelease( key->ref_encrypt );
|
||||
@@ -1159,6 +1192,12 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
+{
|
||||
+ ERR( "support for keys not available at build time\n" );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+}
|
||||
+
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
@@ -1312,7 +1351,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if ((status = key_encrypt( key, input, input_len, output, output_len )))
|
||||
return status;
|
||||
|
||||
- return STATUS_SUCCESS;
|
||||
+ return key_get_tag( key, auth_info->pbTag, auth_info->cbTag );
|
||||
}
|
||||
|
||||
if ((status = key_set_params( key, iv, iv_len ))) return status;
|
||||
@@ -1371,6 +1410,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if (key->mode == MODE_ID_GCM)
|
||||
{
|
||||
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
|
||||
+ UCHAR tag[16];
|
||||
|
||||
if (!auth_info) return STATUS_INVALID_PARAMETER;
|
||||
if (!auth_info->pbNonce) return STATUS_INVALID_PARAMETER;
|
||||
@@ -1388,6 +1428,11 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if ((status = key_decrypt( key, input, input_len, output, output_len )))
|
||||
return status;
|
||||
|
||||
+ if ((status = key_get_tag( key, tag, sizeof(tag) )))
|
||||
+ return status;
|
||||
+ if (memcmp( tag, auth_info->pbTag, auth_info->cbTag ))
|
||||
+ return STATUS_AUTH_TAG_MISMATCH;
|
||||
+
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 89a3c40..18cd2a2 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -754,11 +754,11 @@ static void test_BCryptEncrypt(void)
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
ok(size == 32, "got %u\n", size);
|
||||
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
|
||||
- todo_wine ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
|
||||
+ ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
|
||||
for (i = 0; i < 32; i++)
|
||||
ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
|
||||
for (i = 0; i < 16; i++)
|
||||
- todo_wine ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
|
||||
+ ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
|
||||
|
||||
/* input size is not multiple of block size */
|
||||
size = 0;
|
||||
@@ -769,11 +769,11 @@ static void test_BCryptEncrypt(void)
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
ok(size == 24, "got %u\n", size);
|
||||
ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
|
||||
- todo_wine ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
|
||||
+ ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
|
||||
for (i = 0; i < 24; i++)
|
||||
ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
|
||||
for (i = 0; i < 16; i++)
|
||||
- todo_wine ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
|
||||
+ ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
|
||||
|
||||
/* test with padding */
|
||||
memcpy(ivbuf, iv, sizeof(iv));
|
||||
@@ -977,7 +977,7 @@ static void test_BCryptDecrypt(void)
|
||||
memcpy(ivbuf, iv, sizeof(iv));
|
||||
auth_info.pbTag = iv; /* wrong tag */
|
||||
ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
|
||||
- todo_wine ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
|
||||
+ ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
|
||||
ok(size == 32, "got %u\n", size);
|
||||
|
||||
ret = pBCryptDestroyKey(key);
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 622e4b47bdabcdae3deab7347a73d0b3ea804fca Mon Sep 17 00:00:00 2001
|
||||
From 392198981958d9d2c76e22e27c1b704c7763971b 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: [PATCH 20/36] bcrypt: Implement BCryptDuplicateKey.
|
||||
Subject: [PATCH] bcrypt: Implement BCryptDuplicateKey.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 2 +-
|
||||
@ -23,11 +23,11 @@ index 21b54b4..28c2394 100644
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long)
|
||||
@ stub BCryptEnumContextFunctionProviders
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 5daddff..e72a8fd 100644
|
||||
index cd44bdf..0d321d2 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -954,6 +954,24 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
return STATUS_SUCCESS;
|
||||
@@ -953,6 +953,24 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
@ -51,8 +51,8 @@ index 5daddff..e72a8fd 100644
|
||||
static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
{
|
||||
switch (key->alg_id)
|
||||
@@ -1089,6 +1107,25 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
return STATUS_SUCCESS;
|
||||
@@ -1094,6 +1112,25 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
@ -77,7 +77,7 @@ index 5daddff..e72a8fd 100644
|
||||
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
{
|
||||
CCCryptorStatus status;
|
||||
@@ -1172,6 +1209,13 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
@@ -1182,6 +1219,13 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ index 5daddff..e72a8fd 100644
|
||||
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
@@ -1300,6 +1344,30 @@ NTSTATUS WINAPI BCryptExportKey(BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
|
||||
@@ -1310,6 +1354,30 @@ NTSTATUS WINAPI BCryptExportKey(BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
|
||||
return key_export( key, type, output, output_len, size );
|
||||
}
|
||||
|
||||
@ -136,5 +136,5 @@ index 5d5fae0..d0f0f56 100644
|
||||
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms
|
||||
@ stub BCryptEnumContextFunctionProviders
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,111 +0,0 @@
|
||||
From b41fdf5830cdaf31108cbdf82585f130882a0fb7 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:41:31 +0100
|
||||
Subject: [PATCH 22/36] bcrypt: Allow to call BCryptSetProperty on key objects.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
|
||||
dlls/bcrypt/tests/bcrypt.c | 4 ++++
|
||||
2 files changed, 46 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index e72a8fd..f027eea 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -246,6 +246,9 @@ struct algorithm
|
||||
BOOL hmac;
|
||||
};
|
||||
|
||||
+struct key;
|
||||
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags );
|
||||
+
|
||||
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG count, ULONG flags)
|
||||
{
|
||||
const DWORD supported_flags = BCRYPT_USE_SYSTEM_PREFERRED_RNG;
|
||||
@@ -696,8 +699,8 @@ NTSTATUS WINAPI BCryptSetProperty( BCRYPT_HANDLE handle, const WCHAR *prop, UCHA
|
||||
}
|
||||
case MAGIC_KEY:
|
||||
{
|
||||
- FIXME( "keys not implemented yet\n" );
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
+ struct key *key = (struct key *)object;
|
||||
+ return set_key_property( key, prop, value, size, flags );
|
||||
}
|
||||
default:
|
||||
WARN( "unknown magic %08x\n", object->magic );
|
||||
@@ -972,6 +975,31 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
|
||||
+{
|
||||
+ if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
|
||||
+ {
|
||||
+ if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
|
||||
+ {
|
||||
+ key->mode = MODE_ID_CBC;
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+ else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
|
||||
+ {
|
||||
+ key->mode = MODE_ID_GCM;
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ FIXME( "unsupported key property %s\n", debugstr_w(prop) );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+}
|
||||
+
|
||||
static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
{
|
||||
switch (key->alg_id)
|
||||
@@ -1126,6 +1154,12 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
|
||||
+{
|
||||
+ FIXME( "not implemented on Mac\n" );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+}
|
||||
+
|
||||
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
{
|
||||
CCCryptorStatus status;
|
||||
@@ -1216,6 +1250,12 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
|
||||
+{
|
||||
+ ERR( "support for keys not available at build time\n" );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+}
|
||||
+
|
||||
static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 6ec429e..baf5b63 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -526,6 +526,10 @@ static void test_BCryptGenerateSymmetricKey(void)
|
||||
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
+ ret = pBCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
|
||||
+ sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
|
||||
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
|
||||
+
|
||||
size = 0xdeadbeef;
|
||||
ret = pBCryptEncrypt(key, NULL, 0, NULL, NULL, 0, NULL, 0, &size, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,7 +1,7 @@
|
||||
From da83888b40c6a37740e3ff3ba1b0f2d3e2b9008c Mon Sep 17 00:00:00 2001
|
||||
From 6bd98b26d6448c2a0cddd934f91bad42fe0fc9a0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 13 Aug 2017 05:04:21 +0200
|
||||
Subject: [PATCH 28/36] bcrypt: Add support for 192 and 256 bit aes keys.
|
||||
Subject: [PATCH] bcrypt: Add support for 192 and 256 bit aes keys.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 14 ++++++++++++--
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH 28/36] bcrypt: Add support for 192 and 256 bit aes keys.
|
||||
2 files changed, 44 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index dbd8152..227c007 100644
|
||||
index 9fb2268..2e6ed8b 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1031,11 +1031,21 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
@@ -1002,11 +1002,21 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
WARN( "handle block size\n" );
|
||||
switch (key->mode)
|
||||
{
|
||||
@ -37,7 +37,7 @@ index dbd8152..227c007 100644
|
||||
FIXME( "algorithm %u not supported\n", key->alg_id );
|
||||
return GNUTLS_CIPHER_UNKNOWN;
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 2381fdf..2bf8b1b 100644
|
||||
index 30fdb60..ac5fc36 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -615,6 +615,9 @@ static void test_BCryptEncrypt(void)
|
||||
@ -94,5 +94,5 @@ index 2381fdf..2bf8b1b 100644
|
||||
* AES - GCM mode *
|
||||
******************/
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,16 +1,25 @@
|
||||
From d4255af99adc2fb09940feae4a7836fdd7e45a8e Mon Sep 17 00:00:00 2001
|
||||
From 70501f83e7effe724e09263791e99c494ecfbe3d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 29 Sep 2017 18:31:55 +0200
|
||||
Subject: [PATCH 29/36] bcrypt: Preparation for asymmetric keys.
|
||||
Subject: [PATCH] bcrypt: Preparation for asymmetric keys.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 368 ++++++++++++++++++++++++++++------------------
|
||||
1 file changed, 227 insertions(+), 141 deletions(-)
|
||||
dlls/bcrypt/bcrypt_main.c | 367 ++++++++++++++++++++++++++++------------------
|
||||
1 file changed, 226 insertions(+), 141 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 227c007..9b1ac80 100644
|
||||
index 2e6ed8b..0791cf3 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
-
|
||||
+#undef HAVE_GNUTLS_CIPHER_INIT
|
||||
#include <stdarg.h>
|
||||
#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
|
||||
#include <AvailabilityMacros.h>
|
||||
@@ -238,16 +238,17 @@ static const struct {
|
||||
ULONG hash_length;
|
||||
ULONG block_bits;
|
||||
@ -38,7 +47,7 @@ index 227c007..9b1ac80 100644
|
||||
};
|
||||
|
||||
struct algorithm
|
||||
@@ -885,21 +886,28 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
|
||||
@@ -856,21 +857,28 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
|
||||
}
|
||||
|
||||
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H)
|
||||
@ -73,7 +82,7 @@ index 227c007..9b1ac80 100644
|
||||
enum mode_id mode;
|
||||
ULONG block_size;
|
||||
CCCryptorRef ref_encrypt;
|
||||
@@ -907,16 +915,56 @@ struct key
|
||||
@@ -878,16 +886,56 @@ struct key
|
||||
UCHAR *secret;
|
||||
ULONG secret_len;
|
||||
};
|
||||
@ -132,7 +141,7 @@ index 227c007..9b1ac80 100644
|
||||
static ULONG get_block_size( struct algorithm *alg )
|
||||
{
|
||||
ULONG ret = 0, size = sizeof(ret);
|
||||
@@ -928,25 +976,43 @@ static NTSTATUS key_export( struct key *key, const WCHAR *type, UCHAR *output, U
|
||||
@@ -899,25 +947,43 @@ static NTSTATUS key_export( struct key *key, const WCHAR *type, UCHAR *output, U
|
||||
if (!strcmpW( type, BCRYPT_KEY_DATA_BLOB ))
|
||||
{
|
||||
BCRYPT_KEY_DATA_BLOB_HEADER *header = (BCRYPT_KEY_DATA_BLOB_HEADER *)output;
|
||||
@ -180,7 +189,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
UCHAR *buffer;
|
||||
|
||||
@@ -962,15 +1028,15 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
@@ -933,15 +999,15 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
@ -202,7 +211,28 @@ index 227c007..9b1ac80 100644
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -979,16 +1045,24 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
@@ -952,17 +1018,17 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
{
|
||||
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
|
||||
{
|
||||
- key->mode = MODE_ID_ECB;
|
||||
+ key->u.s.mode = MODE_ID_ECB;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
|
||||
{
|
||||
- key->mode = MODE_ID_CBC;
|
||||
+ key->u.s.mode = MODE_ID_CBC;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
|
||||
{
|
||||
- key->mode = MODE_ID_GCM;
|
||||
+ key->u.s.mode = MODE_ID_GCM;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
@@ -980,16 +1046,24 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
{
|
||||
UCHAR *buffer;
|
||||
|
||||
@ -236,28 +266,7 @@ index 227c007..9b1ac80 100644
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -999,17 +1073,17 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
{
|
||||
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
|
||||
{
|
||||
- key->mode = MODE_ID_ECB;
|
||||
+ key->u.s.mode = MODE_ID_ECB;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
|
||||
{
|
||||
- key->mode = MODE_ID_CBC;
|
||||
+ key->u.s.mode = MODE_ID_CBC;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
|
||||
{
|
||||
- key->mode = MODE_ID_GCM;
|
||||
+ key->u.s.mode = MODE_ID_GCM;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
@@ -1029,22 +1103,22 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
@@ -1000,22 +1074,22 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
{
|
||||
case ALG_ID_AES:
|
||||
WARN( "handle block size\n" );
|
||||
@ -287,7 +296,7 @@ index 227c007..9b1ac80 100644
|
||||
return GNUTLS_CIPHER_UNKNOWN;
|
||||
default:
|
||||
FIXME( "algorithm %u not supported\n", key->alg_id );
|
||||
@@ -1052,17 +1126,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
@@ -1023,17 +1097,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,7 +318,7 @@ index 227c007..9b1ac80 100644
|
||||
}
|
||||
|
||||
if ((cipher = get_gnutls_cipher( key )) == GNUTLS_CIPHER_UNKNOWN)
|
||||
@@ -1074,12 +1148,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
@@ -1045,12 +1119,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
iv_len = sizeof(zero_iv);
|
||||
}
|
||||
|
||||
@ -325,7 +334,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1088,11 +1162,11 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
@@ -1059,11 +1133,11 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -339,7 +348,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1101,12 +1175,12 @@ static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len
|
||||
@@ -1072,12 +1146,12 @@ static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -354,7 +363,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1120,7 +1194,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
@@ -1091,7 +1165,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -363,7 +372,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1133,7 +1207,7 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
@@ -1104,7 +1178,7 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -372,7 +381,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1144,13 +1218,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
@@ -1115,13 +1189,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
@ -389,7 +398,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
UCHAR *buffer;
|
||||
|
||||
@@ -1172,16 +1246,16 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
@@ -1143,16 +1217,16 @@ static NTSTATUS key_init( struct key *key, struct algorithm *alg, const UCHAR *s
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
@ -413,7 +422,7 @@ index 227c007..9b1ac80 100644
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1190,17 +1264,17 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
@@ -1167,66 +1241,66 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
{
|
||||
UCHAR *buffer;
|
||||
|
||||
@ -441,9 +450,6 @@ index 227c007..9b1ac80 100644
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1211,51 +1285,51 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
-static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
+static NTSTATUS key_symmetric_set_params( struct key *key, UCHAR *iv, ULONG iv_len )
|
||||
@ -507,7 +513,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
WARN( "CCCryptorUpdate failed %d\n", status );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1269,7 +1343,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
@@ -1240,7 +1314,7 @@ static NTSTATUS key_decrypt( struct key *key, const UCHAR *input, ULONG input_le
|
||||
{
|
||||
CCCryptorStatus status;
|
||||
|
||||
@ -516,14 +522,14 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
WARN( "CCCryptorUpdate failed %d\n", status );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
@@ -1286,24 +1360,24 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
@@ -1257,14 +1331,14 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
- if (key->ref_encrypt) CCCryptorRelease( key->ref_encrypt );
|
||||
- if (key->ref_decrypt) CCCryptorRelease( key->ref_decrypt );
|
||||
- heap_free( key->secret );
|
||||
+ if (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
|
||||
+ iif (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
|
||||
+ if (key->u.s.ref_decrypt) CCCryptorRelease( key->u.s.ref_decrypt );
|
||||
+ heap_free( key->u.s.secret );
|
||||
heap_free( key );
|
||||
@ -534,20 +540,12 @@ index 227c007..9b1ac80 100644
|
||||
+static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, const UCHAR *secret, ULONG secret_len )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
- key->mode = MODE_ID_CBC;
|
||||
+ key->u.s.mode = MODE_ID_CBC;
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -1279,23 +1353,22 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
- key_copy->mode = MODE_ID_CBC;
|
||||
+ key_copy->u.s.mode = MODE_ID_CBC;
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -1313,19 +1387,19 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -570,7 +568,7 @@ index 227c007..9b1ac80 100644
|
||||
ULONG output_len )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
@@ -1380,7 +1454,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
|
||||
@@ -1350,7 +1423,7 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
|
||||
|
||||
key->hdr.magic = MAGIC_KEY;
|
||||
|
||||
@ -579,7 +577,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
heap_free( key );
|
||||
*handle = NULL;
|
||||
@@ -1499,19 +1573,30 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1469,19 +1542,30 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
struct key *key = handle;
|
||||
ULONG bytes_left = input_len;
|
||||
UCHAR *buf, *src, *dst;
|
||||
@ -611,7 +609,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
|
||||
|
||||
@@ -1522,7 +1607,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1492,7 +1576,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if (auth_info->dwFlags & BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG)
|
||||
FIXME( "call chaining not implemented\n" );
|
||||
|
||||
@ -620,7 +618,7 @@ index 227c007..9b1ac80 100644
|
||||
return status;
|
||||
|
||||
*ret_len = input_len;
|
||||
@@ -1530,46 +1615,47 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1500,46 +1584,47 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if (input && !output) return STATUS_SUCCESS;
|
||||
if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
|
||||
|
||||
@ -683,7 +681,7 @@ index 227c007..9b1ac80 100644
|
||||
heap_free( buf );
|
||||
}
|
||||
|
||||
@@ -1595,7 +1681,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1565,7 +1650,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -692,7 +690,7 @@ index 227c007..9b1ac80 100644
|
||||
{
|
||||
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO *auth_info = padding;
|
||||
UCHAR tag[16];
|
||||
@@ -1605,7 +1691,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1575,7 +1660,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if (!auth_info->pbTag) return STATUS_INVALID_PARAMETER;
|
||||
if (auth_info->cbTag < 12 || auth_info->cbTag > 16) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
@ -701,7 +699,7 @@ index 227c007..9b1ac80 100644
|
||||
return status;
|
||||
|
||||
*ret_len = input_len;
|
||||
@@ -1613,7 +1699,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1583,7 +1668,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
if (!output) return STATUS_SUCCESS;
|
||||
if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL;
|
||||
|
||||
@ -710,7 +708,7 @@ index 227c007..9b1ac80 100644
|
||||
return status;
|
||||
if ((status = key_decrypt( key, input, input_len, output, output_len )))
|
||||
return status;
|
||||
@@ -1626,44 +1712,44 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
@@ -1596,44 +1681,44 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -773,5 +771,5 @@ index 227c007..9b1ac80 100644
|
||||
else
|
||||
status = STATUS_UNSUCCESSFUL; /* FIXME: invalid padding */
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,73 +0,0 @@
|
||||
From 9f12175593de82371bbd40c51f1cf4ea09378590 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 29 Sep 2017 18:49:09 +0200
|
||||
Subject: [PATCH] include: Add ecdsa and asymmetric key related
|
||||
bcrypt definitions.
|
||||
|
||||
---
|
||||
include/bcrypt.h | 28 ++++++++++++++++++++++++++++
|
||||
1 file changed, 28 insertions(+)
|
||||
|
||||
diff --git a/include/bcrypt.h b/include/bcrypt.h
|
||||
index d0b29c7..bf47576 100644
|
||||
--- a/include/bcrypt.h
|
||||
+++ b/include/bcrypt.h
|
||||
@@ -61,6 +61,8 @@ typedef LONG NTSTATUS;
|
||||
#define BCRYPT_OPAQUE_KEY_BLOB (const WCHAR []){'O','p','a','q','u','e','K','e','y','B','l','o','b',0}
|
||||
#define BCRYPT_KEY_DATA_BLOB (const WCHAR []){'K','e','y','D','a','t','a','B','l','o','b',0}
|
||||
#define BCRYPT_AES_WRAP_KEY_BLOB (const WCHAR []){'R','f','c','3','5','6','5','K','e','y','W','r','a','p','B','l','o','b',0}
|
||||
+#define BCRYPT_ECCPUBLIC_BLOB (const WCHAR []){'E','C','C','P','U','B','L','I','C','B','L','O','B',0}
|
||||
+#define BCRYPT_ECCPRIVATE_BLOB (const WCHAR []){'E','C','C','P','R','I','V','A','T','E','B','L','O','B',0}
|
||||
|
||||
#define MS_PRIMITIVE_PROVIDER (const WCHAR [])\
|
||||
{'M','i','c','r','o','s','o','f','t',' ','P','r','i','m','i','t','i','v','e',' ','P','r','o','v','i','d','e','r',0}
|
||||
@@ -76,6 +78,9 @@ typedef LONG NTSTATUS;
|
||||
#define BCRYPT_SHA256_ALGORITHM (const WCHAR []){'S','H','A','2','5','6',0}
|
||||
#define BCRYPT_SHA384_ALGORITHM (const WCHAR []){'S','H','A','3','8','4',0}
|
||||
#define BCRYPT_SHA512_ALGORITHM (const WCHAR []){'S','H','A','5','1','2',0}
|
||||
+#define BCRYPT_ECDSA_P256_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','2','5','6',0}
|
||||
+#define BCRYPT_ECDSA_P384_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','3','8','4',0}
|
||||
+#define BCRYPT_ECDSA_P521_ALGORITHM (const WCHAR []){'E','C','D','S','A','_','P','5','2','1',0}
|
||||
|
||||
#define BCRYPT_CHAIN_MODE_NA (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','N','/','A',0}
|
||||
#define BCRYPT_CHAIN_MODE_CBC (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','B','C',0}
|
||||
@@ -84,6 +89,13 @@ typedef LONG NTSTATUS;
|
||||
#define BCRYPT_CHAIN_MODE_CCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','C','M',0}
|
||||
#define BCRYPT_CHAIN_MODE_GCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','G','C','M',0}
|
||||
|
||||
+#define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345
|
||||
+#define BCRYPT_ECDSA_PRIVATE_P256_MAGIC 0x32534345
|
||||
+#define BCRYPT_ECDSA_PUBLIC_P384_MAGIC 0x33534345
|
||||
+#define BCRYPT_ECDSA_PRIVATE_P384_MAGIC 0x34534345
|
||||
+#define BCRYPT_ECDSA_PUBLIC_P521_MAGIC 0x35534345
|
||||
+#define BCRYPT_ECDSA_PRIVATE_P521_MAGIC 0x36534345
|
||||
+
|
||||
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
|
||||
{
|
||||
LPWSTR pszName;
|
||||
@@ -115,6 +127,22 @@ typedef struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
|
||||
ULONG dwFlags;
|
||||
} BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO, *PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO;
|
||||
|
||||
+typedef struct _BCRYPT_ECCKEY_BLOB
|
||||
+{
|
||||
+ ULONG dwMagic;
|
||||
+ ULONG cbKey;
|
||||
+} BCRYPT_ECCKEY_BLOB, *PBCRYPT_ECCKEY_BLOB;
|
||||
+
|
||||
+typedef struct _BCRYPT_PKCS1_PADDING_INFO
|
||||
+{
|
||||
+ LPCWSTR pszAlgId;
|
||||
+} BCRYPT_PKCS1_PADDING_INFO;
|
||||
+
|
||||
+#define BCRYPT_PAD_NONE 0x00000001
|
||||
+#define BCRYPT_PAD_PKCS1 0x00000002
|
||||
+#define BCRYPT_PAD_OAEP 0x00000004
|
||||
+#define BCRYPT_PAD_PSS 0x00000008
|
||||
+
|
||||
#define BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION 1
|
||||
|
||||
#define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,14 +1,14 @@
|
||||
From 4bdabbed491daddcfe5b29c61843f18fb08f0d0c Mon Sep 17 00:00:00 2001
|
||||
From 095c654875966c29472ceb56be564f689ad4f22c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 29 Sep 2017 18:50:04 +0200
|
||||
Subject: [PATCH 31/36] bcrypt/tests: Add basic test for ecdsa.
|
||||
Subject: [PATCH] bcrypt/tests: Add basic test for ecdsa.
|
||||
|
||||
---
|
||||
dlls/bcrypt/tests/bcrypt.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 65 insertions(+)
|
||||
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index a0906e9904..9b04f62df2 100644
|
||||
index ac5fc36..22a0ffe 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -50,6 +50,8 @@ static NTSTATUS (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE);
|
||||
@ -105,5 +105,5 @@ index a0906e9904..9b04f62df2 100644
|
||||
if (pBCryptHash) /* >= Win 10 */
|
||||
test_BcryptHash();
|
||||
--
|
||||
2.16.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 6bd5e33916b76195ecf5ce743de346bb9874295b Mon Sep 17 00:00:00 2001
|
||||
From a1c152388920e9a6b3cafc840df1e28822f52180 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 29 Sep 2017 19:18:58 +0200
|
||||
Subject: [PATCH 32/36] bcrypt: Implement importing of ecdsa keys.
|
||||
Subject: [PATCH] bcrypt: Implement importing of ecdsa keys.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 4 +-
|
||||
@ -33,7 +33,7 @@ index 28c2394..78824d7 100644
|
||||
@ stub GetCipherInterface
|
||||
@ stub GetHashInterface
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 9b1ac80..9efa132 100644
|
||||
index 0791cf3..c1a5114 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -220,7 +220,9 @@ enum alg_id
|
||||
@ -58,7 +58,7 @@ index 9b1ac80..9efa132 100644
|
||||
};
|
||||
|
||||
struct algorithm
|
||||
@@ -327,6 +331,8 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
@@ -324,6 +328,8 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256;
|
||||
else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384;
|
||||
else if (!strcmpW( id, BCRYPT_SHA512_ALGORITHM )) alg_id = ALG_ID_SHA512;
|
||||
@ -67,7 +67,7 @@ index 9b1ac80..9efa132 100644
|
||||
else
|
||||
{
|
||||
FIXME( "algorithm %s not supported\n", debugstr_w(id) );
|
||||
@@ -895,6 +901,12 @@ struct key_symmetric
|
||||
@@ -866,6 +872,12 @@ struct key_symmetric
|
||||
ULONG secret_len;
|
||||
};
|
||||
|
||||
@ -80,7 +80,7 @@ index 9b1ac80..9efa132 100644
|
||||
struct key
|
||||
{
|
||||
struct object hdr;
|
||||
@@ -902,6 +914,7 @@ struct key
|
||||
@@ -873,6 +885,7 @@ struct key
|
||||
union
|
||||
{
|
||||
struct key_symmetric s;
|
||||
@ -88,7 +88,7 @@ index 9b1ac80..9efa132 100644
|
||||
} u;
|
||||
};
|
||||
|
||||
@@ -916,6 +929,12 @@ struct key_symmetric
|
||||
@@ -887,6 +900,12 @@ struct key_symmetric
|
||||
ULONG secret_len;
|
||||
};
|
||||
|
||||
@ -101,7 +101,7 @@ index 9b1ac80..9efa132 100644
|
||||
struct key
|
||||
{
|
||||
struct object hdr;
|
||||
@@ -923,6 +942,7 @@ struct key
|
||||
@@ -894,6 +913,7 @@ struct key
|
||||
union
|
||||
{
|
||||
struct key_symmetric s;
|
||||
@ -109,7 +109,7 @@ index 9b1ac80..9efa132 100644
|
||||
} u;
|
||||
};
|
||||
#else
|
||||
@@ -998,6 +1018,12 @@ static inline BOOL key_is_symmetric( struct key *key )
|
||||
@@ -969,6 +989,12 @@ static inline BOOL key_is_symmetric( struct key *key )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -122,8 +122,8 @@ index 9b1ac80..9efa132 100644
|
||||
static NTSTATUS key_symmetric_get_mode( struct key *key, enum mode_id *mode )
|
||||
{
|
||||
*mode = key->u.s.mode;
|
||||
@@ -1041,6 +1067,33 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
|
||||
return STATUS_SUCCESS;
|
||||
@@ -1042,6 +1068,33 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHAR *pubkey, ULONG pubkey_len )
|
||||
@ -156,7 +156,7 @@ index 9b1ac80..9efa132 100644
|
||||
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
{
|
||||
UCHAR *buffer;
|
||||
@@ -1061,7 +1114,13 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
@@ -1062,7 +1115,13 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -171,7 +171,7 @@ index 9b1ac80..9efa132 100644
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
@@ -1218,8 +1277,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
@@ -1189,8 +1248,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
@ -187,8 +187,8 @@ index 9b1ac80..9efa132 100644
|
||||
heap_free( key );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1260,6 +1324,12 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
|
||||
return STATUS_SUCCESS;
|
||||
@@ -1237,6 +1301,12 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
+static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHAR *pubkey, ULONG pubkey_len )
|
||||
@ -200,7 +200,7 @@ index 9b1ac80..9efa132 100644
|
||||
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
{
|
||||
UCHAR *buffer;
|
||||
@@ -1374,6 +1444,12 @@ static NTSTATUS key_symmetric_init( struct key *key, struct algorithm *alg, cons
|
||||
@@ -1350,6 +1420,12 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ index 9b1ac80..9efa132 100644
|
||||
static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
@@ -1556,6 +1632,88 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
|
||||
@@ -1525,6 +1601,88 @@ NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ index 9b1ac80..9efa132 100644
|
||||
{
|
||||
struct key *key = handle;
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 1c2700d..aaa187e 100644
|
||||
index 22a0ffe..73d3325 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -1404,7 +1404,7 @@ static void test_ECDSA(void)
|
||||
@ -329,10 +329,10 @@ index 1c2700d..aaa187e 100644
|
||||
pBCryptDestroyKey(key);
|
||||
pBCryptCloseAlgorithmProvider(alg, 0);
|
||||
diff --git a/include/bcrypt.h b/include/bcrypt.h
|
||||
index bf47576..6804f2b 100644
|
||||
index 717d77c..f28b0d3 100644
|
||||
--- a/include/bcrypt.h
|
||||
+++ b/include/bcrypt.h
|
||||
@@ -210,8 +210,10 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
|
||||
@@ -211,8 +211,10 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
|
||||
NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCHAR, ULONG);
|
||||
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
@ -344,5 +344,5 @@ index bf47576..6804f2b 100644
|
||||
|
||||
#endif /* __WINE_BCRYPT_H */
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
From d10899e701ce7fd4463b30c90ad8c2656a6adead Mon Sep 17 00:00:00 2001
|
||||
From 6b19309d0496fef0d87553b074bd80a487d9cac1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 29 Sep 2017 20:31:00 +0200
|
||||
Subject: [PATCH 33/36] bcrypt: Implement BCryptVerifySignature for ecdsa
|
||||
signatures.
|
||||
Subject: [PATCH] bcrypt: Implement BCryptVerifySignature for ecdsa signatures.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 343 +++++++++++++++++++++++++++++++++++++++++++--
|
||||
@ -10,7 +9,7 @@ Subject: [PATCH 33/36] bcrypt: Implement BCryptVerifySignature for ecdsa
|
||||
2 files changed, 337 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 9efa132..082474b 100644
|
||||
index c1a5114..057a27d 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -27,6 +27,7 @@
|
||||
@ -126,7 +125,7 @@ index 9efa132..082474b 100644
|
||||
|
||||
if (TRACE_ON( bcrypt ))
|
||||
{
|
||||
@@ -1275,6 +1329,264 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
@@ -1246,6 +1300,264 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -391,7 +390,7 @@ index 9efa132..082474b 100644
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
if(key_is_symmetric(key))
|
||||
@@ -1428,6 +1740,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
@@ -1399,6 +1711,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -404,8 +403,8 @@ index 9efa132..082474b 100644
|
||||
+
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
if (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
|
||||
@@ -1495,6 +1814,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
iif (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
|
||||
@@ -1464,6 +1783,13 @@ static NTSTATUS key_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -419,7 +418,7 @@ index 9efa132..082474b 100644
|
||||
static NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
@@ -1705,13 +2031,14 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
|
||||
@@ -1674,13 +2000,14 @@ NTSTATUS WINAPI BCryptVerifySignature( BCRYPT_KEY_HANDLE handle, void *padding,
|
||||
{
|
||||
struct key *key = handle;
|
||||
|
||||
@ -437,7 +436,7 @@ index 9efa132..082474b 100644
|
||||
|
||||
NTSTATUS WINAPI BCryptDestroyKey( BCRYPT_KEY_HANDLE handle )
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index aaa187e..6b62fb3 100644
|
||||
index 73d3325..d0bc52d 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -1420,10 +1420,10 @@ static void test_ECDSA(void)
|
||||
@ -454,5 +453,5 @@ index aaa187e..6b62fb3 100644
|
||||
pBCryptDestroyKey(key);
|
||||
pBCryptCloseAlgorithmProvider(alg, 0);
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From d9e0c414c53eb664791de70e5eb2b03e2c8ccb66 Mon Sep 17 00:00:00 2001
|
||||
From 53cb3911bc744414e3f0dce3e33ccad2bbd507e7 Mon Sep 17 00:00:00 2001
|
||||
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
|
||||
Date: Tue, 10 Oct 2017 16:40:41 +0300
|
||||
Subject: [PATCH 34/36] bcrypt: Initial implementation for RSA key import and
|
||||
Subject: [PATCH] bcrypt: Initial implementation for RSA key import and
|
||||
signature verification.
|
||||
|
||||
---
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH 34/36] bcrypt: Initial implementation for RSA key import and
|
||||
2 files changed, 135 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index d7a6435581..4f7e7636ca 100644
|
||||
index 057a27d..f858bec 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -77,6 +77,9 @@ static int (*pgnutls_pubkey_verify_hash2)(gnutls_pubkey_t key, gnutls_sign_algor
|
||||
@ -35,7 +35,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
static void gnutls_log( int level, const char *msg )
|
||||
{
|
||||
TRACE( "<%d> %s", level, msg );
|
||||
@@ -181,6 +189,11 @@ static BOOL gnutls_initialize(void)
|
||||
@@ -186,6 +194,11 @@ static BOOL gnutls_initialize(void)
|
||||
WARN("gnutls_pubkey_verify_hash2 not found\n");
|
||||
pgnutls_pubkey_verify_hash2 = compat_gnutls_pubkey_verify_hash2;
|
||||
}
|
||||
@ -47,7 +47,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
|
||||
if (TRACE_ON( bcrypt ))
|
||||
{
|
||||
@@ -276,6 +289,7 @@ enum alg_id
|
||||
@@ -271,6 +284,7 @@ enum alg_id
|
||||
ALG_ID_MD4,
|
||||
ALG_ID_MD5,
|
||||
ALG_ID_RNG,
|
||||
@ -55,7 +55,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
ALG_ID_SHA1,
|
||||
ALG_ID_SHA256,
|
||||
ALG_ID_SHA384,
|
||||
@@ -306,6 +320,7 @@ static const struct {
|
||||
@@ -301,6 +315,7 @@ static const struct {
|
||||
/* ALG_ID_MD4 */ { 270, 16, 512, BCRYPT_MD4_ALGORITHM, FALSE },
|
||||
/* ALG_ID_MD5 */ { 274, 16, 512, BCRYPT_MD5_ALGORITHM, FALSE },
|
||||
/* ALG_ID_RNG */ { 0, 0, 0, BCRYPT_RNG_ALGORITHM, FALSE },
|
||||
@ -63,7 +63,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
/* ALG_ID_SHA1 */ { 278, 20, 512, BCRYPT_SHA1_ALGORITHM, FALSE },
|
||||
/* ALG_ID_SHA256 */ { 286, 32, 512, BCRYPT_SHA256_ALGORITHM, FALSE },
|
||||
/* ALG_ID_SHA384 */ { 382, 48, 1024, BCRYPT_SHA384_ALGORITHM, FALSE },
|
||||
@@ -386,6 +401,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
@@ -378,6 +393,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
||||
else if (!strcmpW( id, BCRYPT_MD4_ALGORITHM )) alg_id = ALG_ID_MD4;
|
||||
else if (!strcmpW( id, BCRYPT_MD5_ALGORITHM )) alg_id = ALG_ID_MD5;
|
||||
else if (!strcmpW( id, BCRYPT_RNG_ALGORITHM )) alg_id = ALG_ID_RNG;
|
||||
@ -71,7 +71,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
else if (!strcmpW( id, BCRYPT_SHA1_ALGORITHM )) alg_id = ALG_ID_SHA1;
|
||||
else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256;
|
||||
else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384;
|
||||
@@ -1074,6 +1090,7 @@ static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, con
|
||||
@@ -1132,6 +1148,7 @@ static NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, con
|
||||
{
|
||||
case ALG_ID_ECDSA_P256:
|
||||
case ALG_ID_ECDSA_P384:
|
||||
@ -79,7 +79,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1449,6 +1466,34 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
|
||||
@@ -1446,6 +1463,34 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_key)
|
||||
{
|
||||
switch (key->alg_id)
|
||||
@@ -1456,6 +1501,8 @@ static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_
|
||||
@@ -1453,6 +1498,8 @@ static NTSTATUS import_gnutls_pubkey( struct key *key, gnutls_pubkey_t *gnutls_
|
||||
case ALG_ID_ECDSA_P256:
|
||||
case ALG_ID_ECDSA_P384:
|
||||
return import_gnutls_pubkey_ecc( key, gnutls_key );
|
||||
@ -123,7 +123,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
|
||||
default:
|
||||
FIXME("Algorithm %d not yet supported\n", key->alg_id);
|
||||
@@ -1485,6 +1532,14 @@ static NTSTATUS prepare_gnutls_signature_ecc( struct key *key, UCHAR *signature,
|
||||
@@ -1482,6 +1529,14 @@ static NTSTATUS prepare_gnutls_signature_ecc( struct key *key, UCHAR *signature,
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULONG signature_len,
|
||||
gnutls_datum_t *gnutls_signature )
|
||||
{
|
||||
@@ -1493,6 +1548,8 @@ static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULO
|
||||
@@ -1490,6 +1545,8 @@ static NTSTATUS prepare_gnutls_signature( struct key *key, UCHAR *signature, ULO
|
||||
case ALG_ID_ECDSA_P256:
|
||||
case ALG_ID_ECDSA_P384:
|
||||
return prepare_gnutls_signature_ecc( key, signature, signature_len, gnutls_signature );
|
||||
@ -147,7 +147,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
|
||||
default:
|
||||
FIXME( "Algorithm %d not yet supported\n", key->alg_id );
|
||||
@@ -1511,18 +1568,38 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
|
||||
@@ -1508,18 +1565,38 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
|
||||
NTSTATUS status;
|
||||
int ret;
|
||||
|
||||
@ -195,7 +195,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
}
|
||||
|
||||
switch (key->alg_id)
|
||||
@@ -1531,6 +1608,9 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
|
||||
@@ -1528,6 +1605,9 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
|
||||
case ALG_ID_ECDSA_P384:
|
||||
pk_algo = GNUTLS_PK_ECC;
|
||||
break;
|
||||
@ -205,7 +205,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
|
||||
default:
|
||||
FIXME( "Algorithm %d not yet supported\n", key->alg_id );
|
||||
@@ -1556,7 +1636,8 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
|
||||
@@ -1553,7 +1633,8 @@ static NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *ha
|
||||
gnutls_hash.size = hash_len;
|
||||
ret = pgnutls_pubkey_verify_hash2( gnutls_key, sign_algo, 0, &gnutls_hash, &gnutls_signature );
|
||||
|
||||
@ -215,7 +215,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
pgnutls_pubkey_deinit( gnutls_key );
|
||||
return (ret < 0) ? STATUS_INVALID_SIGNATURE : STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1938,6 +2019,33 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
|
||||
@@ -1990,6 +2071,33 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
|
||||
*ret_key = key;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@ -250,7 +250,7 @@ index d7a6435581..4f7e7636ca 100644
|
||||
FIXME( "unsupported key type %s\n", debugstr_w(type) );
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
diff --git a/include/bcrypt.h b/include/bcrypt.h
|
||||
index 6804f2bff5..2a9a0d0986 100644
|
||||
index f28b0d3..df54f62 100644
|
||||
--- a/include/bcrypt.h
|
||||
+++ b/include/bcrypt.h
|
||||
@@ -63,6 +63,8 @@ typedef LONG NTSTATUS;
|
||||
@ -292,5 +292,5 @@ index 6804f2bff5..2a9a0d0986 100644
|
||||
{
|
||||
LPCWSTR pszAlgId;
|
||||
--
|
||||
2.16.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 198271bfc6e17cb7be8f2296ea2375eb3a441db1 Mon Sep 17 00:00:00 2001
|
||||
From 40c9ce94bf6975c77741669a86136935303a138e Mon Sep 17 00:00:00 2001
|
||||
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
|
||||
Date: Tue, 10 Oct 2017 16:41:09 +0300
|
||||
Subject: [PATCH 35/36] bcrypt/tests: Add simple test for RSA.
|
||||
Subject: [PATCH] bcrypt/tests: Add simple test for RSA.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
@ -12,7 +12,7 @@ Based on patch from Bernhard Übelacker.
|
||||
1 file changed, 95 insertions(+)
|
||||
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index 047ffb4e6f..c0b936f6e5 100644
|
||||
index d0bc52d..feb74c4 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -1429,6 +1429,100 @@ static void test_ECDSA(void)
|
||||
@ -125,5 +125,5 @@ index 047ffb4e6f..c0b936f6e5 100644
|
||||
if (pBCryptHash) /* >= Win 10 */
|
||||
test_BcryptHash();
|
||||
--
|
||||
2.16.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,18 +1,17 @@
|
||||
From 139caeb5c401db46fc11cd8de60791f035852cbd Mon Sep 17 00:00:00 2001
|
||||
From f986cac5710ee6bbf96aae2cdefea4f8eb49653e Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 14 Oct 2017 22:44:13 +0200
|
||||
Subject: [PATCH 36/36] bcrypt: Store full ECCKEY_BLOB struct in
|
||||
BCryptImportKeyPair.
|
||||
Subject: [PATCH] bcrypt: Store full ECCKEY_BLOB struct in BCryptImportKeyPair.
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 4f7e7636ca..695c49acd1 100644
|
||||
index f858bec..c2300b4 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1431,6 +1431,7 @@ static void buffer_append_asn1_r_s( struct buffer *buffer, BYTE *r, DWORD r_len,
|
||||
@@ -1428,6 +1428,7 @@ static void buffer_append_asn1_r_s( struct buffer *buffer, BYTE *r, DWORD r_len,
|
||||
|
||||
static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnutls_key )
|
||||
{
|
||||
@ -20,7 +19,7 @@ index 4f7e7636ca..695c49acd1 100644
|
||||
gnutls_ecc_curve_t curve;
|
||||
gnutls_datum_t x, y;
|
||||
int ret;
|
||||
@@ -1451,10 +1452,11 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
|
||||
@@ -1448,10 +1449,11 @@ static NTSTATUS import_gnutls_pubkey_ecc( struct key *key, gnutls_pubkey_t *gnut
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
@ -36,7 +35,7 @@ index 4f7e7636ca..695c49acd1 100644
|
||||
|
||||
if ((ret = pgnutls_pubkey_import_ecc_raw( *gnutls_key, curve, &x, &y )))
|
||||
{
|
||||
@@ -2010,7 +2012,7 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
|
||||
@@ -2062,7 +2064,7 @@ NTSTATUS WINAPI BCryptImportKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HAN
|
||||
return STATUS_NO_MEMORY;
|
||||
|
||||
key->hdr.magic = MAGIC_KEY;
|
||||
@ -46,5 +45,5 @@ index 4f7e7636ca..695c49acd1 100644
|
||||
HeapFree( GetProcessHeap(), 0, key );
|
||||
return status;
|
||||
--
|
||||
2.16.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,2 +1 @@
|
||||
Fixes: [44500] Add stubs for FltRegisterFilter, FltStartFiltering, FltUnregisterFilter
|
||||
Depends: ntoskrnl-Ob_callbacks
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 92cb03fb619558c2193475843fbde619f517469d Mon Sep 17 00:00:00 2001
|
||||
From: Jarkko Korpi <jarkko_korpi@hotmail.com>
|
||||
Date: Wed, 15 Jul 2015 02:38:25 +0300
|
||||
Subject: kernel32: Silence repeated LocaleNameToLCID unsupported flags
|
||||
message.
|
||||
|
||||
---
|
||||
dlls/kernel32/locale.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
|
||||
index eaf1183..74f77dd 100644
|
||||
--- a/dlls/kernel32/locale.c
|
||||
+++ b/dlls/kernel32/locale.c
|
||||
@@ -1093,8 +1093,10 @@ LANGID WINAPI GetSystemDefaultUILanguage(void)
|
||||
LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags )
|
||||
{
|
||||
struct locale_name locale_name;
|
||||
+ static int once;
|
||||
|
||||
- if (flags) FIXME( "unsupported flags %x\n", flags );
|
||||
+ if (flags && !once++)
|
||||
+ FIXME( "unsupported flags %x\n", flags );
|
||||
|
||||
if (name == LOCALE_NAME_USER_DEFAULT)
|
||||
return GetUserDefaultLCID();
|
||||
@@ -1124,7 +1126,8 @@ LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags )
|
||||
*/
|
||||
INT WINAPI LCIDToLocaleName( LCID lcid, LPWSTR name, INT count, DWORD flags )
|
||||
{
|
||||
- if (flags) FIXME( "unsupported flags %x\n", flags );
|
||||
+ static int once;
|
||||
+ if (flags && !once++) FIXME( "unsupported flags %x\n", flags );
|
||||
|
||||
return GetLocaleInfoW( lcid, LOCALE_SNAME | LOCALE_NOUSEROVERRIDE, name, count );
|
||||
}
|
||||
--
|
||||
2.4.5
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [30076] Silence repeated LocaleNameToLCID/LCIDToLocaleName unsupported flags FIXMEs
|
@ -1,128 +0,0 @@
|
||||
From a1f421186a42a54456a7507f117c135d8a248040 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 9 Mar 2018 14:21:46 +1100
|
||||
Subject: [PATCH] include: Add more typedefs to wdm.h
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
include/ddk/wdm.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 97 insertions(+)
|
||||
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index 8f5b909447..d874a35daa 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -44,6 +44,7 @@ typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
|
||||
|
||||
typedef ULONG_PTR ERESOURCE_THREAD;
|
||||
typedef ERESOURCE_THREAD *PERESOURCE_THREAD;
|
||||
+typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION;
|
||||
|
||||
struct _KDPC;
|
||||
struct _KAPC;
|
||||
@@ -1291,6 +1292,102 @@ typedef struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST
|
||||
typedef NTSTATUS (NTAPI EX_CALLBACK_FUNCTION)(void *CallbackContext, void *Argument1, void *Argument2);
|
||||
typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION;
|
||||
|
||||
+typedef ULONG OB_OPERATION;
|
||||
+
|
||||
+typedef struct _OB_PRE_CREATE_HANDLE_INFORMATION {
|
||||
+ ACCESS_MASK DesiredAccess;
|
||||
+ ACCESS_MASK OriginalDesiredAccess;
|
||||
+} OB_PRE_CREATE_HANDLE_INFORMATION, *POB_PRE_CREATE_HANDLE_INFORMATION;
|
||||
+
|
||||
+typedef struct _OB_PRE_DUPLICATE_HANDLE_INFORMATION {
|
||||
+ ACCESS_MASK DesiredAccess;
|
||||
+ ACCESS_MASK OriginalDesiredAccess;
|
||||
+ PVOID SourceProcess;
|
||||
+ PVOID TargetProcess;
|
||||
+} OB_PRE_DUPLICATE_HANDLE_INFORMATION, *POB_PRE_DUPLICATE_HANDLE_INFORMATION;
|
||||
+
|
||||
+typedef union _OB_PRE_OPERATION_PARAMETERS {
|
||||
+ OB_PRE_CREATE_HANDLE_INFORMATION CreateHandleInformation;
|
||||
+ OB_PRE_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
|
||||
+} OB_PRE_OPERATION_PARAMETERS, *POB_PRE_OPERATION_PARAMETERS;
|
||||
+
|
||||
+typedef struct _OB_PRE_OPERATION_INFORMATION {
|
||||
+ OB_OPERATION Operation;
|
||||
+ union {
|
||||
+ ULONG Flags;
|
||||
+ struct {
|
||||
+ ULONG KernelHandle:1;
|
||||
+ ULONG Reserved:31;
|
||||
+ } DUMMYSTRUCTNAME;
|
||||
+ } DUMMYUNIONNAME;
|
||||
+ PVOID Object;
|
||||
+ POBJECT_TYPE ObjectType;
|
||||
+ PVOID CallContext;
|
||||
+ POB_PRE_OPERATION_PARAMETERS Parameters;
|
||||
+} OB_PRE_OPERATION_INFORMATION, *POB_PRE_OPERATION_INFORMATION;
|
||||
+
|
||||
+typedef struct _OB_POST_CREATE_HANDLE_INFORMATION {
|
||||
+ IN ACCESS_MASK GrantedAccess;
|
||||
+} OB_POST_CREATE_HANDLE_INFORMATION, *POB_POST_CREATE_HANDLE_INFORMATION;
|
||||
+
|
||||
+typedef struct _OB_POST_DUPLICATE_HANDLE_INFORMATION {
|
||||
+ IN ACCESS_MASK GrantedAccess;
|
||||
+} OB_POST_DUPLICATE_HANDLE_INFORMATION, *POB_POST_DUPLICATE_HANDLE_INFORMATION;
|
||||
+
|
||||
+typedef union _OB_POST_OPERATION_PARAMETERS {
|
||||
+ IN OB_POST_CREATE_HANDLE_INFORMATION CreateHandleInformation;
|
||||
+ IN OB_POST_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
|
||||
+} OB_POST_OPERATION_PARAMETERS, *POB_POST_OPERATION_PARAMETERS;
|
||||
+
|
||||
+typedef struct _OB_POST_OPERATION_INFORMATION {
|
||||
+ OB_OPERATION Operation;
|
||||
+ union {
|
||||
+ IN ULONG Flags;
|
||||
+ struct {
|
||||
+ ULONG KernelHandle:1;
|
||||
+ ULONG Reserved:31;
|
||||
+ } DUMMYSTRUCTNAME;
|
||||
+ } DUMMYUNIONNAME;
|
||||
+ PVOID Object;
|
||||
+ POBJECT_TYPE ObjectType;
|
||||
+ PVOID CallContext;
|
||||
+ NTSTATUS ReturnStatus;
|
||||
+ POB_POST_OPERATION_PARAMETERS Parameters;
|
||||
+} OB_POST_OPERATION_INFORMATION,*POB_POST_OPERATION_INFORMATION;
|
||||
+
|
||||
+typedef enum _OB_PREOP_CALLBACK_STATUS {
|
||||
+ OB_PREOP_SUCCESS
|
||||
+} OB_PREOP_CALLBACK_STATUS, *POB_PREOP_CALLBACK_STATUS;
|
||||
+
|
||||
+typedef OB_PREOP_CALLBACK_STATUS
|
||||
+(WINAPI *POB_PRE_OPERATION_CALLBACK)(void *context, POB_PRE_OPERATION_INFORMATION information);
|
||||
+
|
||||
+typedef void
|
||||
+(WINAPI *POB_POST_OPERATION_CALLBACK)(void *context, POB_POST_OPERATION_INFORMATION information);
|
||||
+
|
||||
+typedef struct _OB_OPERATION_REGISTRATION {
|
||||
+ POBJECT_TYPE *ObjectType;
|
||||
+ OB_OPERATION Operations;
|
||||
+ POB_PRE_OPERATION_CALLBACK PreOperation;
|
||||
+ POB_POST_OPERATION_CALLBACK PostOperation;
|
||||
+} OB_OPERATION_REGISTRATION, *POB_OPERATION_REGISTRATION;
|
||||
+
|
||||
+typedef struct _OB_CALLBACK_REGISTRATION {
|
||||
+ USHORT Version;
|
||||
+ USHORT OperationRegistrationCount;
|
||||
+ UNICODE_STRING Altitude;
|
||||
+ PVOID RegistrationContext;
|
||||
+ OB_OPERATION_REGISTRATION *OperationRegistration;
|
||||
+} OB_CALLBACK_REGISTRATION, *POB_CALLBACK_REGISTRATION;
|
||||
+
|
||||
+#define OB_FLT_REGISTRATION_VERSION_0100 0x0100
|
||||
+#define OB_FLT_REGISTRATION_VERSION OB_FLT_REGISTRATION_VERSION_0100
|
||||
+
|
||||
+typedef enum _DIRECTORY_NOTIFY_INFORMATION_CLASS {
|
||||
+ DirectoryNotifyInformation = 1,
|
||||
+ DirectoryNotifyExtendedInformation
|
||||
+} DIRECTORY_NOTIFY_INFORMATION_CLASS, *PDIRECTORY_NOTIFY_INFORMATION_CLASS;
|
||||
+
|
||||
NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle);
|
||||
|
||||
#ifdef NONAMELESSUNION
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,50 +0,0 @@
|
||||
From de2e5f34189173bb594b68fc392268c8820589e6 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 9 Mar 2018 16:27:51 +1100
|
||||
Subject: [PATCH] include: Add more types to ntifs.h
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
include/ddk/ntifs.h | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/include/ddk/ntifs.h b/include/ddk/ntifs.h
|
||||
index 32c9e3084b..5e7dd18c7e 100644
|
||||
--- a/include/ddk/ntifs.h
|
||||
+++ b/include/ddk/ntifs.h
|
||||
@@ -19,8 +19,24 @@
|
||||
#ifndef __NTIFS_H__
|
||||
#define __NTIFS_H__
|
||||
|
||||
+#include "ntddk.h"
|
||||
+
|
||||
typedef struct _EX_PUSH_LOCK EX_PUSH_LOCK, *PEX_PUSH_LOCK;
|
||||
|
||||
+typedef enum _FS_FILTER_SECTION_SYNC_TYPE
|
||||
+{
|
||||
+ SyncTypeOther = 0,
|
||||
+ SyncTypeCreateSection
|
||||
+} FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE;
|
||||
+
|
||||
+typedef struct _FS_FILTER_SECTION_SYNC_OUTPUT
|
||||
+{
|
||||
+ ULONG StructureSize;
|
||||
+ ULONG SizeReturned;
|
||||
+ ULONG Flags;
|
||||
+ ULONG DesiredReadAlignment;
|
||||
+} FS_FILTER_SECTION_SYNC_OUTPUT, *PFS_FILTER_SECTION_SYNC_OUTPUT;
|
||||
+
|
||||
typedef struct _KQUEUE
|
||||
{
|
||||
DISPATCHER_HEADER Header;
|
||||
@@ -30,6 +46,7 @@ typedef struct _KQUEUE
|
||||
LIST_ENTRY ThreadListHead;
|
||||
} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;
|
||||
|
||||
+
|
||||
NTSTATUS WINAPI ObQueryNameString(PVOID,POBJECT_NAME_INFORMATION,ULONG,PULONG);
|
||||
|
||||
#endif
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,62 +0,0 @@
|
||||
From 2577f27639376d7e4bf1a58d9c08e4944d1242e6 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 9 Mar 2018 14:26:26 +1100
|
||||
Subject: [PATCH] ntoskrnl.exe: Add ObRegisterCallbacks stub
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/ntoskrnl.exe/ntoskrnl.c | 12 ++++++++++++
|
||||
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 +
|
||||
include/ddk/wdm.h | 1 +
|
||||
3 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
index 57bf33e07f..91ad00af2b 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
@@ -2408,6 +2408,18 @@ void WINAPI ObfDereferenceObject( void *obj )
|
||||
ObDereferenceObject( obj );
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * ObRegisterCallbacks (NTOSKRNL.EXE.@)
|
||||
+ */
|
||||
+NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION *callBack, void **handle)
|
||||
+{
|
||||
+ FIXME( "stub: %p %p\n", callBack, handle );
|
||||
+
|
||||
+ if(handle)
|
||||
+ *handle = UlongToHandle(0xdeadbeaf);
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* IoGetAttachedDeviceReference (NTOSKRNL.EXE.@)
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 7580a96cd8..56f01dd2ba 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -817,6 +817,7 @@
|
||||
@ stdcall ObReferenceObjectByName(ptr long ptr long ptr long ptr ptr)
|
||||
@ stdcall ObReferenceObjectByPointer(ptr long ptr long)
|
||||
@ stub ObReferenceSecurityDescriptor
|
||||
+@ stdcall ObRegisterCallbacks(ptr ptr)
|
||||
@ stub ObReleaseObjectSecurity
|
||||
@ stub ObSetHandleAttributes
|
||||
@ stub ObSetSecurityDescriptorInfo
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index d874a35daa..5e575236f2 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -1501,6 +1501,7 @@ static inline void *MmGetSystemAddressForMdlSafe(MDL *mdl, ULONG priority)
|
||||
}
|
||||
|
||||
void WINAPI ObDereferenceObject(void*);
|
||||
+NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION*, void**);
|
||||
NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
|
||||
NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**);
|
||||
NTSTATUS WINAPI ObReferenceObjectByPointer(void*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE);
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 574e5ae9b3ba97c0e5a8288b56a69eea109d621c Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 9 Mar 2018 14:29:35 +1100
|
||||
Subject: [PATCH] ntoskrnl.exe: Add ObUnRegisterCallbacks stub
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/ntoskrnl.exe/ntoskrnl.c | 8 ++++++++
|
||||
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 +
|
||||
include/ddk/wdm.h | 1 +
|
||||
3 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
index 91ad00af2b..346054cf43 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
@@ -2421,6 +2421,14 @@ NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION *callBack, void **
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * ObUnRegisterCallbacks (NTOSKRNL.EXE.@)
|
||||
+ */
|
||||
+void WINAPI ObUnRegisterCallbacks(void *handle)
|
||||
+{
|
||||
+ FIXME( "stub: %p\n", handle );
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* IoGetAttachedDeviceReference (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 56f01dd2ba..83962c795a 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -822,6 +822,7 @@
|
||||
@ stub ObSetHandleAttributes
|
||||
@ stub ObSetSecurityDescriptorInfo
|
||||
@ stub ObSetSecurityObjectByPointer
|
||||
+@ stdcall ObUnRegisterCallbacks(ptr)
|
||||
@ stub PfxFindPrefix
|
||||
@ stub PfxInitialize
|
||||
@ stub PfxInsertPrefix
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index 5e575236f2..543a0c49ac 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -1505,6 +1505,7 @@ NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION*, void**);
|
||||
NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
|
||||
NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**);
|
||||
NTSTATUS WINAPI ObReferenceObjectByPointer(void*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE);
|
||||
+void WINAPI ObUnRegisterCallbacks(void*);
|
||||
|
||||
POWER_STATE WINAPI PoSetPowerState(PDEVICE_OBJECT,POWER_STATE_TYPE,POWER_STATE);
|
||||
NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID);
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,60 +0,0 @@
|
||||
From cb7e55670fb25d96060dad308ad69528fcc27084 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 9 Mar 2018 14:32:28 +1100
|
||||
Subject: [PATCH] ntoskrnl.exe: Add ObGetFilterVersion stub
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/ntoskrnl.exe/ntoskrnl.c | 10 ++++++++++
|
||||
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 +
|
||||
include/ddk/wdm.h | 1 +
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
index 346054cf43..13818f667c 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
@@ -2429,6 +2429,16 @@ void WINAPI ObUnRegisterCallbacks(void *handle)
|
||||
FIXME( "stub: %p\n", handle );
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * ObGetFilterVersion (NTOSKRNL.EXE.@)
|
||||
+ */
|
||||
+USHORT WINAPI ObGetFilterVersion(void)
|
||||
+{
|
||||
+ FIXME( "stub:\n" );
|
||||
+
|
||||
+ return OB_FLT_REGISTRATION_VERSION;
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* IoGetAttachedDeviceReference (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 83962c795a..d68f2d3713 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -805,6 +805,7 @@
|
||||
@ stdcall ObDereferenceObject(ptr)
|
||||
@ stub ObDereferenceSecurityDescriptor
|
||||
@ stub ObFindHandleForObject
|
||||
+@ stdcall ObGetFilterVersion()
|
||||
@ stub ObGetObjectSecurity
|
||||
@ stub ObInsertObject
|
||||
@ stub ObLogSecurityDescriptor
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index 543a0c49ac..eef00e0aae 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -1501,6 +1501,7 @@ static inline void *MmGetSystemAddressForMdlSafe(MDL *mdl, ULONG priority)
|
||||
}
|
||||
|
||||
void WINAPI ObDereferenceObject(void*);
|
||||
+USHORT WINAPI ObGetFilterVersion(void);
|
||||
NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION*, void**);
|
||||
NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
|
||||
NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**);
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,2 +0,0 @@
|
||||
Fixes: [44497] Add stubs for ObRegisterCallbacks, ObUnRegisterCallbacks, ObGetFilterVersion
|
||||
Depends: ntoskrnl-Stubs
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "cfb67712ce35c05d6b7d27ece84c9192e66290b4"
|
||||
echo "f2cb86decb334fc72ff5422122ba190bc9b6046e"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -180,7 +180,6 @@ patch_enable_all ()
|
||||
enable_kernel32_GetShortPathName="$1"
|
||||
enable_kernel32_Job_Tests="$1"
|
||||
enable_kernel32_K32GetPerformanceInfo="$1"
|
||||
enable_kernel32_LocaleNameToLCID="$1"
|
||||
enable_kernel32_Misalign_Workaround="$1"
|
||||
enable_kernel32_MoveFile="$1"
|
||||
enable_kernel32_NeedCurrentDirectoryForExePath="$1"
|
||||
@ -268,7 +267,6 @@ patch_enable_all ()
|
||||
enable_ntdll__aulldvrm="$1"
|
||||
enable_ntdll_set_full_cpu_context="$1"
|
||||
enable_ntdll_x86_64_ExceptionInformation="$1"
|
||||
enable_ntoskrnl_Ob_callbacks="$1"
|
||||
enable_ntoskrnl_Stubs="$1"
|
||||
enable_nvapi_Stub_DLL="$1"
|
||||
enable_nvcuda_CUDA_Support="$1"
|
||||
@ -327,7 +325,6 @@ patch_enable_all ()
|
||||
enable_shell32_ACE_Viewer="$1"
|
||||
enable_shell32_Context_Menu="$1"
|
||||
enable_shell32_File_Property_Dialog="$1"
|
||||
enable_shell32_Icons="$1"
|
||||
enable_shell32_Microsoft_Windows_Themes="$1"
|
||||
enable_shell32_NewMenu_Interface="$1"
|
||||
enable_shell32_Placeholder_Icons="$1"
|
||||
@ -428,6 +425,7 @@ patch_enable_all ()
|
||||
enable_winex11_DefaultDisplayFrequency="$1"
|
||||
enable_winex11_MWM_Decorations="$1"
|
||||
enable_winex11_UpdateLayeredWindow="$1"
|
||||
enable_winex11_Vulkan_compile_fix="$1"
|
||||
enable_winex11_WM_WINDOWPOSCHANGING="$1"
|
||||
enable_winex11_Window_Style="$1"
|
||||
enable_winex11_XEMBED="$1"
|
||||
@ -754,9 +752,6 @@ patch_enable ()
|
||||
kernel32-K32GetPerformanceInfo)
|
||||
enable_kernel32_K32GetPerformanceInfo="$2"
|
||||
;;
|
||||
kernel32-LocaleNameToLCID)
|
||||
enable_kernel32_LocaleNameToLCID="$2"
|
||||
;;
|
||||
kernel32-Misalign_Workaround)
|
||||
enable_kernel32_Misalign_Workaround="$2"
|
||||
;;
|
||||
@ -1018,9 +1013,6 @@ patch_enable ()
|
||||
ntdll-x86_64_ExceptionInformation)
|
||||
enable_ntdll_x86_64_ExceptionInformation="$2"
|
||||
;;
|
||||
ntoskrnl-Ob_callbacks)
|
||||
enable_ntoskrnl_Ob_callbacks="$2"
|
||||
;;
|
||||
ntoskrnl-Stubs)
|
||||
enable_ntoskrnl_Stubs="$2"
|
||||
;;
|
||||
@ -1195,9 +1187,6 @@ patch_enable ()
|
||||
shell32-File_Property_Dialog)
|
||||
enable_shell32_File_Property_Dialog="$2"
|
||||
;;
|
||||
shell32-Icons)
|
||||
enable_shell32_Icons="$2"
|
||||
;;
|
||||
shell32-Microsoft_Windows_Themes)
|
||||
enable_shell32_Microsoft_Windows_Themes="$2"
|
||||
;;
|
||||
@ -1498,6 +1487,9 @@ patch_enable ()
|
||||
winex11-UpdateLayeredWindow)
|
||||
enable_winex11_UpdateLayeredWindow="$2"
|
||||
;;
|
||||
winex11-Vulkan-compile-fix)
|
||||
enable_winex11_Vulkan_compile_fix="$2"
|
||||
;;
|
||||
winex11-WM_WINDOWPOSCHANGING)
|
||||
enable_winex11_WM_WINDOWPOSCHANGING="$2"
|
||||
;;
|
||||
@ -2265,6 +2257,13 @@ if test "$enable_nvapi_Stub_DLL" -eq 1; then
|
||||
enable_nvcuda_CUDA_Support=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntoskrnl_Stubs" -eq 1; then
|
||||
if test "$enable_Compiler_Warnings" -gt 1; then
|
||||
abort "Patchset Compiler_Warnings disabled, but ntoskrnl-Stubs depends on that."
|
||||
fi
|
||||
enable_Compiler_Warnings=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_SystemRoot_Symlink" -eq 1; then
|
||||
if test "$enable_ntdll_Exception" -gt 1; then
|
||||
abort "Patchset ntdll-Exception disabled, but ntdll-SystemRoot_Symlink depends on that."
|
||||
@ -2457,27 +2456,6 @@ if test "$enable_imagehlp_ImageLoad" -eq 1; then
|
||||
enable_imagehlp_Cleanup=1
|
||||
fi
|
||||
|
||||
if test "$enable_fltmgr_sys_filters" -eq 1; then
|
||||
if test "$enable_ntoskrnl_Ob_callbacks" -gt 1; then
|
||||
abort "Patchset ntoskrnl-Ob_callbacks disabled, but fltmgr.sys-filters depends on that."
|
||||
fi
|
||||
enable_ntoskrnl_Ob_callbacks=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntoskrnl_Ob_callbacks" -eq 1; then
|
||||
if test "$enable_ntoskrnl_Stubs" -gt 1; then
|
||||
abort "Patchset ntoskrnl-Stubs disabled, but ntoskrnl-Ob_callbacks depends on that."
|
||||
fi
|
||||
enable_ntoskrnl_Stubs=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntoskrnl_Stubs" -eq 1; then
|
||||
if test "$enable_Compiler_Warnings" -gt 1; then
|
||||
abort "Patchset Compiler_Warnings disabled, but ntoskrnl-Stubs depends on that."
|
||||
fi
|
||||
enable_Compiler_Warnings=1
|
||||
fi
|
||||
|
||||
if test "$enable_dxdiagn_GetChildContainer_Leaf_Nodes" -eq 1; then
|
||||
if test "$enable_dxdiagn_Enumerate_DirectSound" -gt 1; then
|
||||
abort "Patchset dxdiagn-Enumerate_DirectSound disabled, but dxdiagn-GetChildContainer_Leaf_Nodes depends on that."
|
||||
@ -3029,12 +3007,8 @@ fi
|
||||
# | include/bcrypt.h
|
||||
# |
|
||||
if test "$enable_bcrypt_Improvements" -eq 1; then
|
||||
patch_apply bcrypt-Improvements/0017-bcrypt-Implement-BCryptEncrypt-for-AES-GCM-mode.patch
|
||||
patch_apply bcrypt-Improvements/0018-bcrypt-Implement-BCryptDecrypt-for-AES-GCM-mode.patch
|
||||
patch_apply bcrypt-Improvements/0019-bcrypt-Add-support-for-computing-comparing-cipher-ta.patch
|
||||
patch_apply bcrypt-Improvements/0020-bcrypt-Implement-BCryptDuplicateKey.patch
|
||||
patch_apply bcrypt-Improvements/0021-bcrypt-tests-Add-tests-for-BCryptDuplicateKey.patch
|
||||
patch_apply bcrypt-Improvements/0022-bcrypt-Allow-to-call-BCryptSetProperty-on-key-object.patch
|
||||
patch_apply bcrypt-Improvements/0023-bcrypt-Add-support-for-auth-data-in-AES-GCM-mode.patch
|
||||
patch_apply bcrypt-Improvements/0024-bcrypt-tests-Add-tests-for-auth-data-in-AES-GCM-mode.patch
|
||||
patch_apply bcrypt-Improvements/0025-bcrypt-Avoid-crash-in-tests-when-compiling-without-g.patch
|
||||
@ -3042,7 +3016,6 @@ if test "$enable_bcrypt_Improvements" -eq 1; then
|
||||
patch_apply bcrypt-Improvements/0027-bcrypt-Fix-BCryptEncrypt-with-AES_GCM-and-no-input-a.patch
|
||||
patch_apply bcrypt-Improvements/0029-bcrypt-Add-support-for-192-and-256-bit-aes-keys.patch
|
||||
patch_apply bcrypt-Improvements/0030-bcrypt-Preparation-for-asymmetric-keys.patch
|
||||
patch_apply bcrypt-Improvements/0031-include-Add-ecdsa-and-asymmetric-key-related-bcrypt-.patch
|
||||
patch_apply bcrypt-Improvements/0032-bcrypt-tests-Add-basic-test-for-ecdsa.patch
|
||||
patch_apply bcrypt-Improvements/0033-bcrypt-Implement-importing-of-ecdsa-keys.patch
|
||||
patch_apply bcrypt-Improvements/0034-bcrypt-Implement-BCryptVerifySignature-for-ecdsa-sig.patch
|
||||
@ -3050,12 +3023,8 @@ if test "$enable_bcrypt_Improvements" -eq 1; then
|
||||
patch_apply bcrypt-Improvements/0036-bcrypt-tests-Add-simple-test-for-RSA.patch
|
||||
patch_apply bcrypt-Improvements/0037-bcrypt-Store-full-ECCKEY_BLOB-struct-in-BCryptImport.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Implement BCryptEncrypt for AES GCM mode.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Implement BCryptDecrypt for AES GCM mode.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Add support for computing/comparing cipher tag.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Implement BCryptDuplicateKey.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "bcrypt/tests: Add tests for BCryptDuplicateKey.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Allow to call BCryptSetProperty on key objects.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Add support for auth data in AES GCM mode.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "bcrypt/tests: Add tests for auth data in AES GCM mode.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "bcrypt: Avoid crash in tests when compiling without gnutls support.", 1 },';
|
||||
@ -3063,7 +3032,6 @@ if test "$enable_bcrypt_Improvements" -eq 1; then
|
||||
printf '%s\n' '+ { "Andrew Wesie", "bcrypt: Fix BCryptEncrypt with AES_GCM and no input and no output.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Add support for 192 and 256 bit aes keys.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Preparation for asymmetric keys.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "include: Add ecdsa and asymmetric key related bcrypt definitions.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt/tests: Add basic test for ecdsa.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Implement importing of ecdsa keys.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "bcrypt: Implement BCryptVerifySignature for ecdsa signatures.", 1 },';
|
||||
@ -4172,70 +4140,8 @@ if test "$enable_explorer_Video_Registry_Key" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntoskrnl-Stubs
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * Compiler_Warnings
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, include/ddk/wdm.h, include/winnt.h
|
||||
# |
|
||||
if test "$enable_ntoskrnl_Stubs" -eq 1; then
|
||||
patch_apply ntoskrnl-Stubs/0003-ntoskrnl.exe-Add-stubs-for-ExAcquireFastMutexUnsafe-.patch
|
||||
patch_apply ntoskrnl-Stubs/0005-ntoskrnl.exe-Improve-KeReleaseMutex-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0006-ntoskrnl.exe-Improve-KeInitializeSemaphore-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0007-ntoskrnl.exe-Improve-KeInitializeTimerEx-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0009-ntoskrnl.exe-Implement-MmMapLockedPages-and-MmUnmapL.patch
|
||||
patch_apply ntoskrnl-Stubs/0010-ntoskrnl.exe-Implement-KeInitializeMutex.patch
|
||||
patch_apply ntoskrnl-Stubs/0011-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch
|
||||
patch_apply ntoskrnl-Stubs/0013-ntoskrnl.exe-Implement-NtBuildNumber.patch
|
||||
patch_apply ntoskrnl-Stubs/0014-ntoskrnl.exe-Implement-ExInitializeNPagedLookasideLi.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Add stubs for ExAcquireFastMutexUnsafe and ExReleaseFastMutexUnsafe.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeReleaseMutex stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeInitializeSemaphore stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeInitializeTimerEx stub.", 1 },';
|
||||
printf '%s\n' '+ { "Christian Costa", "ntoskrnl.exe: Implement MmMapLockedPages and MmUnmapLockedPages.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Implement KeInitializeMutex.", 1 },';
|
||||
printf '%s\n' '+ { "Jarkko Korpi", "ntoskrnl.exe: Add IoGetDeviceAttachmentBaseRef stub.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntoskrnl: Implement ExInterlockedPopEntrySList.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntoskrnl.exe: Implement NtBuildNumber.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntoskrnl.exe: Implement ExInitializeNPagedLookasideList.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntoskrnl-Ob_callbacks
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * Compiler_Warnings, ntoskrnl-Stubs
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#44497] Add stubs for ObRegisterCallbacks, ObUnRegisterCallbacks, ObGetFilterVersion
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, include/ddk/ntifs.h, include/ddk/wdm.h
|
||||
# |
|
||||
if test "$enable_ntoskrnl_Ob_callbacks" -eq 1; then
|
||||
patch_apply ntoskrnl-Ob_callbacks/0001-include-Add-more-typedefs-to-wdm.h.patch
|
||||
patch_apply ntoskrnl-Ob_callbacks/0002-include-Add-more-types-to-ntifs.h.patch
|
||||
patch_apply ntoskrnl-Ob_callbacks/0003-ntoskrnl.exe-Add-ObRegisterCallbacks-stub.patch
|
||||
patch_apply ntoskrnl-Ob_callbacks/0004-ntoskrnl.exe-Add-ObUnRegisterCallbacks-stub.patch
|
||||
patch_apply ntoskrnl-Ob_callbacks/0005-ntoskrnl.exe-Add-ObGetFilterVersion-stub.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "include: Add more typedefs to wdm.h.", 1 },';
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "include: Add more types to ntifs.h.", 1 },';
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "ntoskrnl.exe: Add ObRegisterCallbacks stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "ntoskrnl.exe: Add ObUnRegisterCallbacks stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "ntoskrnl.exe: Add ObGetFilterVersion stub.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset fltmgr.sys-filters
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * Compiler_Warnings, ntoskrnl-Stubs, ntoskrnl-Ob_callbacks
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#44500] Add stubs for FltRegisterFilter, FltStartFiltering, FltUnregisterFilter
|
||||
# |
|
||||
@ -4684,21 +4590,6 @@ if test "$enable_kernel32_K32GetPerformanceInfo" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernel32-LocaleNameToLCID
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#30076] Silence repeated LocaleNameToLCID/LCIDToLocaleName unsupported flags FIXMEs
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/locale.c
|
||||
# |
|
||||
if test "$enable_kernel32_LocaleNameToLCID" -eq 1; then
|
||||
patch_apply kernel32-LocaleNameToLCID/0001-kernel32-Silence-repeated-LocaleNameToLCID-unsupport.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Jarkko Korpi", "kernel32: Silence repeated LocaleNameToLCID unsupported flags message.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernel32-Misalign_Workaround
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -6118,6 +6009,39 @@ if test "$enable_ntdll_set_full_cpu_context" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntoskrnl-Stubs
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * Compiler_Warnings
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, include/ddk/wdm.h, include/winnt.h
|
||||
# |
|
||||
if test "$enable_ntoskrnl_Stubs" -eq 1; then
|
||||
patch_apply ntoskrnl-Stubs/0003-ntoskrnl.exe-Add-stubs-for-ExAcquireFastMutexUnsafe-.patch
|
||||
patch_apply ntoskrnl-Stubs/0005-ntoskrnl.exe-Improve-KeReleaseMutex-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0006-ntoskrnl.exe-Improve-KeInitializeSemaphore-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0007-ntoskrnl.exe-Improve-KeInitializeTimerEx-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0009-ntoskrnl.exe-Implement-MmMapLockedPages-and-MmUnmapL.patch
|
||||
patch_apply ntoskrnl-Stubs/0010-ntoskrnl.exe-Implement-KeInitializeMutex.patch
|
||||
patch_apply ntoskrnl-Stubs/0011-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch
|
||||
patch_apply ntoskrnl-Stubs/0013-ntoskrnl.exe-Implement-NtBuildNumber.patch
|
||||
patch_apply ntoskrnl-Stubs/0014-ntoskrnl.exe-Implement-ExInitializeNPagedLookasideLi.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Add stubs for ExAcquireFastMutexUnsafe and ExReleaseFastMutexUnsafe.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeReleaseMutex stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeInitializeSemaphore stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeInitializeTimerEx stub.", 1 },';
|
||||
printf '%s\n' '+ { "Christian Costa", "ntoskrnl.exe: Implement MmMapLockedPages and MmUnmapLockedPages.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Implement KeInitializeMutex.", 1 },';
|
||||
printf '%s\n' '+ { "Jarkko Korpi", "ntoskrnl.exe: Add IoGetDeviceAttachmentBaseRef stub.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntoskrnl: Implement ExInterlockedPopEntrySList.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntoskrnl.exe: Implement NtBuildNumber.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntoskrnl.exe: Implement ExInitializeNPagedLookasideList.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset nvcuda-CUDA_Support
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -7178,21 +7102,6 @@ if test "$enable_shell32_Context_Menu" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset shell32-Icons
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#24721] Support for extra large and jumbo icon lists in shell32
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/shell32/iconcache.c, dlls/shell32/shell32_main.h, dlls/shell32/shellord.c, dlls/shell32/tests/shelllink.c
|
||||
# |
|
||||
if test "$enable_shell32_Icons" -eq 1; then
|
||||
patch_apply shell32-Icons/0001-shell32-Add-support-for-extra-large-and-jumbo-icon-l.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "shell32: Add support for extra large and jumbo icon lists.", 2 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset shell32-Microsoft_Windows_Themes
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -8916,6 +8825,18 @@ if test "$enable_winex11_UpdateLayeredWindow" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winex11-Vulkan-compile-fix
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/winex11.drv/vulkan.c
|
||||
# |
|
||||
if test "$enable_winex11_Vulkan_compile_fix" -eq 1; then
|
||||
patch_apply winex11-Vulkan-compile-fix/0001-winex11.drv-Fix-compile-error-when-Vulkan-isn-t-avai.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "winex11.drv: Fix compile error when Vulkan isn'\''t avaiable.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winex11-_NET_ACTIVE_WINDOW
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -1,417 +0,0 @@
|
||||
From b73fce3206de216ebb9423caae4bcc02d64de261 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 3 Aug 2014 02:23:44 +0200
|
||||
Subject: shell32: Add support for extra large and jumbo icon lists. (v2)
|
||||
|
||||
---
|
||||
dlls/shell32/iconcache.c | 223 ++++++++++++++++++++++++++---------------
|
||||
dlls/shell32/shell32_main.h | 3 +
|
||||
dlls/shell32/shellord.c | 28 ++++--
|
||||
dlls/shell32/tests/shelllink.c | 7 +-
|
||||
4 files changed, 169 insertions(+), 92 deletions(-)
|
||||
|
||||
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c
|
||||
index 0ea2eb9e0e8..767c90e8e71 100644
|
||||
--- a/dlls/shell32/iconcache.c
|
||||
+++ b/dlls/shell32/iconcache.c
|
||||
@@ -62,7 +62,9 @@ typedef struct
|
||||
static HDPA sic_hdpa;
|
||||
static INIT_ONCE sic_init_once = INIT_ONCE_STATIC_INIT;
|
||||
static HIMAGELIST ShellSmallIconList;
|
||||
-static HIMAGELIST ShellBigIconList;
|
||||
+static HIMAGELIST ShellLargeIconList;
|
||||
+static HIMAGELIST ShellExtraLargeIconList;
|
||||
+static HIMAGELIST ShellJumboIconList;
|
||||
|
||||
static CRITICAL_SECTION SHELL32_SicCS;
|
||||
static CRITICAL_SECTION_DEBUG critsect_debug =
|
||||
@@ -158,7 +160,7 @@ static int SIC_LoadOverlayIcon(int icon_idx);
|
||||
* Creates a new icon as a copy of the passed-in icon, overlaid with a
|
||||
* shortcut image.
|
||||
*/
|
||||
-static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
|
||||
+static HICON SIC_OverlayShortcutImage(HICON SourceIcon, int type)
|
||||
{ ICONINFO SourceIconInfo, ShortcutIconInfo, TargetIconInfo;
|
||||
HICON ShortcutIcon, TargetIcon;
|
||||
BITMAP SourceBitmapInfo, ShortcutBitmapInfo;
|
||||
@@ -188,10 +190,16 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
|
||||
|
||||
if (s_imgListIdx != -1)
|
||||
{
|
||||
- if (large)
|
||||
- ShortcutIcon = ImageList_GetIcon(ShellBigIconList, s_imgListIdx, ILD_TRANSPARENT);
|
||||
- else
|
||||
- ShortcutIcon = ImageList_GetIcon(ShellSmallIconList, s_imgListIdx, ILD_TRANSPARENT);
|
||||
+ if (type == SHIL_SMALL)
|
||||
+ ShortcutIcon = ImageList_GetIcon(ShellSmallIconList, s_imgListIdx, ILD_TRANSPARENT);
|
||||
+ else if (type == SHIL_LARGE)
|
||||
+ ShortcutIcon = ImageList_GetIcon(ShellLargeIconList, s_imgListIdx, ILD_TRANSPARENT);
|
||||
+ else if (type == SHIL_EXTRALARGE)
|
||||
+ ShortcutIcon = ImageList_GetIcon(ShellExtraLargeIconList, s_imgListIdx, ILD_TRANSPARENT);
|
||||
+ else if (type == SHIL_JUMBO)
|
||||
+ ShortcutIcon = ImageList_GetIcon(ShellJumboIconList, s_imgListIdx, ILD_TRANSPARENT);
|
||||
+ else
|
||||
+ ShortcutIcon = NULL;
|
||||
} else
|
||||
ShortcutIcon = NULL;
|
||||
|
||||
@@ -307,11 +315,14 @@ fail:
|
||||
* NOTES
|
||||
* appends an icon pair to the end of the cache
|
||||
*/
|
||||
-static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
|
||||
-{ LPSIC_ENTRY lpsice;
|
||||
- INT ret, index, index1;
|
||||
+static INT SIC_IconAppend(LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon,
|
||||
+ HICON hLargeIcon, HICON hExtraLargeIcon, HICON hJumboIcon, DWORD dwFlags)
|
||||
+{
|
||||
+ LPSIC_ENTRY lpsice;
|
||||
+ INT ret, index, index1, index2, index3;
|
||||
WCHAR path[MAX_PATH];
|
||||
- TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
|
||||
+ TRACE("%s %i %p %p %p %p %d\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon,
|
||||
+ hLargeIcon, hExtraLargeIcon, hJumboIcon, dwFlags);
|
||||
|
||||
lpsice = SHAlloc(sizeof(SIC_ENTRY));
|
||||
|
||||
@@ -333,13 +344,14 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
|
||||
}
|
||||
else
|
||||
{
|
||||
- index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
|
||||
- index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
|
||||
+ index = ImageList_AddIcon( ShellSmallIconList, hSmallIcon );
|
||||
+ index1 = ImageList_AddIcon( ShellLargeIconList, hLargeIcon );
|
||||
+ index2 = ImageList_AddIcon( ShellExtraLargeIconList, hExtraLargeIcon );
|
||||
+ index3 = ImageList_AddIcon( ShellJumboIconList, hJumboIcon );
|
||||
+
|
||||
+ if (index != index1 || index != index2 || index != index3)
|
||||
+ FIXME("iconlists out of sync 0x%x 0x%x 0x%x 0x%x\n", index, index1, index2, index3);
|
||||
|
||||
- if (index!=index1)
|
||||
- {
|
||||
- FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1);
|
||||
- }
|
||||
lpsice->dwListIndex = index;
|
||||
ret = lpsice->dwListIndex;
|
||||
}
|
||||
@@ -353,7 +365,7 @@ static BOOL get_imagelist_icon_size(int list, SIZE *size)
|
||||
HIMAGELIST image_list;
|
||||
|
||||
if (list < SHIL_LARGE || list > SHIL_SMALL) return FALSE;
|
||||
- image_list = (list == SHIL_LARGE) ? ShellBigIconList : ShellSmallIconList;
|
||||
+ image_list = (list == SHIL_LARGE) ? ShellLargeIconList : ShellSmallIconList;
|
||||
|
||||
return ImageList_GetIconSize( image_list, &size->cx, &size->cy );
|
||||
}
|
||||
@@ -366,19 +378,25 @@ static BOOL get_imagelist_icon_size(int list, SIZE *size)
|
||||
*/
|
||||
static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
|
||||
{
|
||||
- HICON hiconLarge=0;
|
||||
- HICON hiconSmall=0;
|
||||
- HICON hiconLargeShortcut;
|
||||
- HICON hiconSmallShortcut;
|
||||
- int ret;
|
||||
- SIZE size;
|
||||
-
|
||||
- get_imagelist_icon_size( SHIL_LARGE, &size );
|
||||
- PrivateExtractIconsW( sSourceFile, dwSourceIndex, size.cx, size.cy, &hiconLarge, 0, 1, 0 );
|
||||
- get_imagelist_icon_size( SHIL_SMALL, &size );
|
||||
- PrivateExtractIconsW( sSourceFile, dwSourceIndex, size.cx, size.cy, &hiconSmall, 0, 1, 0 );
|
||||
-
|
||||
- if ( !hiconLarge || !hiconSmall)
|
||||
+ HICON hiconSmall=0;
|
||||
+ HICON hiconLarge=0;
|
||||
+ HICON hiconExtraLarge=0;
|
||||
+ HICON hiconJumbo=0;
|
||||
+ HICON hiconSmallShortcut;
|
||||
+ HICON hiconLargeShortcut;
|
||||
+ HICON hiconExtraLargeShortcut;
|
||||
+ HICON hiconJumboShortcut;
|
||||
+ int ret;
|
||||
+ SIZE size;
|
||||
+
|
||||
+ get_imagelist_icon_size( SHIL_SMALL, &size );
|
||||
+ PrivateExtractIconsW( sSourceFile, dwSourceIndex, size.cx, size.cy, &hiconSmall, 0, 1, 0 );
|
||||
+ get_imagelist_icon_size( SHIL_LARGE, &size );
|
||||
+ PrivateExtractIconsW( sSourceFile, dwSourceIndex, size.cx, size.cy, &hiconLarge, 0, 1, 0 );
|
||||
+ PrivateExtractIconsW( sSourceFile, dwSourceIndex, 48, 48, &hiconExtraLarge, 0, 1, 0 );
|
||||
+ PrivateExtractIconsW( sSourceFile, dwSourceIndex, 256, 256, &hiconJumbo, 0, 1, 0 );
|
||||
+
|
||||
+ if (!hiconSmall || !hiconLarge || !hiconExtraLarge || !hiconJumbo)
|
||||
{
|
||||
WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall);
|
||||
return -1;
|
||||
@@ -386,28 +404,42 @@ static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
|
||||
|
||||
if (0 != (dwFlags & GIL_FORSHORTCUT))
|
||||
{
|
||||
- hiconLargeShortcut = SIC_OverlayShortcutImage(hiconLarge, TRUE);
|
||||
- hiconSmallShortcut = SIC_OverlayShortcutImage(hiconSmall, FALSE);
|
||||
- if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut)
|
||||
- {
|
||||
- DestroyIcon( hiconLarge );
|
||||
+ hiconSmallShortcut = SIC_OverlayShortcutImage( hiconSmall, SHIL_SMALL );
|
||||
+ hiconLargeShortcut = SIC_OverlayShortcutImage( hiconLarge, SHIL_LARGE );
|
||||
+ hiconExtraLargeShortcut = SIC_OverlayShortcutImage( hiconExtraLarge, SHIL_EXTRALARGE );
|
||||
+ hiconJumboShortcut = SIC_OverlayShortcutImage( hiconJumbo, SHIL_JUMBO );
|
||||
+
|
||||
+ if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut &&
|
||||
+ NULL != hiconExtraLargeShortcut && NULL != hiconJumboShortcut)
|
||||
+ {
|
||||
DestroyIcon( hiconSmall );
|
||||
- hiconLarge = hiconLargeShortcut;
|
||||
- hiconSmall = hiconSmallShortcut;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- WARN("Failed to create shortcut overlaid icons\n");
|
||||
- if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut);
|
||||
- if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut);
|
||||
- dwFlags &= ~ GIL_FORSHORTCUT;
|
||||
- }
|
||||
+ DestroyIcon( hiconLarge );
|
||||
+ DestroyIcon( hiconExtraLarge );
|
||||
+ DestroyIcon( hiconJumbo );
|
||||
+
|
||||
+ hiconSmall = hiconSmallShortcut;
|
||||
+ hiconLarge = hiconLargeShortcut;
|
||||
+ hiconExtraLarge = hiconExtraLargeShortcut;
|
||||
+ hiconJumbo = hiconJumboShortcut;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ WARN("Failed to create shortcut overlaid icons\n");
|
||||
+ if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut);
|
||||
+ if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut);
|
||||
+ if (NULL != hiconExtraLargeShortcut) DestroyIcon(hiconExtraLargeShortcut);
|
||||
+ if (NULL != hiconJumboShortcut) DestroyIcon(hiconJumboShortcut);
|
||||
+ dwFlags &= ~ GIL_FORSHORTCUT;
|
||||
+ }
|
||||
}
|
||||
|
||||
- ret = SIC_IconAppend( sSourceFile, dwSourceIndex, hiconSmall, hiconLarge, dwFlags );
|
||||
- DestroyIcon( hiconLarge );
|
||||
- DestroyIcon( hiconSmall );
|
||||
- return ret;
|
||||
+ ret = SIC_IconAppend( sSourceFile, dwSourceIndex, hiconSmall, hiconLarge,
|
||||
+ hiconExtraLarge, hiconJumbo, dwFlags );
|
||||
+ DestroyIcon( hiconSmall );
|
||||
+ DestroyIcon( hiconLarge );
|
||||
+ DestroyIcon( hiconExtraLarge );
|
||||
+ DestroyIcon( hiconJumbo );
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int get_shell_icon_size(void)
|
||||
@@ -433,9 +465,11 @@ static int get_shell_icon_size(void)
|
||||
*/
|
||||
static BOOL WINAPI SIC_Initialize( INIT_ONCE *once, void *param, void **context )
|
||||
{
|
||||
- HICON hSm, hLg;
|
||||
- int cx_small, cy_small;
|
||||
- int cx_large, cy_large;
|
||||
+ HICON hSm, hLg, hELg, hJb;
|
||||
+ int cx_small, cy_small;
|
||||
+ int cx_large, cy_large;
|
||||
+ int cx_extralarge, cy_extralarge;
|
||||
+ int cx_jumbo, cy_jumbo;
|
||||
|
||||
if (!IsProcessDPIAware())
|
||||
{
|
||||
@@ -451,7 +485,13 @@ static BOOL WINAPI SIC_Initialize( INIT_ONCE *once, void *param, void **context
|
||||
cy_small = cy_large / 2;
|
||||
}
|
||||
|
||||
+ cx_extralarge = (GetSystemMetrics( SM_CXICON ) * 3) / 2;
|
||||
+ cy_extralarge = (GetSystemMetrics( SM_CYICON ) * 3) / 2;
|
||||
+ cx_jumbo = 256;
|
||||
+ cy_jumbo = 256;
|
||||
+
|
||||
TRACE("large %dx%d small %dx%d\n", cx_large, cy_large, cx_small, cx_small);
|
||||
+ TRACE("extra %dx%d jumbo %dx%d\n", cx_extralarge, cy_extralarge, cx_jumbo, cy_jumbo);
|
||||
|
||||
sic_hdpa = DPA_Create(16);
|
||||
|
||||
@@ -460,28 +500,36 @@ static BOOL WINAPI SIC_Initialize( INIT_ONCE *once, void *param, void **context
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
- ShellSmallIconList = ImageList_Create(cx_small,cy_small,ILC_COLOR32|ILC_MASK,0,0x20);
|
||||
- ShellBigIconList = ImageList_Create(cx_large,cy_large,ILC_COLOR32|ILC_MASK,0,0x20);
|
||||
-
|
||||
- ImageList_SetBkColor(ShellSmallIconList, CLR_NONE);
|
||||
- ImageList_SetBkColor(ShellBigIconList, CLR_NONE);
|
||||
-
|
||||
- /* Load the document icon, which is used as the default if an icon isn't found. */
|
||||
- hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
|
||||
- IMAGE_ICON, cx_small, cy_small, LR_SHARED);
|
||||
- hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
|
||||
- IMAGE_ICON, cx_large, cy_large, LR_SHARED);
|
||||
+ ShellSmallIconList = ImageList_Create( cx_small,cy_small,ILC_COLOR32|ILC_MASK,0,0x20 );
|
||||
+ ShellLargeIconList = ImageList_Create( cx_large,cy_large,ILC_COLOR32|ILC_MASK,0,0x20 );
|
||||
+ ShellExtraLargeIconList = ImageList_Create( cx_extralarge,cy_extralarge,ILC_COLOR32|ILC_MASK,0,0x20 );
|
||||
+ ShellJumboIconList = ImageList_Create( cx_jumbo,cy_jumbo,ILC_COLOR32|ILC_MASK,0,0x20 );
|
||||
+
|
||||
+ ImageList_SetBkColor( ShellSmallIconList, CLR_NONE );
|
||||
+ ImageList_SetBkColor( ShellLargeIconList, CLR_NONE );
|
||||
+ ImageList_SetBkColor( ShellExtraLargeIconList, CLR_NONE );
|
||||
+ ImageList_SetBkColor( ShellJumboIconList, CLR_NONE );
|
||||
+
|
||||
+ /* Load the document icon, which is used as the default if an icon isn't found. */
|
||||
+ hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
|
||||
+ IMAGE_ICON, cx_small, cy_small, LR_SHARED);
|
||||
+ hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
|
||||
+ IMAGE_ICON, cx_large, cy_large, LR_SHARED);
|
||||
+ hELg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
|
||||
+ IMAGE_ICON, cx_extralarge, cy_extralarge, LR_SHARED);
|
||||
+ hJb = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
|
||||
+ IMAGE_ICON, cx_jumbo, cy_jumbo, LR_SHARED);
|
||||
+ if (!hSm || !hLg || !hELg || !hJb)
|
||||
+ {
|
||||
+ FIXME("Failed to load IDI_SHELL_DOCUMENT icon!\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
- if (!hSm || !hLg)
|
||||
- {
|
||||
- FIXME("Failed to load IDI_SHELL_DOCUMENT icon!\n");
|
||||
- return FALSE;
|
||||
- }
|
||||
+ SIC_IconAppend( swShell32Name, IDI_SHELL_DOCUMENT-1, hSm, hLg, hELg, hJb, 0 );
|
||||
+ SIC_IconAppend( swShell32Name, -IDI_SHELL_DOCUMENT, hSm, hLg, hELg, hJb, 0 );
|
||||
|
||||
- SIC_IconAppend (swShell32Name, IDI_SHELL_DOCUMENT-1, hSm, hLg, 0);
|
||||
- SIC_IconAppend (swShell32Name, -IDI_SHELL_DOCUMENT, hSm, hLg, 0);
|
||||
-
|
||||
- TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
|
||||
+ TRACE("hIconSmall=%p hIconLarge=%p hExtraLargeIcon=%p hJumboIcon=%p\n",
|
||||
+ ShellSmallIconList, ShellLargeIconList, ShellExtraLargeIconList, ShellJumboIconList);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -505,13 +553,17 @@ void SIC_Destroy(void)
|
||||
|
||||
if (sic_hdpa) DPA_DestroyCallback(sic_hdpa, sic_free, NULL );
|
||||
|
||||
- if (ShellSmallIconList)
|
||||
- ImageList_Destroy(ShellSmallIconList);
|
||||
- if (ShellBigIconList)
|
||||
- ImageList_Destroy(ShellBigIconList);
|
||||
-
|
||||
- LeaveCriticalSection(&SHELL32_SicCS);
|
||||
- DeleteCriticalSection(&SHELL32_SicCS);
|
||||
+ if (ShellSmallIconList)
|
||||
+ ImageList_Destroy( ShellSmallIconList );
|
||||
+ if (ShellLargeIconList)
|
||||
+ ImageList_Destroy( ShellLargeIconList );
|
||||
+ if (ShellExtraLargeIconList)
|
||||
+ ImageList_Destroy( ShellExtraLargeIconList );
|
||||
+ if (ShellJumboIconList)
|
||||
+ ImageList_Destroy( ShellJumboIconList );
|
||||
+
|
||||
+ LeaveCriticalSection(&SHELL32_SicCS);
|
||||
+ DeleteCriticalSection(&SHELL32_SicCS);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -625,10 +677,21 @@ BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList
|
||||
{
|
||||
TRACE("(%p,%p)\n",lpBigList,lpSmallList);
|
||||
InitOnceExecuteOnce( &sic_init_once, SIC_Initialize, NULL, NULL );
|
||||
- if (lpBigList) *lpBigList = ShellBigIconList;
|
||||
+ if (lpBigList) *lpBigList = ShellLargeIconList;
|
||||
if (lpSmallList) *lpSmallList = ShellSmallIconList;
|
||||
return TRUE;
|
||||
}
|
||||
+
|
||||
+void SHELL_GetInternalImageLists(HIMAGELIST *lpSmallList, HIMAGELIST *lpLargeList,
|
||||
+ HIMAGELIST *lpExtraLargeList, HIMAGELIST *lpJumboList)
|
||||
+{
|
||||
+ InitOnceExecuteOnce( &sic_init_once, SIC_Initialize, NULL, NULL );
|
||||
+ if (lpSmallList) *lpSmallList = ShellSmallIconList;
|
||||
+ if (lpLargeList) *lpLargeList = ShellLargeIconList;
|
||||
+ if (lpExtraLargeList) *lpExtraLargeList = ShellExtraLargeIconList;
|
||||
+ if (lpJumboList) *lpJumboList = ShellJumboIconList;
|
||||
+}
|
||||
+
|
||||
/*************************************************************************
|
||||
* PidlToSicIndex [INTERNAL]
|
||||
*
|
||||
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
|
||||
index fc2a5ba8a86..b91bb5528ad 100644
|
||||
--- a/dlls/shell32/shell32_main.h
|
||||
+++ b/dlls/shell32/shell32_main.h
|
||||
@@ -251,4 +251,7 @@ static inline WCHAR *strdupAtoW(const char *str)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+void SHELL_GetInternalImageLists(HIMAGELIST *lpSmallList, HIMAGELIST *lpLargeList,
|
||||
+ HIMAGELIST *lpExtraLargeList, HIMAGELIST *lpJumboList) DECLSPEC_HIDDEN;
|
||||
+
|
||||
#endif
|
||||
diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c
|
||||
index f9814997dae..5102bf0e475 100644
|
||||
--- a/dlls/shell32/shellord.c
|
||||
+++ b/dlls/shell32/shellord.c
|
||||
@@ -2146,18 +2146,30 @@ void WINAPI SHFlushSFCache(void)
|
||||
*/
|
||||
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
|
||||
{
|
||||
- HIMAGELIST hLarge, hSmall;
|
||||
+ HIMAGELIST hSmall, hLarge, hExtraLarge, hJumbo;
|
||||
HIMAGELIST hNew;
|
||||
|
||||
- /* Wine currently only maintains large and small image lists */
|
||||
- if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
|
||||
+ SHELL_GetInternalImageLists( &hSmall, &hLarge, &hExtraLarge, &hJumbo );
|
||||
+
|
||||
+ switch (iImageList)
|
||||
{
|
||||
- FIXME("Unsupported image list %i requested\n", iImageList);
|
||||
- return E_FAIL;
|
||||
+ case SHIL_SMALL:
|
||||
+ case SHIL_SYSSMALL:
|
||||
+ hNew = hSmall;
|
||||
+ break;
|
||||
+ case SHIL_LARGE:
|
||||
+ hNew = hLarge;
|
||||
+ break;
|
||||
+ case SHIL_EXTRALARGE:
|
||||
+ hNew = hExtraLarge;
|
||||
+ break;
|
||||
+ case SHIL_JUMBO:
|
||||
+ hNew = hJumbo;
|
||||
+ break;
|
||||
+ default:
|
||||
+ FIXME("Unsupported image list %i requested\n", iImageList);
|
||||
+ return E_FAIL;
|
||||
}
|
||||
|
||||
- Shell_GetImageLists(&hLarge, &hSmall);
|
||||
- hNew = (iImageList == SHIL_LARGE) ? hLarge : hSmall;
|
||||
-
|
||||
return HIMAGELIST_QueryInterface(hNew, riid, ppv);
|
||||
}
|
||||
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
|
||||
index ad254c83498..03878af46dd 100644
|
||||
--- a/dlls/shell32/tests/shelllink.c
|
||||
+++ b/dlls/shell32/tests/shelllink.c
|
||||
@@ -1363,10 +1363,9 @@ static void test_SHGetImageList(void)
|
||||
for (i = 0; i <= SHIL_LAST; i++)
|
||||
{
|
||||
hr = SHGetImageList( i, &IID_IImageList, (void **)&list );
|
||||
- todo_wine_if(i == SHIL_EXTRALARGE || i == SHIL_JUMBO)
|
||||
- ok( hr == S_OK ||
|
||||
- broken( i == SHIL_JUMBO && hr == E_INVALIDARG ), /* XP and 2003 */
|
||||
- "%d: got %08x\n", i, hr );
|
||||
+ ok( hr == S_OK ||
|
||||
+ broken( i == SHIL_JUMBO && hr == E_INVALIDARG ), /* XP and 2003 */
|
||||
+ "%d: got %08x\n", i, hr );
|
||||
if (FAILED(hr)) continue;
|
||||
IImageList_GetIconSize( list, &width, &height );
|
||||
switch (i)
|
||||
--
|
||||
2.13.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [24721] Support for extra large and jumbo icon lists in shell32
|
@ -1,4 +1,4 @@
|
||||
From d84576e65c6081602d34b673403ec41b3f12aaf7 Mon Sep 17 00:00:00 2001
|
||||
From 8e9691e9f5a3f138fd846b7fad02f850aa23d83e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 23 Aug 2016 22:54:14 +0200
|
||||
Subject: [PATCH] wined3d: Create dummy 1d textures.
|
||||
@ -99,7 +99,7 @@ index c5517f5..bdc551e 100644
|
||||
checkGLcall("delete dummy textures");
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 718ee63..91c2137 100644
|
||||
index fdbcd7c..40ef580 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2868,11 +2868,13 @@ struct wined3d_state
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 240e588c1e885e1830307a45c4b1c5b588ae689d Mon Sep 17 00:00:00 2001
|
||||
From d28db7c620d03e6c903fca247a60374233b6c3b2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 23 Aug 2016 22:47:56 +0200
|
||||
Subject: [PATCH] wined3d: Add 1d texture resource type.
|
||||
@ -21,7 +21,7 @@ index a54e18e..91b05fb 100644
|
||||
WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_3D);
|
||||
#undef WINED3D_TO_STR
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 2b4f274..6faa2a8 100644
|
||||
index a4b939c..6ec132d 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -690,8 +690,9 @@ enum wined3d_resource_type
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 81ccd036b36dcae299188799de5cf27dd1f3a480 Mon Sep 17 00:00:00 2001
|
||||
From 4a95eee65438a5a8e229683381606aa3a05d82a3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 22:19:25 +0200
|
||||
Subject: [PATCH] wined3d: Add is_power_of_two helper function.
|
||||
@ -8,7 +8,7 @@ Subject: [PATCH] wined3d: Add is_power_of_two helper function.
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index ba0fa63e80d..9fc0d22ed41 100644
|
||||
index 187e2a2..f3a5a5c 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -133,6 +133,11 @@ static DWORD wined3d_resource_access_from_location(DWORD location)
|
||||
@ -23,7 +23,7 @@ index ba0fa63e80d..9fc0d22ed41 100644
|
||||
static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
|
||||
{
|
||||
struct wined3d_texture_sub_resource *sub_resource;
|
||||
@@ -1472,7 +1477,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1478,7 +1483,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
else
|
||||
texture->target = GL_TEXTURE_2D;
|
||||
|
||||
@ -33,5 +33,5 @@ index ba0fa63e80d..9fc0d22ed41 100644
|
||||
{
|
||||
texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED;
|
||||
--
|
||||
2.16.2
|
||||
1.9.1
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
From 1cf2b72c0c5760e6cae88c0f5a0327193899f591 Mon Sep 17 00:00:00 2001
|
||||
From c0703627d824158ef1e38f0ee5b783844380117c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:24:47 +0200
|
||||
Subject: [PATCH] wined3d: Create dummy 1d textures and surfaces.
|
||||
|
||||
---
|
||||
dlls/wined3d/resource.c | 1 +
|
||||
dlls/wined3d/texture.c | 163 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 164 insertions(+)
|
||||
dlls/wined3d/texture.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 149 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 8968c164ed5..bcd06103bde 100644
|
||||
index 8968c16..bcd0610 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -75,6 +75,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
@ -21,27 +21,13 @@ index 8968c164ed5..bcd06103bde 100644
|
||||
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_RECT},
|
||||
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_RB},
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 907d5bec69c..71f59d74258 100644
|
||||
index f3a5a5c..003868c 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1758,6 +1758,36 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||
format, src_box, data, row_pitch, slice_pitch, dst_x, dst_y, dst_z, srgb);
|
||||
@@ -1749,6 +1749,21 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+/* This call just uploads data, the caller is responsible for binding the
|
||||
+ * correct texture. */
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box,
|
||||
+ const struct wined3d_const_bo_address *data, unsigned int src_row_pitch, unsigned int src_slice_pitch,
|
||||
+ unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb)
|
||||
+{
|
||||
+ FIXME("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
|
||||
+ "src_row_pitch %#x, src_slice_pitch %#x, dst_x %u, dst_y %u, dst_z %u, srgb %#x.\n",
|
||||
+ texture, sub_resource_idx, context, debug_d3dformat(format->id), debug_box(src_box),
|
||||
+ data->buffer_object, data->addr, src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
|
||||
+}
|
||||
+
|
||||
+/* Context activation is done by the caller. */
|
||||
+static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
@ -54,14 +40,13 @@ index 907d5bec69c..71f59d74258 100644
|
||||
+
|
||||
+static const struct wined3d_texture_ops texture1d_ops =
|
||||
+{
|
||||
+ texture1d_upload_data,
|
||||
+ texture1d_load_location
|
||||
+};
|
||||
+
|
||||
/* This call just uploads data, the caller is responsible for binding the
|
||||
* correct texture. */
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -2534,6 +2564,135 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
@@ -2574,6 +2589,135 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
@ -194,10 +179,10 @@ index 907d5bec69c..71f59d74258 100644
|
||||
+ return WINED3D_OK;
|
||||
+}
|
||||
+
|
||||
/* This call just uploads data, the caller is responsible for binding the
|
||||
* correct texture. */
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -3073,6 +3232,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
static void texture3d_download_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
const struct wined3d_context *context, const struct wined3d_bo_address *data)
|
||||
@@ -3042,6 +3186,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
|
||||
switch (desc->resource_type)
|
||||
{
|
||||
@ -209,5 +194,5 @@ index 907d5bec69c..71f59d74258 100644
|
||||
hr = wined3d_texture_init(object, desc, layer_count, level_count,
|
||||
flags, device, parent, parent_ops, &texture2d_ops);
|
||||
--
|
||||
2.16.2
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 5a362a78214110a3671d6aeab8d60f79164c6f28 Mon Sep 17 00:00:00 2001
|
||||
From 65fd59157958551ad543149c9b075f0294f512d9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 22:22:26 +0200
|
||||
Subject: [PATCH] wined3d: Implement preparation for 1d textures.
|
||||
@ -8,7 +8,7 @@ Subject: [PATCH] wined3d: Implement preparation for 1d textures.
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 71f59d74258..6957e01e556 100644
|
||||
index 003868c..cb02276 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -477,6 +477,18 @@ static void wined3d_texture_allocate_gl_mutable_storage(struct wined3d_texture *
|
||||
@ -44,5 +44,5 @@ index 71f59d74258..6957e01e556 100644
|
||||
GL_EXTCALL(glTexStorage2D(texture->target, texture->level_count,
|
||||
gl_internal_format, width, height));
|
||||
--
|
||||
2.16.2
|
||||
1.9.1
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
From af097346c9265b21cc2f823cdd347a976fa7c09b Mon Sep 17 00:00:00 2001
|
||||
From c70ae0c4b0a6b7929472b844f374baa42c868fc1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 22:25:20 +0200
|
||||
Subject: [PATCH] wined3d: Implement uploading for 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 3 ++-
|
||||
dlls/wined3d/texture.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 70 insertions(+), 2 deletions(-)
|
||||
dlls/wined3d/texture.c | 12 ++++++++++++
|
||||
2 files changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index bdc551e5054..bb61f78d62d 100644
|
||||
index bdc551e..bb61f78 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4272,7 +4272,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
|
||||
@ -23,88 +23,28 @@ index bdc551e5054..bb61f78d62d 100644
|
||||
struct wined3d_texture *texture = texture_from_resource(resource);
|
||||
unsigned int level;
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 6957e01e556..fd95963b7dc 100644
|
||||
index cb02276..45b5afb 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1784,10 +1784,77 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
const struct wined3d_const_bo_address *data, unsigned int src_row_pitch, unsigned int src_slice_pitch,
|
||||
unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb)
|
||||
{
|
||||
- FIXME("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
|
||||
+ unsigned int level = sub_resource_idx % texture->level_count;
|
||||
+ unsigned int layer = sub_resource_idx / texture->level_count;
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+ const void *mem = data->addr;
|
||||
+ void *converted_mem = NULL;
|
||||
+ unsigned int width, x, update_w;
|
||||
+ GLenum target;
|
||||
@@ -1953,6 +1953,18 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||
GL_EXTCALL(glTexSubImage3D(target, level, dst_x, dst_y, dst_z,
|
||||
update_w, update_h, update_d, format->glFormat, format->glType, bo.addr));
|
||||
}
|
||||
+ else if (target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, dst_x, dst_y, update_w, 1, format->glFormat, format->glType, bo.addr);
|
||||
+ checkGLcall("glTexSubImage2D");
|
||||
+
|
||||
+ TRACE("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
|
||||
"src_row_pitch %#x, src_slice_pitch %#x, dst_x %u, dst_y %u, dst_z %u, srgb %#x.\n",
|
||||
texture, sub_resource_idx, context, debug_d3dformat(format->id), debug_box(src_box),
|
||||
data->buffer_object, data->addr, src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
|
||||
+
|
||||
+ width = wined3d_texture_get_level_width(texture, level);
|
||||
+
|
||||
+ if (!src_box)
|
||||
+ {
|
||||
+ x = 0;
|
||||
+ update_w = width;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ x = src_box->left;
|
||||
+ update_w = src_box->right - src_box->left;
|
||||
+ }
|
||||
+
|
||||
+ if (format->upload)
|
||||
+ {
|
||||
+ unsigned int dst_row_pitch;
|
||||
+
|
||||
+ if (data->buffer_object)
|
||||
+ ERR("Loading a converted texture from a PBO.\n");
|
||||
+ if (texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
|
||||
+ ERR("Converting a block-based format.\n");
|
||||
+
|
||||
+ dst_row_pitch = update_w * format->conv_byte_count;
|
||||
+
|
||||
+ converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_row_pitch);
|
||||
+ format->upload(data->addr, converted_mem, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_row_pitch, update_w, 1, 1);
|
||||
+ mem = converted_mem;
|
||||
+ }
|
||||
+
|
||||
+ if (data->buffer_object)
|
||||
+ {
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, data->buffer_object));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+ }
|
||||
+
|
||||
+ target = wined3d_texture_get_sub_resource_target(texture, sub_resource_idx);
|
||||
+ if (target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, src_row_pitch / format->byte_count);
|
||||
+
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, x, layer, update_w, 1, format->glFormat, format->glType, mem);
|
||||
+ checkGLcall("glTexSubImage2D");
|
||||
+
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage1D(target, level, x, update_w, format->glFormat, format->glType, mem);
|
||||
+ checkGLcall("glTexSubImage1D");
|
||||
+ }
|
||||
+
|
||||
+ if (data->buffer_object)
|
||||
+ {
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+ }
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, converted_mem);
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
+ }
|
||||
+ else if (target == GL_TEXTURE_1D)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage1D(target, level, dst_x, update_w, format->glFormat, format->glType, bo.addr);
|
||||
+ checkGLcall("glTexSubImage1D");
|
||||
+}
|
||||
else
|
||||
{
|
||||
gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, dst_x, dst_y,
|
||||
--
|
||||
2.16.2
|
||||
1.9.1
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
From 0e991598b502b33723a96212a3509c37c8054ab5 Mon Sep 17 00:00:00 2001
|
||||
From 22426ce3fa27934afee1235ee690909e370c8e21 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 22:38:47 +0200
|
||||
Subject: [PATCH 1/3] wined3d: Implement loading from system memory and buffers
|
||||
to (s)rgb 1d textures.
|
||||
Subject: [PATCH] wined3d: Implement loading from system memory and buffers to
|
||||
(s)rgb 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 67 insertions(+), 2 deletions(-)
|
||||
dlls/wined3d/texture.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 62 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index fd95963b7dc..6c8e09db4f2 100644
|
||||
index 45b5afb..a2ed5f4 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1861,10 +1861,75 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
@@ -1771,10 +1771,70 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
@ -57,18 +57,13 @@ index fd95963b7dc..6c8e09db4f2 100644
|
||||
+ case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
+ if (sub_resource->locations & WINED3D_LOCATION_SYSMEM)
|
||||
+ {
|
||||
+ struct wined3d_const_bo_address data = {0, texture->resource.heap_memory};
|
||||
+ data.addr += sub_resource->offset;
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
+ }
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
+ {
|
||||
+ struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
@ -91,5 +86,5 @@ index fd95963b7dc..6c8e09db4f2 100644
|
||||
|
||||
static const struct wined3d_texture_ops texture1d_ops =
|
||||
--
|
||||
2.16.2
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From be0950f4dc83719ea9cbe322abb7affc327e1ef2 Mon Sep 17 00:00:00 2001
|
||||
From 1cf407698d0ef427d093fb09e76c0a63d84eca33 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 22:41:05 +0200
|
||||
Subject: [PATCH] wined3d: Implement downloading from (s)rgb 1d textures to
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH] wined3d: Implement downloading from (s)rgb 1d textures to
|
||||
1 file changed, 114 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 40ce11b..81a638e 100644
|
||||
index a2ed5f4..25219e9 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1882,6 +1882,78 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
@@ -1768,6 +1768,78 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@ -91,7 +91,7 @@ index 40ce11b..81a638e 100644
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
@@ -1944,6 +2016,48 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1825,6 +1897,48 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
From 183c39dd55a004946a788d352a29940e9b737d0c Mon Sep 17 00:00:00 2001
|
||||
From 37d03dd2f32784e4729aabcd1cc5084c0292dc83 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 22:44:14 +0200
|
||||
Subject: [PATCH] wined3d: Implement converting between (s)rgb 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 31 +++++++++++++++++++++++++++++++
|
||||
1 file changed, 31 insertions(+)
|
||||
dlls/wined3d/texture.c | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 81a638e..0755d4d 100644
|
||||
index 25219e9..6e537de 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1954,6 +1954,29 @@ static void texture1d_download_data(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1840,6 +1840,27 @@ static void texture1d_download_data(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@ -31,8 +31,6 @@ index 81a638e..0755d4d 100644
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, !dest_is_srgb);
|
||||
+ texture1d_download_data(texture, sub_resource_idx, context, &data);
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, dest_is_srgb);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL,
|
||||
+ wined3d_const_bo_address(&data), row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, data.addr);
|
||||
+}
|
||||
@ -41,9 +39,9 @@ index 81a638e..0755d4d 100644
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
@@ -2009,6 +2032,14 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1890,6 +1911,14 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
}
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ {
|
||||
|
@ -1,4 +1,4 @@
|
||||
From db22fe4ed60b15384e0f6ede1a5cb3b42bdca50f Mon Sep 17 00:00:00 2001
|
||||
From 2d1efe098f329aab45acf65dfd65d76c2290a356 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:11:03 +0200
|
||||
Subject: [PATCH] wined3d: Check for 1d textures in
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH] wined3d: Check for 1d textures in
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 0755d4d..6504774 100644
|
||||
index 6e537de..d490ac8 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1507,6 +1507,12 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1445,6 +1445,12 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From d7fe15c919f116112f85a75b799c3617d13ec8fe Mon Sep 17 00:00:00 2001
|
||||
From 9224aa288a653ca42b1bfe54ecd9174ce8182a7f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 17:00:12 +0200
|
||||
Subject: [PATCH] wined3d: Check if 1d teture is still in use before releasing.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 246b0e8add4f2e928aafe76345b2a11a8dc0f0b2 Mon Sep 17 00:00:00 2001
|
||||
From 3b9f0470ff37163e93747ad05eb68ddfb90f5be9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 17:06:41 +0200
|
||||
Subject: [PATCH] wined3d: Generate glsl samplers for 1d texture arrays.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 025959d7dc3e7476cb1605d7713f6b0c6adafd0a Mon Sep 17 00:00:00 2001
|
||||
From 707e03d8c031f4914e118a00c9e5cc120d663d1e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:09:41 +0200
|
||||
Subject: [PATCH] wined3d: Add support for 1d textures in
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 617e43bafc3bf0bc14c3cdeb9b191933ef2a8f44 Mon Sep 17 00:00:00 2001
|
||||
From 743513495ac98b1edc6ce398689a5979fc6a083a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:21:20 +0200
|
||||
Subject: [PATCH] wined3d: Handle 1d textures in texture_activate_dimensions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 379b72a4ddca1c84cc57a2d42668e2192305289c Mon Sep 17 00:00:00 2001
|
||||
From 2fb363f151d5a8fd868eb43273c5956eb0c469d4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:26:07 +0200
|
||||
Subject: [PATCH] wined3d: Allow creation of 1d shader views.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 59893987de8d756b0a6db1e5b4bd46727a20d5b6 Mon Sep 17 00:00:00 2001
|
||||
From 8f01b5d785f759c43ceb2e4d7419e52002bf50b6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 4 Jun 2017 22:04:39 +0200
|
||||
Subject: [PATCH] d3d11: Improve ID3D11Device_CheckFormatSupport.
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH] d3d11: Improve ID3D11Device_CheckFormatSupport.
|
||||
3 files changed, 64 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 25308c2..1183335 100644
|
||||
index d93f4eb..a4e1d4b 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -3224,17 +3224,24 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *i
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 814753a96f2567b45393acd4c960ddc81f671743 Mon Sep 17 00:00:00 2001
|
||||
From 832b94de184ffe01067e877969b465fa0ea23fd4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 7 Jul 2017 04:03:19 +0200
|
||||
Subject: [PATCH] d3d11: Allow DXGI_FORMAT_UNKNOWN in CheckFormatSupport and
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH] d3d11: Allow DXGI_FORMAT_UNKNOWN in CheckFormatSupport and
|
||||
2 files changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 1183335..aaefb0a 100644
|
||||
index a4e1d4b..89d3922 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -3241,7 +3241,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *i
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c653adacc254629d34c5a7c27b820f229698d661 Mon Sep 17 00:00:00 2001
|
||||
From 68a40c7553254a71925933c26d63147ec5b2b490 Mon Sep 17 00:00:00 2001
|
||||
From: Wine Staging Team <webmaster@fds-team.de>
|
||||
Date: Fri, 16 Mar 2018 14:10:37 +1100
|
||||
Subject: [PATCH] Autogenerated #ifdef patch for wined3d-CSMT_Main.
|
||||
@ -15,13 +15,13 @@ Based on patches by:
|
||||
dlls/wined3d/device.c | 74 ++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/surface.c | 4 ++
|
||||
dlls/wined3d/swapchain.c | 4 ++
|
||||
dlls/wined3d/texture.c | 89 +++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/texture.c | 85 +++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/view.c | 14 +++++++
|
||||
dlls/wined3d/wined3d_private.h | 23 +++++++++++
|
||||
7 files changed, 298 insertions(+)
|
||||
7 files changed, 294 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 0d7e10f..f342819 100644
|
||||
index c194832..0493bb8 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -406,6 +406,9 @@ struct wined3d_cs_update_sub_resource
|
||||
@ -34,7 +34,7 @@ index 0d7e10f..f342819 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs_add_dirty_texture_region
|
||||
@@ -2247,6 +2250,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2243,6 +2246,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
unsigned int slice_pitch)
|
||||
{
|
||||
struct wined3d_cs_update_sub_resource *op;
|
||||
@ -88,7 +88,7 @@ index 0d7e10f..f342819 100644
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
|
||||
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
|
||||
@@ -2260,8 +2310,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2256,8 +2306,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
wined3d_resource_acquire(resource);
|
||||
|
||||
cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
|
||||
@ -99,7 +99,7 @@ index 0d7e10f..f342819 100644
|
||||
cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
|
||||
}
|
||||
|
||||
@@ -2444,6 +2496,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2440,6 +2492,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_GENERATE_MIPMAPS */ wined3d_cs_exec_generate_mipmaps,
|
||||
};
|
||||
|
||||
@ -113,7 +113,7 @@ index 0d7e10f..f342819 100644
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (size > (cs->data_size - cs->end))
|
||||
@@ -2497,6 +2556,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2493,6 +2552,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_st_ops =
|
||||
{
|
||||
@ -123,7 +123,7 @@ index 0d7e10f..f342819 100644
|
||||
wined3d_cs_st_require_space,
|
||||
wined3d_cs_st_submit,
|
||||
wined3d_cs_st_finish,
|
||||
@@ -2530,6 +2592,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2526,6 +2588,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
wined3d_cs_queue_submit(&cs->queue[queue_id], cs);
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ index 0d7e10f..f342819 100644
|
||||
static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size_t size, struct wined3d_cs *cs)
|
||||
{
|
||||
size_t queue_size = ARRAY_SIZE(queue->data);
|
||||
@@ -2591,6 +2668,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
@@ -2587,6 +2664,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
return packet->data;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ index 0d7e10f..f342819 100644
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (cs->thread_id == GetCurrentThreadId())
|
||||
@@ -2610,6 +2697,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2606,6 +2693,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_mt_ops =
|
||||
{
|
||||
@ -285,17 +285,17 @@ index 583e85f..d0eb846 100644
|
||||
+}
|
||||
+#endif /* STAGING_CSMT */
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 913f217..088391e 100644
|
||||
index 217d1d8..bed9e86 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -2392,7 +2392,11 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
|
||||
@@ -2239,7 +2239,11 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
|
||||
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
|
||||
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
|
||||
* getting called. */
|
||||
+#if !defined(STAGING_CSMT)
|
||||
if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer_object)
|
||||
if (conversion && sub_resource->buffer_object)
|
||||
+#else /* STAGING_CSMT */
|
||||
+ if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer)
|
||||
+ if (conversion && sub_resource->buffer)
|
||||
+#endif /* STAGING_CSMT */
|
||||
{
|
||||
TRACE("Removing the pbo attached to texture %p, %u.\n", texture, sub_resource_idx);
|
||||
@ -317,7 +317,7 @@ index 09e26af..26ebba9 100644
|
||||
|
||||
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index c3f98ba..33165fb 100644
|
||||
index 4fcec89..6d12d60 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -326,7 +326,11 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
@ -332,7 +332,7 @@ index c3f98ba..33165fb 100644
|
||||
return;
|
||||
}
|
||||
if (locations & WINED3D_LOCATION_USER_MEMORY)
|
||||
@@ -436,6 +440,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
@@ -350,6 +354,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
|
||||
@ -340,7 +340,7 @@ index c3f98ba..33165fb 100644
|
||||
unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info)
|
||||
{
|
||||
GLuint *buffer_object = &texture->sub_resources[sub_resource_idx].buffer_object;
|
||||
@@ -448,6 +453,19 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture
|
||||
@@ -362,6 +367,19 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture
|
||||
|
||||
wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_BUFFER);
|
||||
*buffer_object = 0;
|
||||
@ -360,7 +360,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
@@ -467,7 +485,11 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
@@ -381,7 +399,11 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
&& !wined3d_texture_load_location(texture, i, context, map_binding))
|
||||
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
|
||||
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
||||
@ -372,7 +372,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
if (context)
|
||||
@@ -788,17 +810,28 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
@@ -726,17 +748,28 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
const struct wined3d_gl_info *gl_info = NULL;
|
||||
struct wined3d_context *context = NULL;
|
||||
struct wined3d_dc_info *dc_info;
|
||||
@ -401,7 +401,7 @@ index c3f98ba..33165fb 100644
|
||||
|
||||
/* We may not be able to get a context in wined3d_texture_cleanup() in
|
||||
* general, but if a buffer object was previously created we can. */
|
||||
@@ -808,7 +841,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
@@ -746,7 +779,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
gl_info = context->gl_info;
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
if (!context && !list_empty(&texture->renderbuffers))
|
||||
@@ -1620,11 +1658,16 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1558,11 +1596,16 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
|
||||
@ -431,7 +431,7 @@ index c3f98ba..33165fb 100644
|
||||
if (sub_resource->buffer_object)
|
||||
return;
|
||||
|
||||
@@ -1636,6 +1679,16 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
|
||||
@@ -1574,6 +1617,16 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
|
||||
|
||||
TRACE("Created buffer object %u for texture %p, sub-resource %u.\n",
|
||||
sub_resource->buffer_object, texture, sub_resource_idx);
|
||||
@ -448,7 +448,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
|
||||
@@ -1734,7 +1787,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
@@ -1708,7 +1761,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@ -460,19 +460,7 @@ index c3f98ba..33165fb 100644
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
@@ -2033,7 +2090,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
+#if !defined(STAGING_CSMT)
|
||||
struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
|
||||
+#else /* STAGING_CSMT */
|
||||
+ struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL};
|
||||
+#endif /* STAGING_CSMT */
|
||||
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
@@ -2078,7 +2139,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1957,7 +2014,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@ -484,7 +472,7 @@ index c3f98ba..33165fb 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -2347,8 +2412,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
@@ -2304,8 +2365,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
@ -498,7 +486,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
||||
@@ -3105,7 +3175,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3080,7 +3146,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
@ -507,10 +495,10 @@ index c3f98ba..33165fb 100644
|
||||
+#else /* STAGING_CSMT */
|
||||
+ struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL};
|
||||
+#endif /* STAGING_CSMT */
|
||||
struct wined3d_box src_box;
|
||||
|
||||
wined3d_texture_bind_and_dirtify(texture, context,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
@@ -3151,7 +3225,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3130,7 +3200,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@ -522,7 +510,7 @@ index c3f98ba..33165fb 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -3349,8 +3427,19 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
|
||||
@@ -3196,8 +3270,19 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
|
||||
if (dst_texture->sub_resources[dst_sub_resource_idx].map_count
|
||||
|| src_texture->sub_resources[src_sub_resource_idx].map_count)
|
||||
{
|
||||
@ -589,7 +577,7 @@ index 1eebce6..bed39db 100644
|
||||
|
||||
return WINED3D_OK;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index c1bcfde..33ca431 100644
|
||||
index b240503..996da72 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2904,6 +2904,16 @@ struct wined3d_dummy_textures
|
||||
@ -622,7 +610,7 @@ index c1bcfde..33ca431 100644
|
||||
|
||||
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
|
||||
{
|
||||
@@ -3208,7 +3224,11 @@ struct wined3d_texture
|
||||
@@ -3203,7 +3219,11 @@ struct wined3d_texture
|
||||
|
||||
unsigned int map_count;
|
||||
DWORD locations;
|
||||
|
@ -0,0 +1,30 @@
|
||||
From f3bc9d9828f84d9899fd1b9ef42af3ea7027e258 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 22 Mar 2018 09:35:41 +1100
|
||||
Subject: [PATCH] winex11.drv: Fix compile error when Vulkan isn't avaiable
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/winex11.drv/vulkan.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
|
||||
index 27ff722..f96ef64 100644
|
||||
--- a/dlls/winex11.drv/vulkan.c
|
||||
+++ b/dlls/winex11.drv/vulkan.c
|
||||
@@ -37,10 +37,10 @@
|
||||
#include "wine/vulkan.h"
|
||||
#include "wine/vulkan_driver.h"
|
||||
|
||||
-#ifdef SONAME_LIBVULKAN
|
||||
-
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
|
||||
|
||||
+#ifdef SONAME_LIBVULKAN
|
||||
+
|
||||
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
||||
#define VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR 1000004000
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
Loading…
Reference in New Issue
Block a user