You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4af8ffc7f2 | ||
|
4801f89bba | ||
|
9e260976b4 | ||
|
48e37a9f7c | ||
|
c9330ebfa3 | ||
|
9832547e5c | ||
|
792181ca4e | ||
|
409261dc56 | ||
|
bd3bf6c3b0 | ||
|
6eb6431a82 | ||
|
eb4096dc62 | ||
|
bff60a3afb | ||
|
d61501a68f | ||
|
5b388bb912 | ||
|
3e2b8a53bb | ||
|
de87a73aac | ||
|
8fd6d103e3 | ||
|
11233f0810 | ||
|
3fe54232fa | ||
|
8853cef050 | ||
|
f70daff195 | ||
|
22f1c6b57f | ||
|
a596208a7f | ||
|
35999cf261 | ||
|
bd8446fa57 | ||
|
0cf0a265da | ||
|
2736dff771 | ||
|
f6fdc7705e | ||
|
b4fce09d03 | ||
|
89733585b3 | ||
|
6e3fbe28e1 | ||
|
e31b1ba24f |
@@ -1,268 +0,0 @@
|
||||
From 95fd708dbdd9f8d61fdd8f1571c44e98c54b8988 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Wesie <awesie@gmail.com>
|
||||
Date: Tue, 2 May 2017 00:59:49 -0500
|
||||
Subject: [PATCH] advapi32: Implement BuildSecurityDescriptorW.
|
||||
|
||||
---
|
||||
dlls/advapi32/security.c | 218 +++++++++++++++++++++++++++++++++++------------
|
||||
1 file changed, 164 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
|
||||
index 6f4fb44..3737827 100644
|
||||
--- a/dlls/advapi32/security.c
|
||||
+++ b/dlls/advapi32/security.c
|
||||
@@ -48,6 +48,7 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
||||
|
||||
static BOOL ParseStringSidToSid(LPCWSTR StringSid, PSID pSid, LPDWORD cBytes);
|
||||
+static DWORD trustee_to_sid(DWORD nDestinationSidLength, PSID pDestinationSid, PTRUSTEEW pTrustee);
|
||||
|
||||
typedef struct _ACEFLAG
|
||||
{
|
||||
@@ -1255,16 +1256,122 @@ DWORD WINAPI BuildSecurityDescriptorW(
|
||||
IN ULONG cCountOfAccessEntries,
|
||||
IN PEXPLICIT_ACCESSW pListOfAccessEntries,
|
||||
IN ULONG cCountOfAuditEntries,
|
||||
- IN PEXPLICIT_ACCESSW pListofAuditEntries,
|
||||
+ IN PEXPLICIT_ACCESSW pListOfAuditEntries,
|
||||
IN PSECURITY_DESCRIPTOR pOldSD,
|
||||
IN OUT PULONG lpdwBufferLength,
|
||||
OUT PSECURITY_DESCRIPTOR* pNewSD)
|
||||
{
|
||||
- FIXME("(%p,%p,%d,%p,%d,%p,%p,%p,%p) stub!\n",pOwner,pGroup,
|
||||
- cCountOfAccessEntries,pListOfAccessEntries,cCountOfAuditEntries,
|
||||
- pListofAuditEntries,pOldSD,lpdwBufferLength,pNewSD);
|
||||
+ SECURITY_DESCRIPTOR desc;
|
||||
+ NTSTATUS status;
|
||||
+ DWORD ret = ERROR_SUCCESS;
|
||||
+
|
||||
+ TRACE("(%p,%p,%d,%p,%d,%p,%p,%p,%p)\n", pOwner, pGroup,
|
||||
+ cCountOfAccessEntries, pListOfAccessEntries, cCountOfAuditEntries,
|
||||
+ pListOfAuditEntries, pOldSD, lpdwBufferLength, pNewSD);
|
||||
|
||||
- return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
+ if (pOldSD)
|
||||
+ {
|
||||
+ SECURITY_DESCRIPTOR_CONTROL control;
|
||||
+ DWORD desc_size, dacl_size = 0, sacl_size = 0, owner_size = 0, group_size = 0;
|
||||
+ PACL dacl = NULL, sacl = NULL;
|
||||
+ PSID owner = NULL, group = NULL;
|
||||
+ DWORD revision;
|
||||
+
|
||||
+ if ((status = RtlGetControlSecurityDescriptor( pOldSD, &control, &revision )) != STATUS_SUCCESS)
|
||||
+ return RtlNtStatusToDosError( status );
|
||||
+ if (!(control & SE_SELF_RELATIVE))
|
||||
+ return ERROR_INVALID_SECURITY_DESCR;
|
||||
+
|
||||
+ desc_size = sizeof(desc);
|
||||
+ status = RtlSelfRelativeToAbsoluteSD( pOldSD, &desc, &desc_size, dacl, &dacl_size, sacl, &sacl_size,
|
||||
+ owner, &owner_size, group, &group_size );
|
||||
+ if (status == STATUS_BUFFER_TOO_SMALL)
|
||||
+ {
|
||||
+ if (dacl_size)
|
||||
+ dacl = LocalAlloc( LMEM_FIXED, dacl_size );
|
||||
+ if (sacl_size)
|
||||
+ sacl = LocalAlloc( LMEM_FIXED, sacl_size );
|
||||
+ if (owner_size)
|
||||
+ owner = LocalAlloc( LMEM_FIXED, owner_size );
|
||||
+ if (group_size)
|
||||
+ group = LocalAlloc( LMEM_FIXED, group_size );
|
||||
+
|
||||
+ desc_size = sizeof(desc);
|
||||
+ status = RtlSelfRelativeToAbsoluteSD( pOldSD, &desc, &desc_size, dacl, &dacl_size, sacl, &sacl_size,
|
||||
+ owner, &owner_size, group, &group_size );
|
||||
+ }
|
||||
+ if (status != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ LocalFree( dacl );
|
||||
+ LocalFree( sacl );
|
||||
+ LocalFree( owner );
|
||||
+ LocalFree( group );
|
||||
+ return RtlNtStatusToDosError( status );
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if ((status = RtlCreateSecurityDescriptor( &desc, SECURITY_DESCRIPTOR_REVISION )) != STATUS_SUCCESS)
|
||||
+ return RtlNtStatusToDosError( status );
|
||||
+ }
|
||||
+
|
||||
+ if (pOwner)
|
||||
+ {
|
||||
+ LocalFree( desc.Owner );
|
||||
+ desc.Owner = LocalAlloc( LMEM_FIXED, sizeof(MAX_SID) );
|
||||
+ if ((ret = trustee_to_sid( sizeof(MAX_SID), desc.Owner, pOwner )))
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (pGroup)
|
||||
+ {
|
||||
+ LocalFree( desc.Group );
|
||||
+ desc.Group = LocalAlloc( LMEM_FIXED, sizeof(MAX_SID) );
|
||||
+ if ((ret = trustee_to_sid( sizeof(MAX_SID), desc.Group, pGroup )))
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (pListOfAccessEntries)
|
||||
+ {
|
||||
+ PACL new_dacl;
|
||||
+
|
||||
+ if ((ret = SetEntriesInAclW( cCountOfAccessEntries, pListOfAccessEntries, desc.Dacl, &new_dacl )))
|
||||
+ goto done;
|
||||
+
|
||||
+ LocalFree( desc.Dacl );
|
||||
+ desc.Dacl = new_dacl;
|
||||
+ desc.Control |= SE_DACL_PRESENT;
|
||||
+ }
|
||||
+
|
||||
+ if (pListOfAuditEntries)
|
||||
+ {
|
||||
+ PACL new_sacl;
|
||||
+
|
||||
+ if ((ret = SetEntriesInAclW( cCountOfAuditEntries, pListOfAuditEntries, desc.Sacl, &new_sacl )))
|
||||
+ goto done;
|
||||
+
|
||||
+ LocalFree( desc.Sacl );
|
||||
+ desc.Sacl = new_sacl;
|
||||
+ desc.Control |= SE_SACL_PRESENT;
|
||||
+ }
|
||||
+
|
||||
+ *lpdwBufferLength = RtlLengthSecurityDescriptor( &desc );
|
||||
+ *pNewSD = LocalAlloc( LMEM_FIXED, *lpdwBufferLength );
|
||||
+
|
||||
+ if ((status = RtlMakeSelfRelativeSD( &desc, *pNewSD, lpdwBufferLength )) != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ ret = RtlNtStatusToDosError( status );
|
||||
+ LocalFree( *pNewSD );
|
||||
+ *pNewSD = NULL;
|
||||
+ }
|
||||
+
|
||||
+done:
|
||||
+ /* free absolute descriptor */
|
||||
+ LocalFree( desc.Owner );
|
||||
+ LocalFree( desc.Group );
|
||||
+ LocalFree( desc.Sacl );
|
||||
+ LocalFree( desc.Dacl );
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -3754,6 +3861,56 @@ static void free_trustee_name(TRUSTEE_FORM form, WCHAR *trustee_nameW)
|
||||
}
|
||||
}
|
||||
|
||||
+static DWORD trustee_to_sid( DWORD nDestinationSidLength, PSID pDestinationSid, PTRUSTEEW pTrustee )
|
||||
+{
|
||||
+ if (pTrustee->MultipleTrusteeOperation == TRUSTEE_IS_IMPERSONATE)
|
||||
+ {
|
||||
+ WARN("bad multiple trustee operation %d\n", pTrustee->MultipleTrusteeOperation);
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+
|
||||
+ switch (pTrustee->TrusteeForm)
|
||||
+ {
|
||||
+ case TRUSTEE_IS_SID:
|
||||
+ if (!CopySid(nDestinationSidLength, pDestinationSid, pTrustee->ptstrName))
|
||||
+ {
|
||||
+ WARN("bad sid %p\n", pTrustee->ptstrName);
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+ break;
|
||||
+ case TRUSTEE_IS_NAME:
|
||||
+ {
|
||||
+ DWORD sid_size = nDestinationSidLength;
|
||||
+ DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
|
||||
+ SID_NAME_USE use;
|
||||
+ if (!strcmpW( pTrustee->ptstrName, CURRENT_USER ))
|
||||
+ {
|
||||
+ if (!lookup_user_account_name( pDestinationSid, &sid_size, NULL, &domain_size, &use ))
|
||||
+ {
|
||||
+ return GetLastError();
|
||||
+ }
|
||||
+ }
|
||||
+ else if (!LookupAccountNameW(NULL, pTrustee->ptstrName, pDestinationSid, &sid_size, NULL, &domain_size, &use))
|
||||
+ {
|
||||
+ WARN("bad user name %s\n", debugstr_w(pTrustee->ptstrName));
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ case TRUSTEE_IS_OBJECTS_AND_SID:
|
||||
+ FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n");
|
||||
+ break;
|
||||
+ case TRUSTEE_IS_OBJECTS_AND_NAME:
|
||||
+ FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n");
|
||||
+ break;
|
||||
+ default:
|
||||
+ WARN("bad trustee form %d\n", pTrustee->TrusteeForm);
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
* SetEntriesInAclA [ADVAPI32.@]
|
||||
*/
|
||||
@@ -3849,56 +4006,9 @@ DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries,
|
||||
pEntries[i].Trustee.TrusteeForm, pEntries[i].Trustee.TrusteeType,
|
||||
pEntries[i].Trustee.ptstrName);
|
||||
|
||||
- if (pEntries[i].Trustee.MultipleTrusteeOperation == TRUSTEE_IS_IMPERSONATE)
|
||||
- {
|
||||
- WARN("bad multiple trustee operation %d for trustee %d\n", pEntries[i].Trustee.MultipleTrusteeOperation, i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
- goto exit;
|
||||
- }
|
||||
-
|
||||
- switch (pEntries[i].Trustee.TrusteeForm)
|
||||
- {
|
||||
- case TRUSTEE_IS_SID:
|
||||
- if (!CopySid(FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]),
|
||||
- ppsid[i], pEntries[i].Trustee.ptstrName))
|
||||
- {
|
||||
- WARN("bad sid %p for trustee %d\n", pEntries[i].Trustee.ptstrName, i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
- goto exit;
|
||||
- }
|
||||
- break;
|
||||
- case TRUSTEE_IS_NAME:
|
||||
- {
|
||||
- DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]);
|
||||
- DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
|
||||
- SID_NAME_USE use;
|
||||
- if (!strcmpW( pEntries[i].Trustee.ptstrName, CURRENT_USER ))
|
||||
- {
|
||||
- if (!lookup_user_account_name( ppsid[i], &sid_size, NULL, &domain_size, &use ))
|
||||
- {
|
||||
- ret = GetLastError();
|
||||
- goto exit;
|
||||
- }
|
||||
- }
|
||||
- else if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
|
||||
- {
|
||||
- WARN("bad user name %s for trustee %d\n", debugstr_w(pEntries[i].Trustee.ptstrName), i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
- goto exit;
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
- case TRUSTEE_IS_OBJECTS_AND_SID:
|
||||
- FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n");
|
||||
- break;
|
||||
- case TRUSTEE_IS_OBJECTS_AND_NAME:
|
||||
- FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n");
|
||||
- break;
|
||||
- default:
|
||||
- WARN("bad trustee form %d for trustee %d\n", pEntries[i].Trustee.TrusteeForm, i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
+ ret = trustee_to_sid( FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]), ppsid[i], &pEntries[i].Trustee);
|
||||
+ if (ret)
|
||||
goto exit;
|
||||
- }
|
||||
|
||||
/* Note: we overestimate the ACL size here as a tradeoff between
|
||||
* instructions (simplicity) and memory */
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,69 +0,0 @@
|
||||
From 09d62cfc4fa999eacc89af2ad414810e22c910a9 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 5 May 2017 00:18:50 +0200
|
||||
Subject: advapi32/tests: Add basic tests for BuildSecurityDescriptor.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 39 +++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 39 insertions(+)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index ca5edffae5..db5a0f934c 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -7217,6 +7217,44 @@ static void test_GetExplicitEntriesFromAclW(void)
|
||||
HeapFree(GetProcessHeap(), 0, old_acl);
|
||||
}
|
||||
|
||||
+static void test_BuildSecurityDescriptorW(void)
|
||||
+{
|
||||
+ SECURITY_DESCRIPTOR old_sd, *new_sd, *rel_sd;
|
||||
+ ULONG new_sd_size;
|
||||
+ DWORD buf_size;
|
||||
+ char buf[1024];
|
||||
+ BOOL success;
|
||||
+ DWORD ret;
|
||||
+
|
||||
+ InitializeSecurityDescriptor(&old_sd, SECURITY_DESCRIPTOR_REVISION);
|
||||
+
|
||||
+ buf_size = sizeof(buf);
|
||||
+ rel_sd = (SECURITY_DESCRIPTOR *)buf;
|
||||
+ success = MakeSelfRelativeSD(&old_sd, rel_sd, &buf_size);
|
||||
+ ok(success, "MakeSelfRelativeSD failed with %u\n", GetLastError());
|
||||
+
|
||||
+ new_sd = NULL;
|
||||
+ new_sd_size = 0;
|
||||
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, NULL, &new_sd_size, (void **)&new_sd);
|
||||
+ ok(ret == ERROR_SUCCESS, "BuildSecurityDescriptor failed with %u\n", ret);
|
||||
+ ok(new_sd != NULL, "expected new_sd != NULL\n");
|
||||
+ ok(new_sd_size == sizeof(old_sd), "expected new_sd_size == sizeof(old_sd), got %u\n", new_sd_size);
|
||||
+ LocalFree(new_sd);
|
||||
+
|
||||
+ new_sd = (void *)0xdeadbeef;
|
||||
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, &old_sd, &new_sd_size, (void **)&new_sd);
|
||||
+ ok(ret == ERROR_INVALID_SECURITY_DESCR, "expected ERROR_INVALID_SECURITY_DESCR, got %u\n", ret);
|
||||
+ ok(new_sd == (void *)0xdeadbeef, "expected new_sd == 0xdeadbeef, got %p\n", new_sd);
|
||||
+
|
||||
+ new_sd = NULL;
|
||||
+ new_sd_size = 0;
|
||||
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, rel_sd, &new_sd_size, (void **)&new_sd);
|
||||
+ ok(ret == ERROR_SUCCESS, "BuildSecurityDescriptor failed with %u\n", ret);
|
||||
+ ok(new_sd != NULL, "expected new_sd != NULL\n");
|
||||
+ ok(new_sd_size == sizeof(old_sd), "expected new_sd_size == sizeof(old_sd), got %u\n", new_sd_size);
|
||||
+ LocalFree(new_sd);
|
||||
+}
|
||||
+
|
||||
START_TEST(security)
|
||||
{
|
||||
init();
|
||||
@@ -7271,6 +7309,7 @@ START_TEST(security)
|
||||
test_maximum_allowed();
|
||||
test_token_label();
|
||||
test_GetExplicitEntriesFromAclW();
|
||||
+ test_BuildSecurityDescriptorW();
|
||||
|
||||
/* Must be the last test, modifies process token */
|
||||
test_token_security_descriptor();
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [37594] Initial implementation of advapi32.BuildSecurityDescriptorW
|
@@ -1,4 +1,4 @@
|
||||
From 05b8bc95cff5742cf02b67afa3d6fc875d26e041 Mon Sep 17 00:00:00 2001
|
||||
From 0616176a3276be4ae49dc86c7d96b11240afca78 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 6 Aug 2017 03:15:34 +0200
|
||||
Subject: [PATCH] programs/runas: Basic implementation for starting processes
|
||||
@@ -17,10 +17,10 @@ Subject: [PATCH] programs/runas: Basic implementation for starting processes
|
||||
create mode 100644 programs/runas/runas.rc
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cfc2080..5c97c1c 100644
|
||||
index b9ef668..404ab7a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3847,6 +3847,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
|
||||
@@ -3879,6 +3879,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
|
||||
WINE_CONFIG_MAKEFILE(programs/regsvcs)
|
||||
WINE_CONFIG_MAKEFILE(programs/regsvr32)
|
||||
WINE_CONFIG_MAKEFILE(programs/rpcss)
|
||||
@@ -44,7 +44,7 @@ index 0000000..be9434b
|
||||
+RC_SRCS = runas.rc
|
||||
diff --git a/programs/runas/runas.c b/programs/runas/runas.c
|
||||
new file mode 100644
|
||||
index 0000000..cfd1c73
|
||||
index 0000000..8e96aff
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.c
|
||||
@@ -0,0 +1,214 @@
|
||||
@@ -125,7 +125,7 @@ index 0000000..cfd1c73
|
||||
+ LocalFree(str);
|
||||
+}
|
||||
+
|
||||
+static void __cdecl output_message(unsigned int id, ...)
|
||||
+static void WINAPIV output_message(unsigned int id, ...)
|
||||
+{
|
||||
+ WCHAR fmt[1024];
|
||||
+ __ms_va_list va_args;
|
||||
@@ -340,5 +340,5 @@ index 0000000..f9297a4
|
||||
+ %2!u!: %3\n"
|
||||
+}
|
||||
--
|
||||
1.9.1
|
||||
2.7.4
|
||||
|
||||
|
@@ -1,43 +0,0 @@
|
||||
From 4e75102aea7a341d58ca1326639b3d4b795e82d3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 01:37:09 +0100
|
||||
Subject: [PATCH 1/7] include/roapi.h: Add further typedefs.
|
||||
|
||||
---
|
||||
include/roapi.h | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/include/roapi.h b/include/roapi.h
|
||||
index 0421fe9..f4154f8 100644
|
||||
--- a/include/roapi.h
|
||||
+++ b/include/roapi.h
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Martin Storsjo
|
||||
+ * Copyright (C) 2016 Michael MĂĽller
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,6 +21,7 @@
|
||||
#define __WINE_ROAPI_H
|
||||
|
||||
#include <windef.h>
|
||||
+#include <activation.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -27,6 +29,11 @@ typedef enum
|
||||
RO_INIT_MULTITHREADED = 1,
|
||||
} RO_INIT_TYPE;
|
||||
|
||||
+DECLARE_HANDLE(APARTMENT_SHUTDOWN_REGISTRATION_COOKIE);
|
||||
+
|
||||
+typedef struct {} *RO_REGISTRATION_COOKIE;
|
||||
+typedef HRESULT (WINAPI *PFNGETACTIVATIONFACTORY)(HSTRING, IActivationFactory **);
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -0,0 +1,196 @@
|
||||
From 45b77996f35a193f0586110cd03377e8a04bda20 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 01:42:05 +0100
|
||||
Subject: [PATCH] combase: Implement RoGetActivationFactory.
|
||||
|
||||
---
|
||||
dlls/combase/Makefile.in | 2 +-
|
||||
dlls/combase/roapi.c | 139 +++++++++++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 135 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/combase/Makefile.in b/dlls/combase/Makefile.in
|
||||
index b1d759e49a8..df051ad2934 100644
|
||||
--- a/dlls/combase/Makefile.in
|
||||
+++ b/dlls/combase/Makefile.in
|
||||
@@ -1,5 +1,5 @@
|
||||
MODULE = combase.dll
|
||||
-IMPORTS = ole32 uuid
|
||||
+IMPORTS = advapi32 ole32 uuid
|
||||
|
||||
C_SRCS = \
|
||||
roapi.c \
|
||||
diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c
|
||||
index a2d625202d9..f7862fb774a 100644
|
||||
--- a/dlls/combase/roapi.c
|
||||
+++ b/dlls/combase/roapi.c
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2014 Martin Storsjo
|
||||
+ * Copyright 2016 Michael MĂĽller
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -15,16 +16,96 @@
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
-
|
||||
+#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
+#include "initguid.h"
|
||||
#include "roapi.h"
|
||||
#include "roparameterizediid.h"
|
||||
-#include "hstring.h"
|
||||
+#include "winstring.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(combase);
|
||||
|
||||
+static const char *debugstr_hstring(HSTRING hstr)
|
||||
+{
|
||||
+ const WCHAR *str;
|
||||
+ UINT32 len;
|
||||
+ if (hstr && !((ULONG_PTR)hstr >> 16)) return "(invalid)";
|
||||
+ str = WindowsGetStringRawBuffer(hstr, &len);
|
||||
+ return wine_dbgstr_wn(str, len);
|
||||
+}
|
||||
+
|
||||
+static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out)
|
||||
+{
|
||||
+ static const WCHAR classkeyW[] = {'S','o','f','t','w','a','r','e','\\',
|
||||
+ 'M','i','c','r','o','s','o','f','t','\\',
|
||||
+ 'W','i','n','d','o','w','s','R','u','n','t','i','m','e','\\',
|
||||
+ 'A','c','t','i','v','a','t','a','b','l','e','C','l','a','s','s','I','d',0};
|
||||
+ static const WCHAR dllpathW[] = {'D','l','l','P','a','t','h',0};
|
||||
+ HKEY hkey_root, hkey_class;
|
||||
+ DWORD type, size;
|
||||
+ HRESULT hr;
|
||||
+ WCHAR *buf = NULL;
|
||||
+
|
||||
+ *out = NULL;
|
||||
+
|
||||
+ /* load class registry key */
|
||||
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, classkeyW, 0, KEY_READ, &hkey_root))
|
||||
+ return REGDB_E_READREGDB;
|
||||
+ if (RegOpenKeyExW(hkey_root, classid, 0, KEY_READ, &hkey_class))
|
||||
+ {
|
||||
+ WARN("Class %s not found in registry\n", debugstr_w(classid));
|
||||
+ RegCloseKey(hkey_root);
|
||||
+ return REGDB_E_CLASSNOTREG;
|
||||
+ }
|
||||
+ RegCloseKey(hkey_root);
|
||||
+
|
||||
+ /* load (and expand) DllPath registry value */
|
||||
+ if (RegQueryValueExW(hkey_class, dllpathW, NULL, &type, NULL, &size))
|
||||
+ {
|
||||
+ hr = REGDB_E_READREGDB;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ if (type != REG_SZ && type != REG_EXPAND_SZ)
|
||||
+ {
|
||||
+ hr = REGDB_E_READREGDB;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ if (!(buf = HeapAlloc(GetProcessHeap(), 0, size)))
|
||||
+ {
|
||||
+ hr = E_OUTOFMEMORY;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ if (RegQueryValueExW(hkey_class, dllpathW, NULL, NULL, (BYTE *)buf, &size))
|
||||
+ {
|
||||
+ hr = REGDB_E_READREGDB;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ if (type == REG_EXPAND_SZ)
|
||||
+ {
|
||||
+ WCHAR *expanded;
|
||||
+ DWORD len = ExpandEnvironmentStringsW(buf, NULL, 0);
|
||||
+ if (!(expanded = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
|
||||
+ {
|
||||
+ hr = E_OUTOFMEMORY;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ ExpandEnvironmentStringsW(buf, expanded, len);
|
||||
+ HeapFree(GetProcessHeap(), 0, buf);
|
||||
+ buf = expanded;
|
||||
+ }
|
||||
+
|
||||
+ *out = buf;
|
||||
+ return S_OK;
|
||||
+
|
||||
+done:
|
||||
+ HeapFree(GetProcessHeap(), 0, buf);
|
||||
+ RegCloseKey(hkey_class);
|
||||
+ return hr;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/***********************************************************************
|
||||
* RoInitialize (combase.@)
|
||||
*/
|
||||
@@ -51,10 +132,58 @@ void WINAPI RoUninitialize(void)
|
||||
/***********************************************************************
|
||||
* RoGetActivationFactory (combase.@)
|
||||
*/
|
||||
-HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **factory)
|
||||
+HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_factory)
|
||||
{
|
||||
- FIXME("stub: %p %p %p\n", classid, iid, factory);
|
||||
- return E_NOTIMPL;
|
||||
+ PFNGETACTIVATIONFACTORY pDllGetActivationFactory;
|
||||
+ IActivationFactory *factory;
|
||||
+ WCHAR *library;
|
||||
+ HMODULE module;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ FIXME("(%s, %s, %p): semi-stub\n", debugstr_hstring(classid), debugstr_guid(iid), class_factory);
|
||||
+
|
||||
+ if (!iid || !class_factory)
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
+ hr = get_library_for_classid(WindowsGetStringRawBuffer(classid, NULL), &library);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ ERR("Failed to find library for %s\n", debugstr_hstring(classid));
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ if (!(module = LoadLibraryW(library)))
|
||||
+ {
|
||||
+ ERR("Failed to load module %s\n", debugstr_w(library));
|
||||
+ hr = HRESULT_FROM_WIN32(GetLastError());
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (!(pDllGetActivationFactory = (void *)GetProcAddress(module, "DllGetActivationFactory")))
|
||||
+ {
|
||||
+ ERR("Module %s does not implement DllGetActivationFactory\n", debugstr_w(library));
|
||||
+ hr = E_FAIL;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("Found library %s for class %s\n", debugstr_w(library), debugstr_hstring(classid));
|
||||
+
|
||||
+ hr = pDllGetActivationFactory(classid, &factory);
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ {
|
||||
+ hr = IActivationFactory_QueryInterface(factory, iid, class_factory);
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ {
|
||||
+ TRACE("Created interface %p\n", *class_factory);
|
||||
+ module = NULL;
|
||||
+ }
|
||||
+ IActivationFactory_Release(factory);
|
||||
+ }
|
||||
+
|
||||
+done:
|
||||
+ HeapFree(GetProcessHeap(), 0, library);
|
||||
+ if (module) FreeLibrary(module);
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
--
|
||||
2.16.3
|
||||
|
@@ -1,16 +1,16 @@
|
||||
From 8274b8bb8f25d89c2f01b1724aed7e9e2eb5614b Mon Sep 17 00:00:00 2001
|
||||
From 4707618a4e4d1ecb55362e95052465266055eada Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 01:45:30 +0100
|
||||
Subject: [PATCH 2/7] combase: Implement RoActivateInstance.
|
||||
Subject: [PATCH] combase: Implement RoActivateInstance.
|
||||
|
||||
---
|
||||
.../api-ms-win-core-winrt-l1-1-0.spec | 2 +-
|
||||
dlls/combase/combase.spec | 2 +-
|
||||
dlls/combase/roapi.c | 24 +++++++++++++++++++++-
|
||||
3 files changed, 25 insertions(+), 3 deletions(-)
|
||||
.../api-ms-win-core-winrt-l1-1-0.spec | 2 +-
|
||||
dlls/combase/combase.spec | 2 +-
|
||||
dlls/combase/roapi.c | 20 ++++++++++++++++++++
|
||||
3 files changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec b/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec
|
||||
index 74c9d27..978c3dc 100644
|
||||
index 74c9d27aae3..978c3dc6d07 100644
|
||||
--- a/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec
|
||||
+++ b/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec
|
||||
@@ -1,4 +1,4 @@
|
||||
@@ -20,7 +20,7 @@ index 74c9d27..978c3dc 100644
|
||||
@ stub RoGetApartmentIdentifier
|
||||
@ stdcall RoInitialize(long) combase.RoInitialize
|
||||
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
|
||||
index c238eb8..f42bdae 100644
|
||||
index c238eb82db7..f42bdae605b 100644
|
||||
--- a/dlls/combase/combase.spec
|
||||
+++ b/dlls/combase/combase.spec
|
||||
@@ -242,7 +242,7 @@
|
||||
@@ -33,26 +33,10 @@ index c238eb8..f42bdae 100644
|
||||
@ stub RoClearError
|
||||
@ stub RoFailFastWithErrorContext
|
||||
diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c
|
||||
index a2d62520..a272d2c 100644
|
||||
index f7862fb774a..bfd07fb3f4e 100644
|
||||
--- a/dlls/combase/roapi.c
|
||||
+++ b/dlls/combase/roapi.c
|
||||
@@ -15,12 +15,14 @@
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
-
|
||||
+#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
+#include "initguid.h"
|
||||
#include "roapi.h"
|
||||
#include "roparameterizediid.h"
|
||||
#include "hstring.h"
|
||||
|
||||
+
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(combase);
|
||||
@@ -69,3 +71,23 @@ HRESULT WINAPI RoGetParameterizedTypeInstanceIID(UINT32 name_element_count, cons
|
||||
@@ -198,3 +198,23 @@ HRESULT WINAPI RoGetParameterizedTypeInstanceIID(UINT32 name_element_count, cons
|
||||
if (hiid) *hiid = INVALID_HANDLE_VALUE;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -77,5 +61,5 @@ index a2d62520..a272d2c 100644
|
||||
+ return hr;
|
||||
+}
|
||||
--
|
||||
1.9.1
|
||||
2.16.3
|
||||
|
||||
|
@@ -1,2 +1 @@
|
||||
Fixes: [42191] Add semi-stub for D3D11 deferred context implementation
|
||||
Depends: d3d11-ID3D11Texture1D_Rebased
|
||||
|
@@ -1,38 +1,40 @@
|
||||
From 2c4ebd2e8f4cfdded1b93f26e74139e88ca94f78 Mon Sep 17 00:00:00 2001
|
||||
From bdc2d668649d5810b88bcdd842228f7d44d7a012 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 7 Jul 2017 05:44:09 +0200
|
||||
Subject: [PATCH 1/4] d3d11/tests: Add some basic depth tests.
|
||||
Subject: [PATCH] d3d11/tests: Add some basic depth tests.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 209 ++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 206 insertions(+), 3 deletions(-)
|
||||
dlls/d3d11/tests/d3d11.c | 210 ++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 207 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 5a36bc2..9d9d74b 100644
|
||||
index 8279e7b..5831bbc 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -1458,8 +1458,9 @@ static void set_quad_color(struct d3d11_test_context *context, const struct vec4
|
||||
@@ -1476,10 +1476,11 @@ static void set_quad_color(struct d3d11_test_context *context, const struct vec4
|
||||
(ID3D11Resource *)context->ps_cb, 0, NULL, color, 0, 0);
|
||||
}
|
||||
|
||||
-#define draw_color_quad(context, color) draw_color_quad_(__LINE__, context, color)
|
||||
-static void draw_color_quad_(unsigned int line, struct d3d11_test_context *context, const struct vec4 *color)
|
||||
+#define draw_color_quad(context, color) draw_color_quad_(__LINE__, context, color, 0.0)
|
||||
+#define draw_color_quad_z(context, color, z) draw_color_quad_(__LINE__, context, color, z)
|
||||
+static void draw_color_quad_(unsigned int line, struct d3d11_test_context *context, const struct vec4 *color, float z)
|
||||
-#define draw_color_quad(a, b) draw_color_quad_(__LINE__, a, b, NULL, 0)
|
||||
-#define draw_color_quad_vs(a, b, c, d) draw_color_quad_(__LINE__, a, b, c, d)
|
||||
+#define draw_color_quad(a, b) draw_color_quad_(__LINE__, a, b, NULL, 0, 0.0)
|
||||
+#define draw_color_quad_vs(a, b, c, d) draw_color_quad_(__LINE__, a, b, c, d, 0.0)
|
||||
+#define draw_color_quad_z(context, color, z) draw_color_quad_(__LINE__, context, color, NULL, 0, z)
|
||||
static void draw_color_quad_(unsigned int line, struct d3d11_test_context *context,
|
||||
- const struct vec4 *color, const DWORD *vs_code, size_t vs_code_size)
|
||||
+ const struct vec4 *color, const DWORD *vs_code, size_t vs_code_size, float z)
|
||||
{
|
||||
static const DWORD ps_color_code[] =
|
||||
{
|
||||
@@ -1501,7 +1502,7 @@ static void draw_color_quad_(unsigned int line, struct d3d11_test_context *conte
|
||||
|
||||
@@ -1522,6 +1523,7 @@ static void draw_color_quad_(unsigned int line, struct d3d11_test_context *conte
|
||||
set_quad_color(context, color);
|
||||
|
||||
- draw_quad_(line, context);
|
||||
draw_quad_vs_(line, context, vs_code, vs_code_size);
|
||||
+ draw_quad_z_(line, context, z);
|
||||
}
|
||||
|
||||
static void test_create_device(void)
|
||||
@@ -16776,6 +16777,207 @@ static void test_stencil_separate(void)
|
||||
@@ -17583,6 +17585,207 @@ static void test_stencil_separate(void)
|
||||
release_test_context(&test_context);
|
||||
}
|
||||
|
||||
@@ -240,7 +242,7 @@ index 5a36bc2..9d9d74b 100644
|
||||
static void test_uav_load(void)
|
||||
{
|
||||
struct shader
|
||||
@@ -25115,6 +25317,7 @@ START_TEST(d3d11)
|
||||
@@ -26490,6 +26693,7 @@ START_TEST(d3d11)
|
||||
test_shader_input_registers_limits();
|
||||
test_unbind_shader_resource_view();
|
||||
test_stencil_separate();
|
||||
@@ -249,5 +251,5 @@ index 5a36bc2..9d9d74b 100644
|
||||
test_cs_uav_store();
|
||||
test_uav_store_immediate_constant();
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,454 +0,0 @@
|
||||
From 19d3f2a7b2bdd740cc46e4b0f8a08d4c7e3e33bc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:41:15 +0200
|
||||
Subject: [PATCH] d3d11: Add stub ID3D11Texture2D and ID3D10Texture2D
|
||||
interfaces.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 21 +++
|
||||
dlls/d3d11/device.c | 36 ++++-
|
||||
dlls/d3d11/texture.c | 340 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 393 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 52496d8..bdd7c34 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -111,6 +111,27 @@ void skip_dword_unknown(const char **ptr, unsigned int count) DECLSPEC_HIDDEN;
|
||||
HRESULT parse_dxbc(const char *data, SIZE_T data_size,
|
||||
HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN;
|
||||
|
||||
+/* ID3D11Texture1D, ID3D10Texture1D */
|
||||
+struct d3d_texture1d
|
||||
+{
|
||||
+ ID3D11Texture1D ID3D11Texture1D_iface;
|
||||
+ ID3D10Texture1D ID3D10Texture1D_iface;
|
||||
+ LONG refcount;
|
||||
+
|
||||
+ D3D11_TEXTURE1D_DESC desc;
|
||||
+ ID3D11Device *device;
|
||||
+};
|
||||
+
|
||||
+static inline struct d3d_texture1d *impl_from_ID3D10Texture1D(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D10Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DESC *desc,
|
||||
+ const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture1d **texture) DECLSPEC_HIDDEN;
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D11Texture1D(ID3D11Texture1D *iface) DECLSPEC_HIDDEN;
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D10Texture1D(ID3D10Texture1D *iface) DECLSPEC_HIDDEN;
|
||||
+
|
||||
/* ID3D11Texture2D, ID3D10Texture2D */
|
||||
struct d3d_texture2d
|
||||
{
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 6a747d0..b514ebd 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -6028,9 +6028,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device *iface,
|
||||
const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture1D **texture)
|
||||
{
|
||||
- FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
|
||||
+ struct d3d_device *device = impl_from_ID3D11Device(iface);
|
||||
+ struct d3d_texture1d *object;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
|
||||
+
|
||||
+ if (FAILED(hr = d3d_texture1d_create(device, desc, data, &object)))
|
||||
+ return hr;
|
||||
+
|
||||
+ *texture = &object->ID3D11Texture1D_iface;
|
||||
+
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device *iface,
|
||||
@@ -8272,9 +8281,28 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device1 *iface,
|
||||
const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture)
|
||||
{
|
||||
- FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
|
||||
+ struct d3d_device *device = impl_from_ID3D10Device(iface);
|
||||
+ D3D11_TEXTURE1D_DESC d3d11_desc;
|
||||
+ struct d3d_texture1d *object;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
|
||||
+
|
||||
+ d3d11_desc.Width = desc->Width;
|
||||
+ d3d11_desc.MipLevels = desc->MipLevels;
|
||||
+ d3d11_desc.ArraySize = desc->ArraySize;
|
||||
+ d3d11_desc.Format = desc->Format;
|
||||
+ d3d11_desc.Usage = d3d11_usage_from_d3d10_usage(desc->Usage);
|
||||
+ d3d11_desc.BindFlags = d3d11_bind_flags_from_d3d10_bind_flags(desc->BindFlags);
|
||||
+ d3d11_desc.CPUAccessFlags = d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(desc->CPUAccessFlags);
|
||||
+ d3d11_desc.MiscFlags = d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(desc->MiscFlags);
|
||||
+
|
||||
+ if (FAILED(hr = d3d_texture1d_create(device, &d3d11_desc, (const D3D11_SUBRESOURCE_DATA *)data, &object)))
|
||||
+ return hr;
|
||||
+
|
||||
+ *texture = &object->ID3D10Texture1D_iface;
|
||||
+
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device1 *iface,
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 4315284..00540b5 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -25,6 +25,346 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d11);
|
||||
|
||||
+
|
||||
+/* ID3D11Texture1D methods */
|
||||
+
|
||||
+static inline struct d3d_texture1d *impl_from_ID3D11Texture1D(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_QueryInterface(ID3D11Texture1D *iface, REFIID riid, void **object)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_ID3D11Texture1D)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D11Resource)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
|
||||
+ || IsEqualGUID(riid, &IID_IUnknown))
|
||||
+ {
|
||||
+ *object = &texture->ID3D11Texture1D_iface;
|
||||
+ IUnknown_AddRef((IUnknown *)*object);
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ else if (IsEqualGUID(riid, &IID_ID3D10Texture1D)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D10Resource)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
|
||||
+ {
|
||||
+ *object = &texture->ID3D10Texture1D_iface;
|
||||
+ IUnknown_AddRef((IUnknown *)*object);
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
+
|
||||
+ *object = NULL;
|
||||
+ return E_NOINTERFACE;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ ULONG refcount = InterlockedIncrement(&texture->refcount);
|
||||
+
|
||||
+ TRACE("%p increasing refcount to %u.\n", texture, refcount);
|
||||
+
|
||||
+ if (refcount == 1)
|
||||
+ {
|
||||
+ ID3D11Device_AddRef(texture->device);
|
||||
+ }
|
||||
+
|
||||
+ return refcount;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ ULONG refcount = InterlockedDecrement(&texture->refcount);
|
||||
+
|
||||
+ TRACE("%p decreasing refcount to %u.\n", texture, refcount);
|
||||
+
|
||||
+ if (!refcount)
|
||||
+ {
|
||||
+ ID3D11Device *device = texture->device;
|
||||
+
|
||||
+ /* Release the device last, it may cause the wined3d device to be
|
||||
+ * destroyed. */
|
||||
+ ID3D11Device_Release(device);
|
||||
+ }
|
||||
+
|
||||
+ return refcount;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_GetDevice(ID3D11Texture1D *iface, ID3D11Device **device)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, device %p.\n", iface, device);
|
||||
+
|
||||
+ *device = texture->device;
|
||||
+ ID3D11Device_AddRef(*device);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_GetPrivateData(ID3D11Texture1D *iface,
|
||||
+ REFGUID guid, UINT *data_size, void *data)
|
||||
+{
|
||||
+ FIXME("iface %p, guid %s, data_size %p, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateData(ID3D11Texture1D *iface,
|
||||
+ REFGUID guid, UINT data_size, const void *data)
|
||||
+{
|
||||
+ FIXME("iface %p, guid %s, data_size %u, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateDataInterface(ID3D11Texture1D *iface,
|
||||
+ REFGUID guid, const IUnknown *data)
|
||||
+{
|
||||
+ FIXME("iface %p, guid %s, data %p: stub.\n", iface, debugstr_guid(guid), data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_GetType(ID3D11Texture1D *iface,
|
||||
+ D3D11_RESOURCE_DIMENSION *resource_dimension)
|
||||
+{
|
||||
+ TRACE("iface %p, resource_dimension %p.\n", iface, resource_dimension);
|
||||
+
|
||||
+ *resource_dimension = D3D11_RESOURCE_DIMENSION_TEXTURE1D;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_SetEvictionPriority(ID3D11Texture1D *iface, UINT eviction_priority)
|
||||
+{
|
||||
+ FIXME("iface %p, eviction_priority %#x stub!\n", iface, eviction_priority);
|
||||
+}
|
||||
+
|
||||
+static UINT STDMETHODCALLTYPE d3d11_texture1d_GetEvictionPriority(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ FIXME("iface %p stub!\n", iface);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_GetDesc(ID3D11Texture1D *iface, D3D11_TEXTURE1D_DESC *desc)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+
|
||||
+ FIXME("iface %p, desc %p: semi-stub.\n", iface, desc);
|
||||
+
|
||||
+ *desc = texture->desc;
|
||||
+}
|
||||
+
|
||||
+static const struct ID3D11Texture1DVtbl d3d11_texture1d_vtbl =
|
||||
+{
|
||||
+ /* IUnknown methods */
|
||||
+ d3d11_texture1d_QueryInterface,
|
||||
+ d3d11_texture1d_AddRef,
|
||||
+ d3d11_texture1d_Release,
|
||||
+ /* ID3D11DeviceChild methods */
|
||||
+ d3d11_texture1d_GetDevice,
|
||||
+ d3d11_texture1d_GetPrivateData,
|
||||
+ d3d11_texture1d_SetPrivateData,
|
||||
+ d3d11_texture1d_SetPrivateDataInterface,
|
||||
+ /* ID3D11Resource methods */
|
||||
+ d3d11_texture1d_GetType,
|
||||
+ d3d11_texture1d_SetEvictionPriority,
|
||||
+ d3d11_texture1d_GetEvictionPriority,
|
||||
+ /* ID3D11Texture1D methods */
|
||||
+ d3d11_texture1d_GetDesc,
|
||||
+};
|
||||
+
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D11Texture1D(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ if (!iface)
|
||||
+ return NULL;
|
||||
+ assert(iface->lpVtbl == &d3d11_texture1d_vtbl);
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+/* IUnknown methods */
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_QueryInterface(ID3D10Texture1D *iface, REFIID riid, void **object)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
+
|
||||
+ return d3d11_texture1d_QueryInterface(&texture->ID3D11Texture1D_iface, riid, object);
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d10_texture1d_AddRef(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p.\n", iface);
|
||||
+
|
||||
+ return d3d11_texture1d_AddRef(&texture->ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d10_texture1d_Release(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p.\n", iface);
|
||||
+
|
||||
+ return d3d11_texture1d_Release(&texture->ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+/* ID3D10DeviceChild methods */
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_GetDevice(ID3D10Texture1D *iface, ID3D10Device **device)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, device %p.\n", iface, device);
|
||||
+
|
||||
+ ID3D11Device_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_GetPrivateData(ID3D10Texture1D *iface,
|
||||
+ REFGUID guid, UINT *data_size, void *data)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return d3d11_texture1d_GetPrivateData(&texture->ID3D11Texture1D_iface, guid, data_size, data);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_SetPrivateData(ID3D10Texture1D *iface,
|
||||
+ REFGUID guid, UINT data_size, const void *data)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return d3d11_texture1d_SetPrivateData(&texture->ID3D11Texture1D_iface, guid, data_size, data);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_SetPrivateDataInterface(ID3D10Texture1D *iface,
|
||||
+ REFGUID guid, const IUnknown *data)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
|
||||
+
|
||||
+ return d3d11_texture1d_SetPrivateDataInterface(&texture->ID3D11Texture1D_iface, guid, data);
|
||||
+}
|
||||
+
|
||||
+/* ID3D10Resource methods */
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_GetType(ID3D10Texture1D *iface,
|
||||
+ D3D10_RESOURCE_DIMENSION *resource_dimension)
|
||||
+{
|
||||
+ TRACE("iface %p, resource_dimension %p\n", iface, resource_dimension);
|
||||
+
|
||||
+ *resource_dimension = D3D10_RESOURCE_DIMENSION_TEXTURE1D;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_SetEvictionPriority(ID3D10Texture1D *iface, UINT eviction_priority)
|
||||
+{
|
||||
+ FIXME("iface %p, eviction_priority %u stub!\n", iface, eviction_priority);
|
||||
+}
|
||||
+
|
||||
+static UINT STDMETHODCALLTYPE d3d10_texture1d_GetEvictionPriority(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ FIXME("iface %p stub!\n", iface);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* ID3D10Texture1D methods */
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_Map(ID3D10Texture1D *iface, UINT sub_resource_idx,
|
||||
+ D3D10_MAP map_type, UINT map_flags, void **data)
|
||||
+{
|
||||
+ FIXME("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p: stub.\n",
|
||||
+ iface, sub_resource_idx, map_type, map_flags, data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT sub_resource_idx)
|
||||
+{
|
||||
+ FIXME("iface %p, sub_resource_idx %u: stub.\n", iface, sub_resource_idx);
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
+{
|
||||
+ FIXME("iface %p, desc %p: stub\n", iface, desc);
|
||||
+}
|
||||
+
|
||||
+static const struct ID3D10Texture1DVtbl d3d10_texture1d_vtbl =
|
||||
+{
|
||||
+ /* IUnknown methods */
|
||||
+ d3d10_texture1d_QueryInterface,
|
||||
+ d3d10_texture1d_AddRef,
|
||||
+ d3d10_texture1d_Release,
|
||||
+ /* ID3D10DeviceChild methods */
|
||||
+ d3d10_texture1d_GetDevice,
|
||||
+ d3d10_texture1d_GetPrivateData,
|
||||
+ d3d10_texture1d_SetPrivateData,
|
||||
+ d3d10_texture1d_SetPrivateDataInterface,
|
||||
+ /* ID3D10Resource methods */
|
||||
+ d3d10_texture1d_GetType,
|
||||
+ d3d10_texture1d_SetEvictionPriority,
|
||||
+ d3d10_texture1d_GetEvictionPriority,
|
||||
+ /* ID3D10Texture1D methods */
|
||||
+ d3d10_texture1d_Map,
|
||||
+ d3d10_texture1d_Unmap,
|
||||
+ d3d10_texture1d_GetDesc,
|
||||
+};
|
||||
+
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D10Texture1D(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ if (!iface)
|
||||
+ return NULL;
|
||||
+ assert(iface->lpVtbl == &d3d10_texture1d_vtbl);
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D10Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_device *device,
|
||||
+ const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data)
|
||||
+{
|
||||
+ texture->ID3D11Texture1D_iface.lpVtbl = &d3d11_texture1d_vtbl;
|
||||
+ texture->ID3D10Texture1D_iface.lpVtbl = &d3d10_texture1d_vtbl;
|
||||
+ texture->refcount = 1;
|
||||
+ texture->desc = *desc;
|
||||
+
|
||||
+ texture->device = &device->ID3D11Device_iface;
|
||||
+ ID3D11Device_AddRef(texture->device);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DESC *desc,
|
||||
+ const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture1d **texture)
|
||||
+{
|
||||
+ struct d3d_texture1d *object;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ if (FAILED(hr = d3d_texture1d_init(object, device, desc, data)))
|
||||
+ {
|
||||
+ WARN("Failed to initialize texture, hr %#x.\n", hr);
|
||||
+ HeapFree(GetProcessHeap(), 0, object);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("Created texture %p.\n", object);
|
||||
+ *texture = object;
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
/* ID3D11Texture2D methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture2d_QueryInterface(ID3D11Texture2D *iface, REFIID riid, void **object)
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,135 +0,0 @@
|
||||
From a1e800ac4f09ae90a19e2503682f069dd81850a5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 31 Aug 2016 16:22:43 +0200
|
||||
Subject: d3d11: Create a texture in d3d_texture1d_init.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/texture.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/d3d11/utils.c | 8 ++++++++
|
||||
3 files changed, 59 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 6bd7282..73f4196 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -111,6 +111,7 @@ struct d3d_texture1d
|
||||
ID3D10Texture1D ID3D10Texture1D_iface;
|
||||
LONG refcount;
|
||||
|
||||
+ struct wined3d_texture *wined3d_texture;
|
||||
D3D11_TEXTURE1D_DESC desc;
|
||||
ID3D11Device *device;
|
||||
};
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index d201b23..55fb265 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -73,6 +73,9 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface)
|
||||
if (refcount == 1)
|
||||
{
|
||||
ID3D11Device_AddRef(texture->device);
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_texture_incref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return refcount;
|
||||
@@ -89,6 +92,9 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface)
|
||||
{
|
||||
ID3D11Device *device = texture->device;
|
||||
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_texture_decref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
/* Release the device last, it may cause the wined3d device to be
|
||||
* destroyed. */
|
||||
ID3D11Device_Release(device);
|
||||
@@ -329,14 +335,58 @@ struct d3d_texture1d *unsafe_impl_from_ID3D10Texture1D(ID3D10Texture1D *iface)
|
||||
return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D10Texture1D_iface);
|
||||
}
|
||||
|
||||
+static void STDMETHODCALLTYPE d3d_texture1d_wined3d_object_released(void *parent)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = parent;
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
+}
|
||||
+
|
||||
+static const struct wined3d_parent_ops d3d_texture1d_wined3d_parent_ops =
|
||||
+{
|
||||
+ d3d_texture1d_wined3d_object_released,
|
||||
+};
|
||||
+
|
||||
static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_device *device,
|
||||
const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data)
|
||||
{
|
||||
+ struct wined3d_resource_desc wined3d_desc;
|
||||
+ unsigned int levels;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
texture->ID3D11Texture1D_iface.lpVtbl = &d3d11_texture1d_vtbl;
|
||||
texture->ID3D10Texture1D_iface.lpVtbl = &d3d10_texture1d_vtbl;
|
||||
texture->refcount = 1;
|
||||
texture->desc = *desc;
|
||||
|
||||
+ wined3d_mutex_lock();
|
||||
+
|
||||
+ wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_1D;
|
||||
+ wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
|
||||
+ wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
+ wined3d_desc.multisample_quality = 0;
|
||||
+ wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage);
|
||||
+ wined3d_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
|
||||
+ wined3d_desc.width = desc->Width;
|
||||
+ wined3d_desc.height = 1;
|
||||
+ wined3d_desc.depth = 1;
|
||||
+ wined3d_desc.size = 0;
|
||||
+
|
||||
+ levels = desc->MipLevels ? desc->MipLevels : wined3d_log2i(max(desc->Width, 1)) + 1;
|
||||
+
|
||||
+ if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &wined3d_desc,
|
||||
+ desc->ArraySize, levels, 0, (struct wined3d_sub_resource_data *)data,
|
||||
+ texture, &d3d_texture1d_wined3d_parent_ops, &texture->wined3d_texture)))
|
||||
+ {
|
||||
+ WARN("Failed to create wined3d texture, hr %#x.\n", hr);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DERR_INVALIDCALL)
|
||||
+ hr = E_INVALIDARG;
|
||||
+ return hr;
|
||||
+ }
|
||||
+ texture->desc.MipLevels = levels;
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
texture->device = &device->ID3D11Device_iface;
|
||||
ID3D11Device_AddRef(texture->device);
|
||||
|
||||
diff --git a/dlls/d3d11/utils.c b/dlls/d3d11/utils.c
|
||||
index 89dbbda..06f2600 100644
|
||||
--- a/dlls/d3d11/utils.c
|
||||
+++ b/dlls/d3d11/utils.c
|
||||
@@ -566,6 +566,10 @@ struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *re
|
||||
return wined3d_buffer_get_resource(unsafe_impl_from_ID3D11Buffer(
|
||||
(ID3D11Buffer *)resource)->wined3d_buffer);
|
||||
|
||||
+ case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
+ return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture1D(
|
||||
+ (ID3D11Texture1D *)resource)->wined3d_texture);
|
||||
+
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture2D(
|
||||
(ID3D11Texture2D *)resource)->wined3d_texture);
|
||||
@@ -592,6 +596,10 @@ struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *re
|
||||
return wined3d_buffer_get_resource(unsafe_impl_from_ID3D10Buffer(
|
||||
(ID3D10Buffer *)resource)->wined3d_buffer);
|
||||
|
||||
+ case D3D10_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
+ return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture1D(
|
||||
+ (ID3D10Texture1D *)resource)->wined3d_texture);
|
||||
+
|
||||
case D3D10_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture2D(
|
||||
(ID3D10Texture2D *)resource)->wined3d_texture);
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,53 +0,0 @@
|
||||
From 25be3c1b3ee879ab4dcc4721636042d3bb7c52af Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 31 Aug 2016 16:23:12 +0200
|
||||
Subject: d3d11: Create a private store in d3d_texture1d_init.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/texture.c | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 73f4196..4a18ca7 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -111,6 +111,7 @@ struct d3d_texture1d
|
||||
ID3D10Texture1D ID3D10Texture1D_iface;
|
||||
LONG refcount;
|
||||
|
||||
+ struct wined3d_private_store private_store;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
D3D11_TEXTURE1D_DESC desc;
|
||||
ID3D11Device *device;
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 55fb265..0c269c1 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -339,6 +339,7 @@ static void STDMETHODCALLTYPE d3d_texture1d_wined3d_object_released(void *parent
|
||||
{
|
||||
struct d3d_texture1d *texture = parent;
|
||||
|
||||
+ wined3d_private_store_cleanup(&texture->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, texture);
|
||||
}
|
||||
|
||||
@@ -360,6 +361,7 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
texture->desc = *desc;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
+ wined3d_private_store_init(&texture->private_store);
|
||||
|
||||
wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_1D;
|
||||
wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
|
||||
@@ -379,6 +381,7 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
texture, &d3d_texture1d_wined3d_parent_ops, &texture->wined3d_texture)))
|
||||
{
|
||||
WARN("Failed to create wined3d texture, hr %#x.\n", hr);
|
||||
+ wined3d_private_store_cleanup(&texture->private_store);
|
||||
wined3d_mutex_unlock();
|
||||
if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DERR_INVALIDCALL)
|
||||
hr = E_INVALIDARG;
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,83 +0,0 @@
|
||||
From d29fadf3f80f98f06f955739ede3739dc1425459 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:59:20 +0200
|
||||
Subject: d3d11: Generate dxgi surface in d3d_texture1d_init.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/texture.c | 33 +++++++++++++++++++++++++++++++++
|
||||
2 files changed, 34 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 3bd2dec..edf7217 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -112,6 +112,7 @@ struct d3d_texture1d
|
||||
LONG refcount;
|
||||
|
||||
struct wined3d_private_store private_store;
|
||||
+ IUnknown *dxgi_surface;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
D3D11_TEXTURE1D_DESC desc;
|
||||
ID3D11Device *device;
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 2fe7aa4..94f4c57 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -57,6 +57,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_texture1d_QueryInterface(ID3D11Texture1D
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
+ if (texture->dxgi_surface)
|
||||
+ {
|
||||
+ TRACE("Forwarding to dxgi surface.\n");
|
||||
+ return IUnknown_QueryInterface(texture->dxgi_surface, riid, object);
|
||||
+ }
|
||||
+
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
|
||||
*object = NULL;
|
||||
@@ -339,6 +345,7 @@ static void STDMETHODCALLTYPE d3d_texture1d_wined3d_object_released(void *parent
|
||||
{
|
||||
struct d3d_texture1d *texture = parent;
|
||||
|
||||
+ if (texture->dxgi_surface) IUnknown_Release(texture->dxgi_surface);
|
||||
wined3d_private_store_cleanup(&texture->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, texture);
|
||||
}
|
||||
@@ -388,6 +395,32 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
return hr;
|
||||
}
|
||||
texture->desc.MipLevels = levels;
|
||||
+
|
||||
+ if (desc->MipLevels == 1 && desc->ArraySize == 1)
|
||||
+ {
|
||||
+ IWineDXGIDevice *wine_device;
|
||||
+
|
||||
+ if (FAILED(hr = ID3D10Device1_QueryInterface(&device->ID3D10Device1_iface, &IID_IWineDXGIDevice,
|
||||
+ (void **)&wine_device)))
|
||||
+ {
|
||||
+ ERR("Device should implement IWineDXGIDevice.\n");
|
||||
+ wined3d_texture_decref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ hr = IWineDXGIDevice_create_surface(wine_device, texture->wined3d_texture, 0, NULL,
|
||||
+ (IUnknown *)&texture->ID3D10Texture1D_iface, (void **)&texture->dxgi_surface);
|
||||
+ IWineDXGIDevice_Release(wine_device);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ ERR("Failed to create DXGI surface, returning %#x\n", hr);
|
||||
+ texture->dxgi_surface = NULL;
|
||||
+ wined3d_texture_decref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ return hr;
|
||||
+ }
|
||||
+ }
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
texture->device = &device->ID3D11Device_iface;
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -1,40 +0,0 @@
|
||||
From 49ab2b28ef9d217479be639dcc89b689bcbf758c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:34:24 +0200
|
||||
Subject: d3d11: Improve d3d11_texture1d_GetDesc by obtaining the current width
|
||||
and format from wined3d.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index e116994..3336367 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -166,10 +166,21 @@ static UINT STDMETHODCALLTYPE d3d11_texture1d_GetEvictionPriority(ID3D11Texture1
|
||||
static void STDMETHODCALLTYPE d3d11_texture1d_GetDesc(ID3D11Texture1D *iface, D3D11_TEXTURE1D_DESC *desc)
|
||||
{
|
||||
struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ struct wined3d_resource_desc wined3d_desc;
|
||||
|
||||
- FIXME("iface %p, desc %p: semi-stub.\n", iface, desc);
|
||||
+ TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
*desc = texture->desc;
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_resource_get_desc(wined3d_texture_get_resource(texture->wined3d_texture), &wined3d_desc);
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
+ /* FIXME: Resizing swapchain buffers can cause these to change. We'd like
|
||||
+ * to get everything from wined3d, but e.g. bind flags don't exist as such
|
||||
+ * there (yet). */
|
||||
+ desc->Width = wined3d_desc.width;
|
||||
+ desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.format);
|
||||
}
|
||||
|
||||
static const struct ID3D11Texture1DVtbl d3d11_texture1d_vtbl =
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,56 +0,0 @@
|
||||
From 6709d525107a787f91530b7ffae1e108bd971744 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:36:25 +0200
|
||||
Subject: d3d11: Implement d3d10_texture1d_(Un)map.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 27 ++++++++++++++++++++++++---
|
||||
1 file changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 3336367..204aa98 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -307,15 +307,36 @@ static UINT STDMETHODCALLTYPE d3d10_texture1d_GetEvictionPriority(ID3D10Texture1
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_texture1d_Map(ID3D10Texture1D *iface, UINT sub_resource_idx,
|
||||
D3D10_MAP map_type, UINT map_flags, void **data)
|
||||
{
|
||||
- FIXME("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p: stub.\n",
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+ struct wined3d_map_desc wined3d_map_desc;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p.\n",
|
||||
iface, sub_resource_idx, map_type, map_flags, data);
|
||||
|
||||
- return E_FAIL;
|
||||
+ if (map_flags)
|
||||
+ FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx,
|
||||
+ &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type))))
|
||||
+ {
|
||||
+ *data = wined3d_map_desc.data;
|
||||
+ }
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT sub_resource_idx)
|
||||
{
|
||||
- FIXME("iface %p, sub_resource_idx %u: stub.\n", iface, sub_resource_idx);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx);
|
||||
+ wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,39 +0,0 @@
|
||||
From 94a19771d621239e2a17f94ce89f797fd28877ab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:37:59 +0200
|
||||
Subject: d3d11: Implement d3d10_texture1d_GetDesc.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 16 +++++++++++++++-
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 204aa98..e8b0047 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -341,7 +341,21 @@ static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
{
|
||||
- FIXME("iface %p, desc %p: stub\n", iface, desc);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+ D3D11_TEXTURE1D_DESC d3d11_desc;
|
||||
+
|
||||
+ TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
+
|
||||
+ d3d11_texture1d_GetDesc(&texture->ID3D11Texture1D_iface, &d3d11_desc);
|
||||
+
|
||||
+ desc->Width = d3d11_desc.Width;
|
||||
+ desc->MipLevels = d3d11_desc.MipLevels;
|
||||
+ desc->ArraySize = d3d11_desc.ArraySize;
|
||||
+ desc->Format = d3d11_desc.Format;
|
||||
+ desc->Usage = d3d10_usage_from_d3d11_usage(d3d11_desc.Usage);
|
||||
+ desc->BindFlags = d3d10_bind_flags_from_d3d11_bind_flags(d3d11_desc.BindFlags);
|
||||
+ desc->CPUAccessFlags = d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(d3d11_desc.CPUAccessFlags);
|
||||
+ desc->MiscFlags = d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(d3d11_desc.MiscFlags);
|
||||
}
|
||||
|
||||
static const struct ID3D10Texture1DVtbl d3d10_texture1d_vtbl =
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,62 +0,0 @@
|
||||
From d204de51fa14b6245cbf4afd0f0ddc01f9aa554b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:39:56 +0200
|
||||
Subject: d3d11: Implement d3d11_texture1d_{G,S}etPrivateData.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 32 ++++++++++++++++++++++++++++----
|
||||
1 file changed, 28 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index e8b0047..411dca6 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -122,17 +122,41 @@ static void STDMETHODCALLTYPE d3d11_texture1d_GetDevice(ID3D11Texture1D *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_GetPrivateData(ID3D11Texture1D *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
- FIXME("iface %p, guid %s, data_size %p, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ IDXGISurface *dxgi_surface;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_FAIL;
|
||||
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ if (texture->dxgi_surface
|
||||
+ && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface)))
|
||||
+ {
|
||||
+ hr = IDXGISurface_GetPrivateData(dxgi_surface, guid, data_size, data);
|
||||
+ IDXGISurface_Release(dxgi_surface);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ return d3d_get_private_data(&texture->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateData(ID3D11Texture1D *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
- FIXME("iface %p, guid %s, data_size %u, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ IDXGISurface *dxgi_surface;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_FAIL;
|
||||
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ if (texture->dxgi_surface
|
||||
+ && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface)))
|
||||
+ {
|
||||
+ hr = IDXGISurface_SetPrivateData(dxgi_surface, guid, data_size, data);
|
||||
+ IDXGISurface_Release(dxgi_surface);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ return d3d_set_private_data(&texture->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateDataInterface(ID3D11Texture1D *iface,
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,40 +0,0 @@
|
||||
From 950c6ffc394ca315f5769b04ce5390ce8798949d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:42:10 +0200
|
||||
Subject: d3d11: Add d3d11_texture1d_SetPrivateDataInterface.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 411dca6..eb39ef8 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -162,9 +162,21 @@ static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateData(ID3D11Texture1D
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateDataInterface(ID3D11Texture1D *iface,
|
||||
REFGUID guid, const IUnknown *data)
|
||||
{
|
||||
- FIXME("iface %p, guid %s, data %p: stub.\n", iface, debugstr_guid(guid), data);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ IDXGISurface *dxgi_surface;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
|
||||
+
|
||||
+ if (texture->dxgi_surface
|
||||
+ && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface)))
|
||||
+ {
|
||||
+ hr = IDXGISurface_SetPrivateDataInterface(dxgi_surface, guid, data);
|
||||
+ IDXGISurface_Release(dxgi_surface);
|
||||
+ return hr;
|
||||
+ }
|
||||
|
||||
- return E_FAIL;
|
||||
+ return d3d_set_private_data_interface(&texture->private_store, guid, data);
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_texture1d_GetType(ID3D11Texture1D *iface,
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,33 +0,0 @@
|
||||
From 7e3f33623d4ddf7a8fb0bab30b5c9ce18344e0ce Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 21:23:52 +0200
|
||||
Subject: d3d11: Add a hack to prevent creation of 1d cube textures
|
||||
|
||||
There is already a check in wined3d to prevent this, but it is not triggered
|
||||
as the request to create a cube texture is currently not forwarded to wined3d.
|
||||
The correct solution would be to change wined3d_usage_from_d3d11 to translate
|
||||
the D3D11_RESOURCE_MISC_TEXTURECUBE flag into WINED3DUSAGE_LEGACY_CUBEMAP.
|
||||
This would also prevent the creation of 2d cube map arrays which are not
|
||||
supported yet, but some d3d11 tests are based on the fact that wine pretends
|
||||
to support them by simply using 2d array textues and ignoring the cube map flags.
|
||||
---
|
||||
dlls/d3d11/texture.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index eb39ef8..541ed45 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -444,6 +444,9 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
unsigned int levels;
|
||||
HRESULT hr;
|
||||
|
||||
+ if (desc->MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE)
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
texture->ID3D11Texture1D_iface.lpVtbl = &d3d11_texture1d_vtbl;
|
||||
texture->ID3D10Texture1D_iface.lpVtbl = &d3d10_texture1d_vtbl;
|
||||
texture->refcount = 1;
|
||||
--
|
||||
2.8.1
|
||||
|
@@ -1,44 +0,0 @@
|
||||
From 7d92409655346368c6af7c90f8285ec1f1b40a94 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:44:57 +0200
|
||||
Subject: d3d11: Add support for 1d textures in normalize_srv_desc.
|
||||
|
||||
---
|
||||
dlls/d3d11/view.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c
|
||||
index 205513d..d6974d8 100644
|
||||
--- a/dlls/d3d11/view.c
|
||||
+++ b/dlls/d3d11/view.c
|
||||
@@ -604,6 +604,8 @@ static HRESULT normalize_srv_desc(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11R
|
||||
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
{
|
||||
+ const struct d3d_texture1d *texture;
|
||||
+
|
||||
if (desc->ViewDimension != D3D11_SRV_DIMENSION_TEXTURE1D
|
||||
&& desc->ViewDimension != D3D11_SRV_DIMENSION_TEXTURE1DARRAY)
|
||||
{
|
||||
@@ -611,8 +613,16 @@ static HRESULT normalize_srv_desc(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11R
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
- FIXME("Unhandled 1D texture resource.\n");
|
||||
- return S_OK;
|
||||
+ if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
|
||||
+ {
|
||||
+ ERR("Cannot get implementation from ID3D11Texture1D.\n");
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ format = texture->desc.Format;
|
||||
+ miplevel_count = texture->desc.MipLevels;
|
||||
+ layer_count = texture->desc.ArraySize;
|
||||
+ break;
|
||||
}
|
||||
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
--
|
||||
2.8.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user