Compare commits

...

21 Commits
v5.18 ... v5.19

Author SHA1 Message Date
Alistair Leslie-Hughes
6ea9eb634f Release v5.19 2020-10-10 10:18:47 +11:00
Alistair Leslie-Hughes
24fa2aa786 Updated bcrypt-ECDHSecretAgreement patchset 2020-10-10 09:06:27 +11:00
Alistair Leslie-Hughes
8bef81b0a6 Updated color-sRGB-profile patchset 2020-10-10 08:58:41 +11:00
Paul Gofman
ab4391f61b Updated ntdll-ForceBottomUpAlloc patchset. 2020-10-09 13:12:52 +03:00
Alistair Leslie-Hughes
f6356a2c93 Rebase against 412db7789379549c4f821acb11c92f7aabab71c9. 2020-10-09 08:19:43 +11:00
Alistair Leslie-Hughes
8c5be4c9e7 Updated xactengine2-dll patchset 2020-10-07 10:42:36 +11:00
Alistair Leslie-Hughes
48fc6b0ba0 Updated xactengine-initial patchset 2020-10-07 10:34:59 +11:00
Alistair Leslie-Hughes
ee0185d9e2 Rebase against c29f9e6ee7656aa028bb1630284e7d4873bd5b0f. 2020-10-07 10:30:27 +11:00
Paul Gofman
df02967431 Updated server-Object_Types patchset.
Don't grab type object in get_object_type().
2020-10-06 23:37:25 +03:00
Alistair Leslie-Hughes
87a40ed683 Rebase against 568e3e8b697a960881c162671a33c28727921797. 2020-10-06 10:01:40 +11:00
Alistair Leslie-Hughes
194669052e Updated bcrypt-ECDHSecretAgreement patchset 2020-10-03 18:55:33 +10:00
Alistair Leslie-Hughes
aa7895faf6 Updated mfplat-streaming-support patchset 2020-10-03 18:10:26 +10:00
Alistair Leslie-Hughes
f82518af72 Rebase against cce4f36e214125173a8df84d27ba5b33df8d1434. 2020-10-03 15:35:36 +10:00
Alistair Leslie-Hughes
7145412e08 Rebase against fa9f4a20f5305b7cbcfe3a644d39d4b759f89203. 2020-10-02 08:48:09 +10:00
Alistair Leslie-Hughes
cd9f6dbd90 Updated xactengine-initial patchset
Use the Version 2 of the tests patch whcih moved them to xactengine.
Seperated out x3daudio1_7 library into it's own patch.
2020-10-01 19:14:39 +10:00
Alistair Leslie-Hughes
e634569429 Rebase against d45b3d4fdd7cbcfdba70c327ab90976a3b658da2. 2020-10-01 08:58:16 +10:00
Zebediah Figura
76a479203b Rebase against 23c6dd55b8c983ec88cada0a6d6c75ee9cd93976. 2020-09-29 15:52:53 -05:00
Alistair Leslie-Hughes
639755741e Rebase against 2ee75bf9ade3e90f10ffe4236c8c95d817402392. 2020-09-29 12:58:11 +10:00
Alistair Leslie-Hughes
9acfa3b899 Added windows.networking.connectivity.dll patchset 2020-09-28 15:32:22 +10:00
Alistair Leslie-Hughes
7b32c6a57f Updated mfplat-streaming-support patchset 2020-09-28 15:32:21 +10:00
Zebediah Figura
7bd8acb4ca ntdll-Junction_Points: Updates from Erich E. Hoover.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49790
2020-09-27 20:30:44 -05:00
104 changed files with 2574 additions and 3427 deletions

View File

@@ -1,4 +1,4 @@
From 700513f28e4844cbfc40b3ebf1b77cf121b71e71 Mon Sep 17 00:00:00 2001
From 0cf6433af95363c5fbba2af482b2ba50b863dfb7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:44:31 +0200
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
1 file changed, 15 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 587c87bbfc0..05b40326d82 100644
index 20bc3f977d1..c2187a19397 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -44,6 +44,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -20,7 +20,7 @@ index 587c87bbfc0..05b40326d82 100644
#ifdef _WIN64
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
@@ -3487,6 +3488,7 @@ static void process_breakpoint(void)
@@ -3456,6 +3457,7 @@ static void process_breakpoint(void)
__ENDTRY
}
@@ -28,17 +28,17 @@ index 587c87bbfc0..05b40326d82 100644
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
@@ -3497,6 +3499,9 @@ static void process_breakpoint(void)
@@ -3465,6 +3467,9 @@ static void process_breakpoint(void)
*/
void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR unknown3, ULONG_PTR unknown4 )
{
static const unsigned int fls_slot_count = 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits);
+ OBJECT_ATTRIBUTES staging_event_attr;
+ UNICODE_STRING staging_event_string;
+ HANDLE staging_event;
static int attach_done;
int i;
NTSTATUS status;
@@ -3515,6 +3520,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
@@ -3483,6 +3488,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
entry = (void **)&context->u.s.X0;
#endif

View File

@@ -1 +1 @@
Depends: ntdll-FLS_Callbacks
#Depends: ntdll-FLS_Callbacks

View File

