From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Forspoken checks for the existence of this DLL. --- MAINTAINERS | 1 + configure.ac | 2 + dlls/d3d12core/Makefile.in | 8 ++++ dlls/d3d12core/d3d12core.spec | 2 + dlls/d3d12core/main.c | 30 ++++++++++++++ dlls/d3d12core/tests/Makefile.in | 5 +++ dlls/d3d12core/tests/d3d12core.c | 68 ++++++++++++++++++++++++++++++++ dlls/d3d12core/version.rc | 26 ++++++++++++ 8 files changed, 142 insertions(+) create mode 100644 dlls/d3d12core/Makefile.in create mode 100644 dlls/d3d12core/d3d12core.spec create mode 100644 dlls/d3d12core/main.c create mode 100644 dlls/d3d12core/tests/Makefile.in create mode 100644 dlls/d3d12core/tests/d3d12core.c create mode 100644 dlls/d3d12core/version.rc
diff --git a/MAINTAINERS b/MAINTAINERS index 276471287da..49d88dc0cb3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -72,6 +72,7 @@ P: Matteo Bruni mbruni@codeweavers.com F: dlls/d3d10core/ F: dlls/d3d11/ F: dlls/d3d12/ +F: dlls/d3d12core/ F: dlls/d3d8/ F: dlls/d3d9/ F: dlls/d3drm/ diff --git a/configure.ac b/configure.ac index 9ff7c5e8914..42c5a4f8071 100644 --- a/configure.ac +++ b/configure.ac @@ -2432,6 +2432,8 @@ WINE_CONFIG_MAKEFILE(dlls/d3d11) WINE_CONFIG_MAKEFILE(dlls/d3d11/tests) WINE_CONFIG_MAKEFILE(dlls/d3d12) WINE_CONFIG_MAKEFILE(dlls/d3d12/tests) +WINE_CONFIG_MAKEFILE(dlls/d3d12core) +WINE_CONFIG_MAKEFILE(dlls/d3d12core/tests) WINE_CONFIG_MAKEFILE(dlls/d3d8) WINE_CONFIG_MAKEFILE(dlls/d3d8/tests) WINE_CONFIG_MAKEFILE(dlls/d3d8thk) diff --git a/dlls/d3d12core/Makefile.in b/dlls/d3d12core/Makefile.in new file mode 100644 index 00000000000..61f169c3972 --- /dev/null +++ b/dlls/d3d12core/Makefile.in @@ -0,0 +1,8 @@ +MODULE = d3d12core.dll +IMPORTLIB = d3d12core + +C_SRCS = \ + main.c + +RC_SRCS = \ + version.rc diff --git a/dlls/d3d12core/d3d12core.spec b/dlls/d3d12core/d3d12core.spec new file mode 100644 index 00000000000..7ce10bdf8b5 --- /dev/null +++ b/dlls/d3d12core/d3d12core.spec @@ -0,0 +1,2 @@ +@ stdcall D3D12GetInterface(ptr ptr ptr) +@ extern D3D12SDKVersion diff --git a/dlls/d3d12core/main.c b/dlls/d3d12core/main.c new file mode 100644 index 00000000000..b556e3b4410 --- /dev/null +++ b/dlls/d3d12core/main.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/debug.h" +#include "d3d12.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d12core); + +HRESULT WINAPI D3D12GetInterface( REFCLSID clsid, REFIID iid, void **debug ) +{ + FIXME( "clsid %s, iid %s, debug %p stub!\n", debugstr_guid(clsid), debugstr_guid(iid), debug ); + return DXGI_ERROR_SDK_COMPONENT_MISSING; +} + +const UINT D3D12SDKVersion = D3D12_SDK_VERSION; diff --git a/dlls/d3d12core/tests/Makefile.in b/dlls/d3d12core/tests/Makefile.in new file mode 100644 index 00000000000..a7e83d94dcf --- /dev/null +++ b/dlls/d3d12core/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = d3d12core.dll +IMPORTS = d3d12core + +C_SRCS = \ + d3d12core.c diff --git a/dlls/d3d12core/tests/d3d12core.c b/dlls/d3d12core/tests/d3d12core.c new file mode 100644 index 00000000000..9e3237207fd --- /dev/null +++ b/dlls/d3d12core/tests/d3d12core.c @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "initguid.h" +#include "d3d12.h" +#include "d3d12sdklayers.h" +#include "wine/test.h" + +static void test_D3D12GetInterface(void) +{ + ID3D12DeviceRemovedExtendedDataSettings *settings; + ID3D12SDKConfiguration *config; + ID3D12Tools *tools; + ID3D12Debug *debug; + HRESULT hr; + + /* Error handling */ + + hr = D3D12GetInterface( &CLSID_D3D12Debug, &IID_ID3D12Debug, NULL ); + ok( hr == DXGI_ERROR_SDK_COMPONENT_MISSING, "Unexpected hr %#lx.\n", hr ); + + hr = D3D12GetInterface( &CLSID_D3D12Debug, NULL, (void **)&debug ); + ok( hr == DXGI_ERROR_SDK_COMPONENT_MISSING, "Unexpected hr %#lx.\n", hr ); + + hr = D3D12GetInterface( &CLSID_D3D12DeviceRemovedExtendedData, &IID_ID3D12DeviceRemovedExtendedDataSettings, NULL ); + todo_wine ok( hr == S_FALSE, "Unexpected hr %#lx.\n", hr ); + + if (0) /* Crashes on Windows */ + { + hr = D3D12GetInterface( NULL, &IID_ID3D12Debug, (void **)&debug ); + hr = D3D12GetInterface( &CLSID_D3D12DeviceRemovedExtendedData, NULL, (void **)&settings ); + hr = D3D12GetInterface( &CLSID_D3D12DeviceRemovedExtendedData, &IID_ID3D12DeviceRemovedExtendedDataSettings, (void **)0xdeadbeef ); + } + + /* Expected behavior */ + + hr = D3D12GetInterface( &CLSID_D3D12Debug, &IID_ID3D12Debug, (void **)&debug ); + ok( hr == DXGI_ERROR_SDK_COMPONENT_MISSING, "Unexpected hr %#lx.\n", hr ); + + hr = D3D12GetInterface( &CLSID_D3D12Tools, &IID_ID3D12Tools, (void **)&tools ); + todo_wine ok( hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr ); + + hr = D3D12GetInterface( &CLSID_D3D12SDKConfiguration, &IID_ID3D12SDKConfiguration, (void **)&config ); + todo_wine ok( hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr ); + + hr = D3D12GetInterface( &CLSID_D3D12DeviceRemovedExtendedData, &IID_ID3D12DeviceRemovedExtendedDataSettings, (void **)&settings ); + todo_wine ok( hr == S_OK, "Unexpected hr %#lx.\n", hr ); +} + +START_TEST(d3d12core) +{ + test_D3D12GetInterface(); +} diff --git a/dlls/d3d12core/version.rc b/dlls/d3d12core/version.rc new file mode 100644 index 00000000000..9e0f540e7d9 --- /dev/null +++ b/dlls/d3d12core/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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 WINE_FILEDESCRIPTION_STR "Wine Direct3D 12 Core Runtime" +#define WINE_FILENAME_STR "d3d12core.dll" +#define WINE_FILEVERSION 10,0,18363,1350 +#define WINE_FILEVERSION_STR "10.0.18363.1350" +#define WINE_PRODUCTVERSION 10,0,18363,1350 +#define WINE_PRODUCTVERSION_STR "10.0.18363.1350" + +#include "wine/wine_common_ver.rc"