Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- v2: Use non-safe list iteration macros. v3: Fix intermediate test crash. v4: Make d3dkmt_* struct local. Supersede 165966~165969
.../api-ms-win-dx-d3dkmt-l1-1-0.spec | 2 +- dlls/d3d11/d3d11.spec | 1 + dlls/gdi32/driver.c | 51 +++++++++++++++++++ dlls/gdi32/gdi32.spec | 1 + dlls/gdi32/tests/driver.c | 2 +- include/ddk/d3dkmthk.h | 1 + 6 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec b/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec index e8aa38edf4..43186e8fcc 100644 --- a/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec +++ b/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec @@ -46,7 +46,7 @@ @ stub D3DKMTLock @ stub D3DKMTOfferAllocations @ stub D3DKMTOpenAdapterFromDeviceName -@ stub D3DKMTOpenAdapterFromGdiDisplayName +@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) gdi32.D3DKMTOpenAdapterFromGdiDisplayName @ stdcall D3DKMTOpenAdapterFromHdc(ptr) gdi32.D3DKMTOpenAdapterFromHdc @ stub D3DKMTOpenKeyedMutex @ stub D3DKMTOpenKeyedMutex2 diff --git a/dlls/d3d11/d3d11.spec b/dlls/d3d11/d3d11.spec index 267778ab14..365e5d7c0c 100644 --- a/dlls/d3d11/d3d11.spec +++ b/dlls/d3d11/d3d11.spec @@ -22,6 +22,7 @@ @ stub D3DKMTGetRuntimeData @ stub D3DKMTGetSharedPrimaryHandle @ stub D3DKMTLock +@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) gdi32.D3DKMTOpenAdapterFromGdiDisplayName @ stub D3DKMTOpenAdapterFromHdc @ stub D3DKMTOpenResource @ stub D3DKMTPresent diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 88f49a03b6..fe66266e18 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -41,6 +41,7 @@ #include "wine/unicode.h" #include "wine/list.h" #include "wine/debug.h" +#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(driver);
@@ -51,9 +52,18 @@ struct graphics_driver const struct gdi_dc_funcs *funcs; };
+struct d3dkmt_adapter +{ + D3DKMT_HANDLE handle; /* Kernel mode graphics adapter handle */ + INT ordinal; /* Graphics adapter ordinal */ + struct list entry; /* List entry */ +}; + static struct list drivers = LIST_INIT( drivers ); static struct graphics_driver *display_driver;
+static struct list d3dkmt_adapters = LIST_INIT( d3dkmt_adapters ); + const struct gdi_dc_funcs *font_driver = NULL;
static CRITICAL_SECTION driver_section; @@ -1272,3 +1282,44 @@ NTSTATUS WINAPI D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc ) FIXME("(%p): stub\n", desc); return STATUS_SUCCESS; } + +/****************************************************************************** + * D3DKMTOpenAdapterFromGdiDisplayName [GDI32.@] + */ +NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName( D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc ) +{ + static const WCHAR display1W[] = {'\','\','.','\','D','I','S','P','L','A','Y','1',0}; + static D3DKMT_HANDLE handle_start = 0; + struct d3dkmt_adapter *adapter; + + TRACE("(%p) semi-stub\n", desc); + + if (!desc) + return STATUS_UNSUCCESSFUL; + + /* FIXME: Support multiple monitors */ + if (lstrcmpiW( desc->DeviceName, display1W )) + { + FIXME("%s is unsupported\n", wine_dbgstr_w( desc->DeviceName )); + return STATUS_UNSUCCESSFUL; + } + + adapter = heap_alloc( sizeof( *adapter ) ); + if (!adapter) + return STATUS_NO_MEMORY; + + /* D3DKMT_HANDLE is UINT, so we can't use pointer as handle */ + adapter->handle = ++handle_start; + adapter->ordinal = 0; + + desc->hAdapter = handle_start; + /* FIXME: Support AdapterLuid */ + desc->AdapterLuid.LowPart = 0; + desc->AdapterLuid.HighPart = 0; + desc->VidPnSourceId = 0; + + EnterCriticalSection( &driver_section ); + list_add_tail( &d3dkmt_adapters, &adapter->entry ); + LeaveCriticalSection( &driver_section ); + return STATUS_SUCCESS; +} diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 2d158e0f1b..5c17ed9ee8 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -84,6 +84,7 @@ @ stdcall D3DKMTCreateDCFromMemory(ptr) @ stdcall D3DKMTDestroyDCFromMemory(ptr) @ stdcall D3DKMTEscape(ptr) +@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) @ stdcall D3DKMTOpenAdapterFromHdc(ptr) @ stdcall DPtoLP(long ptr long) @ stdcall DeleteColorSpace(long) diff --git a/dlls/gdi32/tests/driver.c b/dlls/gdi32/tests/driver.c index 3b8953b4c3..067c162838 100644 --- a/dlls/gdi32/tests/driver.c +++ b/dlls/gdi32/tests/driver.c @@ -56,7 +56,7 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void) if (!pD3DKMTOpenAdapterFromGdiDisplayName || pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc) == STATUS_PROCEDURE_NOT_FOUND) { - skip("D3DKMTOpenAdapterFromGdiDisplayName() is unavailable.\n"); + win_skip("D3DKMTOpenAdapterFromGdiDisplayName() is unavailable.\n"); return; }
diff --git a/include/ddk/d3dkmthk.h b/include/ddk/d3dkmthk.h index c87321058c..5436cb6612 100644 --- a/include/ddk/d3dkmthk.h +++ b/include/ddk/d3dkmthk.h @@ -168,6 +168,7 @@ extern "C" NTSTATUS WINAPI D3DKMTCloseAdapter(const D3DKMT_CLOSEADAPTER *desc); NTSTATUS WINAPI D3DKMTCreateDCFromMemory(D3DKMT_CREATEDCFROMMEMORY *desc); NTSTATUS WINAPI D3DKMTDestroyDCFromMemory(const D3DKMT_DESTROYDCFROMMEMORY *desc); +NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName(D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc);
#ifdef __cplusplus }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53303
Your paranoid android.
=== debian9 (32 bit report) ===
d3d11: d3d11.c:6101: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian9 (32 bit Chinese:China report) ===
d3d11: d3d11.c:6101: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian9 (32 bit WoW report) ===
Report errors: d3d11:d3d11 has no test summary line (early exit of the main process?) d3d11:d3d11 has unaccounted for failure messages d3d11:d3d11 has unaccounted for todo messages d3d11:d3d11 has unaccounted for skip messages d3d11:d3d11 returned success despite having failures
=== debian9 (64 bit WoW report) ===
d3d11: d3d11.c:6111: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16849: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 1, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 1, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 2, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 2, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 3, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27577: Test failed: Resource type 3, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:25813: Test failed: Got depth 2.51951814e-003, expected 2.51948950e-003. d3d11.c:25813: Test failed: Got depth 2.51951814e-003, expected 2.51948950e-003. d3d11.c:25813: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25813: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25813: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25813: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25813: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25813: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25813: Test failed: Got depth 5.03277779e-003, expected 5.03897900e-003. d3d11.c:25813: Test failed: Got depth 5.03277779e-003, expected 5.03897900e-003. d3d11.c:25813: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25813: Test failed: Got depth 7.52645731e-003, expected 7.53897894e-003. d3d11.c:25813: Test failed: Got depth 7.52645731e-003, expected 7.53897894e-003. d3d11.c:25813: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25813: Test failed: Got depth 1.25139356e-002, expected 1.25389788e-002. d3d11.c:25813: Test failed: Got depth 1.25139356e-002, expected 1.25389788e-002. d3d11.c:25813: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25813: Test failed: Got depth 6.40938997e-001, expected 6.42538965e-001. d3d11.c:25813: Test failed: Got depth 6.40938997e-001, expected 6.42538965e-001. d3d11.c:25813: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25813: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25813: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25821: Test failed: Got value 0x149d4 (5.03277809e-003), expected 0x14a3c (5.03897697e-003). d3d11.c:25821: Test failed: Got value 0x149d4 (5.03277809e-003), expected 0x14a3c (5.03897697e-003). d3d11.c:25821: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25821: Test failed: Got value 0x1ed41 (7.52645776e-003), expected 0x1ee13 (7.53897473e-003). d3d11.c:25821: Test failed: Got value 0x1ed41 (7.52645776e-003), expected 0x1ee13 (7.53897473e-003). d3d11.c:25821: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25821: Test failed: Got value 0x3341d (1.25139363e-002), expected 0x335c1 (1.25389703e-002). d3d11.c:25821: Test failed: Got value 0x3341d (1.25139363e-002), expected 0x335c1 (1.25389703e-002). d3d11.c:25821: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25821: Test failed: Got value 0xa41493 (6.40938976e-001), expected 0xa47d6e (6.42538943e-001). d3d11.c:25821: Test failed: Got value 0xa41493 (6.40938976e-001), expected 0xa47d6e (6.42538943e-001). d3d11.c:25821: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25821: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25821: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25830: Test failed: Got value 0x3d8 (1.50148775e-002), expected 0x3da (1.50453956e-002). d3d11.c:25830: Test failed: Got value 0x3d8 (1.50148775e-002), expected 0x3da (1.50453956e-002). d3d11.c:25830: Test failed: Got value 0x333 (1.24971389e-002), expected 0x336 (1.25429160e-002). d3d11.c:25830: Test failed: Got value 0x333 (1.24971389e-002), expected 0x336 (1.25429160e-002). d3d11.c:25830: Test failed: Got value 0x479 (1.74715801e-002), expected 0x47d (1.75326162e-002). d3d11.c:25830: Test failed: Got value 0x479 (1.74715801e-002), expected 0x47d (1.75326162e-002). d3d11.c:25830: Test failed: Got value 0xa414 (6.40939956e-001), expected 0xa47c (6.42526894e-001). d3d11.c:25830: Test failed: Got value 0xa414 (6.40939956e-001), expected 0xa47c (6.42526894e-001).
Report errors: d3d11:d3d11 prints too much data (35753 bytes)
=== debian9 (build log) ===
X Error of failed request: GLXBadFBConfig Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 34 ()
Zhiyi Zhang zzhang@codeweavers.com writes:
+/******************************************************************************
D3DKMTOpenAdapterFromGdiDisplayName [GDI32.@]
- */
+NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName( D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc ) +{
- static const WCHAR display1W[] = {'\','\','.','\','D','I','S','P','L','A','Y','1',0};
- static D3DKMT_HANDLE handle_start = 0;
- struct d3dkmt_adapter *adapter;
- TRACE("(%p) semi-stub\n", desc);
- if (!desc)
return STATUS_UNSUCCESSFUL;
- /* FIXME: Support multiple monitors */
- if (lstrcmpiW( desc->DeviceName, display1W ))
- {
FIXME("%s is unsupported\n", wine_dbgstr_w( desc->DeviceName ));
return STATUS_UNSUCCESSFUL;
- }
- adapter = heap_alloc( sizeof( *adapter ) );
- if (!adapter)
return STATUS_NO_MEMORY;
- /* D3DKMT_HANDLE is UINT, so we can't use pointer as handle */
- adapter->handle = ++handle_start;
You should use interlocked functions, or do that inside the critical section.