[PATCH 5/5] d3d12: Set ordinal for D3D12CreateDevice().

Józef Kucia jkucia at codeweavers.com
Mon Mar 11 05:28:59 CDT 2019


It seems that D3D12CreateDevice() is imported by ordinal on Windows.

Reported by Sveinar Søpler.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d12/d3d12.spec    |  2 +-
 dlls/d3d12/tests/d3d12.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d12/d3d12.spec b/dlls/d3d12/d3d12.spec
index 5c4f4cfecf8a..63c8db8d235f 100644
--- a/dlls/d3d12/d3d12.spec
+++ b/dlls/d3d12/d3d12.spec
@@ -1,5 +1,5 @@
 @ stub GetBehaviorValue
-@ stdcall D3D12CreateDevice(ptr long ptr ptr)
+101 stdcall D3D12CreateDevice(ptr long ptr ptr)
 @ stdcall D3D12GetDebugInterface(ptr ptr)
 @ stub D3D12CoreCreateLayeredDevice
 @ stub D3D12CoreGetLayeredDeviceSize
diff --git a/dlls/d3d12/tests/d3d12.c b/dlls/d3d12/tests/d3d12.c
index 6b6f056e8770..76efb561c4f7 100644
--- a/dlls/d3d12/tests/d3d12.c
+++ b/dlls/d3d12/tests/d3d12.c
@@ -774,6 +774,21 @@ static void check_sub_resource_uint_(unsigned int line, ID3D12Resource *texture,
     release_resource_readback(&rb);
 }
 
+static void test_ordinals(void)
+{
+    PFN_D3D12_CREATE_DEVICE pfn_D3D12CreateDevice, pfn_101;
+    HMODULE d3d12;
+
+    d3d12 = GetModuleHandleA("d3d12.dll");
+    ok(!!d3d12, "Failed to get module handle.\n");
+
+    pfn_D3D12CreateDevice = (void *)GetProcAddress(d3d12, "D3D12CreateDevice");
+    ok(!!pfn_D3D12CreateDevice, "Failed to get D3D12CreateDevice() proc address.\n");
+
+    pfn_101 = (void *)GetProcAddress(d3d12, (const char *)101);
+    ok(pfn_101 == pfn_D3D12CreateDevice, "Got %p, expected %p.\n", pfn_101, pfn_D3D12CreateDevice);
+}
+
 static void test_interfaces(void)
 {
     D3D12_COMMAND_QUEUE_DESC desc;
@@ -1368,6 +1383,7 @@ START_TEST(d3d12)
 
     print_adapter_info();
 
+    test_ordinals();
     test_interfaces();
     test_create_device();
     test_draw();
-- 
2.19.2




More information about the wine-devel mailing list