Skip to content

Commit

Permalink
[SDK][WIN32SS][MEDIA] Make Them Build
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFire01 committed Oct 18, 2024
1 parent e3b2958 commit 1356986
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions media/doc/3rd Party Files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions overrides-gcc.cmake
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
1 change: 1 addition & 0 deletions sdk/cmake/gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ add_compile_options(-mlong-double-64)
add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-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("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>")
Expand Down
4 changes: 3 additions & 1 deletion sdk/include/ddk/d3dkmthk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)

Expand Down
19 changes: 16 additions & 3 deletions sdk/include/psdk/d3dkmdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/psdk/d3dukmdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions win32ss/gdi/gdi32_vista/dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

0 comments on commit 1356986

Please sign in to comment.