From 1356986eb49fb5188f5f8fa8cf71468e2dd42dee Mon Sep 17 00:00:00 2001 From: Justin Miller Date: Thu, 17 Oct 2024 01:01:19 -0700 Subject: [PATCH] [SDK][WIN32SS][MEDIA] Make Them Build --- CMakeLists.txt | 2 ++ media/doc/3rd Party Files.txt | 8 ++++++++ overrides-gcc.cmake | 1 + sdk/cmake/gcc.cmake | 1 + sdk/include/ddk/d3dkmthk.h | 4 +++- sdk/include/psdk/d3dkmdt.h | 19 ++++++++++++++++--- sdk/include/psdk/d3dukmdt.h | 2 +- win32ss/gdi/gdi32_vista/dc.c | 4 ++-- 8 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3583b78b894d6..1bb54f893eb34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,6 +233,8 @@ Enable this if the module uses typeid or dynamic_cast. You will probably need to -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502 -DMINGW_HAS_SECURE_API=1 + -DD3D_UMD_INTERFACE_VERSION=0x000C # Vista + -DDXGKDDI_INTERFACE_VERSION=0x1052 # Vista -DDLL_EXPORT_VERSION=${DLL_EXPORT_VERSION}) # Arch Options diff --git a/media/doc/3rd Party Files.txt b/media/doc/3rd Party Files.txt index bd86c57550f9c..1139bc05a07eb 100644 --- a/media/doc/3rd Party Files.txt +++ b/media/doc/3rd Party Files.txt @@ -295,3 +295,11 @@ Path: modules/rosapps/lib/vfdlib Used Version: 2.1.2008.206 License: GPL-2.0 (https://spdx.org/licenses/GPL-2.0.html) URL: https://vfd.sourceforge.net/ + +Title: libdxg - WDDM Headers +Path: sdk/include/psdk/d3dukmdt.h +Path: sdk/include/psdk/d3dkmdt.h +Path: sdk/include/ddk/d3dkmthk.h +Used Version: git commit 045831e +License: MIT (https://spdx.org/licenses/MIT.html) +URL: https://github.com/microsoft/libdxg diff --git a/overrides-gcc.cmake b/overrides-gcc.cmake index 854caf26aa9fc..396ef1b4acf9b 100644 --- a/overrides-gcc.cmake +++ b/overrides-gcc.cmake @@ -1,3 +1,4 @@ +# Disable unknown-pragmas warning foreach(lang C CXX ASM) set(CMAKE_${lang}_FLAGS_DEBUG "") set(CMAKE_${lang}_FLAGS_MINSIZEREL "-Os -DNDEBUG") diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index df28387349483..cecbd895cd4f7 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -50,6 +50,7 @@ add_compile_options(-mlong-double-64) add_compile_options("$<$>:-nostdinc>") if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + add_compile_options("-Wno-unknown-pragmas") add_compile_options(-fno-aggressive-loop-optimizations) if (DBG) add_compile_options("$<$:-Wold-style-declaration>") diff --git a/sdk/include/ddk/d3dkmthk.h b/sdk/include/ddk/d3dkmthk.h index bc38231299548..dd1d795855c2b 100644 --- a/sdk/include/ddk/d3dkmthk.h +++ b/sdk/include/ddk/d3dkmthk.h @@ -29,7 +29,7 @@ typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; // Available only for Vista (LONGHORN) and later and for // multiplatform tools such as debugger extensions // -#if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) +#if defined(__REACTOS__) || ((NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL)) typedef struct _D3DKMT_CREATEDEVICEFLAGS { @@ -5649,11 +5649,13 @@ typedef _Check_return_ NTSTATUS (APIENTRY *PFND3DKMT_CANCELPRESENTS)(_In_ D3DKMT #endif +#ifndef __REACTOS__ EXTERN_C _Check_return_ NTSTATUS APIENTRY D3DKMTShareObjectWithHost(_Inout_ D3DKMT_SHAREOBJECTWITHHOST*); EXTERN_C _Check_return_ NTSTATUS APIENTRY D3DKMTCreateSyncFile(_Inout_ D3DKMT_CREATESYNCFILE*); // Used in WSL to close the internal file descriptor to /dev/dxg EXTERN_C VOID APIENTRY D3DKMTCloseDxCoreDevice(); +#endif #if !defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) diff --git a/sdk/include/psdk/d3dkmdt.h b/sdk/include/psdk/d3dkmdt.h index 3699f6f05b9d7..6e8ab6afd2af8 100644 --- a/sdk/include/psdk/d3dkmdt.h +++ b/sdk/include/psdk/d3dkmdt.h @@ -24,7 +24,8 @@ #include "d3dukmdt.h" -#define NTSTATUS int32_t +#ifndef __REACTOS__ +#define NTSTATUS int32_t /* * Some of the Windows return codes, which needs to be translated to Linux @@ -74,6 +75,13 @@ typedef enum _DEVICE_POWER_STATE { PowerDeviceMaximum } DEVICE_POWER_STATE, *PDEVICE_POWER_STATE; +#else + +#ifndef NTSTATUS +typedef LONG NTSTATUS; +#endif +#endif + #pragma region Desktop Family #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) @@ -85,7 +93,7 @@ typedef enum _DEVICE_POWER_STATE { // Available only for Vista (LONGHORN) and later and for // multiplatform tools such as debugger extensions // -#if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) +#if defined(__REACTOS__) || ((NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL)) // // Hardcoded overlay count @@ -599,13 +607,18 @@ typedef struct _D3DKMDT_VIDEO_SIGNAL_INFO #if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WDDM1_3_M1) struct { +#ifdef __REACTOS__ + // Scan line ordering (e.g. progressive, interlaced). + UINT ScanLineOrdering : 3; // D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING +#else // Scan line ordering (e.g. progressive, interlaced). D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING ScanLineOrdering : 3; +#endif // Vertical refresh frequency divider UINT VSyncFreqDivider : 6; - UINT Reserved : 23; + UINT Reserved : 23; } AdditionalSignalInfo; #endif // DXGKDDI_INTERFACE_VERSION_WDDM1_3_M1 diff --git a/sdk/include/psdk/d3dukmdt.h b/sdk/include/psdk/d3dukmdt.h index d8b1128d3811e..35b203657d730 100644 --- a/sdk/include/psdk/d3dukmdt.h +++ b/sdk/include/psdk/d3dukmdt.h @@ -194,7 +194,7 @@ typedef union _D3DKMT_PTR_TYPE // Available only for Vista (LONGHORN) and later and for // multiplatform tools such as debugger extensions // -#if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) +#if defined(__REACTOS__) || ((NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL)) typedef ULONGLONG D3DGPU_VIRTUAL_ADDRESS; typedef ULONGLONG D3DGPU_SIZE_T; diff --git a/win32ss/gdi/gdi32_vista/dc.c b/win32ss/gdi/gdi32_vista/dc.c index c985aa22255b4..7068f8bf1e8a8 100644 --- a/win32ss/gdi/gdi32_vista/dc.c +++ b/win32ss/gdi/gdi32_vista/dc.c @@ -15,12 +15,12 @@ /*********************************************************************** * D3DKMTCreateDCFromMemory (GDI32.@) */ -DWORD WINAPI D3DKMTCreateDCFromMemory( D3DKMT_CREATEDCFROMMEMORY *desc ) +NTSTATUS APIENTRY D3DKMTCreateDCFromMemory(_Inout_ D3DKMT_CREATEDCFROMMEMORY* desc) { return NtGdiDdDDICreateDCFromMemory( desc ); } -DWORD WINAPI D3DKMTDestroyDCFromMemory( const D3DKMT_DESTROYDCFROMMEMORY *desc ) +NTSTATUS APIENTRY D3DKMTDestroyDCFromMemory(_In_ CONST D3DKMT_DESTROYDCFROMMEMORY* desc) { return NtGdiDdDDIDestroyDCFromMemory( desc ); }