Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
September 2020
- 79 participants
- 771 discussions
[PATCH 1/2] ntdll: Implement saving AVX registers in NtGetContextThread().
by Paul Gofman 02 Sep '20
by Paul Gofman 02 Sep '20
02 Sep '20
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/ntdll/unix/signal_i386.c | 58 ++++++++++++++++++++++++++++++--
dlls/ntdll/unix/signal_x86_64.c | 59 +++++++++++++++++++++++++++++++--
2 files changed, 113 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
index 5d4d1469472..45482b819cc 100644
--- a/dlls/ntdll/unix/signal_i386.c
+++ b/dlls/ntdll/unix/signal_i386.c
@@ -683,6 +683,56 @@ static inline void save_fpux( CONTEXT *context )
}
+/***********************************************************************
+ * save_xstate
+ *
+ * Save the XState context
+ */
+static inline NTSTATUS save_xstate( CONTEXT *context )
+{
+ CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
+ DECLSPEC_ALIGN(64) struct
+ {
+ XSAVE_FORMAT xsave;
+ XSTATE xstate;
+ }
+ xsave_area;
+ XSTATE *xs;
+
+ if (!(user_shared_data->XState.EnabledFeatures && (xs = xstate_from_context( context ))))
+ return STATUS_SUCCESS;
+
+ if (context_ex->XState.Length < offsetof(XSTATE, YmmContext)
+ || context_ex->XState.Length > sizeof(XSTATE))
+ return STATUS_INVALID_PARAMETER;
+
+ if (user_shared_data->XState.CompactionEnabled)
+ {
+ /* xsavec doesn't use anything from the save area. */
+ __asm__ volatile( "xsavec %0" : "=m"(xsave_area)
+ : "a" ((unsigned int)(xs->CompactionMask & (1 << XSTATE_AVX))), "d" (0) );
+ }
+ else
+ {
+ /* xsave preserves those bits in the mask which are not in EDX:EAX, so zero it. */
+ xsave_area.xstate.Mask = xsave_area.xstate.CompactionMask = 0;
+ __asm__ volatile( "xsave %0" : "=m"(xsave_area)
+ : "a" ((unsigned int)(xs->Mask & (1 << XSTATE_AVX))), "d" (0) );
+ }
+
+ memcpy(xs, &xsave_area.xstate, offsetof(XSTATE, YmmContext));
+ if (xs->Mask & (1 << XSTATE_AVX))
+ {
+ if (context_ex->XState.Length < sizeof(XSTATE))
+ return STATUS_BUFFER_OVERFLOW;
+
+ memcpy(&xs->YmmContext, &xsave_area.xstate.YmmContext, sizeof(xs->YmmContext));
+ }
+
+ return STATUS_SUCCESS;
+}
+
+
/***********************************************************************
* restore_fpu
*
@@ -1189,11 +1239,15 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
*/
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
{
- NTSTATUS ret;
+ NTSTATUS ret, xsave_status;
struct syscall_frame *frame = x86_thread_data()->syscall_frame;
DWORD needed_flags = context->ContextFlags & ~CONTEXT_i386;
BOOL self = (handle == GetCurrentThread());
+ /* Save xstate before any calls which can potentially change volatile ymm registers.
+ * E. g., debug output will clobber ymm registers. */
+ xsave_status = self ? save_xstate( context ) : STATUS_SUCCESS; /* FIXME: other thread. */
+
/* debug registers require a server call */
if (needed_flags & CONTEXT_DEBUG_REGISTERS) self = FALSE;
@@ -1265,7 +1319,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
TRACE( "%p: dr0=%08x dr1=%08x dr2=%08x dr3=%08x dr6=%08x dr7=%08x\n", handle,
context->Dr0, context->Dr1, context->Dr2, context->Dr3, context->Dr6, context->Dr7 );
- return STATUS_SUCCESS;
+ return xsave_status;
}
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index c77d65f8678..a0ad49815a4 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -1481,6 +1481,56 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
}
+/***********************************************************************
+ * save_xstate
+ *
+ * Save the XState context
+ */
+static inline NTSTATUS save_xstate( CONTEXT *context )
+{
+ CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
+ DECLSPEC_ALIGN(64) struct
+ {
+ XSAVE_FORMAT xsave;
+ XSTATE xstate;
+ }
+ xsave_area;
+ XSTATE *xs;
+
+ if (!(user_shared_data->XState.EnabledFeatures && (xs = xstate_from_context( context ))))
+ return STATUS_SUCCESS;
+
+ if (context_ex->XState.Length < offsetof(XSTATE, YmmContext)
+ || context_ex->XState.Length > sizeof(XSTATE))
+ return STATUS_INVALID_PARAMETER;
+
+ if (user_shared_data->XState.CompactionEnabled)
+ {
+ /* xsavec doesn't use anything from the save area. */
+ __asm__ volatile( "xsavec %0" : "=m"(xsave_area)
+ : "a" ((unsigned int)(xs->CompactionMask & (1 << XSTATE_AVX))), "d" (0) );
+ }
+ else
+ {
+ /* xsave preserves those bits in the mask which are not in EDX:EAX, so zero it. */
+ xsave_area.xstate.Mask = xsave_area.xstate.CompactionMask = 0;
+ __asm__ volatile( "xsave %0" : "=m"(xsave_area)
+ : "a" ((unsigned int)(xs->Mask & (1 << XSTATE_AVX))), "d" (0) );
+ }
+
+ memcpy(xs, &xsave_area.xstate, offsetof(XSTATE, YmmContext));
+ if (xs->Mask & (1 << XSTATE_AVX))
+ {
+ if (context_ex->XState.Length < sizeof(XSTATE))
+ return STATUS_BUFFER_OVERFLOW;
+
+ memcpy(&xs->YmmContext, &xsave_area.xstate.YmmContext, sizeof(xs->YmmContext));
+ }
+
+ return STATUS_SUCCESS;
+}
+
+
/***********************************************************************
* restore_context
*
@@ -1780,13 +1830,17 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
*/
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
{
- NTSTATUS ret;
+ NTSTATUS ret, xsave_status;
DWORD needed_flags;
struct syscall_frame *frame = amd64_thread_data()->syscall_frame;
BOOL self = (handle == GetCurrentThread());
if (!context) return STATUS_INVALID_PARAMETER;
+ /* Save xstate before any calls which can potentially change volatile ymm registers.
+ * E. g., debug output will clobber ymm registers. */
+ xsave_status = self ? save_xstate( context ) : STATUS_SUCCESS; /* FIXME: other thread. */
+
needed_flags = context->ContextFlags & ~CONTEXT_AMD64;
/* debug registers require a server call */
@@ -1859,7 +1913,8 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
amd64_thread_data()->dr7 = context->Dr7;
}
}
- return STATUS_SUCCESS;
+
+ return xsave_status;
}
extern void CDECL raise_func_trampoline( void *dispatcher );
--
2.26.2
1
1
[PATCH] kernelbase: Forward ConvertToAutoInheritPrivateObjectSecurity() to ntdll.
by Nikolay Sivov 02 Sep '20
by Nikolay Sivov 02 Sep '20
02 Sep '20
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/kernelbase/security.c | 3 +--
include/winternl.h | 2 ++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/kernelbase/security.c b/dlls/kernelbase/security.c
index d1736e61b80..72bb5892d3b 100644
--- a/dlls/kernelbase/security.c
+++ b/dlls/kernelbase/security.c
@@ -900,8 +900,7 @@ BOOL WINAPI ConvertToAutoInheritPrivateObjectSecurity( PSECURITY_DESCRIPTOR pare
GUID *type, BOOL is_dir,
PGENERIC_MAPPING mapping )
{
- FIXME("%p %p %p %p %d %p - stub\n", parent, current, descr, type, is_dir, mapping );
- return FALSE;
+ return set_ntstatus( RtlConvertToAutoInheritSecurityObject( parent, current, descr, type, is_dir, mapping ));
}
/******************************************************************************
diff --git a/include/winternl.h b/include/winternl.h
index 6c809193977..db79a050048 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -3281,6 +3281,8 @@ NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UN
NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN);
NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
+NTSYSAPI NTSTATUS WINAPI RtlConvertToAutoInheritSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR cdesc,
+ PSECURITY_DESCRIPTOR*, GUID*,BOOL,PGENERIC_MAPPING);
NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
--
2.28.0
1
0
[PATCH v2 1/2] bcrypt: Return STATUS_INVALID_PARAMETER on ECC magic mismatch.
by Hans Leidekker 02 Sep '20
by Hans Leidekker 02 Sep '20
02 Sep '20
From: Rémi Bernon <rbernon(a)codeweavers.com>
Flight Simulator XAL authentication hits this condition because of
buggy bcrypt private key export (see next patch).
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/bcrypt/bcrypt_main.c | 4 ++--
dlls/bcrypt/tests/bcrypt.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index b6bb73a715f..cd3b746e295 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1171,7 +1171,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
return STATUS_NOT_SUPPORTED;
}
- if (ecc_blob->dwMagic != magic) return STATUS_NOT_SUPPORTED;
+ if (ecc_blob->dwMagic != magic) return STATUS_INVALID_PARAMETER;
if (ecc_blob->cbKey != key_size || input_len < sizeof(*ecc_blob) + ecc_blob->cbKey * 2)
return STATUS_INVALID_PARAMETER;
@@ -1211,7 +1211,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
return STATUS_NOT_SUPPORTED;
}
- if (ecc_blob->dwMagic != magic) return STATUS_NOT_SUPPORTED;
+ if (ecc_blob->dwMagic != magic) return STATUS_INVALID_PARAMETER;
if (ecc_blob->cbKey != key_size || input_len < sizeof(*ecc_blob) + ecc_blob->cbKey * 3)
return STATUS_INVALID_PARAMETER;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index e37a33e38a0..3e5d5cf17f8 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1730,6 +1730,12 @@ static void test_ECDSA(void)
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ecckey->dwMagic = BCRYPT_ECDH_PUBLIC_P256_MAGIC;
+ ecckey->cbKey = 32;
+ status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+
+ ecckey->dwMagic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC;
ecckey->cbKey = 32;
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
@@ -1749,6 +1755,12 @@ static void test_ECDSA(void)
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ecckey->dwMagic = BCRYPT_ECDH_PRIVATE_P256_MAGIC;
+ ecckey->cbKey = 32;
+ status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+
+ ecckey->dwMagic = BCRYPT_ECDSA_PRIVATE_P256_MAGIC;
ecckey->cbKey = 32;
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
--
2.20.1
2
1
[PATCH v2 2/2] bcrypt: Export ECDSA/ECDH blobs with the correct header magic.
by Hans Leidekker 02 Sep '20
by Hans Leidekker 02 Sep '20
02 Sep '20
From: Rémi Bernon <rbernon(a)codeweavers.com>
This fixes Flight Simulator XAL authentication error message.
v2: Apply the same fix to public keys.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/bcrypt/gnutls.c | 54 ++++++++++++++++++++++++++------------
dlls/bcrypt/tests/bcrypt.c | 8 ++++++
2 files changed, 45 insertions(+), 17 deletions(-)
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index a80bce47f95..7acf8198626 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -680,7 +680,8 @@ static NTSTATUS export_gnutls_pubkey_rsa( gnutls_privkey_t gnutls_key, ULONG bit
return STATUS_SUCCESS;
}
-static NTSTATUS export_gnutls_pubkey_ecc( gnutls_privkey_t gnutls_key, UCHAR **pubkey, ULONG *pubkey_len )
+static NTSTATUS export_gnutls_pubkey_ecc( gnutls_privkey_t gnutls_key, enum alg_id alg_id, UCHAR **pubkey,
+ ULONG *pubkey_len )
{
BCRYPT_ECCKEY_BLOB *ecc_blob;
gnutls_ecc_curve_t curve;
@@ -689,20 +690,29 @@ static NTSTATUS export_gnutls_pubkey_ecc( gnutls_privkey_t gnutls_key, UCHAR **p
UCHAR *src, *dst;
int ret;
+ switch (alg_id)
+ {
+ case ALG_ID_ECDH_P256:
+ magic = BCRYPT_ECDH_PUBLIC_P256_MAGIC;
+ size = 32;
+ break;
+ case ALG_ID_ECDSA_P256:
+ magic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC;
+ size = 32;
+ break;
+ default:
+ FIXME( "algorithm %u not supported\n", alg_id );
+ return STATUS_NOT_IMPLEMENTED;
+ }
+
if ((ret = pgnutls_privkey_export_ecc_raw( gnutls_key, &curve, &x, &y, NULL )))
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
}
- switch (curve)
+ if (curve != GNUTLS_ECC_CURVE_SECP256R1)
{
- case GNUTLS_ECC_CURVE_SECP256R1:
- magic = BCRYPT_ECDH_PUBLIC_P256_MAGIC;
- size = 32;
- break;
-
- default:
FIXME( "curve %u not supported\n", curve );
free( x.data ); free( y.data );
return STATUS_NOT_IMPLEMENTED;
@@ -863,7 +873,7 @@ NTSTATUS key_asymmetric_generate( struct key *key )
break;
case GNUTLS_PK_ECC:
- status = export_gnutls_pubkey_ecc( handle, &key->u.a.pubkey, &key->u.a.pubkey_len );
+ status = export_gnutls_pubkey_ecc( handle, key->alg_id, &key->u.a.pubkey, &key->u.a.pubkey_len );
break;
case GNUTLS_PK_DSA:
@@ -894,20 +904,30 @@ NTSTATUS key_export_ecc( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len
UCHAR *src, *dst;
int ret;
+ switch (key->alg_id)
+ {
+ case ALG_ID_ECDH_P256:
+ magic = BCRYPT_ECDH_PRIVATE_P256_MAGIC;
+ size = 32;
+ break;
+ case ALG_ID_ECDSA_P256:
+ magic = BCRYPT_ECDSA_PRIVATE_P256_MAGIC;
+ size = 32;
+ break;
+
+ default:
+ FIXME( "algorithm %u does not yet support exporting ecc blob\n", key->alg_id );
+ return STATUS_NOT_IMPLEMENTED;
+ }
+
if ((ret = pgnutls_privkey_export_ecc_raw( key->u.a.handle, &curve, &x, &y, &d )))
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
}
- switch (curve)
+ if (curve != GNUTLS_ECC_CURVE_SECP256R1)
{
- case GNUTLS_ECC_CURVE_SECP256R1:
- magic = BCRYPT_ECDH_PRIVATE_P256_MAGIC;
- size = 32;
- break;
-
- default:
FIXME( "curve %u not supported\n", curve );
free( x.data ); free( y.data ); free( d.data );
return STATUS_NOT_IMPLEMENTED;
@@ -982,7 +1002,7 @@ NTSTATUS key_import_ecc( struct key *key, UCHAR *buf, ULONG len )
return STATUS_INTERNAL_ERROR;
}
- if ((status = export_gnutls_pubkey_ecc( handle, &key->u.a.pubkey, &key->u.a.pubkey_len )))
+ if ((status = export_gnutls_pubkey_ecc( handle, key->alg_id, &key->u.a.pubkey, &key->u.a.pubkey_len )))
{
pgnutls_privkey_deinit( handle );
return status;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 3e5d5cf17f8..7fdc0ac7fb2 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1765,6 +1765,14 @@ static void test_ECDSA(void)
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
+ memset( buffer, 0, sizeof(buffer) );
+ status = pBCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, buffer, size, &size, 0);
+ ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ecckey = (BCRYPT_ECCKEY_BLOB *)buffer;
+ ok(ecckey->dwMagic == BCRYPT_ECDSA_PRIVATE_P256_MAGIC, "got %08x\n", ecckey->dwMagic);
+ ok(ecckey->cbKey == 32, "got %u\n", ecckey->cbKey);
+ ok(size == sizeof(*ecckey) + ecckey->cbKey * 3, "got %u\n", size);
+
pBCryptDestroyKey(key);
pBCryptCloseAlgorithmProvider(alg, 0);
}
--
2.20.1
1
0
[PATCH] server: Avoid a potential NULL dereference in startup_info_dump().
by Zebediah Figura 01 Sep '20
by Zebediah Figura 01 Sep '20
01 Sep '20
From: Zebediah Figura <zfigura(a)codeweavers.com>
info->data may be set to NULL by get_startup_info, without invalidating the
object itself.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
server/process.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/server/process.c b/server/process.c
index c1bdb591f60..fc3e8df2ef2 100644
--- a/server/process.c
+++ b/server/process.c
@@ -749,8 +749,13 @@ static void startup_info_dump( struct object *obj, int verbose )
struct startup_info *info = (struct startup_info *)obj;
assert( obj->ops == &startup_info_ops );
- fprintf( stderr, "Startup info in=%04x out=%04x err=%04x\n",
- info->data->hstdin, info->data->hstdout, info->data->hstderr );
+ fputs( "Startup info", stderr );
+ if (info->data)
+ {
+ fprintf( stderr, " in=%04x out=%04x err=%04x",
+ info->data->hstdin, info->data->hstdout, info->data->hstderr );
+ }
+ fputc( '\n', stderr );
}
static int startup_info_signaled( struct object *obj, struct wait_queue_entry *entry )
--
2.28.0
1
0
[PATCH 1/2] bcrypt: Return STATUS_INVALID_PARAMETER on ECC magic mismatch.
by Rémi Bernon 01 Sep '20
by Rémi Bernon 01 Sep '20
01 Sep '20
Flight Simulator XAL authentication hits this condition because of
buggy bcrypt private key export (see next patch).
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/bcrypt/bcrypt_main.c | 4 ++--
dlls/bcrypt/tests/bcrypt.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index b6bb73a715f..cd3b746e295 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1171,7 +1171,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
return STATUS_NOT_SUPPORTED;
}
- if (ecc_blob->dwMagic != magic) return STATUS_NOT_SUPPORTED;
+ if (ecc_blob->dwMagic != magic) return STATUS_INVALID_PARAMETER;
if (ecc_blob->cbKey != key_size || input_len < sizeof(*ecc_blob) + ecc_blob->cbKey * 2)
return STATUS_INVALID_PARAMETER;
@@ -1211,7 +1211,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
return STATUS_NOT_SUPPORTED;
}
- if (ecc_blob->dwMagic != magic) return STATUS_NOT_SUPPORTED;
+ if (ecc_blob->dwMagic != magic) return STATUS_INVALID_PARAMETER;
if (ecc_blob->cbKey != key_size || input_len < sizeof(*ecc_blob) + ecc_blob->cbKey * 3)
return STATUS_INVALID_PARAMETER;
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index e37a33e38a0..3e5d5cf17f8 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -1730,6 +1730,12 @@ static void test_ECDSA(void)
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ecckey->dwMagic = BCRYPT_ECDH_PUBLIC_P256_MAGIC;
+ ecckey->cbKey = 32;
+ status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+
+ ecckey->dwMagic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC;
ecckey->cbKey = 32;
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
@@ -1749,6 +1755,12 @@ static void test_ECDSA(void)
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ecckey->dwMagic = BCRYPT_ECDH_PRIVATE_P256_MAGIC;
+ ecckey->cbKey = 32;
+ status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+
+ ecckey->dwMagic = BCRYPT_ECDSA_PRIVATE_P256_MAGIC;
ecckey->cbKey = 32;
status = pBCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
--
2.28.0
1
1
[PATCH v2] d3dcompiler: Unconditionally report special (pixel shader output) sysvals based on the semantic name.
by Zebediah Figura 01 Sep '20
by Zebediah Figura 01 Sep '20
01 Sep '20
From: Zebediah Figura <zfigura(a)codeweavers.com>
That is, do not check that the shader is a pixel shader and that the signature
is an output signature. These semantic names can only be generated in such
conditions; using the name for any other stage is invalid.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/d3dcompiler_43/reflection.c | 39 +++----
dlls/d3dcompiler_43/tests/reflection.c | 155 ++++++++-----------------
2 files changed, 62 insertions(+), 132 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 729501dbddc..a081b20d68f 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -1608,7 +1608,7 @@ err_out:
return hr;
}
-static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, struct dxbc_section *section, DWORD target)
+static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, struct dxbc_section *section)
{
D3D11_SIGNATURE_PARAMETER_DESC *d;
unsigned int string_data_offset;
@@ -1690,27 +1690,16 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *
d[i].ReadWriteMask = (mask >> 8) & 0xff;
d[i].Mask = mask & 0xff;
- /* pixel shaders have a special handling for SystemValueType in the output signature */
- if (((target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) == 0xffff0000) && (section->tag == TAG_OSG5 || section->tag == TAG_OSGN))
- {
- TRACE("Pixelshader output signature fixup.\n");
-
- if (d[i].Register == 0xffffffff)
- {
- if (!stricmp(d[i].SemanticName, "sv_depth"))
- d[i].SystemValueType = D3D_NAME_DEPTH;
- else if (!stricmp(d[i].SemanticName, "sv_coverage"))
- d[i].SystemValueType = D3D_NAME_COVERAGE;
- else if (!stricmp(d[i].SemanticName, "sv_depthgreaterequal"))
- d[i].SystemValueType = D3D_NAME_DEPTH_GREATER_EQUAL;
- else if (!stricmp(d[i].SemanticName, "sv_depthlessequal"))
- d[i].SystemValueType = D3D_NAME_DEPTH_LESS_EQUAL;
- }
- else
- {
- d[i].SystemValueType = D3D_NAME_TARGET;
- }
- }
+ if (!stricmp(d[i].SemanticName, "sv_depth"))
+ d[i].SystemValueType = D3D_NAME_DEPTH;
+ else if (!stricmp(d[i].SemanticName, "sv_coverage"))
+ d[i].SystemValueType = D3D_NAME_COVERAGE;
+ else if (!stricmp(d[i].SemanticName, "sv_depthgreaterequal"))
+ d[i].SystemValueType = D3D_NAME_DEPTH_GREATER_EQUAL;
+ else if (!stricmp(d[i].SemanticName, "sv_depthlessequal"))
+ d[i].SystemValueType = D3D_NAME_DEPTH_LESS_EQUAL;
+ else if (!stricmp(d[i].SemanticName, "sv_target"))
+ d[i].SystemValueType = D3D_NAME_TARGET;
TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
"type %u, register idx: %u, use_mask %#x, input_mask %#x, stream %u\n",
@@ -1777,7 +1766,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
goto err_out;
}
- hr = d3dcompiler_parse_signature(reflection->isgn, section, reflection->target);
+ hr = d3dcompiler_parse_signature(reflection->isgn, section);
if (FAILED(hr))
{
WARN("Failed to parse section ISGN.\n");
@@ -1795,7 +1784,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
goto err_out;
}
- hr = d3dcompiler_parse_signature(reflection->osgn, section, reflection->target);
+ hr = d3dcompiler_parse_signature(reflection->osgn, section);
if (FAILED(hr))
{
WARN("Failed to parse section OSGN.\n");
@@ -1812,7 +1801,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
goto err_out;
}
- hr = d3dcompiler_parse_signature(reflection->pcsg, section, reflection->target);
+ hr = d3dcompiler_parse_signature(reflection->pcsg, section);
if (FAILED(hr))
{
WARN("Failed to parse section PCSG.\n");
diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c
index 617003a97b7..dee88776fa3 100644
--- a/dlls/d3dcompiler_43/tests/reflection.c
+++ b/dlls/d3dcompiler_43/tests/reflection.c
@@ -794,9 +794,9 @@ static void test_reflection_desc_ps(void)
ok(count == 0, "Release failed %u\n", count);
}
-/*
- * fxc.exe /E PS /Tps_5_0 /Fx
- */
+/* The following shaders are stripped, in order to show that the correct
+ * reporting of pixel shader output sysvals should not depend on the RDEF chunk
+ * being present. */
#if 0
float4 PS() : SV_Target3
{
@@ -804,25 +804,16 @@ float4 PS() : SV_Target3
return a;
}
#endif
-static const DWORD test_reflection_desc_ps_output_blob_0[] = {
-0x43425844, 0x3e7b77e6, 0xe4e920b7, 0x9cad0533, 0x240117cc, 0x00000001, 0x0000018c, 0x00000005,
-0x00000034, 0x0000008c, 0x0000009c, 0x000000d0, 0x00000110, 0x46454452, 0x00000050, 0x00000000,
-0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
-0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
-0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
-0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000003, 0x00000000, 0x00000003, 0x00000003,
-0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e,
-0x03000065, 0x001020f2, 0x00000003, 0x08000036, 0x001020f2, 0x00000003, 0x00004002, 0x3f99999a,
-0x3f800000, 0x3e4ccccd, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, 0x00000000,
-0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000
+static const DWORD test_reflection_desc_ps_output_blob_0[] =
+{
+ 0x43425844, 0xc3773602, 0x04f86bdc, 0x715f33b2, 0x9c063cae, 0x00000001, 0x000000b4, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000003, 0x00000000, 0x00000003, 0x00000003,
+ 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000003c, 0x00000050, 0x0000000f,
+ 0x0100086a, 0x03000065, 0x001020f2, 0x00000003, 0x08000036, 0x001020f2, 0x00000003, 0x00004002,
+ 0x3f99999a, 0x3f800000, 0x3e4ccccd, 0x00000000, 0x0100003e,
};
-/*
- * fxc.exe /E PS /Tps_5_0 /Fx
- */
#if 0
float PS() : SV_DepthLessEqual
{
@@ -830,27 +821,16 @@ float PS() : SV_DepthLessEqual
return a;
}
#endif
-static const DWORD test_reflection_desc_ps_output_blob_1[] = {
-0x43425844, 0xd8ead3ec, 0x61276ada, 0x70cdaa9e, 0x2cfd7f4c, 0x00000001, 0x000001c4, 0x00000005,
-0x00000034, 0x000000ac, 0x000000bc, 0x000000f8, 0x00000128, 0x46454452, 0x00000070, 0x00000000,
-0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
-0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
-0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
-0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
-0x00000034, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
-0x00000e01, 0x445f5653, 0x68747065, 0x7373654c, 0x61757145, 0xabab006c, 0x58454853, 0x00000028,
-0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00027001, 0x04000036, 0x00027001, 0x00004001,
-0x3f99999a, 0x0100003e, 0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
-0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000,
+static const DWORD test_reflection_desc_ps_output_blob_1[] =
+{
+ 0x43425844, 0xc45db587, 0xdb0601fb, 0x7370900b, 0x219464be, 0x00000001, 0x000000a8, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000078, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x00000034, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
+ 0x00000e01, 0x445f5653, 0x68747065, 0x7373654c, 0x61757145, 0xabab006c, 0x58454853, 0x00000028,
+ 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00027001, 0x04000036, 0x00027001, 0x00004001,
+ 0x3f99999a, 0x0100003e,
};
-/*
- * fxc.exe /E PS /Tps_5_0 /Fx
- */
#if 0
float PS() : SV_DepthGreaterEqual
{
@@ -858,27 +838,16 @@ float PS() : SV_DepthGreaterEqual
return a;
}
#endif
-static const DWORD test_reflection_desc_ps_output_blob_2[] = {
-0x43425844, 0x9f61c8df, 0x612cbb1f, 0x9e1d039e, 0xf925a074, 0x00000001, 0x000001c8, 0x00000005,
-0x00000034, 0x000000ac, 0x000000bc, 0x000000fc, 0x0000012c, 0x46454452, 0x00000070, 0x00000000,
-0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
-0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
-0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
-0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
-0x00000038, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
-0x00000e01, 0x445f5653, 0x68747065, 0x61657247, 0x45726574, 0x6c617571, 0xababab00, 0x58454853,
-0x00000028, 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00026001, 0x04000036, 0x00026001,
-0x00004001, 0x3f99999a, 0x0100003e, 0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000,
-0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000,
+static const DWORD test_reflection_desc_ps_output_blob_2[] =
+{
+ 0x43425844, 0x13cce144, 0x3628f322, 0xa8ea9b7d, 0xbbf9f8d7, 0x00000001, 0x000000ac, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x0000007c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x00000038, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
+ 0x00000e01, 0x445f5653, 0x68747065, 0x61657247, 0x45726574, 0x6c617571, 0xababab00, 0x58454853,
+ 0x00000028, 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00026001, 0x04000036, 0x00026001,
+ 0x00004001, 0x3f99999a, 0x0100003e,
};
-/*
- * fxc.exe /E PS /Tps_5_0 /Fx
- */
#if 0
float PS() : sV_DePtH
{
@@ -886,26 +855,15 @@ float PS() : sV_DePtH
return a;
}
#endif
-static const DWORD test_reflection_desc_ps_output_blob_3[] = {
-0x43425844, 0x32cec0e6, 0x3873ed32, 0x2e86ffd0, 0x21bb00e8, 0x00000001, 0x000001bc, 0x00000005,
-0x00000034, 0x000000ac, 0x000000bc, 0x000000f0, 0x00000120, 0x46454452, 0x00000070, 0x00000000,
-0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
-0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
-0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
-0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
-0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
-0x00000e01, 0x445f5673, 0x48745065, 0xababab00, 0x58454853, 0x00000028, 0x00000050, 0x0000000a,
-0x0100086a, 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e,
-0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
-0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+static const DWORD test_reflection_desc_ps_output_blob_3[] =
+{
+ 0x43425844, 0x31c891d1, 0xcbb9d935, 0xa199e1d5, 0x70205254, 0x00000001, 0x000000a0, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
+ 0x00000e01, 0x445f5673, 0x48745065, 0xababab00, 0x58454853, 0x00000028, 0x00000050, 0x0000000a,
+ 0x0100086a, 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e,
};
-/*
- * fxc.exe /E PS /Tps_4_0 /Fx
- */
#if 0
float PS() : SV_Depth
{
@@ -913,24 +871,15 @@ float PS() : SV_Depth
return a;
}
#endif
-static const DWORD test_reflection_desc_ps_output_blob_4[] = {
-0x43425844, 0x7af34874, 0x975f09ad, 0xf6e50764, 0xdfb1255f, 0x00000001, 0x00000178, 0x00000005,
-0x00000034, 0x0000008c, 0x0000009c, 0x000000d0, 0x000000fc, 0x46454452, 0x00000050, 0x00000000,
-0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
-0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
-0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
-0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
-0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000024, 0x00000040, 0x00000009,
-0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e, 0x54415453,
-0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
-0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+static const DWORD test_reflection_desc_ps_output_blob_4[] =
+{
+ 0x43425844, 0x1d404736, 0x00e4a4aa, 0x5fcdad54, 0x5abd13f8, 0x00000001, 0x0000009c, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
+ 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000024, 0x00000040, 0x00000009,
+ 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e,
};
-/*
- * fxc.exe /E PS /Tps_4_0 /Fx
- */
#if 0
bool PS() : SV_COVERAGE
{
@@ -938,21 +887,13 @@ bool PS() : SV_COVERAGE
return a;
}
#endif
-static const DWORD test_reflection_desc_ps_output_blob_5[] = {
-0x43425844, 0x40ae32a7, 0xe944bb1c, 0x1a2b1923, 0xea25962d, 0x00000001, 0x000001bc, 0x00000005,
-0x00000034, 0x000000ac, 0x000000bc, 0x000000f0, 0x00000120, 0x46454452, 0x00000070, 0x00000000,
-0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
-0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
-0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
-0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
-0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0xffffffff,
-0x00000e01, 0x435f5653, 0x5245564f, 0x00454741, 0x58454853, 0x00000028, 0x00000050, 0x0000000a,
-0x0100086a, 0x02000065, 0x0000f000, 0x04000036, 0x0000f001, 0x00004001, 0xffffffff, 0x0100003e,
-0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
-0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+static const DWORD test_reflection_desc_ps_output_blob_5[] =
+{
+ 0x43425844, 0x6127612d, 0x09e2bb9a, 0xbba3889a, 0x987dafc2, 0x00000001, 0x000000a0, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0xffffffff,
+ 0x00000e01, 0x435f5653, 0x5245564f, 0x00454741, 0x52444853, 0x00000028, 0x00000041, 0x0000000a,
+ 0x0100086a, 0x02000065, 0x0000f000, 0x04000036, 0x0000f001, 0x00004001, 0xffffffff, 0x0100003e,
};
static void test_reflection_desc_ps_output(void)
--
2.28.0
2
1
[PATCH v3 1/5] d3dcompiler: Rename ID3D11ShaderReflection functions to d3d11_... from d3dcompiler_...
by Paul Gofman 01 Sep '20
by Paul Gofman 01 Sep '20
01 Sep '20
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
v2, v3:
- no changes.
dlls/d3dcompiler_43/reflection.c | 578 +++++++++++++++----------------
1 file changed, 287 insertions(+), 291 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 729501dbddc..9a1e869f0a5 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -145,9 +145,9 @@ struct d3dcompiler_shader_reflection
static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3dcompiler_shader_reflection *reflection, const char *data, DWORD offset);
-static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl;
-static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl;
-static const struct ID3D11ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl;
+static const struct ID3D11ShaderReflectionConstantBufferVtbl d3d11_shader_reflection_constant_buffer_vtbl;
+static const struct ID3D11ShaderReflectionVariableVtbl d3d11_shader_reflection_variable_vtbl;
+static const struct ID3D11ShaderReflectionTypeVtbl d3d11_shader_reflection_type_vtbl;
static const struct ID3D10ShaderReflectionConstantBufferVtbl d3d10_shader_reflection_constant_buffer_vtbl;
static const struct ID3D10ShaderReflectionVariableVtbl d3d10_shader_reflection_variable_vtbl;
@@ -156,17 +156,17 @@ static const struct ID3D10ShaderReflectionTypeVtbl d3d10_shader_reflection_type_
/* null objects - needed for invalid calls */
static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer =
{
- {&d3dcompiler_shader_reflection_constant_buffer_vtbl},
+ {&d3d11_shader_reflection_constant_buffer_vtbl},
{&d3d10_shader_reflection_constant_buffer_vtbl}
};
static struct d3dcompiler_shader_reflection_type null_type =
{
- {&d3dcompiler_shader_reflection_type_vtbl},
+ {&d3d11_shader_reflection_type_vtbl},
{&d3d10_shader_reflection_type_vtbl}
};
static struct d3dcompiler_shader_reflection_variable null_variable =
{
- {&d3dcompiler_shader_reflection_variable_vtbl},
+ {&d3d11_shader_reflection_variable_vtbl},
{&d3d10_shader_reflection_variable_vtbl},
&null_constant_buffer,
&null_type
@@ -327,9 +327,9 @@ static inline struct d3dcompiler_shader_reflection *impl_from_ID3D11ShaderReflec
return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection, ID3D11ShaderReflection_iface);
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface(ID3D11ShaderReflection *iface, REFIID riid, void **object)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_QueryInterface(ID3D11ShaderReflection *iface, REFIID riid, void **object)
{
- TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
+ TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
if (IsEqualGUID(riid, &IID_ID3D11ShaderReflection)
|| IsEqualGUID(riid, &IID_IUnknown))
@@ -339,33 +339,33 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_QueryInterface(ID
return S_OK;
}
- WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
*object = NULL;
return E_NOINTERFACE;
}
-static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_AddRef(ID3D11ShaderReflection *iface)
+static ULONG STDMETHODCALLTYPE d3d11_shader_reflection_AddRef(ID3D11ShaderReflection *iface)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
- ULONG refcount = InterlockedIncrement(&This->refcount);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
+ ULONG refcount = InterlockedIncrement(&reflection->refcount);
- TRACE("%p increasing refcount to %u\n", This, refcount);
+ TRACE("%p increasing refcount to %u.\n", reflection, refcount);
return refcount;
}
-static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release(ID3D11ShaderReflection *iface)
+static ULONG STDMETHODCALLTYPE d3d11_shader_reflection_Release(ID3D11ShaderReflection *iface)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
- ULONG refcount = InterlockedDecrement(&This->refcount);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
+ ULONG refcount = InterlockedDecrement(&reflection->refcount);
- TRACE("%p decreasing refcount to %u\n", This, refcount);
+ TRACE("%p decreasing refcount to %u.\n", reflection, refcount);
if (!refcount)
{
- reflection_cleanup(This);
- HeapFree(GetProcessHeap(), 0, This);
+ reflection_cleanup(reflection);
+ HeapFree(GetProcessHeap(), 0, reflection);
}
return refcount;
@@ -373,53 +373,53 @@ static ULONG STDMETHODCALLTYPE d3dcompiler_shader_reflection_Release(ID3D11Shade
/* ID3D11ShaderReflection methods */
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11ShaderReflection *iface, D3D11_SHADER_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetDesc(ID3D11ShaderReflection *iface, D3D11_SHADER_DESC *desc)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- FIXME("iface %p, desc %p partial stub!\n", iface, desc);
+ FIXME("iface %p, desc %p partial stub.\n", iface, desc);
if (!desc)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_FAIL;
}
- desc->Version = This->version;
- desc->Creator = This->creator;
- desc->Flags = This->flags;
- desc->ConstantBuffers = This->constant_buffer_count;
- desc->BoundResources = This->bound_resource_count;
- desc->InputParameters = This->isgn ? This->isgn->element_count : 0;
- desc->OutputParameters = This->osgn ? This->osgn->element_count : 0;
- desc->InstructionCount = This->instruction_count;
- desc->TempRegisterCount = This->temp_register_count;
- desc->TempArrayCount = This->temp_array_count;
+ desc->Version = reflection->version;
+ desc->Creator = reflection->creator;
+ desc->Flags = reflection->flags;
+ desc->ConstantBuffers = reflection->constant_buffer_count;
+ desc->BoundResources = reflection->bound_resource_count;
+ desc->InputParameters = reflection->isgn ? reflection->isgn->element_count : 0;
+ desc->OutputParameters = reflection->osgn ? reflection->osgn->element_count : 0;
+ desc->InstructionCount = reflection->instruction_count;
+ desc->TempRegisterCount = reflection->temp_register_count;
+ desc->TempArrayCount = reflection->temp_array_count;
desc->DefCount = 0;
- desc->DclCount = This->dcl_count;
- desc->TextureNormalInstructions = This->texture_normal_instructions;
- desc->TextureLoadInstructions = This->texture_load_instructions;
- desc->TextureCompInstructions = This->texture_comp_instructions;
- desc->TextureBiasInstructions = This->texture_bias_instructions;
- desc->TextureGradientInstructions = This->texture_gradient_instructions;
- desc->FloatInstructionCount = This->float_instruction_count;
- desc->IntInstructionCount = This->int_instruction_count;
- desc->UintInstructionCount = This->uint_instruction_count;
- desc->StaticFlowControlCount = This->static_flow_control_count;
- desc->DynamicFlowControlCount = This->dynamic_flow_control_count;
+ desc->DclCount = reflection->dcl_count;
+ desc->TextureNormalInstructions = reflection->texture_normal_instructions;
+ desc->TextureLoadInstructions = reflection->texture_load_instructions;
+ desc->TextureCompInstructions = reflection->texture_comp_instructions;
+ desc->TextureBiasInstructions = reflection->texture_bias_instructions;
+ desc->TextureGradientInstructions = reflection->texture_gradient_instructions;
+ desc->FloatInstructionCount = reflection->float_instruction_count;
+ desc->IntInstructionCount = reflection->int_instruction_count;
+ desc->UintInstructionCount = reflection->uint_instruction_count;
+ desc->StaticFlowControlCount = reflection->static_flow_control_count;
+ desc->DynamicFlowControlCount = reflection->dynamic_flow_control_count;
desc->MacroInstructionCount = 0;
- desc->ArrayInstructionCount = This->array_instruction_count;
- desc->CutInstructionCount = This->cut_instruction_count;
- desc->EmitInstructionCount = This->emit_instruction_count;
- desc->GSOutputTopology = This->gs_output_topology;
- desc->GSMaxOutputVertexCount = This->gs_max_output_vertex_count;
- desc->InputPrimitive = This->input_primitive;
- desc->PatchConstantParameters = This->pcsg ? This->pcsg->element_count : 0;
+ desc->ArrayInstructionCount = reflection->array_instruction_count;
+ desc->CutInstructionCount = reflection->cut_instruction_count;
+ desc->EmitInstructionCount = reflection->emit_instruction_count;
+ desc->GSOutputTopology = reflection->gs_output_topology;
+ desc->GSMaxOutputVertexCount = reflection->gs_max_output_vertex_count;
+ desc->InputPrimitive = reflection->input_primitive;
+ desc->PatchConstantParameters = reflection->pcsg ? reflection->pcsg->element_count : 0;
desc->cGSInstanceCount = 0;
- desc->cControlPoints = This->c_control_points;
- desc->HSOutputPrimitive = This->hs_output_primitive;
- desc->HSPartitioning = This->hs_prtitioning;
- desc->TessellatorDomain = This->tessellator_domain;
+ desc->cControlPoints = reflection->c_control_points;
+ desc->HSOutputPrimitive = reflection->hs_output_primitive;
+ desc->HSPartitioning = reflection->hs_prtitioning;
+ desc->TessellatorDomain = reflection->tessellator_domain;
desc->cBarrierInstructions = 0;
desc->cInterlockedInstructions = 0;
desc->cTextureStoreInstructions = 0;
@@ -427,39 +427,39 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11Sha
return S_OK;
}
-static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByIndex(
- ID3D11ShaderReflection *iface, UINT index)
+static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d11_shader_reflection_GetConstantBufferByIndex
+ (ID3D11ShaderReflection *iface, UINT index)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p, index %u\n", iface, index);
+ TRACE("iface %p, index %u.\n", iface, index);
- if (index >= This->constant_buffer_count)
+ if (index >= reflection->constant_buffer_count)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
}
- return &This->constant_buffers[index].ID3D11ShaderReflectionConstantBuffer_iface;
+ return &reflection->constant_buffers[index].ID3D11ShaderReflectionConstantBuffer_iface;
}
-static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName(
- ID3D11ShaderReflection *iface, const char *name)
+static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d11_shader_reflection_GetConstantBufferByName
+ (ID3D11ShaderReflection *iface, const char *name)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
unsigned int i;
- TRACE("iface %p, name %s\n", iface, debugstr_a(name));
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
if (!name)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
}
- for (i = 0; i < This->constant_buffer_count; ++i)
+ for (i = 0; i < reflection->constant_buffer_count; ++i)
{
- struct d3dcompiler_shader_reflection_constant_buffer *d = &This->constant_buffers[i];
+ struct d3dcompiler_shader_reflection_constant_buffer *d = &reflection->constant_buffers[i];
if (!strcmp(d->name, name))
{
@@ -468,21 +468,21 @@ static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompil
}
}
- WARN("Invalid name specified\n");
+ WARN("Invalid name specified.\n");
return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDesc(
- ID3D11ShaderReflection *iface, UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetResourceBindingDesc(ID3D11ShaderReflection *iface,
+ UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc)
{
struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
+ TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
if (!desc || index >= reflection->bound_resource_count)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_INVALIDARG;
}
@@ -491,16 +491,16 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindin
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameterDesc(
- ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetInputParameterDesc(ID3D11ShaderReflection *iface,
+ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
{
struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
+ TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
if (!desc || !reflection->isgn || index >= reflection->isgn->element_count)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_INVALIDARG;
}
@@ -509,16 +509,16 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetInputParameter
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParameterDesc(
- ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetOutputParameterDesc(ID3D11ShaderReflection *iface,
+ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
{
struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
+ TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
if (!desc || !reflection->osgn || index >= reflection->osgn->element_count)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_INVALIDARG;
}
@@ -527,16 +527,16 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetOutputParamete
return S_OK;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantParameterDesc(
- ID3D11ShaderReflection *iface, UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetPatchConstantParameterDesc(ID3D11ShaderReflection *iface,
+ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc)
{
struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p, index %u, desc %p\n", iface, index, desc);
+ TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
if (!desc || !reflection->pcsg || index >= reflection->pcsg->element_count)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_INVALIDARG;
}
@@ -545,23 +545,23 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantP
return S_OK;
}
-static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName(
- ID3D11ShaderReflection *iface, const char *name)
+static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3d11_shader_reflection_GetVariableByName
+ (ID3D11ShaderReflection *iface, const char *name)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
unsigned int i, k;
- TRACE("iface %p, name %s\n", iface, debugstr_a(name));
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
if (!name)
{
- WARN("Invalid name specified\n");
+ WARN("Invalid name specified.\n");
return &null_variable.ID3D11ShaderReflectionVariable_iface;
}
- for (i = 0; i < This->constant_buffer_count; ++i)
+ for (i = 0; i < reflection->constant_buffer_count; ++i)
{
- struct d3dcompiler_shader_reflection_constant_buffer *cb = &This->constant_buffers[i];
+ struct d3dcompiler_shader_reflection_constant_buffer *cb = &reflection->constant_buffers[i];
for (k = 0; k < cb->variable_count; ++k)
{
@@ -575,28 +575,28 @@ static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_sha
}
}
- WARN("Invalid name specified\n");
+ WARN("Invalid name specified.\n");
return &null_variable.ID3D11ShaderReflectionVariable_iface;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName(
- ID3D11ShaderReflection *iface, const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetResourceBindingDescByName(ID3D11ShaderReflection *iface,
+ const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
unsigned int i;
- TRACE("iface %p, name %s, desc %p\n", iface, debugstr_a(name), desc);
+ TRACE("iface %p, name %s, desc %p.\n", iface, debugstr_a(name), desc);
if (!desc || !name)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_INVALIDARG;
}
- for (i = 0; i < This->bound_resource_count; ++i)
+ for (i = 0; i < reflection->bound_resource_count; ++i)
{
- D3D12_SHADER_INPUT_BIND_DESC *d = &This->bound_resources[i];
+ D3D12_SHADER_INPUT_BIND_DESC *d = &reflection->bound_resources[i];
if (!strcmp(d->Name, name))
{
@@ -606,191 +606,185 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindin
}
}
- WARN("Invalid name specified\n");
+ WARN("Invalid name specified.\n");
return E_INVALIDARG;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovInstructionCount(
- ID3D11ShaderReflection *iface)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_GetMovInstructionCount(ID3D11ShaderReflection *iface)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p\n", iface);
+ TRACE("iface %p.\n", iface);
- return This->mov_instruction_count;
+ return reflection->mov_instruction_count;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMovcInstructionCount(
- ID3D11ShaderReflection *iface)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_GetMovcInstructionCount(ID3D11ShaderReflection *iface)
{
- FIXME("iface %p stub!\n", iface);
+ FIXME("iface %p stub.\n", iface);
return 0;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConversionInstructionCount(
- ID3D11ShaderReflection *iface)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_GetConversionInstructionCount(ID3D11ShaderReflection *iface)
{
- struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
+ struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D11ShaderReflection(iface);
- TRACE("iface %p\n", iface);
+ TRACE("iface %p.\n", iface);
- return This->conversion_instruction_count;
+ return reflection->conversion_instruction_count;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetBitwiseInstructionCount(
- ID3D11ShaderReflection *iface)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_GetBitwiseInstructionCount(ID3D11ShaderReflection *iface)
{
- FIXME("iface %p stub!\n", iface);
+ FIXME("iface %p stub.\n", iface);
return 0;
}
-static D3D_PRIMITIVE STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetGSInputPrimitive(
- ID3D11ShaderReflection *iface)
+static D3D_PRIMITIVE STDMETHODCALLTYPE d3d11_shader_reflection_GetGSInputPrimitive(ID3D11ShaderReflection *iface)
{
- FIXME("iface %p stub!\n", iface);
+ FIXME("iface %p stub.\n", iface);
return 0;
}
-static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencyShader(
- ID3D11ShaderReflection *iface)
+static BOOL STDMETHODCALLTYPE d3d11_shader_reflection_IsSampleFrequencyShader(ID3D11ShaderReflection *iface)
{
- FIXME("iface %p stub!\n", iface);
+ FIXME("iface %p stub.\n", iface);
return FALSE;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots(
- ID3D11ShaderReflection *iface)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_GetNumInterfaceSlots(ID3D11ShaderReflection *iface)
{
- FIXME("iface %p stub!\n", iface);
+ FIXME("iface %p stub.\n", iface);
return 0;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetMinFeatureLevel(
- ID3D11ShaderReflection *iface, D3D_FEATURE_LEVEL *level)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_GetMinFeatureLevel(ID3D11ShaderReflection *iface,
+ D3D_FEATURE_LEVEL *level)
{
- FIXME("iface %p, level %p stub!\n", iface, level);
+ FIXME("iface %p, level %p stub.\n", iface, level);
return E_NOTIMPL;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize(
- ID3D11ShaderReflection *iface, UINT *sizex, UINT *sizey, UINT *sizez)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_GetThreadGroupSize(ID3D11ShaderReflection *iface,
+ UINT *sizex, UINT *sizey, UINT *sizez)
{
- FIXME("iface %p, sizex %p, sizey %p, sizez %p stub!\n", iface, sizex, sizey, sizez);
+ FIXME("iface %p, sizex %p, sizey %p, sizez %p stub.\n", iface, sizex, sizey, sizez);
return 0;
}
-static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags(
- ID3D11ShaderReflection *iface)
+static UINT64 STDMETHODCALLTYPE d3d11_shader_reflection_GetRequiresFlags(ID3D11ShaderReflection *iface)
{
- FIXME("iface %p stub!\n", iface);
+ FIXME("iface %p stub.\n", iface);
return 0;
}
-static const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl =
+static const struct ID3D11ShaderReflectionVtbl d3d11_shader_reflection_vtbl =
{
/* IUnknown methods */
- d3dcompiler_shader_reflection_QueryInterface,
- d3dcompiler_shader_reflection_AddRef,
- d3dcompiler_shader_reflection_Release,
+ d3d11_shader_reflection_QueryInterface,
+ d3d11_shader_reflection_AddRef,
+ d3d11_shader_reflection_Release,
/* ID3D11ShaderReflection methods */
- d3dcompiler_shader_reflection_GetDesc,
- d3dcompiler_shader_reflection_GetConstantBufferByIndex,
- d3dcompiler_shader_reflection_GetConstantBufferByName,
- d3dcompiler_shader_reflection_GetResourceBindingDesc,
- d3dcompiler_shader_reflection_GetInputParameterDesc,
- d3dcompiler_shader_reflection_GetOutputParameterDesc,
- d3dcompiler_shader_reflection_GetPatchConstantParameterDesc,
- d3dcompiler_shader_reflection_GetVariableByName,
- d3dcompiler_shader_reflection_GetResourceBindingDescByName,
- d3dcompiler_shader_reflection_GetMovInstructionCount,
- d3dcompiler_shader_reflection_GetMovcInstructionCount,
- d3dcompiler_shader_reflection_GetConversionInstructionCount,
- d3dcompiler_shader_reflection_GetBitwiseInstructionCount,
- d3dcompiler_shader_reflection_GetGSInputPrimitive,
- d3dcompiler_shader_reflection_IsSampleFrequencyShader,
- d3dcompiler_shader_reflection_GetNumInterfaceSlots,
- d3dcompiler_shader_reflection_GetMinFeatureLevel,
- d3dcompiler_shader_reflection_GetThreadGroupSize,
- d3dcompiler_shader_reflection_GetRequiresFlags,
+ d3d11_shader_reflection_GetDesc,
+ d3d11_shader_reflection_GetConstantBufferByIndex,
+ d3d11_shader_reflection_GetConstantBufferByName,
+ d3d11_shader_reflection_GetResourceBindingDesc,
+ d3d11_shader_reflection_GetInputParameterDesc,
+ d3d11_shader_reflection_GetOutputParameterDesc,
+ d3d11_shader_reflection_GetPatchConstantParameterDesc,
+ d3d11_shader_reflection_GetVariableByName,
+ d3d11_shader_reflection_GetResourceBindingDescByName,
+ d3d11_shader_reflection_GetMovInstructionCount,
+ d3d11_shader_reflection_GetMovcInstructionCount,
+ d3d11_shader_reflection_GetConversionInstructionCount,
+ d3d11_shader_reflection_GetBitwiseInstructionCount,
+ d3d11_shader_reflection_GetGSInputPrimitive,
+ d3d11_shader_reflection_IsSampleFrequencyShader,
+ d3d11_shader_reflection_GetNumInterfaceSlots,
+ d3d11_shader_reflection_GetMinFeatureLevel,
+ d3d11_shader_reflection_GetThreadGroupSize,
+ d3d11_shader_reflection_GetRequiresFlags,
};
/* ID3D11ShaderReflectionConstantBuffer methods */
-static inline struct d3dcompiler_shader_reflection_constant_buffer *impl_from_ID3D11ShaderReflectionConstantBuffer(ID3D11ShaderReflectionConstantBuffer *iface)
+static inline struct d3dcompiler_shader_reflection_constant_buffer *impl_from_ID3D11ShaderReflectionConstantBuffer
+ (ID3D11ShaderReflectionConstantBuffer *iface)
{
- return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_constant_buffer, ID3D11ShaderReflectionConstantBuffer_iface);
+ return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_constant_buffer,
+ ID3D11ShaderReflectionConstantBuffer_iface);
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetDesc(
- ID3D11ShaderReflectionConstantBuffer *iface, D3D11_SHADER_BUFFER_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_constant_buffer_GetDesc
+ (ID3D11ShaderReflectionConstantBuffer *iface, D3D11_SHADER_BUFFER_DESC *desc)
{
- struct d3dcompiler_shader_reflection_constant_buffer *This = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
+ struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
- TRACE("iface %p, desc %p\n", iface, desc);
+ TRACE("iface %p, desc %p.\n", iface, desc);
- if (This == &null_constant_buffer)
+ if (cb == &null_constant_buffer)
{
- WARN("Null constant buffer specified\n");
+ WARN("Null constant buffer specified.\n");
return E_FAIL;
}
if (!desc)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_FAIL;
}
- desc->Name = This->name;
- desc->Type = This->type;
- desc->Variables = This->variable_count;
- desc->Size = This->size;
- desc->uFlags = This->flags;
+ desc->Name = cb->name;
+ desc->Type = cb->type;
+ desc->Variables = cb->variable_count;
+ desc->Size = cb->size;
+ desc->uFlags = cb->flags;
return S_OK;
}
-static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex(
- ID3D11ShaderReflectionConstantBuffer *iface, UINT index)
+static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3d11_shader_reflection_constant_buffer_GetVariableByIndex
+ (ID3D11ShaderReflectionConstantBuffer *iface, UINT index)
{
- struct d3dcompiler_shader_reflection_constant_buffer *This = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
+ struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
- TRACE("iface %p, index %u\n", iface, index);
+ TRACE("iface %p, index %u.\n", iface, index);
- if (index >= This->variable_count)
+ if (index >= cb->variable_count)
{
- WARN("Invalid index specified\n");
+ WARN("Invalid index specified.\n");
return &null_variable.ID3D11ShaderReflectionVariable_iface;
}
- return &This->variables[index].ID3D11ShaderReflectionVariable_iface;
+ return &cb->variables[index].ID3D11ShaderReflectionVariable_iface;
}
-static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName(
- ID3D11ShaderReflectionConstantBuffer *iface, const char *name)
+static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3d11_shader_reflection_constant_buffer_GetVariableByName
+ (ID3D11ShaderReflectionConstantBuffer *iface, const char *name)
{
- struct d3dcompiler_shader_reflection_constant_buffer *This = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
+ struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
unsigned int i;
- TRACE("iface %p, name %s\n", iface, debugstr_a(name));
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
if (!name)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return &null_variable.ID3D11ShaderReflectionVariable_iface;
}
- for (i = 0; i < This->variable_count; ++i)
+ for (i = 0; i < cb->variable_count; ++i)
{
- struct d3dcompiler_shader_reflection_variable *v = &This->variables[i];
+ struct d3dcompiler_shader_reflection_variable *v = &cb->variables[i];
if (!strcmp(v->name, name))
{
@@ -799,155 +793,158 @@ static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref
}
}
- WARN("Invalid name specified\n");
+ WARN("Invalid name specified.\n");
return &null_variable.ID3D11ShaderReflectionVariable_iface;
}
-static const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl =
+static const struct ID3D11ShaderReflectionConstantBufferVtbl d3d11_shader_reflection_constant_buffer_vtbl =
{
/* ID3D11ShaderReflectionConstantBuffer methods */
- d3dcompiler_shader_reflection_constant_buffer_GetDesc,
- d3dcompiler_shader_reflection_constant_buffer_GetVariableByIndex,
- d3dcompiler_shader_reflection_constant_buffer_GetVariableByName,
+ d3d11_shader_reflection_constant_buffer_GetDesc,
+ d3d11_shader_reflection_constant_buffer_GetVariableByIndex,
+ d3d11_shader_reflection_constant_buffer_GetVariableByName,
};
/* ID3D11ShaderReflectionVariable methods */
-static inline struct d3dcompiler_shader_reflection_variable *impl_from_ID3D11ShaderReflectionVariable(ID3D11ShaderReflectionVariable *iface)
+static inline struct d3dcompiler_shader_reflection_variable *impl_from_ID3D11ShaderReflectionVariable
+ (ID3D11ShaderReflectionVariable *iface)
{
- return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_variable, ID3D11ShaderReflectionVariable_iface);
+ return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_variable,
+ ID3D11ShaderReflectionVariable_iface);
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetDesc(
- ID3D11ShaderReflectionVariable *iface, D3D11_SHADER_VARIABLE_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_variable_GetDesc
+ (ID3D11ShaderReflectionVariable *iface, D3D11_SHADER_VARIABLE_DESC *desc)
{
- struct d3dcompiler_shader_reflection_variable *This = impl_from_ID3D11ShaderReflectionVariable(iface);
+ struct d3dcompiler_shader_reflection_variable *cb = impl_from_ID3D11ShaderReflectionVariable(iface);
- TRACE("iface %p, desc %p\n", iface, desc);
+ TRACE("iface %p, desc %p.\n", iface, desc);
- if (This == &null_variable)
+ if (cb == &null_variable)
{
- WARN("Null variable specified\n");
+ WARN("Null variable specified.\n");
return E_FAIL;
}
if (!desc)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_FAIL;
}
- desc->Name = This->name;
- desc->StartOffset = This->start_offset;
- desc->Size = This->size;
- desc->uFlags = This->flags;
- desc->DefaultValue = This->default_value;
+ desc->Name = cb->name;
+ desc->StartOffset = cb->start_offset;
+ desc->Size = cb->size;
+ desc->uFlags = cb->flags;
+ desc->DefaultValue = cb->default_value;
return S_OK;
}
-static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetType(
- ID3D11ShaderReflectionVariable *iface)
+static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3d11_shader_reflection_variable_GetType
+ (ID3D11ShaderReflectionVariable *iface)
{
- struct d3dcompiler_shader_reflection_variable *This = impl_from_ID3D11ShaderReflectionVariable(iface);
+ struct d3dcompiler_shader_reflection_variable *cb = impl_from_ID3D11ShaderReflectionVariable(iface);
- TRACE("iface %p\n", iface);
+ TRACE("iface %p.\n", iface);
- return &This->type->ID3D11ShaderReflectionType_iface;
+ return &cb->type->ID3D11ShaderReflectionType_iface;
}
-static ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetBuffer(
- ID3D11ShaderReflectionVariable *iface)
+static ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d11_shader_reflection_variable_GetBuffer
+ (ID3D11ShaderReflectionVariable *iface)
{
- struct d3dcompiler_shader_reflection_variable *This = impl_from_ID3D11ShaderReflectionVariable(iface);
+ struct d3dcompiler_shader_reflection_variable *cb = impl_from_ID3D11ShaderReflectionVariable(iface);
- TRACE("iface %p\n", iface);
+ TRACE("iface %p.\n", iface);
- return &This->constant_buffer->ID3D11ShaderReflectionConstantBuffer_iface;
+ return &cb->constant_buffer->ID3D11ShaderReflectionConstantBuffer_iface;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_variable_GetInterfaceSlot(
- ID3D11ShaderReflectionVariable *iface, UINT index)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_variable_GetInterfaceSlot
+ (ID3D11ShaderReflectionVariable *iface, UINT index)
{
- FIXME("iface %p, index %u stub!\n", iface, index);
+ FIXME("iface %p, index %u stub.\n", iface, index);
return 0;
}
-static const struct ID3D11ShaderReflectionVariableVtbl d3dcompiler_shader_reflection_variable_vtbl =
+static const struct ID3D11ShaderReflectionVariableVtbl d3d11_shader_reflection_variable_vtbl =
{
/* ID3D11ShaderReflectionVariable methods */
- d3dcompiler_shader_reflection_variable_GetDesc,
- d3dcompiler_shader_reflection_variable_GetType,
- d3dcompiler_shader_reflection_variable_GetBuffer,
- d3dcompiler_shader_reflection_variable_GetInterfaceSlot,
+ d3d11_shader_reflection_variable_GetDesc,
+ d3d11_shader_reflection_variable_GetType,
+ d3d11_shader_reflection_variable_GetBuffer,
+ d3d11_shader_reflection_variable_GetInterfaceSlot,
};
/* ID3D11ShaderReflectionType methods */
-static inline struct d3dcompiler_shader_reflection_type *impl_from_ID3D11ShaderReflectionType(ID3D11ShaderReflectionType *iface)
+static inline struct d3dcompiler_shader_reflection_type *impl_from_ID3D11ShaderReflectionType
+ (ID3D11ShaderReflectionType *iface)
{
return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_type, ID3D11ShaderReflectionType_iface);
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetDesc(
- ID3D11ShaderReflectionType *iface, D3D11_SHADER_TYPE_DESC *desc)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_type_GetDesc
+ (ID3D11ShaderReflectionType *iface, D3D11_SHADER_TYPE_DESC *desc)
{
- struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface);
+ struct d3dcompiler_shader_reflection_type *type = impl_from_ID3D11ShaderReflectionType(iface);
- TRACE("iface %p, desc %p\n", iface, desc);
+ TRACE("iface %p, desc %p.\n", iface, desc);
- if (This == &null_type)
+ if (type == &null_type)
{
- WARN("Null type specified\n");
+ WARN("Null type specified.\n");
return E_FAIL;
}
if (!desc)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return E_FAIL;
}
- *desc = This->desc;
+ *desc = type->desc;
return S_OK;
}
-static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByIndex(
- ID3D11ShaderReflectionType *iface, UINT index)
+static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3d11_shader_reflection_type_GetMemberTypeByIndex
+ (ID3D11ShaderReflectionType *iface, UINT index)
{
- struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface);
+ struct d3dcompiler_shader_reflection_type *type = impl_from_ID3D11ShaderReflectionType(iface);
- TRACE("iface %p, index %u\n", iface, index);
+ TRACE("iface %p, index %u.\n", iface, index);
- if (index >= This->desc.Members)
+ if (index >= type->desc.Members)
{
- WARN("Invalid index specified\n");
+ WARN("Invalid index specified.\n");
return &null_type.ID3D11ShaderReflectionType_iface;
}
- return &This->members[index].type->ID3D11ShaderReflectionType_iface;
+ return &type->members[index].type->ID3D11ShaderReflectionType_iface;
}
-static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName(
- ID3D11ShaderReflectionType *iface, const char *name)
+static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3d11_shader_reflection_type_GetMemberTypeByName
+ (ID3D11ShaderReflectionType *iface, const char *name)
{
- struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface);
+ struct d3dcompiler_shader_reflection_type *type = impl_from_ID3D11ShaderReflectionType(iface);
unsigned int i;
- TRACE("iface %p, name %s\n", iface, debugstr_a(name));
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
if (!name)
{
- WARN("Invalid argument specified\n");
+ WARN("Invalid argument specified.\n");
return &null_type.ID3D11ShaderReflectionType_iface;
}
- for (i = 0; i < This->desc.Members; ++i)
+ for (i = 0; i < type->desc.Members; ++i)
{
- struct d3dcompiler_shader_reflection_type_member *member = &This->members[i];
+ struct d3dcompiler_shader_reflection_type_member *member = &type->members[i];
if (!strcmp(member->name, name))
{
@@ -956,43 +953,43 @@ static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect
}
}
- WARN("Invalid name specified\n");
+ WARN("Invalid name specified.\n");
return &null_type.ID3D11ShaderReflectionType_iface;
}
-static const char * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName(
- ID3D11ShaderReflectionType *iface, UINT index)
+static const char * STDMETHODCALLTYPE d3d11_shader_reflection_type_GetMemberTypeName
+ (ID3D11ShaderReflectionType *iface, UINT index)
{
- struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface);
+ struct d3dcompiler_shader_reflection_type *type = impl_from_ID3D11ShaderReflectionType(iface);
- TRACE("iface %p, index %u\n", iface, index);
+ TRACE("iface %p, index %u.\n", iface, index);
- if (This == &null_type)
+ if (type == &null_type)
{
- WARN("Null type specified\n");
+ WARN("Null type specified.\n");
return "$Invalid";
}
- if (index >= This->desc.Members)
+ if (index >= type->desc.Members)
{
- WARN("Invalid index specified\n");
+ WARN("Invalid index specified.\n");
return NULL;
}
- return This->members[index].name;
+ return type->members[index].name;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual(
- ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_type_IsEqual
+ (ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
{
- struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface);
+ struct d3dcompiler_shader_reflection_type *reflection_type = impl_from_ID3D11ShaderReflectionType(iface);
- TRACE("iface %p, type %p\n", iface, type);
+ TRACE("iface %p, type %p.\n", iface, type);
- if (This == &null_type)
+ if (reflection_type == &null_type)
{
- WARN("Null type specified\n");
+ WARN("Null type specified.\n");
return E_FAIL;
}
@@ -1002,68 +999,67 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsEqual(
return S_FALSE;
}
-static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetSubType(
- ID3D11ShaderReflectionType *iface)
+static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3d11_shader_reflection_type_GetSubType
+ (ID3D11ShaderReflectionType *iface)
{
FIXME("iface %p stub!\n", iface);
return NULL;
}
-static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetBaseClass(
- ID3D11ShaderReflectionType *iface)
+static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3d11_shader_reflection_type_GetBaseClass
+ (ID3D11ShaderReflectionType *iface)
{
FIXME("iface %p stub!\n", iface);
return NULL;
}
-static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetNumInterfaces(
- ID3D11ShaderReflectionType *iface)
+static UINT STDMETHODCALLTYPE d3d11_shader_reflection_type_GetNumInterfaces(ID3D11ShaderReflectionType *iface)
{
FIXME("iface %p stub!\n", iface);
return 0;
}
-static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetInterfaceByIndex(
- ID3D11ShaderReflectionType *iface, UINT index)
+static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3d11_shader_reflection_type_GetInterfaceByIndex
+ (ID3D11ShaderReflectionType *iface, UINT index)
{
FIXME("iface %p, index %u stub!\n", iface, index);
return NULL;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_IsOfType(
- ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_type_IsOfType
+ (ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *type)
{
FIXME("iface %p, type %p stub!\n", iface, type);
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_ImplementsInterface(
- ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *base)
+static HRESULT STDMETHODCALLTYPE d3d11_shader_reflection_type_ImplementsInterface
+ (ID3D11ShaderReflectionType *iface, ID3D11ShaderReflectionType *base)
{
FIXME("iface %p, base %p stub!\n", iface, base);
return E_NOTIMPL;
}
-static const struct ID3D11ShaderReflectionTypeVtbl d3dcompiler_shader_reflection_type_vtbl =
+static const struct ID3D11ShaderReflectionTypeVtbl d3d11_shader_reflection_type_vtbl =
{
/* ID3D11ShaderReflectionType methods */
- d3dcompiler_shader_reflection_type_GetDesc,
- d3dcompiler_shader_reflection_type_GetMemberTypeByIndex,
- d3dcompiler_shader_reflection_type_GetMemberTypeByName,
- d3dcompiler_shader_reflection_type_GetMemberTypeName,
- d3dcompiler_shader_reflection_type_IsEqual,
- d3dcompiler_shader_reflection_type_GetSubType,
- d3dcompiler_shader_reflection_type_GetBaseClass,
- d3dcompiler_shader_reflection_type_GetNumInterfaces,
- d3dcompiler_shader_reflection_type_GetInterfaceByIndex,
- d3dcompiler_shader_reflection_type_IsOfType,
- d3dcompiler_shader_reflection_type_ImplementsInterface,
+ d3d11_shader_reflection_type_GetDesc,
+ d3d11_shader_reflection_type_GetMemberTypeByIndex,
+ d3d11_shader_reflection_type_GetMemberTypeByName,
+ d3d11_shader_reflection_type_GetMemberTypeName,
+ d3d11_shader_reflection_type_IsEqual,
+ d3d11_shader_reflection_type_GetSubType,
+ d3d11_shader_reflection_type_GetBaseClass,
+ d3d11_shader_reflection_type_GetNumInterfaces,
+ d3d11_shader_reflection_type_GetInterfaceByIndex,
+ d3d11_shader_reflection_type_IsOfType,
+ d3d11_shader_reflection_type_ImplementsInterface,
};
static HRESULT d3dcompiler_parse_stat(struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
@@ -1310,7 +1306,7 @@ static struct d3dcompiler_shader_reflection_type *get_reflection_type(struct d3d
if (!type)
return NULL;
- type->ID3D11ShaderReflectionType_iface.lpVtbl = &d3dcompiler_shader_reflection_type_vtbl;
+ type->ID3D11ShaderReflectionType_iface.lpVtbl = &d3d11_shader_reflection_type_vtbl;
type->ID3D10ShaderReflectionType_iface.lpVtbl = &d3d10_shader_reflection_type_vtbl;
type->id = offset;
type->reflection = reflection;
@@ -1352,7 +1348,7 @@ static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_
struct d3dcompiler_shader_reflection_variable *v = &variables[i];
DWORD offset;
- v->ID3D11ShaderReflectionVariable_iface.lpVtbl = &d3dcompiler_shader_reflection_variable_vtbl;
+ v->ID3D11ShaderReflectionVariable_iface.lpVtbl = &d3d11_shader_reflection_variable_vtbl;
v->ID3D10ShaderReflectionVariable_iface.lpVtbl = &d3d10_shader_reflection_variable_vtbl;
v->constant_buffer = cb;
@@ -1551,7 +1547,7 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c
{
struct d3dcompiler_shader_reflection_constant_buffer *cb = &constant_buffers[i];
- cb->ID3D11ShaderReflectionConstantBuffer_iface.lpVtbl = &d3dcompiler_shader_reflection_constant_buffer_vtbl;
+ cb->ID3D11ShaderReflectionConstantBuffer_iface.lpVtbl = &d3d11_shader_reflection_constant_buffer_vtbl;
cb->ID3D10ShaderReflectionConstantBuffer_iface.lpVtbl = &d3d10_shader_reflection_constant_buffer_vtbl;
cb->reflection = r;
@@ -2375,7 +2371,7 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void
if (!object)
return E_OUTOFMEMORY;
- object->ID3D11ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl;
+ object->ID3D11ShaderReflection_iface.lpVtbl = &d3d11_shader_reflection_vtbl;
object->refcount = 1;
hr = d3dcompiler_shader_reflection_init(object, data, data_size);
--
2.26.2
2
14
01 Sep '20
2
1
[PATCH 2/3] include/d3d11.idl: Add flags in D3D11_RESOURCE_MISC_FLAG enum.
by Biswapriyo Nath 01 Sep '20
by Biswapriyo Nath 01 Sep '20
01 Sep '20
2
1