From 0d3a7a359671a54bb863c1cd3281a72f52ae6260 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 21 Feb 2021 14:08:56 -0600 Subject: [PATCH] nvapi-Stub_DLL: Build nvapi and nvapi64 with msvcrt. --- .../0001-nvapi-First-implementation.patch | 54 ++++++++++--------- ...NvAPI_GPU_Get-Physical-Virtual-Frame.patch | 37 ++++++------- ...NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch | 32 +++++------ 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/patches/nvapi-Stub_DLL/0001-nvapi-First-implementation.patch b/patches/nvapi-Stub_DLL/0001-nvapi-First-implementation.patch index eecd7cf6..437bee6c 100644 --- a/patches/nvapi-Stub_DLL/0001-nvapi-First-implementation.patch +++ b/patches/nvapi-Stub_DLL/0001-nvapi-First-implementation.patch @@ -1,20 +1,20 @@ -From 45051916c0540f68fc9687fc9001415e73c1566e Mon Sep 17 00:00:00 2001 +From d0a39d80d29ceee3358929d2b017a374f688ab2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 5 Jan 2015 18:11:53 +0100 Subject: [PATCH] nvapi: First implementation. --- configure.ac | 9 + - dlls/nvapi/Makefile.in | 4 + - dlls/nvapi/nvapi.c | 462 +++++++++++++++++++++++++++++++++++++++++++ + dlls/nvapi/Makefile.in | 6 + + dlls/nvapi/nvapi.c | 460 +++++++++++++++++++++++++++++++++++ dlls/nvapi/nvapi.spec | 5 + dlls/nvapi/tests/Makefile.in | 5 + - dlls/nvapi/tests/nvapi.c | 276 ++++++++++++++++++++++++++ - dlls/nvapi64/Makefile.in | 5 + + dlls/nvapi/tests/nvapi.c | 276 +++++++++++++++++++++ + dlls/nvapi64/Makefile.in | 7 + dlls/nvapi64/nvapi64.spec | 5 + include/Makefile.in | 1 + - include/nvapi.h | 76 +++++++ - 10 files changed, 848 insertions(+) + include/nvapi.h | 76 ++++++ + 10 files changed, 850 insertions(+) create mode 100644 dlls/nvapi/Makefile.in create mode 100644 dlls/nvapi/nvapi.c create mode 100644 dlls/nvapi/nvapi.spec @@ -25,10 +25,10 @@ Subject: [PATCH] nvapi: First implementation. create mode 100644 include/nvapi.h diff --git a/configure.ac b/configure.ac -index 621d007..2d53813 100644 +index 67f4376f9aa..4c74e6436a3 100644 --- a/configure.ac +++ b/configure.ac -@@ -213,6 +213,12 @@ esac +@@ -224,6 +224,12 @@ esac dnl enable_win16 defaults to yes on x86, to no on other CPUs enable_win16=${enable_win16:-no} enable_win64=${enable_win64:-no} @@ -41,7 +41,7 @@ index 621d007..2d53813 100644 dnl Disable winetest too if tests are disabled enable_winetest=${enable_winetest:-$enable_tests} -@@ -3507,6 +3513,9 @@ WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe) +@@ -3557,6 +3563,9 @@ WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe) WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe/tests) WINE_CONFIG_MAKEFILE(dlls/ntprint) WINE_CONFIG_MAKEFILE(dlls/ntprint/tests) @@ -53,20 +53,22 @@ index 621d007..2d53813 100644 WINE_CONFIG_MAKEFILE(dlls/objsel) diff --git a/dlls/nvapi/Makefile.in b/dlls/nvapi/Makefile.in new file mode 100644 -index 0000000..606177f +index 00000000000..7393f151e1f --- /dev/null +++ b/dlls/nvapi/Makefile.in -@@ -0,0 +1,4 @@ +@@ -0,0 +1,6 @@ +MODULE = nvapi.dll + ++EXTRADLLFLAGS = -mno-cygwin ++ +C_SRCS = \ + nvapi.c diff --git a/dlls/nvapi/nvapi.c b/dlls/nvapi/nvapi.c new file mode 100644 -index 0000000..51de617 +index 00000000000..ff5e42c6bfb --- /dev/null +++ b/dlls/nvapi/nvapi.c -@@ -0,0 +1,462 @@ +@@ -0,0 +1,460 @@ +/* + * Copyright (C) 2015 Michael Müller + * Copyright (C) 2015 Sebastian Lackner @@ -86,8 +88,6 @@ index 0000000..51de617 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + -+#include "config.h" -+ +#include + +#include "windef.h" @@ -531,7 +531,7 @@ index 0000000..51de617 +} diff --git a/dlls/nvapi/nvapi.spec b/dlls/nvapi/nvapi.spec new file mode 100644 -index 0000000..f0c054b +index 00000000000..f0c054b2bf9 --- /dev/null +++ b/dlls/nvapi/nvapi.spec @@ -0,0 +1,5 @@ @@ -542,7 +542,7 @@ index 0000000..f0c054b +@ stub DllUnregisterServer diff --git a/dlls/nvapi/tests/Makefile.in b/dlls/nvapi/tests/Makefile.in new file mode 100644 -index 0000000..a94df01 +index 00000000000..a94df015e09 --- /dev/null +++ b/dlls/nvapi/tests/Makefile.in @@ -0,0 +1,5 @@ @@ -553,7 +553,7 @@ index 0000000..a94df01 + nvapi.c diff --git a/dlls/nvapi/tests/nvapi.c b/dlls/nvapi/tests/nvapi.c new file mode 100644 -index 0000000..d760a18 +index 00000000000..d760a184141 --- /dev/null +++ b/dlls/nvapi/tests/nvapi.c @@ -0,0 +1,276 @@ @@ -835,18 +835,20 @@ index 0000000..d760a18 +} diff --git a/dlls/nvapi64/Makefile.in b/dlls/nvapi64/Makefile.in new file mode 100644 -index 0000000..80e2d6b +index 00000000000..a29d2bfc240 --- /dev/null +++ b/dlls/nvapi64/Makefile.in -@@ -0,0 +1,5 @@ +@@ -0,0 +1,7 @@ +MODULE = nvapi64.dll +PARENTSRC = ../nvapi + ++EXTRADLLFLAGS = -mno-cygwin ++ +C_SRCS = \ + nvapi.c diff --git a/dlls/nvapi64/nvapi64.spec b/dlls/nvapi64/nvapi64.spec new file mode 100644 -index 0000000..f0c054b +index 00000000000..f0c054b2bf9 --- /dev/null +++ b/dlls/nvapi64/nvapi64.spec @@ -0,0 +1,5 @@ @@ -856,10 +858,10 @@ index 0000000..f0c054b +@ stub DllRegisterServer +@ stub DllUnregisterServer diff --git a/include/Makefile.in b/include/Makefile.in -index d12e58a..1dc9cb4 100644 +index 41861c5af0d..78e9b15aad1 100644 --- a/include/Makefile.in +++ b/include/Makefile.in -@@ -475,6 +475,7 @@ SOURCES = \ +@@ -539,6 +539,7 @@ SOURCES = \ ntsecapi.h \ ntsecpkg.h \ ntstatus.h \ @@ -869,7 +871,7 @@ index d12e58a..1dc9cb4 100644 objectarray.idl \ diff --git a/include/nvapi.h b/include/nvapi.h new file mode 100644 -index 0000000..4204256 +index 00000000000..4204256cca2 --- /dev/null +++ b/include/nvapi.h @@ -0,0 +1,76 @@ @@ -950,5 +952,5 @@ index 0000000..4204256 + +#endif /* __WINE_NVAPI_H */ -- -2.7.4 +2.20.1 diff --git a/patches/nvapi-Stub_DLL/0017-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch b/patches/nvapi-Stub_DLL/0017-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch index a96eaf7f..6a23a835 100644 --- a/patches/nvapi-Stub_DLL/0017-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch +++ b/patches/nvapi-Stub_DLL/0017-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch @@ -1,33 +1,30 @@ -From deea16fd49a97aa0683ce1457c7d5ee9dd1c6f72 Mon Sep 17 00:00:00 2001 +From 037687d9f9f7b7ec692b4d998f73b8536c4fb355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 27 Jun 2017 00:28:03 +0200 -Subject: nvapi: Implement NvAPI_GPU_Get{Physical,Virtual}FrameBufferSize. +Subject: [PATCH] nvapi: Implement + NvAPI_GPU_Get{Physical,Virtual}FrameBufferSize. --- dlls/nvapi/Makefile.in | 1 + - dlls/nvapi/nvapi.c | 76 ++++++++++++++++++++++++++++++++++++++++ + dlls/nvapi/nvapi.c | 75 ++++++++++++++++++++++++++++++++++++++++ dlls/nvapi64/Makefile.in | 1 + - 3 files changed, 78 insertions(+) + 3 files changed, 77 insertions(+) diff --git a/dlls/nvapi/Makefile.in b/dlls/nvapi/Makefile.in -index 606177f1f8..6341254d9f 100644 +index 7393f151e1f..73f28fd0687 100644 --- a/dlls/nvapi/Makefile.in +++ b/dlls/nvapi/Makefile.in @@ -1,4 +1,5 @@ MODULE = nvapi.dll +IMPORTS = wined3d - C_SRCS = \ - nvapi.c + EXTRADLLFLAGS = -mno-cygwin + diff --git a/dlls/nvapi/nvapi.c b/dlls/nvapi/nvapi.c -index 598267d6c8..46d52e0984 100644 +index 3f5d772d371..2bdbfd9a78d 100644 --- a/dlls/nvapi/nvapi.c +++ b/dlls/nvapi/nvapi.c -@@ -18,9 +18,11 @@ - */ - - #include "config.h" -+#include "wine/port.h" +@@ -19,6 +19,7 @@ #include @@ -35,7 +32,7 @@ index 598267d6c8..46d52e0984 100644 #include "windef.h" #include "winbase.h" #include "winternl.h" -@@ -29,6 +31,8 @@ +@@ -27,6 +28,8 @@ #include "nvapi.h" #include "d3d9.h" @@ -44,7 +41,7 @@ index 598267d6c8..46d52e0984 100644 WINE_DEFAULT_DEBUG_CHANNEL(nvapi); #define FAKE_PHYSICAL_GPU ((NvPhysicalGpuHandle)0xdead0001) -@@ -589,6 +593,76 @@ static NvAPI_Status CDECL NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResou +@@ -587,6 +590,76 @@ static NvAPI_Status CDECL NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResou return NVAPI_ERROR; } @@ -121,7 +118,7 @@ index 598267d6c8..46d52e0984 100644 void* CDECL nvapi_QueryInterface(unsigned int offset) { static const struct -@@ -631,6 +705,8 @@ void* CDECL nvapi_QueryInterface(unsigned int offset) +@@ -629,6 +702,8 @@ void* CDECL nvapi_QueryInterface(unsigned int offset) {0xee1370cf, NvAPI_GetLogicalGPUFromDisplay}, {0xfceac864, NvAPI_D3D_GetObjectHandleForResource}, {0xa064bdfc, NvAPI_D3D9_RegisterResource}, @@ -131,7 +128,7 @@ index 598267d6c8..46d52e0984 100644 unsigned int i; TRACE("(%x)\n", offset); diff --git a/dlls/nvapi64/Makefile.in b/dlls/nvapi64/Makefile.in -index 80e2d6bfb2..04bd0cf1c4 100644 +index a29d2bfc240..283145a659b 100644 --- a/dlls/nvapi64/Makefile.in +++ b/dlls/nvapi64/Makefile.in @@ -1,5 +1,6 @@ @@ -139,8 +136,8 @@ index 80e2d6bfb2..04bd0cf1c4 100644 PARENTSRC = ../nvapi +IMPORTS = wined3d - C_SRCS = \ - nvapi.c + EXTRADLLFLAGS = -mno-cygwin + -- -2.24.1 +2.20.1 diff --git a/patches/nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch b/patches/nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch index bde291d1..eda7f95b 100644 --- a/patches/nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch +++ b/patches/nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch @@ -1,19 +1,19 @@ -From 499c8332590db70e31fc231424db177108928ff2 Mon Sep 17 00:00:00 2001 +From 81554cdd0962674a29fcdd7f12dfe5b89d9d8009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 14 Jul 2017 09:37:11 +0200 -Subject: nvapi: Implement NvAPI_D3D11_CreateDevice and +Subject: [PATCH] nvapi: Implement NvAPI_D3D11_CreateDevice and NvAPI_D3D11_CreateDeviceAndSwapChain. --- dlls/nvapi/Makefile.in | 2 +- - dlls/nvapi/nvapi.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/nvapi/tests/nvapi.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++- + dlls/nvapi/nvapi.c | 55 +++++++++++++++++++++++++++++++++++++ + dlls/nvapi/tests/nvapi.c | 58 +++++++++++++++++++++++++++++++++++++++- dlls/nvapi64/Makefile.in | 2 +- - include/nvapi.h | 9 ++++++++ + include/nvapi.h | 9 +++++++ 5 files changed, 123 insertions(+), 3 deletions(-) diff --git a/dlls/nvapi/Makefile.in b/dlls/nvapi/Makefile.in -index 6341254d9f6..0ef540b2f7d 100644 +index 73f28fd0687..efe5c60b1f8 100644 --- a/dlls/nvapi/Makefile.in +++ b/dlls/nvapi/Makefile.in @@ -1,5 +1,5 @@ @@ -21,13 +21,13 @@ index 6341254d9f6..0ef540b2f7d 100644 -IMPORTS = wined3d +IMPORTS = wined3d d3d11 - C_SRCS = \ - nvapi.c + EXTRADLLFLAGS = -mno-cygwin + diff --git a/dlls/nvapi/nvapi.c b/dlls/nvapi/nvapi.c -index 22894d6a093..cc825833e84 100644 +index 3d37f87ec0d..2044730b974 100644 --- a/dlls/nvapi/nvapi.c +++ b/dlls/nvapi/nvapi.c -@@ -30,6 +30,7 @@ +@@ -31,6 +31,7 @@ #include "wine/list.h" #include "nvapi.h" #include "d3d9.h" @@ -35,7 +35,7 @@ index 22894d6a093..cc825833e84 100644 #include "wine/wined3d.h" -@@ -709,6 +710,58 @@ static NvAPI_Status CDECL NvAPI_D3D11_SetDepthBoundsTest(IUnknown *pDeviceOrCont +@@ -711,6 +712,58 @@ static NvAPI_Status CDECL NvAPI_D3D11_SetDepthBoundsTest(IUnknown *pDeviceOrCont return NVAPI_OK; } @@ -94,7 +94,7 @@ index 22894d6a093..cc825833e84 100644 void* CDECL nvapi_QueryInterface(unsigned int offset) { static const struct -@@ -755,6 +808,8 @@ void* CDECL nvapi_QueryInterface(unsigned int offset) +@@ -757,6 +810,8 @@ void* CDECL nvapi_QueryInterface(unsigned int offset) {0x5a04b644, NvAPI_GPU_GetVirtualFrameBufferSize}, {0xc7026a87, NvAPI_GPU_GetGpuCoreCount}, {0x7aaf7a04, NvAPI_D3D11_SetDepthBoundsTest}, @@ -208,7 +208,7 @@ index 87327c0e79b..559f1740461 100644 /* d3d9 tests */ wc.lpfnWndProc = DefWindowProcA; diff --git a/dlls/nvapi64/Makefile.in b/dlls/nvapi64/Makefile.in -index 04bd0cf1c46..8988e53d056 100644 +index 283145a659b..8602b741028 100644 --- a/dlls/nvapi64/Makefile.in +++ b/dlls/nvapi64/Makefile.in @@ -1,6 +1,6 @@ @@ -217,8 +217,8 @@ index 04bd0cf1c46..8988e53d056 100644 -IMPORTS = wined3d +IMPORTS = wined3d d3d11 - C_SRCS = \ - nvapi.c + EXTRADLLFLAGS = -mno-cygwin + diff --git a/include/nvapi.h b/include/nvapi.h index 2cb4ed31f2b..5dea1a1a0bd 100644 --- a/include/nvapi.h @@ -240,5 +240,5 @@ index 2cb4ed31f2b..5dea1a1a0bd 100644 { NvU32 version; -- -2.13.1 +2.20.1