[PATCH v3 0/1] MR2045: d3d12core: Add stub DLL.
Forspoken checks for the existence of this DLL. -- v3: d3d12core: Add stub DLL. https://gitlab.winehq.org/wine/wine/-/merge_requests/2045
From: Mohamad Al-Jaf <mohamadaljaf(a)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..c487a7d03d3 --- /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; +} + +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" -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2045
v3 - Remove superfluous const. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22131
Zebediah Figura (@zfigura) commented about dlls/d3d12core/main.c:
+ * + * 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" You're not using this for anything.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22167
Zebediah Figura (@zfigura) commented about dlls/d3d12core/main.c:
+ +#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; +} + +UINT WINAPI D3D12SDKVersion(void) +{ + FIXME( "() - stub.\n" ); + return 4; +} Do you need to actually implement these?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22168
Zebediah Figura (@zfigura) commented about dlls/d3d12core/version.rc:
+ * 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" Do you need this?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22169
This should probably also add d3d12core to the "Direct3D" section of the MAINTAINERS file. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22170
On Fri Jan 27 02:35:52 2023 +0000, Etaash Mathamsetty wrote:
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) I think you're right, it might be a variable.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22216
On Fri Jan 27 17:32:13 2023 +0000, Zebediah Figura wrote:
You're not using this for anything. You're right, I forgot to add the prototype to the header. Though, it still won't be used so I guess I'll remove it.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22217
On Fri Jan 27 17:32:13 2023 +0000, Zebediah Figura wrote:
Do you need to actually implement these? I'm not really sure, those functions are supposed to be only for the SDK. And d3d12.dll is supposed to compare the D3D12SDKVersion of the system d3d12core to the shipped one. But Wine implements d3d12 in a different manner anyway.
It's also possible that a game might check the system d3d12core version directly. They're supposed to be internal functions anyway, apps shouldn't call them. At the very least, we should keep D3D12SDKVersion and set it as the lowest version. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22218
On Fri Jan 27 17:32:14 2023 +0000, Zebediah Figura wrote:
Do you need this? Seeing as how Forspoken directly checks for the existence of the dll, it's probably a good idea to add a version.rc file that returns the lowest version.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22219
On Sat Jan 28 06:22:49 2023 +0000, Mohamad Al-Jaf wrote:
Seeing as how Forspoken directly checks for the existence of the dll, it's probably a good idea to add a version.rc file that returns the lowest version. Checking for existence doesn't necessarily imply checking for a version resource?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22243
On Sun Jan 29 04:06:58 2023 +0000, Zebediah Figura wrote:
Checking for existence doesn't necessarily imply checking for a version resource? True, but I think it's a good idea in case a game does check for a version resource. I don't think this file will need maintenance given that Wine does not ship with a working d3d12core and likely never will.
Also, this was part of the dll that people tested for the game Forspoken and it worked. Granted, this doesn't mean that the game checked for a version resource, but at the same time it didn't break it either. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2045#note_22285
participants (3)
-
Mohamad Al-Jaf -
Mohamad Al-Jaf (@maljaf) -
Zebediah Figura (@zfigura)