Forspoken checks for the existence of this DLL.
-- v2: d3d12core: Add stub DLL.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Forspoken checks for the existence of this DLL. --- configure.ac | 1 + dlls/d3d12core/Makefile.in | 7 +++++++ dlls/d3d12core/d3d12core.spec | 2 ++ dlls/d3d12core/main.c | 39 +++++++++++++++++++++++++++++++++++ dlls/d3d12core/version.rc | 26 +++++++++++++++++++++++ 5 files changed, 75 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/version.rc
diff --git a/configure.ac b/configure.ac index c7217274b80..523f61b68e0 100644 --- a/configure.ac +++ b/configure.ac @@ -2432,6 +2432,7 @@ 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/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..8422cd02ae8 --- /dev/null +++ b/dlls/d3d12core/Makefile.in @@ -0,0 +1,7 @@ +MODULE = d3d12core.dll + +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..efbd732de27 --- /dev/null +++ b/dlls/d3d12core/d3d12core.spec @@ -0,0 +1,2 @@ +@ stdcall D3D12GetInterface(ptr ptr ptr) +@ stdcall D3D12SDKVersion() diff --git a/dlls/d3d12core/main.c b/dlls/d3d12core/main.c new file mode 100644 index 00000000000..23757d81509 --- /dev/null +++ b/dlls/d3d12core/main.c @@ -0,0 +1,39 @@ +/* + * 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 <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "d3d12.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d12core); + +HRESULT WINAPI D3D12GetInterface( REFCLSID clsid, REFIID riid, void **out ) +{ + FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out ); + return CLASS_E_CLASSNOTAVAILABLE; +} + +const UINT WINAPI D3D12SDKVersion(void) +{ + FIXME( "() - stub.\n" ); + return 4; +} 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"
On Fri Jan 27 02:06:46 2023 +0000, Mohamad Al-Jaf wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/2045/diffs?diff_id=29561&start_sha=9397ad318ef261b75bf883d02a625fc5b2fab31f#18155e07203db2f01e8679483563c2d99221479b_35_35)
I believe it's extern on Windows as there is no header for the prototype so it needs external linkage. I'm not sure if it should also be explicitly set as extern in Wine. AFAIK, extern is default in the C compiler anyway.
Though, I missed the const part.
D3D12Core is part of the DirectX Agility SDK. The dll is supposed to be shipped with games. Typically, games check the Windows version rather than the D3D12Core version to determine which is newer and subsequently which to use. However, in this case the game is directly checking for the existence of the dll. So returning the lowest version should make games use their shipped dll.
On Fri Jan 27 02:08:17 2023 +0000, Mohamad Al-Jaf wrote:
I believe it's extern on Windows as there is no header for the prototype so it needs external linkage. I'm not sure if it should also be explicitly set as extern in Wine. AFAIK, extern is default in the C compiler anyway. Though, I missed the const part. D3D12Core is part of the DirectX Agility SDK. The dll is supposed to be shipped with games. Typically, games check the Windows version rather than the D3D12Core version to determine which is newer and subsequently which to use. However, in this case the game is directly checking for the existence of the dll. So returning the lowest version should make games use their shipped dll.
oh btw by extern I meant it's a variable, not a function
and the second part makes sense to me (using the game's dll rather than our own)