@@ -0,0 +1,339 @@
From 104e3d8f36af9bc2179f7878b4f99b7417f59376 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 2 Oct 2020 11:29:24 -0500
Subject: [PATCH] bcrypt: Allow multiple backends to coexist.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/bcrypt/Makefile.in | 3 +-
dlls/bcrypt/bcrypt_internal.h | 3 +
dlls/bcrypt/gnutls.c | 34 +++++--
dlls/bcrypt/macos.c | 20 +++-
dlls/bcrypt/unixlib.c | 186 ++++++++++++++++++++++++++++++++++
5 files changed, 229 insertions(+), 17 deletions(-)
create mode 100644 dlls/bcrypt/unixlib.c
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
index 24803fb2d7c..46a20d473dd 100644
--- a/dlls/bcrypt/Makefile.in
+++ b/dlls/bcrypt/Makefile.in
@@ -11,6 +11,7 @@ C_SRCS = \
macos.c \
md2.c \
sha256.c \
- sha512.c
+ sha512.c \
+ unixlib.c
RC_SRCS = version.rc
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
index 5edc9e6c9c6..29db7210b59 100644
--- a/dlls/bcrypt/bcrypt_internal.h
+++ b/dlls/bcrypt/bcrypt_internal.h
@@ -210,4 +210,7 @@ struct key_funcs
NTSTATUS (CDECL *key_import_ecc)( struct key *, UCHAR *, ULONG );
};
+struct key_funcs *gnutls_lib_init(DWORD reason);
+struct key_funcs *macos_lib_init(DWORD reason);
+
#endif /* __BCRYPT_INTERNAL_H */
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index 21520bb4a84..b761c732acf 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -332,9 +332,12 @@ fail:
static void gnutls_uninitialize(void)
{
- pgnutls_global_deinit();
- dlclose( libgnutls_handle );
- libgnutls_handle = NULL;
+ if (libgnutls_handle)
+ {
+ pgnutls_global_deinit();
+ dlclose( libgnutls_handle );
+ libgnutls_handle = NULL;
+ }
}
struct buffer
@@ -1568,7 +1571,7 @@ static void CDECL key_asymmetric_destroy( struct key *key )
if (key_data(key)->privkey) pgnutls_privkey_deinit( key_data(key)->privkey );
}
-static const struct key_funcs key_funcs =
+static struct key_funcs key_funcs =
{
key_set_property,
key_symmetric_init,
@@ -1589,19 +1592,28 @@ static const struct key_funcs key_funcs =
key_import_ecc
};
-NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+struct key_funcs * gnutls_lib_init( DWORD reason )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
- if (!gnutls_initialize()) return STATUS_DLL_NOT_FOUND;
- *(const struct key_funcs **)ptr_out = &key_funcs;
- break;
+ if (!gnutls_initialize()) return NULL;
+ return &key_funcs;
case DLL_PROCESS_DETACH:
gnutls_uninitialize();
- break;
}
- return STATUS_SUCCESS;
+ return NULL;
}
-#endif /* HAVE_GNUTLS_CIPHER_INIT */
+#else /* HAVE_GNUTLS_CIPHER_INIT */
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+struct key_funcs * gnutls_lib_init( DWORD reason )
+{
+ return NULL;
+}
+#endif
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
index 37615e97689..5868b445625 100644
--- a/dlls/bcrypt/macos.c
+++ b/dlls/bcrypt/macos.c
@@ -259,7 +259,7 @@ static void CDECL key_asymmetric_destroy( struct key *key )
{
}
-static const struct key_funcs key_funcs =
+static struct key_funcs key_funcs =
{
key_set_property,
key_symmetric_init,
@@ -280,11 +280,21 @@ static const struct key_funcs key_funcs =
key_import_ecc
};
-NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+struct key_funcs * macos_lib_init( DWORD reason )
{
- if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
- *(const struct key_funcs **)ptr_out = &key_funcs;
- return STATUS_SUCCESS;
+ if (reason != DLL_PROCESS_ATTACH) return NULL;
+ return &key_funcs;
}
+#else
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+struct key_funcs * macos_lib_init( DWORD reason )
+{
+ return NULL;
+}
#endif
diff --git a/dlls/bcrypt/unixlib.c b/dlls/bcrypt/unixlib.c
new file mode 100644
index 00000000000..791b5d54188
--- /dev/null
+++ b/dlls/bcrypt/unixlib.c
@@ -0,0 +1,186 @@
+#if 0
+#pragma makedep unix
+#endif
+
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "ntsecapi.h"
+#include "bcrypt.h"
+
+#include "bcrypt_internal.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+#if defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 || defined(HAVE_GNUTLS_CIPHER_INIT)
+WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);
+
+static NTSTATUS CDECL key_set_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_init( struct key *key )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static void CDECL key_symmetric_vector_reset( struct key *key )
+{
+ FIXME( "not implemented\n" );
+}
+
+static NTSTATUS CDECL key_symmetric_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_encrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_decrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_get_tag( struct key *key, UCHAR *tag, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static void CDECL key_symmetric_destroy( struct key *key )
+{
+ FIXME( "not implemented\n" );
+}
+
+static NTSTATUS CDECL key_asymmetric_init( struct key *key )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_sign( struct key *key, void *padding, UCHAR *input, ULONG input_len, UCHAR *output,
+ ULONG output_len, ULONG *ret_len, ULONG flags )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_verify( struct key *key, void *padding, UCHAR *hash, ULONG hash_len,
+ UCHAR *signature, ULONG signature_len, DWORD flags )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_export_dsa_capi( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_export_ecc( struct key *key, UCHAR *output, ULONG len, ULONG *ret_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_import_dsa_capi( struct key *key, UCHAR *buf, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_import_ecc( struct key *key, UCHAR *input, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_generate( struct key *key )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static void CDECL key_asymmetric_destroy( struct key *key )
+{
+ FIXME( "not implemented\n" );
+}
+
+static struct key_funcs key_funcs =
+{
+ key_set_property,
+ key_symmetric_init,
+ key_symmetric_vector_reset,
+ key_symmetric_set_auth_data,
+ key_symmetric_encrypt,
+ key_symmetric_decrypt,
+ key_symmetric_get_tag,
+ key_symmetric_destroy,
+ key_asymmetric_init,
+ key_asymmetric_generate,
+ key_asymmetric_sign,
+ key_asymmetric_verify,
+ key_asymmetric_destroy,
+ key_export_dsa_capi,
+ key_export_ecc,
+ key_import_dsa_capi,
+ key_import_ecc
+};
+
+NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+{
+ struct key_funcs *gnutls_funcs = gnutls_lib_init(reason);
+ struct key_funcs *macos_funcs = macos_lib_init(reason);
+
+ if (reason == DLL_PROCESS_ATTACH)
+ {
+#define RESOLVE_FUNC(name) \
+ if (macos_funcs && macos_funcs->key_##name) \
+ key_funcs.key_##name = macos_funcs->key_##name; \
+ if (gnutls_funcs && gnutls_funcs->key_##name) \
+ key_funcs.key_##name = gnutls_funcs->key_##name;
+
+ RESOLVE_FUNC(set_property)
+ RESOLVE_FUNC(symmetric_init)
+ RESOLVE_FUNC(symmetric_vector_reset)
+ RESOLVE_FUNC(symmetric_set_auth_data)
+ RESOLVE_FUNC(symmetric_encrypt)
+ RESOLVE_FUNC(symmetric_decrypt)
+ RESOLVE_FUNC(symmetric_get_tag)
+ RESOLVE_FUNC(symmetric_destroy)
+ RESOLVE_FUNC(asymmetric_init)
+ RESOLVE_FUNC(asymmetric_generate)
+ RESOLVE_FUNC(asymmetric_sign)
+ RESOLVE_FUNC(asymmetric_verify)
+ RESOLVE_FUNC(asymmetric_destroy)
+ RESOLVE_FUNC(export_dsa_capi)
+ RESOLVE_FUNC(export_ecc)
+ RESOLVE_FUNC(import_dsa_capi)
+ RESOLVE_FUNC(import_ecc)
+
+#undef RESOLVE_FUNC
+
+ *(struct key_funcs **)ptr_out = &key_funcs;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+#endif
--
2.28.0

View File

@@ -1,4 +1,4 @@
From d232882c571a14f4da8a134071a2125805ebd41f Mon Sep 17 00:00:00 2001
From 01530fae68970b0c0af8811c5f6c5ea85c14372c Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 7 Jan 2020 14:22:49 -0600
Subject: [PATCH] bcrypt: Implement BCRYPT_KDF_HASH.
@@ -7,21 +7,21 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47699
Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
---
dlls/bcrypt/bcrypt_main.c | 108 ++++++++++++++++++++++++++++++++++++-
dlls/bcrypt/tests/bcrypt.c | 2 +-
2 files changed, 108 insertions(+), 2 deletions(-)
dlls/bcrypt/tests/bcrypt.c | 3 +-
2 files changed, 108 insertions(+), 3 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 65c28ca63e2..6e7b52e93b0 100644
index 8dae41a2e2e..67be417aa61 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1891,7 +1891,113 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
@@ -1837,7 +1837,113 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
if (!secret || secret->hdr.magic != MAGIC_SECRET) return STATUS_INVALID_HANDLE;
if (!kdf) return STATUS_INVALID_PARAMETER;
- if (!(strcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
- if (!(lstrcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
+ if (flags) FIXME("flags ignored: %08x\n", flags);
+
+ if (!(strcmpW( kdf, BCRYPT_KDF_HASH )))
+ if (!(lstrcmpW( kdf, BCRYPT_KDF_HASH )))
+ {
+ unsigned int i;
+ BCryptBuffer *hash_algorithm = NULL;
@@ -67,7 +67,7 @@ index 65c28ca63e2..6e7b52e93b0 100644
+ {
+ for (i = 0; i < ARRAY_SIZE( builtin_algorithms ); i++)
+ {
+ if (!strcmpW( hash_algorithm->pvBuffer, builtin_algorithms[i].name))
+ if (!lstrcmpW( hash_algorithm->pvBuffer, builtin_algorithms[i].name))
+ {
+ hash_alg_id = i;
+ break;
@@ -125,15 +125,15 @@ index 65c28ca63e2..6e7b52e93b0 100644
+
+ return STATUS_SUCCESS;
+ }
+ else if (!(strcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
+ else if (!(lstrcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
{
ULONG n;
ULONG secret_length = secret->len;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index a351aacf1f5..5333b879817 100644
index 5701a0a30ce..d4ffb3fe69c 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -2085,7 +2085,7 @@ static void test_ECDH(void)
@@ -2132,7 +2132,7 @@ static void test_ECDH(void)
raw_secret_end:
status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0);
@@ -142,6 +142,14 @@ index a351aacf1f5..5333b879817 100644
if (status != STATUS_SUCCESS)
{
@@ -2666,7 +2666,6 @@ static void test_SecretAgreement(void)
ok(status == STATUS_INVALID_PARAMETER, "got %08x\n", status);
status = pBCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0);
- todo_wine
ok(status == STATUS_SUCCESS, "got %08x\n", status);
status = pBCryptDestroyHash(secret);
--
2.27.0
2.28.0

View File

@@ -1,2 +1,5 @@
Fixes: [47699] Multiple games fail to connect to online services (missing BCryptSecretAgreement / BCryptDeriveKey implementation)
# Needs to be moved to the unix lib, but that's a nontrivial amount of work, and
# using gcrypt is the wrong way forward (we should expose the missing APIs from
# gnutls instead).
#Disabled: true

View File

@@ -1,229 +0,0 @@
From 01cf21eb49307de6b0eb5445b9befdf8f585e3f7 Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Sat, 12 Sep 2020 01:45:02 -0600
Subject: [PATCH] wine.inf: Add sRGB color profile
"This profile is made available by the International Color Consortium,
and may be copied, distributed, embedded, made, used, and sold without
restriction. Altered versions of this profile shall have the original
identification and copyright information removed and shall not be
misrepresented as the original profile."
See http://www.color.org/srgbprofiles.xalter
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37396
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
Makefile.in | 1 +
color/Makefile.in | 2 ++
color/sRGB_Color_Space_Profile.icm | Bin 0 -> 3024 bytes
configure.ac | 2 ++
loader/wine.inf.in | 14 +++++++++-----
tools/makedep.c | 12 ++++++++++++
6 files changed, 26 insertions(+), 5 deletions(-)
create mode 100644 color/Makefile.in
create mode 100644 color/sRGB_Color_Space_Profile.icm
diff --git a/Makefile.in b/Makefile.in
index 307a95b3b1..367bc3fe77 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -27,6 +27,7 @@ datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
includedir = @includedir@
+colordir = ${datadir}/wine/color
fontdir = ${datadir}/wine/fonts
nlsdir = ${datadir}/wine/nls
dlldir = ${libdir}/wine
diff --git a/color/Makefile.in b/color/Makefile.in
new file mode 100644
index 0000000000..f9f6f62a3b
--- /dev/null
+++ b/color/Makefile.in
@@ -0,0 +1,2 @@
+SOURCES = \
+ sRGB_Color_Space_Profile.icm
diff --git a/color/sRGB_Color_Space_Profile.icm b/color/sRGB_Color_Space_Profile.icm
new file mode 100644
index 0000000000000000000000000000000000000000..49afbfef10f22a1832590b68369d2f248ea553b9
GIT binary patch
literal 3024
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
literal 0
HcmV?d00001
diff --git a/configure.ac b/configure.ac
index 20ae7577fa..c615f1bfe0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2810,6 +2810,7 @@ dummy:
WINE_CONFIG_SYMLINK(wine,tools/winewrapper)
WINE_CONFIG_SYMLINK(wine64,tools/winewrapper,["x$enable_win64" != xno -o -n "$with_wine64"])
+WINE_CONFIG_MAKEFILE(color)
WINE_CONFIG_MAKEFILE(dlls/acledit)
WINE_CONFIG_MAKEFILE(dlls/aclui)
WINE_CONFIG_MAKEFILE(dlls/activeds.tlb)
@@ -4146,6 +4147,7 @@ clean::
else
TOP_INSTALL_DEV="$TOP_INSTALL_DEV include"
TOP_INSTALL_LIB="$TOP_INSTALL_LIB \
+color \
fonts \
loader/wine.inf \
loader/winebus.inf \
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index cd0e7bd16f..f84567c13e 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -30,7 +30,7 @@ signature="$CHICAGO$"
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDlls
UpdateInis=SystemIni
-CopyFiles=InfFiles,NlsFiles,SortFiles
+CopyFiles=ColorFiles,InfFiles,NlsFiles,SortFiles
AddReg=\
Classes,\
ContentIndex,\
@@ -54,7 +54,7 @@ AddReg=\
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDlls
UpdateInis=SystemIni
-CopyFiles=InfFiles,NlsFiles,SortFiles
+CopyFiles=ColorFiles,InfFiles,NlsFiles,SortFiles
AddReg=\
Classes,\
ContentIndex,\
@@ -80,7 +80,7 @@ RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin64,FakeDlls
WinePreInstall=Wow64
UpdateInis=SystemIni
-CopyFiles=InfFiles,NlsFiles,SortFiles
+CopyFiles=ColorFiles,InfFiles,NlsFiles,SortFiles
AddReg=\
Classes,\
ContentIndex,\
@@ -107,7 +107,7 @@ RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin64,FakeDlls
WinePreInstall=Wow64
UpdateInis=SystemIni
-CopyFiles=InfFiles,NlsFiles,SortFiles
+CopyFiles=ColorFiles,InfFiles,NlsFiles,SortFiles
AddReg=\
Classes,\
ContentIndex,\
@@ -2670,7 +2670,6 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,catroot,
11,mui,
11,tasks,
-11,spool\drivers\color,
11,spool\printers,
10,,explorer.exe
10,,hh.exe
@@ -3886,6 +3885,9 @@ HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Solitaire-EnableGame",0x
HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-SpiderSolitaire-EnableGame",0x10001,0x00000001
HKLM,Software\Wine\LicenseInformation,"Shell-PremiumInBoxGames-Chess-EnableGame",0x10001,0x00000001
+[ColorFiles]
+"sRGB Color Space Profile.icm",sRGB_Color_Space_Profile.icm
+
[InfFiles]
winebus.inf
winehid.inf
@@ -3968,10 +3970,12 @@ normnfkd.nls
sortdefault.nls
[WineSourceDirs]
+ColorFiles = color
NlsFiles = nls
SortFiles = nls
[DestinationDirs]
+ColorFiles = 11,spool\drivers\color
InfFiles = 17
NlsFiles = 11
SortFiles = 10,globalization\sorting
diff --git a/tools/makedep.c b/tools/makedep.c
index 7fe2c4daf5..aa188d6fe5 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -2955,6 +2955,17 @@ static void output_source_svg( struct makefile *make, struct incl_file *source,
}
+/*******************************************************************
+ * output_source_icm
+ */
+static void output_source_icm( struct makefile *make, struct incl_file *source, const char *obj )
+{
+ add_install_rule( make, source->name, source->name,
+ strmake( "D$(colordir)/%s", source->name ));
+ output_srcdir_symlink( make, strmake( "%s.icm", obj ));
+}
+
+
/*******************************************************************
* output_source_nls
*/
@@ -3171,6 +3182,7 @@ static const struct
{ "tlb", output_source_tlb },
{ "sfd", output_source_sfd },
{ "svg", output_source_svg },
+ { "icm", output_source_icm },
{ "nls", output_source_nls },
{ "desktop", output_source_desktop },
{ "po", output_source_po },
--
2.28.0

View File

@@ -0,0 +1,167 @@
From b037d19858277d7dde0df6cdf4678a55517366af Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Tue, 22 Sep 2020 22:00:11 -0600
Subject: [PATCH] winspool: Add sRGB color profile
"This profile is made available by the International Color Consortium,
and may be copied, distributed, embedded, made, used, and sold without
restriction. Altered versions of this profile shall have the original
identification and copyright information removed and shall not be
misrepresented as the original profile."
See http://www.color.org/srgbprofiles.xalter
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37396
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
.../winspool.drv/sRGB_Color_Space_Profile.icm | Bin 0 -> 3024 bytes
dlls/winspool.drv/winspool.rc | 3 ++
dlls/winspool.drv/wspool.c | 38 ++++++++++++++++++
dlls/winspool.drv/wspool.h | 2 +
4 files changed, 43 insertions(+)
create mode 100644 dlls/winspool.drv/sRGB_Color_Space_Profile.icm
diff --git a/dlls/winspool.drv/sRGB_Color_Space_Profile.icm b/dlls/winspool.drv/sRGB_Color_Space_Profile.icm
new file mode 100644
index 0000000000000000000000000000000000000000..49afbfef10f22a1832590b68369d2f248ea553b9
GIT binary patch
literal 3024
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
literal 0
HcmV?d00001
diff --git a/dlls/winspool.drv/winspool.rc b/dlls/winspool.drv/winspool.rc
index 50772ce60bb..1b573be096e 100644
--- a/dlls/winspool.drv/winspool.rc
+++ b/dlls/winspool.drv/winspool.rc
@@ -47,6 +47,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* @makedep: generic.ppd */
1 PPDFILE generic.ppd
+/* @makedep: sRGB_Color_Space_Profile.icm */
+IDR_SRGB_ICM RCDATA sRGB_Color_Space_Profile.icm
+
#define WINE_FILENAME_STR "winspool.drv"
#define WINE_FILEDESCRIPTION_STR "Wine core printer driver"
diff --git a/dlls/winspool.drv/wspool.c b/dlls/winspool.drv/wspool.c
index bbfb0fb0f42..baa7bfdb455 100644
--- a/dlls/winspool.drv/wspool.c
+++ b/dlls/winspool.drv/wspool.c
@@ -104,6 +104,43 @@ BOOL load_backend(void)
return FALSE;
}
+static void create_color_profiles(void)
+{
+ static const WCHAR color_dir[] = {'\\','s','p','o','o','l',
+ '\\','d','r','i','v','e','r','s',
+ '\\','c','o','l','o','r','\\',0};
+ static const WCHAR srgb_icm[] = {'s','R','G','B',' ',
+ 'C','o','l','o','r',' ',
+ 'S','p','a','c','e',' ',
+ 'P','r','o','f','i','l','e','.','i','c','m',0};
+ WCHAR profile_path[MAX_PATH];
+ HANDLE file;
+ HRSRC res;
+ DWORD size, written;
+ char *data;
+ BOOL ret;
+
+ GetSystemDirectoryW(profile_path, ARRAY_SIZE(profile_path));
+ lstrcatW(profile_path, color_dir);
+ lstrcatW(profile_path, srgb_icm);
+
+ file = CreateFileW(profile_path, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (file == INVALID_HANDLE_VALUE)
+ return;
+
+ ret = ((res = FindResourceA(WINSPOOL_hInstance, MAKEINTRESOURCEA(IDR_SRGB_ICM), (const char *)RT_RCDATA)) &&
+ (size = SizeofResource(WINSPOOL_hInstance, res)) &&
+ (data = LoadResource(WINSPOOL_hInstance, res)) &&
+ WriteFile(file, data, size, &written, NULL) &&
+ written == size);
+ CloseHandle(file);
+ if (!ret)
+ {
+ ERR("Failed to create %s\n", wine_dbgstr_w(profile_path));
+ DeleteFileW(profile_path);
+ }
+}
+
/******************************************************************************
* DllMain
*
@@ -118,6 +155,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD reason, LPVOID lpReserved)
WINSPOOL_hInstance = hInstance;
DisableThreadLibraryCalls(hInstance);
WINSPOOL_LoadSystemPrinters();
+ create_color_profiles();
break;
}
case DLL_PROCESS_DETACH:
diff --git a/dlls/winspool.drv/wspool.h b/dlls/winspool.drv/wspool.h
index 06c28231330..a229b1ffe88 100644
--- a/dlls/winspool.drv/wspool.h
+++ b/dlls/winspool.drv/wspool.h
@@ -33,5 +33,7 @@ extern void WINSPOOL_LoadSystemPrinters(void) DECLSPEC_HIDDEN;
#define IDS_FILE_EXISTS 11
#define IDS_CANNOT_OPEN 12
+#define IDR_SRGB_ICM 2
+
#define FILENAME_DIALOG 100
#define EDITBOX 201
--
2.28.0

View File

@@ -1,33 +0,0 @@
From d037faddfa629e54b5ba13d57f2e4c185de2a555 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Tue, 4 Nov 2014 22:25:58 +0100
Subject: d3dx9_36: No need to fail if we don't support vertices reordering in
D3DXMESHOPT_ATTRSORT
A non optimized mesh does not prevent rendering as long as we return valid data to the application.
In our case we provided an identity remapping array when no vertices reordering is done.
Avencast demo works perfectly well (using native effects functions).
---
dlls/d3dx9_36/mesh.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index 6f268f2..b15e033 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -1700,11 +1700,7 @@ static HRESULT WINAPI d3dx9_mesh_OptimizeInplace(ID3DXMesh *iface, DWORD flags,
if (FAILED(hr)) goto cleanup;
} else if (flags & D3DXMESHOPT_ATTRSORT) {
if (!(flags & D3DXMESHOPT_IGNOREVERTS))
- {
FIXME("D3DXMESHOPT_ATTRSORT vertex reordering not implemented.\n");
- hr = E_NOTIMPL;
- goto cleanup;
- }
hr = iface->lpVtbl->LockAttributeBuffer(iface, 0, &attrib_buffer);
if (FAILED(hr)) goto cleanup;
--
2.1.3

View File

@@ -1 +0,0 @@
Fixes: [48529] Avencast fails to launch

View File

@@ -1,4 +1,4 @@
From cec8dd343a831fb7016a219c8e7228b8872e1fb9 Mon Sep 17 00:00:00 2001
From 70a09ccf3108ded29c3049ab3ee5aea843b43215 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 15 Aug 2015 02:59:17 +0200
Subject: [PATCH] dxdiagn: Enumerate DirectSound devices and add some basic
@@ -6,9 +6,9 @@ Subject: [PATCH] dxdiagn: Enumerate DirectSound devices and add some basic
---
dlls/dxdiagn/Makefile.in | 2 +-
dlls/dxdiagn/provider.c | 91 +++++++++++++++++++++
dlls/dxdiagn/tests/container.c | 141 +++++++++++++++++++++++++++++++++
3 files changed, 233 insertions(+), 1 deletion(-)
dlls/dxdiagn/provider.c | 91 +++++++++++++++++++++++
dlls/dxdiagn/tests/container.c | 131 +++++++++++++++++++++++++++++++++
3 files changed, 223 insertions(+), 1 deletion(-)
diff --git a/dlls/dxdiagn/Makefile.in b/dlls/dxdiagn/Makefile.in
index fa4b611f245..88c99803b06 100644
@@ -149,22 +149,10 @@ index 6b6f4e640cc..4ae5046b818 100644
}
diff --git a/dlls/dxdiagn/tests/container.c b/dlls/dxdiagn/tests/container.c
index 90287ad0e74..e8d5ac33a83 100644
index c011ff9cc07..3f9f9d6d29f 100644
--- a/dlls/dxdiagn/tests/container.c
+++ b/dlls/dxdiagn/tests/container.c
@@ -36,6 +36,11 @@ static IDxDiagContainer *pddc;
static const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0};
static const WCHAR DxDiag_DisplayDevices[] = {'D','x','D','i','a','g','_','D','i','s','p','l','a','y','D','e','v','i','c','e','s',0};
+static const WCHAR DxDiag_SoundDevices[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d','.',
+ 'D','x','D','i','a','g','_','S','o','u','n','d','D','e','v','i','c','e','s',0};
+static const WCHAR DxDiag_SoundCaptureDevices[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d','.',
+ 'D','x','D','i','a','g','_','S','o','u','n','d','C','a','p','t','u','r','e',
+ 'D','e','v','i','c','e','s',0};
static BOOL create_root_IDxDiagContainer(void)
{
@@ -993,6 +998,140 @@ cleanup:
@@ -922,6 +922,135 @@ cleanup:
IDxDiagProvider_Release(pddp);
}
@@ -193,7 +181,7 @@ index 90287ad0e74..e8d5ac33a83 100644
+ return;
+ }
+
+ hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SoundDevices, &sound_cont);
+ hr = IDxDiagContainer_GetChildContainer(pddc, L"DxDiag_SoundDevices", &sound_cont);
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
+
+ if (hr != S_OK)
@@ -237,17 +225,12 @@ index 90287ad0e74..e8d5ac33a83 100644
+
+static void test_DxDiag_SoundCaptureDevices(void)
+{
+ static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0};
+ static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
+ static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
+ static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
+
+ static const struct property_test property_tests[] =
+ {
+ {szDescription, VT_BSTR},
+ {szGuidDeviceID, VT_BSTR},
+ {szDriverName, VT_BSTR},
+ {szDriverPath, VT_BSTR},
+ {L"szDescription", VT_BSTR},
+ {L"szGuidDeviceID", VT_BSTR},
+ {L"szDriverPath", VT_BSTR},
+ {L"szDriverName", VT_BSTR},
+ };
+
+ IDxDiagContainer *sound_cont = NULL;
@@ -260,7 +243,7 @@ index 90287ad0e74..e8d5ac33a83 100644
+ return;
+ }
+
+ hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SoundCaptureDevices, &sound_cont);
+ hr = IDxDiagContainer_GetChildContainer(pddc, L"DxDiag_SoundCaptureDevices", &sound_cont);
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
+
+ if (hr != S_OK)
@@ -305,7 +288,7 @@ index 90287ad0e74..e8d5ac33a83 100644
START_TEST(container)
{
CoInitialize(NULL);
@@ -1007,5 +1146,7 @@ START_TEST(container)
@@ -936,5 +1065,7 @@ START_TEST(container)
test_root_children();
test_DxDiag_SystemInfo();
test_DxDiag_DisplayDevices();
@@ -314,5 +297,5 @@ index 90287ad0e74..e8d5ac33a83 100644
CoUninitialize();
}
--
2.24.0
2.28.0

View File

@@ -1,4 +1,4 @@
From d1aa9a4e9abd6db9d164d390fa7e942a10efc5cd Mon Sep 17 00:00:00 2001
From 8f0d1a97147714cdee9f69781f6b919bf005aed0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 15 Aug 2015 03:58:04 +0200
Subject: [PATCH] dxdiagn: Calling GetChildContainer with an empty string on a
@@ -32,11 +32,11 @@ index 87d593a15a7..d84f185a795 100644
return hr;
}
diff --git a/dlls/dxdiagn/tests/container.c b/dlls/dxdiagn/tests/container.c
index c80717cd392..7f09fb5cb82 100644
index 18423779075..350b46a0253 100644
--- a/dlls/dxdiagn/tests/container.c
+++ b/dlls/dxdiagn/tests/container.c
@@ -901,7 +901,8 @@ static void test_DxDiag_SystemInfo(void)
{szProcessorEnglish, VT_BSTR},
@@ -819,7 +819,8 @@ static void test_DxDiag_SystemInfo(void)
{L"szProcessorEnglish", VT_BSTR},
};
- IDxDiagContainer *container;
@@ -45,17 +45,17 @@ index c80717cd392..7f09fb5cb82 100644
HRESULT hr;
if (!create_root_IDxDiagContainer())
@@ -910,6 +911,9 @@ static void test_DxDiag_SystemInfo(void)
@@ -828,6 +829,9 @@ static void test_DxDiag_SystemInfo(void)
return;
}
+ hr = IDxDiagContainer_GetChildContainer(pddc, empty, &container2);
+ ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
+
hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SystemInfo, &container);
hr = IDxDiagContainer_GetChildContainer(pddc, L"DxDiag_SystemInfo", &container);
ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
@@ -917,6 +921,14 @@ static void test_DxDiag_SystemInfo(void)
@@ -835,6 +839,14 @@ static void test_DxDiag_SystemInfo(void)
{
trace("Testing container DxDiag_SystemInfo\n");
test_container_properties(container, property_tests, ARRAY_SIZE(property_tests));
@@ -70,7 +70,7 @@ index c80717cd392..7f09fb5cb82 100644
IDxDiagContainer_Release(container);
}
@@ -1033,6 +1045,7 @@ static void test_DxDiag_SoundDevices(void)
@@ -928,6 +940,7 @@ static void test_DxDiag_SoundDevices(void)
static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
@@ -78,7 +78,7 @@ index c80717cd392..7f09fb5cb82 100644
static const struct property_test property_tests[] =
{
@@ -1072,7 +1085,7 @@ static void test_DxDiag_SoundDevices(void)
@@ -967,7 +980,7 @@ static void test_DxDiag_SoundDevices(void)
for (i = 0; i < count; i++)
{
WCHAR child_container[256];
@@ -87,7 +87,7 @@ index c80717cd392..7f09fb5cb82 100644
hr = IDxDiagContainer_EnumChildContainerNames(sound_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR));
ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
@@ -1085,6 +1098,14 @@ static void test_DxDiag_SoundDevices(void)
@@ -980,6 +993,14 @@ static void test_DxDiag_SoundDevices(void)
trace("Testing container %s\n", wine_dbgstr_w(child_container));
test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
}
@@ -103,5 +103,5 @@ index c80717cd392..7f09fb5cb82 100644
}
--
2.20.1
2.28.0

View File

@@ -1,172 +0,0 @@
From cafe4ce8b7c5d0d3c9df47277e6cd53bb8e71b32 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 15 Aug 2015 07:41:17 +0200
Subject: [PATCH] gdi32: Perform lazy initialization of fonts to improve
startup performance.
---
dlls/gdi32/dc.c | 8 +++----
dlls/gdi32/freetype.c | 49 ++++++++++++++++++++++++++++++-------------
2 files changed, 37 insertions(+), 20 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index c24b96e2750..ecc095dffec 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -148,11 +148,9 @@ DC *alloc_dc_ptr( WORD magic )
}
dc->nulldrv.hdc = dc->hSelf;
- if (font_driver && !font_driver->pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL ))
- {
- free_dc_ptr( dc );
- return NULL;
- }
+ if (font_driver)
+ font_driver->pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL );
+
return dc;
}
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 31ad56706ac..91cd6327431 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -108,6 +108,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(font);
+static RTL_RUN_ONCE init_once = RTL_RUN_ONCE_INIT;
+static DWORD WINAPI freetype_lazy_init(RTL_RUN_ONCE *once, void *param, void **context);
+
#ifdef HAVE_FREETYPE
#ifndef HAVE_FT_TRUETYPEENGINETYPE
@@ -3291,6 +3294,7 @@ INT WineEngAddFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
WCHAR path[MAX_PATH];
INT ret = 0;
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
GDI_CheckNotLock();
if (ft_handle) /* do it only if we have freetype up and running */
@@ -3325,6 +3329,7 @@ INT WineEngAddFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
*/
HANDLE WineEngAddFontMemResourceEx(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts)
{
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
GDI_CheckNotLock();
if (ft_handle) /* do it only if we have freetype up and running */
@@ -3364,6 +3369,7 @@ BOOL WineEngRemoveFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
WCHAR path[MAX_PATH];
INT ret = 0;
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
GDI_CheckNotLock();
if (ft_handle) /* do it only if we have freetype up and running */
@@ -3677,10 +3683,13 @@ static BOOL create_fot( const WCHAR *resource, const WCHAR *font_file, const str
BOOL WineEngCreateScalableFontResource( DWORD hidden, LPCWSTR resource,
LPCWSTR font_file, LPCWSTR font_path )
{
- char *unix_name = get_ttf_file_name( font_file, font_path );
+ char *unix_name;
struct fontdir fontdir;
BOOL ret = FALSE;
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
+
+ unix_name = get_ttf_file_name( font_file, font_path );
if (!unix_name || !get_fontdir( unix_name, &fontdir ))
SetLastError( ERROR_INVALID_PARAMETER );
else
@@ -4194,8 +4203,6 @@ static BOOL init_freetype(void)
FT_UInt interpreter_version = 35;
pFT_Property_Set( library, "truetype", "interpreter-version", &interpreter_version );
}
-
- font_driver = &freetype_funcs;
return TRUE;
sym_not_found:
@@ -4366,21 +4373,13 @@ static void reorder_font_list(void)
default_sans = set_default( default_sans_list );
}
-/*************************************************************
- * WineEngInit
- *
- * Initialize FreeType library and create a list of available faces
- */
-BOOL WineEngInit(void)
+static DWORD WINAPI freetype_lazy_init(RTL_RUN_ONCE *once, void *param, void **context)
{
HKEY hkey;
DWORD disposition;
HANDLE font_mutex;
- /* update locale dependent font info in registry */
- update_font_info();
-
- if(!init_freetype()) return FALSE;
+ if(!init_freetype()) return TRUE;
#ifdef SONAME_LIBFONTCONFIG
init_fontconfig();
@@ -4406,7 +4405,7 @@ BOOL WineEngInit(void)
if((font_mutex = CreateMutexW(NULL, FALSE, font_mutex_nameW)) == NULL)
{
ERR("Failed to create font mutex\n");
- return FALSE;
+ return TRUE;
}
WaitForSingleObject(font_mutex, INFINITE);
@@ -4433,6 +4432,21 @@ BOOL WineEngInit(void)
return TRUE;
}
+/*************************************************************
+ * WineEngInit
+ *
+ * Initialize FreeType library and create a list of available faces
+ */
+BOOL WineEngInit(void)
+{
+ /* update locale dependent font info in registry */
+ update_font_info();
+
+ /* The rest will be initialized later in freetype_lazy_init */
+ font_driver = &freetype_funcs;
+ return TRUE;
+}
+
/* Some fonts have large usWinDescent values, as a result of storing signed short
in unsigned field. That's probably caused by sTypoDescent vs usWinDescent confusion in
some font generation tools. */
@@ -5175,8 +5189,12 @@ static BOOL select_charmap(FT_Face ft_face, FT_Encoding encoding)
static BOOL CDECL freetype_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW *devmode )
{
- struct freetype_physdev *physdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physdev) );
+ struct freetype_physdev *physdev;
+
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
+ if (!ft_handle) return FALSE;
+ physdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physdev) );
if (!physdev) return FALSE;
push_dc_driver( dev, &physdev->dev, &freetype_funcs );
return TRUE;
@@ -8753,6 +8771,7 @@ static BOOL CDECL freetype_FontIsLinked( PHYSDEV dev )
*/
BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
{
+ /* RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL ); */
lprs->nSize = sizeof(RASTERIZER_STATUS);
lprs->wFlags = TT_AVAILABLE | TT_ENABLED;
lprs->nLanguageID = 0;
--
2.25.1

View File

@@ -1,2 +0,0 @@
Fixes: Improve startup performance by delaying font initialization

View File

@@ -1,4 +1,4 @@
From e31513df269b2ba58f0dc11cc5494b9db1e05cd4 Mon Sep 17 00:00:00 2001
From aedc3b18250733d5390e88ba451ee58d517eff3b Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Tue, 19 Apr 2016 07:33:32 +0200
Subject: [PATCH] kernel32: Implement GetSystemDEPPolicy().
@@ -8,18 +8,18 @@ Subject: [PATCH] kernel32: Implement GetSystemDEPPolicy().
1 file changed, 68 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index cf97affd6faf..78f80c5210f0 100644
index e8e1e61b354..639c39460d9 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -51,6 +51,7 @@
#include "winbase.h"
@@ -33,6 +33,7 @@
#include "winnls.h"
#include "wincon.h"
#include "kernel_private.h"
+#include "winreg.h"
#include "psapi.h"
#include "wine/exception.h"
#include "wine/server.h"
@@ -671,8 +672,73 @@ DWORD WINAPI WTSGetActiveConsoleSessionId(void)
@@ -560,8 +561,73 @@ DWORD WINAPI WTSGetActiveConsoleSessionId(void)
*/
DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy(void)
{
@@ -96,5 +96,5 @@ index cf97affd6faf..78f80c5210f0 100644
/**********************************************************************
--
2.26.2
2.28.0

View File

@@ -1,422 +0,0 @@
From 139b483754aee0188f68109dc593df6eb9e083c4 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 30 Mar 2020 14:19:35 -0500
Subject: [PATCH 01/52] winegstreamer: Add a GstPad wrapping the media source's
bytestream.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/gst_cbs.c | 58 ++++++++
dlls/winegstreamer/gst_cbs.h | 12 +-
dlls/winegstreamer/main.c | 3 +
dlls/winegstreamer/media_source.c | 219 +++++++++++++++++++++++++++++-
4 files changed, 288 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c
index bf7103b1606..8f48368c96a 100644
--- a/dlls/winegstreamer/gst_cbs.c
+++ b/dlls/winegstreamer/gst_cbs.c
@@ -49,6 +49,8 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
if (cbdata->type < GSTDEMUX_MAX)
perform_cb_gstdemux(cbdata);
+ else if (cbdata->type < MEDIA_SOURCE_MAX)
+ perform_cb_media_source(cbdata);
pthread_mutex_lock(&cbdata->lock);
cbdata->finished = 1;
@@ -301,3 +303,59 @@ gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query)
return cbdata.u.query_sink_data.ret;
}
+
+GstFlowReturn pull_from_bytestream_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len,
+ GstBuffer **buf)
+{
+ struct cb_data cbdata = { PULL_FROM_BYTESTREAM };
+
+ cbdata.u.getrange_data.pad = pad;
+ cbdata.u.getrange_data.parent = parent;
+ cbdata.u.getrange_data.ofs = ofs;
+ cbdata.u.getrange_data.len = len;
+ cbdata.u.getrange_data.buf = buf;
+
+ call_cb(&cbdata);
+
+ return cbdata.u.getrange_data.ret;
+}
+
+gboolean query_bytestream_wrapper(GstPad *pad, GstObject *parent, GstQuery *query)
+{
+ struct cb_data cbdata = { QUERY_BYTESTREAM };
+
+ cbdata.u.query_function_data.pad = pad;
+ cbdata.u.query_function_data.parent = parent;
+ cbdata.u.query_function_data.query = query;
+
+ call_cb(&cbdata);
+
+ return cbdata.u.query_function_data.ret;
+}
+
+gboolean activate_bytestream_pad_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate)
+{
+ struct cb_data cbdata = { ACTIVATE_BYTESTREAM_PAD_MODE };
+
+ cbdata.u.activate_mode_data.pad = pad;
+ cbdata.u.activate_mode_data.parent = parent;
+ cbdata.u.activate_mode_data.mode = mode;
+ cbdata.u.activate_mode_data.activate = activate;
+
+ call_cb(&cbdata);
+
+ return cbdata.u.activate_mode_data.ret;
+}
+
+gboolean process_bytestream_pad_event_wrapper(GstPad *pad, GstObject *parent, GstEvent *event)
+{
+ struct cb_data cbdata = { PROCESS_BYTESTREAM_PAD_EVENT };
+
+ cbdata.u.event_src_data.pad = pad;
+ cbdata.u.event_src_data.parent = parent;
+ cbdata.u.event_src_data.event = event;
+
+ call_cb(&cbdata);
+
+ return cbdata.u.event_src_data.ret;
+}
diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h
index 4725f23ad1a..10e999feea7 100644
--- a/dlls/winegstreamer/gst_cbs.h
+++ b/dlls/winegstreamer/gst_cbs.h
@@ -43,7 +43,12 @@ enum CB_TYPE {
AUTOPLUG_BLACKLIST,
UNKNOWN_TYPE,
QUERY_SINK,
- GSTDEMUX_MAX
+ GSTDEMUX_MAX,
+ PULL_FROM_BYTESTREAM,
+ QUERY_BYTESTREAM,
+ ACTIVATE_BYTESTREAM_PAD_MODE,
+ PROCESS_BYTESTREAM_PAD_EVENT,
+ MEDIA_SOURCE_MAX,
};
struct cb_data {
@@ -138,6 +143,7 @@ struct cb_data {
void mark_wine_thread(void) DECLSPEC_HIDDEN;
void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN;
+void perform_cb_media_source(struct cb_data *data) DECLSPEC_HIDDEN;
GstBusSyncReply watch_bus_wrapper(GstBus *bus, GstMessage *msg, gpointer user) DECLSPEC_HIDDEN;
void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
@@ -154,5 +160,9 @@ GstAutoplugSelectResult autoplug_blacklist_wrapper(GstElement *bin, GstPad *pad,
void unknown_type_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) DECLSPEC_HIDDEN;
void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
+GstFlowReturn pull_from_bytestream_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN;
+gboolean query_bytestream_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
+gboolean activate_bytestream_pad_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN;
+gboolean process_bytestream_pad_event_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN;
#endif
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index 2872710b3e2..4ca371d58bd 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -146,6 +146,9 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
TRACE("clsid %s, iid %s, out %p.\n", debugstr_guid(clsid), debugstr_guid(iid), out);
+ if (!init_gstreamer())
+ return CLASS_E_CLASSNOTAVAILABLE;
+
if (SUCCEEDED(hr = mfplat_get_class_object(clsid, iid, out)))
return hr;
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 84ecf305d4c..6b3bd4a7869 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -17,7 +17,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+
+#include <gst/gst.h>
+
#include "gst_private.h"
+#include "gst_cbs.h"
#include <stdarg.h>
@@ -27,6 +32,7 @@
#include "mfapi.h"
#include "mferror.h"
#include "mfidl.h"
+#include "mfobjects.h"
#include "wine/debug.h"
#include "wine/heap.h"
@@ -39,6 +45,8 @@ struct media_source
IMFMediaSource IMFMediaSource_iface;
LONG ref;
IMFMediaEventQueue *event_queue;
+ IMFByteStream *byte_stream;
+ GstPad *my_src;
enum
{
SOURCE_OPENING,
@@ -52,6 +60,154 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac
return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface);
}
+GstFlowReturn pull_from_bytestream(GstPad *pad, GstObject *parent, guint64 ofs, guint len,
+ GstBuffer **buf)
+{
+ struct media_source *source = gst_pad_get_element_private(pad);
+ IMFByteStream *byte_stream = source->byte_stream;
+ ULONG bytes_read;
+ GstMapInfo info;
+ BOOL is_eof;
+ HRESULT hr;
+
+ TRACE("gstreamer requesting %u bytes at %s from source %p into buffer %p\n", len, wine_dbgstr_longlong(ofs), source, buf);
+
+ if (ofs != GST_BUFFER_OFFSET_NONE)
+ {
+ if (FAILED(IMFByteStream_SetCurrentPosition(byte_stream, ofs)))
+ return GST_FLOW_ERROR;
+ }
+
+ if (FAILED(IMFByteStream_IsEndOfStream(byte_stream, &is_eof)))
+ return GST_FLOW_ERROR;
+ if (is_eof)
+ return GST_FLOW_EOS;
+
+ if (!(*buf))
+ *buf = gst_buffer_new_and_alloc(len);
+ gst_buffer_map(*buf, &info, GST_MAP_WRITE);
+ hr = IMFByteStream_Read(byte_stream, info.data, len, &bytes_read);
+ gst_buffer_unmap(*buf, &info);
+
+ gst_buffer_set_size(*buf, bytes_read);
+
+ if (FAILED(hr))
+ {
+ return GST_FLOW_ERROR;
+ }
+ GST_BUFFER_OFFSET(*buf) = ofs;
+ return GST_FLOW_OK;
+}
+
+static gboolean query_bytestream(GstPad *pad, GstObject *parent, GstQuery *query)
+{
+ struct media_source *source = gst_pad_get_element_private(pad);
+ GstFormat format;
+ QWORD bytestream_len;
+
+ TRACE("GStreamer queries source %p for %s\n", source, GST_QUERY_TYPE_NAME(query));
+
+ if (FAILED(IMFByteStream_GetLength(source->byte_stream, &bytestream_len)))
+ return FALSE;
+
+ switch (GST_QUERY_TYPE(query))
+ {
+ case GST_QUERY_DURATION:
+ {
+ gst_query_parse_duration (query, &format, NULL);
+ if (format == GST_FORMAT_PERCENT) {
+ gst_query_set_duration (query, GST_FORMAT_PERCENT, GST_FORMAT_PERCENT_MAX);
+ return TRUE;
+ }
+ else if (format == GST_FORMAT_BYTES)
+ {
+ QWORD length;
+ IMFByteStream_GetLength(source->byte_stream, &length);
+ gst_query_set_duration (query, GST_FORMAT_BYTES, length);
+ return TRUE;
+ }
+ return FALSE;
+ }
+ case GST_QUERY_SEEKING:
+ {
+ gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
+ if (format != GST_FORMAT_BYTES)
+ {
+ WARN("Cannot seek using format \"%s\".\n", gst_format_get_name(format));
+ return FALSE;
+ }
+ gst_query_set_seeking(query, GST_FORMAT_BYTES, 1, 0, bytestream_len);
+ return TRUE;
+ }
+ case GST_QUERY_SCHEDULING:
+ {
+ gst_query_set_scheduling(query, GST_SCHEDULING_FLAG_SEEKABLE, 1, -1, 0);
+ gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL);
+ return TRUE;
+ }
+ case GST_QUERY_CAPS:
+ {
+ GstStaticCaps any = GST_STATIC_CAPS_ANY;
+ GstCaps *caps, *filter;
+
+ caps = gst_static_caps_get(&any);
+ gst_query_parse_caps(query, &filter);
+
+ if (filter) {
+ GstCaps* filtered;
+ filtered = gst_caps_intersect_full(
+ filter, caps, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref(caps);
+ caps = filtered;
+ }
+ gst_query_set_caps_result(query, caps);
+ gst_caps_unref(caps);
+ return TRUE;
+ }
+ default:
+ {
+ WARN("Unhandled query type %s\n", GST_QUERY_TYPE_NAME(query));
+ return FALSE;
+ }
+ }
+}
+
+static gboolean activate_bytestream_pad_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate)
+{
+ struct media_source *source = gst_pad_get_element_private(pad);
+
+ TRACE("%s source pad for mediasource %p in %s mode.\n",
+ activate ? "Activating" : "Deactivating", source, gst_pad_mode_get_name(mode));
+
+ switch (mode) {
+ case GST_PAD_MODE_PULL:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ return FALSE;
+}
+
+static gboolean process_bytestream_pad_event(GstPad *pad, GstObject *parent, GstEvent *event)
+{
+ struct media_source *source = gst_pad_get_element_private(pad);
+
+ TRACE("source %p, type \"%s\".\n", source, GST_EVENT_TYPE_NAME(event));
+
+ switch (event->type) {
+ /* the seek event should fail in pull mode */
+ case GST_EVENT_SEEK:
+ return FALSE;
+ default:
+ WARN("Ignoring \"%s\" event.\n", GST_EVENT_TYPE_NAME(event));
+ case GST_EVENT_TAG:
+ case GST_EVENT_QOS:
+ case GST_EVENT_RECONFIGURE:
+ return gst_pad_event_default(pad, parent, event);
+ }
+ return TRUE;
+}
+
static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out)
{
struct media_source *source = impl_from_IMFMediaSource(iface);
@@ -211,8 +367,12 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface)
source->state = SOURCE_SHUTDOWN;
+ if (source->my_src)
+ gst_object_unref(GST_OBJECT(source->my_src));
if (source->event_queue)
IMFMediaEventQueue_Shutdown(source->event_queue);
+ if (source->byte_stream)
+ IMFByteStream_Release(source->byte_stream);
return S_OK;
}
@@ -236,19 +396,34 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl =
static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_source **out_media_source)
{
+ GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE(
+ "mf_src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS_ANY);
+
struct media_source *object = heap_alloc_zero(sizeof(*object));
HRESULT hr;
if (!object)
return E_OUTOFMEMORY;
+ object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl;
+ object->ref = 1;
+ object->byte_stream = bytestream;
+ IMFByteStream_AddRef(bytestream);
+
if (FAILED(hr = MFCreateEventQueue(&object->event_queue)))
goto fail;
- object->state = SOURCE_STOPPED;
+ object->my_src = gst_pad_new_from_static_template(&src_template, "mf-src");
+ gst_pad_set_element_private(object->my_src, object);
+ gst_pad_set_getrange_function(object->my_src, pull_from_bytestream_wrapper);
+ gst_pad_set_query_function(object->my_src, query_bytestream_wrapper);
+ gst_pad_set_activatemode_function(object->my_src, activate_bytestream_pad_mode_wrapper);
+ gst_pad_set_event_function(object->my_src, process_bytestream_pad_event_wrapper);
- object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl;
- object->ref = 1;
+ object->state = SOURCE_STOPPED;
*out_media_source = object;
return S_OK;
@@ -717,3 +892,41 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj)
return hr;
}
+
+/* helper for callback forwarding */
+void perform_cb_media_source(struct cb_data *cbdata)
+{
+ switch(cbdata->type)
+ {
+ case PULL_FROM_BYTESTREAM:
+ {
+ struct getrange_data *data = &cbdata->u.getrange_data;
+ cbdata->u.getrange_data.ret = pull_from_bytestream(data->pad, data->parent,
+ data->ofs, data->len, data->buf);
+ break;
+ }
+ case QUERY_BYTESTREAM:
+ {
+ struct query_function_data *data = &cbdata->u.query_function_data;
+ cbdata->u.query_function_data.ret = query_bytestream(data->pad, data->parent, data->query);
+ break;
+ }
+ case ACTIVATE_BYTESTREAM_PAD_MODE:
+ {
+ struct activate_mode_data *data = &cbdata->u.activate_mode_data;
+ cbdata->u.activate_mode_data.ret = activate_bytestream_pad_mode(data->pad, data->parent, data->mode, data->activate);
+ break;
+ }
+ case PROCESS_BYTESTREAM_PAD_EVENT:
+ {
+ struct event_src_data *data = &cbdata->u.event_src_data;
+ cbdata->u.event_src_data.ret = process_bytestream_pad_event(data->pad, data->parent, data->event);
+ break;
+ }
+ default:
+ {
+ ERR("Wrong callback forwarder called\n");
+ return;
+ }
+ }
+}
--
2.28.0

View File

@@ -1,19 +1,33 @@
From c8effecf2d89b5169b03f4d71243729b68d4c3ba Mon Sep 17 00:00:00 2001
From 073dde743ea2fe54e93c50ea24bb83c59adaddd1 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 31 Mar 2020 15:11:31 -0500
Subject: [PATCH 04/52] winegstreamer: Insert parser into pipeline to rectify
type differences.
Date: Tue, 15 Sep 2020 14:25:26 -0500
Subject: [PATCH] winegstreamer: Insert parser into pipeline to rectify type
differences.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/media_source.c | 130 +++++++++++++++++++++++++++++-
1 file changed, 127 insertions(+), 3 deletions(-)
dlls/winegstreamer/gst_private.h | 1 +
dlls/winegstreamer/media_source.c | 149 +++++++++++++++++++++++++++++-
dlls/winegstreamer/mfplat.c | 22 +++++
3 files changed, 169 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 60b38a48f5a..7ec71d40800 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -56,6 +56,7 @@ void start_dispatch_thread(void) DECLSPEC_HIDDEN;
extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN;
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN;
+GstCaps *make_mf_compatible_caps(GstCaps *caps) DECLSPEC_HIDDEN;
IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN;
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN;
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 345b1fe4528..f1e8c5799f7 100644
index 29947e1554f..92b4100f7bc 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -432,6 +432,122 @@ static const IMFMediaStreamVtbl media_stream_vtbl =
@@ -403,6 +403,122 @@ static const IMFMediaStreamVtbl media_stream_vtbl =
media_stream_RequestSample
};
@@ -133,37 +147,100 @@ index 345b1fe4528..f1e8c5799f7 100644
+}
+
+
/* creates a stub stream */
static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD stream_id, struct media_stream **out_stream)
{
@@ -467,8 +583,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD
struct media_stream *object = heap_alloc_zero(sizeof(*object));
@@ -433,8 +549,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD
g_object_set(object->appsink, "sync", FALSE, NULL);
g_object_set(object->appsink, "max-buffers", 5, NULL);
g_object_set(object->appsink, "wait-on-eos", FALSE, NULL);
- object->my_sink = gst_element_get_static_pad(object->appsink, "sink");
- gst_pad_link(object->their_src, object->my_sink);
+ media_stream_align_with_mf(object);
gst_pad_add_probe(object->my_sink, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, caps_listener_wrapper, object, NULL);
gst_element_sync_state_with_parent(object->appsink);
@@ -494,7 +609,16 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
@@ -457,7 +572,16 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
IMFMediaType *stream_type = NULL;
HRESULT hr;
stream->their_caps = gst_caps_fixate(stream->their_caps);
- stream_type = mf_media_type_from_caps(stream->their_caps);
+ if (strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw") &&
+ strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw"))
- stream_type = mf_media_type_from_caps(current_caps);
+ if (strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw") &&
+ strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw"))
+ {
+ GstCaps *compatible_caps = make_mf_compatible_caps(stream->their_caps);
+ GstCaps *compatible_caps = make_mf_compatible_caps(current_caps);
+ stream_type = mf_media_type_from_caps(compatible_caps);
+ gst_caps_unref(compatible_caps);
+ }
+ else
+ stream_type = mf_media_type_from_caps(stream->their_caps);
+ stream_type = mf_media_type_from_caps(current_caps);
+
gst_caps_unref(stream->their_caps);
gst_caps_unref(current_caps);
if (!stream_type)
{
return E_FAIL;
@@ -687,6 +811,23 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl =
media_source_Shutdown,
};
+/* If this callback is extended to use any significant win32 APIs, a wrapper function
+ should be added */
+gboolean stream_found(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user)
+{
+ GstCaps *target_caps;
+
+ /* if the stream can be converted into an MF compatible type, we'll go that route
+ otherwise, we'll rely on decodebin for the whole process */
+
+ if ((target_caps = make_mf_compatible_caps(caps)))
+ {
+ gst_caps_unref(target_caps);
+ return FALSE;
+ }
+ return TRUE;
+}
+
static void stream_added(GstElement *element, GstPad *pad, gpointer user)
{
struct media_source *source = user;
@@ -787,6 +928,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
gst_bin_add(GST_BIN(object->container), object->decodebin);
+ if(!GetEnvironmentVariableA("MF_DECODE_IN_SOURCE", NULL, 0))
+ g_signal_connect(object->decodebin, "autoplug-continue", G_CALLBACK(stream_found), object);
g_signal_connect(object->decodebin, "pad-added", G_CALLBACK(mf_src_stream_added_wrapper), object);
g_signal_connect(object->decodebin, "pad-removed", G_CALLBACK(mf_src_stream_removed_wrapper), object);
g_signal_connect(object->decodebin, "no-more-pads", G_CALLBACK(mf_src_no_more_pads_wrapper), object);
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 2e8b0978648..a67cdef72fe 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -601,3 +601,25 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)
return media_type;
}
+
+GstCaps *make_mf_compatible_caps(GstCaps *caps)
+{
+ GstCaps *ret;
+ IMFMediaType *media_type;
+
+ if (gst_caps_get_size(caps) != 1)
+ return NULL;
+
+ ret = gst_caps_copy(caps);
+
+ if ((media_type = mf_media_type_from_caps(ret)))
+ IMFMediaType_Release(media_type);
+
+ if (!media_type)
+ {
+ gst_caps_unref(ret);
+ return NULL;
+ }
+
+ return ret;
+}
--
2.28.0

View File

@@ -1,19 +1,19 @@
From 862d76c09ef0005d40e63b271a03c98874f78828 Mon Sep 17 00:00:00 2001
From 99b43be87b11803938b12b08298406391b77d510 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 25 Aug 2020 17:35:49 -0500
Subject: [PATCH 05/52] winegstreamer: Insert videoconvert into decoded-video
Subject: [PATCH] winegstreamer: Insert videoconvert into decoded-video
streams.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/media_source.c | 104 ++++++++++++++++++++++++++----
1 file changed, 91 insertions(+), 13 deletions(-)
dlls/winegstreamer/media_source.c | 104 ++++++++++++++++++++++++------
1 file changed, 85 insertions(+), 19 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index f1e8c5799f7..209753608b6 100644
index 92b4100f7bc..a9aff0eb296 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -459,8 +459,22 @@ static HRESULT media_stream_align_with_mf(struct media_stream *stream)
@@ -430,8 +430,22 @@ static HRESULT media_stream_align_with_mf(struct media_stream *stream)
g_free(source_caps_str);
}
@@ -38,22 +38,21 @@ index f1e8c5799f7..209753608b6 100644
{
stream->my_sink = gst_element_get_static_pad(stream->appsink, "sink");
g_object_set(stream->appsink, "caps", source_caps, NULL);
@@ -605,45 +619,109 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
@@ -569,37 +583,89 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
{
HRESULT hr;
GstCaps *current_caps = gst_pad_get_current_caps(stream->their_src);
IMFMediaTypeHandler *type_handler;
+ IMFMediaType **stream_types = NULL;
IMFMediaType *stream_type = NULL;
+ DWORD type_count = 0;
+ unsigned int i;
HRESULT hr;
stream->their_caps = gst_caps_fixate(stream->their_caps);
- if (strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw") &&
- strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw"))
+ if (!strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw"))
- if (strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw") &&
- strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw"))
+ if (!strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw"))
{
- GstCaps *compatible_caps = make_mf_compatible_caps(stream->their_caps);
- GstCaps *compatible_caps = make_mf_compatible_caps(current_caps);
- stream_type = mf_media_type_from_caps(compatible_caps);
- gst_caps_unref(compatible_caps);
+ GstElementFactory *videoconvert_factory = gst_element_factory_find("videoconvert");
@@ -68,20 +67,16 @@ index f1e8c5799f7..209753608b6 100644
+ continue;
+ src_caps = gst_static_pad_template_get_caps(template);
+ gst_structure_get_list(gst_caps_get_structure(src_caps, 0), "format", &formats);
+ type_count = formats->n_values;
+ stream_types = heap_alloc( sizeof(IMFMediaType*) * type_count );
+ stream_types = heap_alloc( sizeof(IMFMediaType*) * formats->n_values );
+ for (i = 0; i < formats->n_values; i++)
+ {
+ GValue *format = g_value_array_get_nth(formats, i);
+ GstCaps *modified_caps = gst_caps_copy(stream->their_caps);
+ GstCaps *modified_caps = gst_caps_copy(current_caps);
+ gst_caps_set_value(modified_caps, "format", format);
+ stream_types[i] = mf_media_type_from_caps(modified_caps);
+ stream_types[type_count] = mf_media_type_from_caps(modified_caps);
+ gst_caps_unref(modified_caps);
+ if (!stream_types[i])
+ {
+ i--;
+ type_count--;
+ }
+ if (stream_types[type_count])
+ type_count++;
+ }
+ g_value_array_free(formats);
+ gst_caps_unref(src_caps);
@@ -89,9 +84,9 @@ index f1e8c5799f7..209753608b6 100644
+ }
}
- else
+ else if (!strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw"))
+ else if (!strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw"))
+ {
stream_type = mf_media_type_from_caps(stream->their_caps);
stream_type = mf_media_type_from_caps(current_caps);
+ if (stream_type)
+ {
+ stream_types = &stream_type;
@@ -100,7 +95,7 @@ index f1e8c5799f7..209753608b6 100644
+ }
+ else
+ {
+ GstCaps *compatible_caps = make_mf_compatible_caps(stream->their_caps);
+ GstCaps *compatible_caps = make_mf_compatible_caps(current_caps);
+ if (compatible_caps)
+ {
+ stream_type = mf_media_type_from_caps(compatible_caps);
@@ -113,49 +108,40 @@ index f1e8c5799f7..209753608b6 100644
+ }
+ }
gst_caps_unref(stream->their_caps);
gst_caps_unref(current_caps);
- if (!stream_type)
+
+ if (!type_count)
{
+ {
+ ERR("Failed to establish an IMFMediaType from any of the possible stream caps!\n");
hr = E_FAIL;
goto fail;
}
return E_FAIL;
+ }
- if (FAILED(hr = MFCreateStreamDescriptor(stream->stream_id, 1, &stream_type, &stream->descriptor)))
- hr = MFCreateStreamDescriptor(stream->stream_id, 1, &stream_type, &stream->descriptor);
-
- IMFMediaType_Release(stream_type);
-
- if (FAILED(hr))
- return hr;
+ if (FAILED(hr = MFCreateStreamDescriptor(stream->stream_id, type_count, stream_types, &stream->descriptor)))
goto fail;
+ goto done;
if (FAILED(hr = IMFStreamDescriptor_GetMediaTypeHandler(stream->descriptor, &type_handler)))
goto fail;
- if (FAILED(hr = IMFMediaTypeHandler_SetCurrentMediaType(type_handler, stream_type)))
+ if (FAILED(hr = IMFMediaTypeHandler_SetCurrentMediaType(type_handler, stream_types[0])))
goto fail;
- return hr;
-
- hr = IMFMediaTypeHandler_SetCurrentMediaType(type_handler, stream_type);
+ goto done;
- IMFMediaTypeHandler_Release(type_handler);
-
stream->state = STREAM_INACTIVE;
+ if (FAILED(hr = IMFMediaTypeHandler_SetCurrentMediaType(type_handler, stream_types[0])))
+ goto done;
+ IMFMediaTypeHandler_Release(type_handler);
+done:
+ if (type_handler)
+ IMFMediaTypeHandler_Release(type_handler);
+ for (i = 0; i < type_count; i++)
+ IMFMediaType_Release(stream_types[i]);
+ if (stream_types != &stream_type)
+ heap_free(stream_types);
+
return S_OK;
fail:
ERR("media stream initialization failed with %x\n", hr);
if (type_handler)
IMFMediaTypeHandler_Release(type_handler);
+ if (stream_types)
+ {
+ for (i = 0; i < type_count; i++)
+ IMFMediaType_Release(stream_types[i]);
+ if (stream_types != &stream_type)
+ heap_free(stream_types);
+ }
return hr;
}

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