From b6aae0492de6d2a6a1e7a0635a3bfc53735becc8 Mon Sep 17 00:00:00 2001 From: Justin Miller Date: Sat, 19 Oct 2024 12:27:23 -0700 Subject: [PATCH] [SDK][WIN32SS] Make Them Build --- CMakeLists.txt | 2 ++ sdk/include/ddk/d3dkmthk.h | 6 +++++- sdk/include/psdk/d3dkmdt.h | 16 +++++++++++++++- sdk/include/psdk/d3dukmdt.h | 2 +- win32ss/gdi/gdi32_vista/dc.c | 4 ++-- 5 files changed, 25 insertions(+), 5 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/sdk/include/ddk/d3dkmthk.h b/sdk/include/ddk/d3dkmthk.h index bc38231299548..5fabcc0d2f946 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,15 @@ typedef _Check_return_ NTSTATUS (APIENTRY *PFND3DKMT_CANCELPRESENTS)(_In_ D3DKMT #endif +#ifdef __REACTOS__ +#if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WDDM2_2) 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 // DXGKDDI_INTERFACE_VERSION_WDDM3_0 +#endif // __REACTOS__ #if !defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) diff --git a/sdk/include/psdk/d3dkmdt.h b/sdk/include/psdk/d3dkmdt.h index 3699f6f05b9d7..5e7c83ce15530 100644 --- a/sdk/include/psdk/d3dkmdt.h +++ b/sdk/include/psdk/d3dkmdt.h @@ -24,6 +24,8 @@ #include "d3dukmdt.h" +#ifndef __REACTOS__ + #define NTSTATUS int32_t /* @@ -74,6 +76,14 @@ typedef enum _DEVICE_POWER_STATE { PowerDeviceMaximum } DEVICE_POWER_STATE, *PDEVICE_POWER_STATE; +#else + +#ifndef NTSTATUS +typedef LONG NTSTATUS; +#endif + +#endif // !__REACTOS__ + #pragma region Desktop Family #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) @@ -85,7 +95,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 @@ -600,7 +610,11 @@ typedef struct _D3DKMDT_VIDEO_SIGNAL_INFO struct { // Scan line ordering (e.g. progressive, interlaced). +#ifdef __REACTOS__ + UINT ScanLineOrdering : 3; // D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING +#else D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING ScanLineOrdering : 3; +#endif // Vertical refresh frequency divider UINT VSyncFreqDivider : 6; 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 ); }