Skip to content

Commit

Permalink
Structure change to be more like reactos src + fix some minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lakor64 committed Aug 2, 2023
1 parent 62d26bd commit 74b756b
Show file tree
Hide file tree
Showing 83 changed files with 12,737 additions and 181 deletions.
22 changes: 0 additions & 22 deletions d3d10/d3d10.vcxproj.filters

This file was deleted.

3 changes: 3 additions & 0 deletions dll/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_subdirectory(dxgi)
#add_subdirectory(dxgidebug) # dxgidebug.h is not updated for this
#add_subdirectory(d3d10)
31 changes: 31 additions & 0 deletions dll/directx_vista/d3d10/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


spec2def(dxgi.dll dxgi.spec ADD_IMPORTLIB)

remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x601)

add_definitions(-D_USRDLL)
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/win32ss_vista/include)

add_library(dxgi MODULE
dllmain.cpp
dxgiadapter.cpp
dxgidevice.cpp
dxgifactory.cpp
dxgikeyedmutex.cpp
dxgioutput.cpp
dxgiresource.cpp
dxgisurface.cpp
dxgiswapchain.cpp
dxgi.rc
guids.cpp
${CMAKE_CURRENT_BINARY_DIR}/dxgi.def
${CMAKE_CURRENT_BINARY_DIR}/dxgi_stubs.c
)

set_module_type(dxgi win32dll UNICODE)
target_link_libraries(dxgi dxguid uuid atl_classes cppstl)
add_pch(dxgi pch.h SOURCE)
add_cd_file(TARGET dxgi DESTINATION reactos/system32 FOR all)
add_importlibs(dxgi gdi32 user32 comdlg32 msvcrt ntdll)
8 changes: 8 additions & 0 deletions dll/directx_vista/d3d10/d3d10.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactX Graphics Infrastructure\0"
#define REACTOS_STR_INTERNAL_NAME "dxgi\0"
#define REACTOS_STR_ORIGINAL_FILENAME "dxgi.dll\0"

#include <reactos/reactx.h>

#include <reactos/version.rc>
File renamed without changes.
11 changes: 8 additions & 3 deletions d3d10/d3d10.vcxproj → dll/directx_vista/d3d10/d3d10.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="d3d10.rc">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
Expand Down Expand Up @@ -126,9 +134,6 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="d3d10.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
6 changes: 6 additions & 0 deletions dll/directx_vista/d3d10/d3d10.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ResourceCompile Include="d3d10.rc" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions dll/directx_vista/dxgi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


spec2def(dxgi.dll dxgi.spec ADD_IMPORTLIB)

remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x601)

add_definitions(-D_USRDLL)
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/win32ss_vista/include)

add_library(dxgi MODULE
dllmain.cpp
dxgiadapter.cpp
dxgidevice.cpp
dxgifactory.cpp
dxgikeyedmutex.cpp
dxgioutput.cpp
dxgiresource.cpp
dxgisurface.cpp
dxgiswapchain.cpp
dxgi.rc
guids.cpp
${CMAKE_CURRENT_BINARY_DIR}/dxgi.def
${CMAKE_CURRENT_BINARY_DIR}/dxgi_stubs.c
)

set_module_type(dxgi win32dll UNICODE)
target_link_libraries(dxgi dxguid uuid atl_classes cppstl)
add_pch(dxgi pch.h SOURCE)
add_cd_file(TARGET dxgi DESTINATION reactos/system32 FOR all)
add_importlibs(dxgi gdi32 user32 comdlg32 msvcrt ntdll)
61 changes: 40 additions & 21 deletions dxgi/d3dkmtstubs.cpp → dll/directx_vista/dxgi/d3dkmtstubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ extern "C"
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTQueryAdapterInfo(_Inout_ D3DKMT_QUERYADAPTERINFO* ai)
NTSTATUS D3DKMTQueryAdapterInfo(_Inout_ CONST D3DKMT_QUERYADAPTERINFO* ai)
{
if (ai->Type == KMTQAITYPE_UMDRIVERNAME)
{
if (ai->PrivateDriverDataSize != sizeof(D3DKMT_UMDFILENAMEINFO))
return STATUS_ACCESS_VIOLATION; // meme, non va bene lol
return STATUS_INVALID_PARAMETER;

wcscpy(((D3DKMT_UMDFILENAMEINFO*)ai->pPrivateDriverData)->UmdFileName, L"dxgi.dll");
((D3DKMT_UMDFILENAMEINFO*)ai->pPrivateDriverData)->Version = KMTUMDVERSION_DX10;
Expand All @@ -59,7 +59,7 @@ extern "C"
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTQueryAllocationResidency(_Inout_ D3DKMT_QUERYALLOCATIONRESIDENCY*)
NTSTATUS D3DKMTQueryAllocationResidency(_In_ CONST D3DKMT_QUERYALLOCATIONRESIDENCY*)
{
return STATUS_SUCCESS;
}
Expand All @@ -69,7 +69,7 @@ extern "C"
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTCloseAdapter(_Inout_ D3DKMT_CLOSEADAPTER*)
NTSTATUS D3DKMTCloseAdapter(_In_ CONST D3DKMT_CLOSEADAPTER*)
{
return STATUS_SUCCESS;
}
Expand All @@ -84,52 +84,52 @@ extern "C"
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSetAllocationPriority(_Inout_ D3DKMT_SETALLOCATIONPRIORITY*)
NTSTATUS D3DKMTSetAllocationPriority(_In_ CONST D3DKMT_SETALLOCATIONPRIORITY*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSetContextSchedulingPriority(_Inout_ /*D3DKMT_SETCONTEXTSCHEDULINGPRIORITY*/ void*)
NTSTATUS D3DKMTSetContextSchedulingPriority(_In_ CONST D3DKMT_SETCONTEXTSCHEDULINGPRIORITY*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSetDisplayMode(_Inout_ D3DKMT_SETDISPLAYMODE*)
NTSTATUS D3DKMTSetDisplayMode(_In_ CONST D3DKMT_SETDISPLAYMODE*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSetDisplayPrivateDriverFormat(_Inout_ /*D3DKMT_SETDISPLAYPRIVATEDRIVERFORMAT*/ void*)
NTSTATUS D3DKMTSetDisplayPrivateDriverFormat(_In_ CONST D3DKMT_SETDISPLAYPRIVATEDRIVERFORMAT*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSetGammaRamp(_Inout_ D3DKMT_SETGAMMARAMP*)
NTSTATUS D3DKMTSetGammaRamp(_In_ CONST D3DKMT_SETGAMMARAMP*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSetVidPnSourceOwner(_Inout_ D3DKMT_SETVIDPNSOURCEOWNER*)
NTSTATUS D3DKMTSetVidPnSourceOwner(_In_ CONST D3DKMT_SETVIDPNSOURCEOWNER*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTSignalSynchronizationObject(_Inout_ D3DKMT_SIGNALSYNCHRONIZATIONOBJECT*)
NTSTATUS D3DKMTSignalSynchronizationObject(_In_ CONST D3DKMT_SIGNALSYNCHRONIZATIONOBJECT*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTUnlock(_Inout_ D3DKMT_UNLOCK*)
NTSTATUS D3DKMTUnlock(_In_ CONST D3DKMT_UNLOCK*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTWaitForSynchronizationObject(_Inout_ D3DKMT_WAITFORSYNCHRONIZATIONOBJECT*)
NTSTATUS D3DKMTWaitForSynchronizationObject(_In_ CONST D3DKMT_WAITFORSYNCHRONIZATIONOBJECT*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTWaitForVerticalBlankEvent(_Inout_ D3DKMT_WAITFORVERTICALBLANKEVENT*)
NTSTATUS D3DKMTWaitForVerticalBlankEvent(_In_ CONST D3DKMT_WAITFORVERTICALBLANKEVENT*)
{
return STATUS_SUCCESS;
}
Expand All @@ -154,32 +154,32 @@ extern "C"
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTDestroyAllocation(_Inout_ D3DKMT_DESTROYALLOCATION*)
NTSTATUS D3DKMTDestroyAllocation(_In_ CONST D3DKMT_DESTROYALLOCATION*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTDestroyContext(_Inout_ D3DKMT_DESTROYCONTEXT*)
NTSTATUS D3DKMTDestroyContext(_In_ CONST D3DKMT_DESTROYCONTEXT*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTDestroyDevice(_Inout_ D3DKMT_DESTROYDEVICE*)
NTSTATUS D3DKMTDestroyDevice(_In_ CONST D3DKMT_DESTROYDEVICE*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTDestroySynchronizationObject(_Inout_ D3DKMT_DESTROYSYNCHRONIZATIONOBJECT*)
NTSTATUS D3DKMTDestroySynchronizationObject(_In_ CONST D3DKMT_DESTROYSYNCHRONIZATIONOBJECT*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTGetContextSchedulingPriority(_Inout_ void*) // NOTE
NTSTATUS D3DKMTGetContextSchedulingPriority(_Inout_ D3DKMT_GETCONTEXTSCHEDULINGPRIORITY*)
{
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTEscape(_Inout_ D3DKMT_ESCAPE*)
NTSTATUS D3DKMTEscape(_Inout_ CONST D3DKMT_ESCAPE*)
{
return STATUS_SUCCESS;
}
Expand All @@ -194,7 +194,7 @@ extern "C"
return STATUS_SUCCESS;
}

NTSTATUS D3DKMTGetRuntimeData(_Inout_ D3DKMT_GETRUNTIMEDATA*)
NTSTATUS D3DKMTGetRuntimeData(_Inout_ CONST D3DKMT_GETRUNTIMEDATA*)
{
return STATUS_SUCCESS;
}
Expand All @@ -203,4 +203,23 @@ extern "C"
{
return STATUS_SUCCESS;
}


HRESULT WINAPI OpenAdapter10(void* pOpenData)
{
#ifdef PFF_PROJ_DEBUG
printf("OpenAdapter10: data %p\n", pOpenData);
_CrtDbgBreak();
#endif
return DXGI_ERROR_UNSUPPORTED;
}

HRESULT WINAPI OpenAdapter10_2(void* pOpenData)
{
#ifdef PFF_PROJ_DEBUG
printf("OpenAdapter10_2: data %p\n", pOpenData);
_CrtDbgBreak();
#endif
return DXGI_ERROR_UNSUPPORTED;
}
}
19 changes: 1 addition & 18 deletions dxgi/dllmain.cpp → dll/directx_vista/dxgi/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extern "C"
_In_ UINT Flags, _In_ const D3D_FEATURE_LEVEL* pLevels, _In_ UINT levelsCount, _COM_Outptr_ void** device)
{
#ifdef PFF_PROJ_DEBUG
printf("DXGID3D10CreateDevice: %#x %p %p %#x %p %u %p\n", hD3d10, pFactory, pAdapter, Flags, pLevels, levelsCount, device);
printf("DXGID3D10CreateDevice: %#llx %p %p %#x %p %u %p\n", (uint64_t)hD3d10, pFactory, pAdapter, Flags, pLevels, levelsCount, device);
_CrtDbgBreak();
#endif
return DXGI_ERROR_UNSUPPORTED;
Expand Down Expand Up @@ -198,21 +198,4 @@ extern "C"
return DXGI_ERROR_UNSUPPORTED;
}

HRESULT WINAPI OpenAdapter10(void* pOpenData)
{
#ifdef PFF_PROJ_DEBUG
printf("OpenAdapter10: data %p\n", pOpenData);
_CrtDbgBreak();
#endif
return DXGI_ERROR_UNSUPPORTED;
}

HRESULT WINAPI OpenAdapter10_2(void* pOpenData)
{
#ifdef PFF_PROJ_DEBUG
printf("OpenAdapter10_2: data %p\n", pOpenData);
_CrtDbgBreak();
#endif
return DXGI_ERROR_UNSUPPORTED;
}
}
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions dll/directx_vista/dxgi/dxgi.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactX Graphics Infrastructure\0"
#define REACTOS_STR_INTERNAL_NAME "dxgi\0"
#define REACTOS_STR_ORIGINAL_FILENAME "dxgi.dll\0"

#include <reactos/reactx.h>

#include <reactos/version.rc>
55 changes: 55 additions & 0 deletions dll/directx_vista/dxgi/dxgi.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@ stdcall CreateDXGIFactory(ptr ptr)
@ stdcall CreateDXGIFactory1(ptr ptr)
@ stdcall -version=0x601+ CreateDXGIFactory2(ptr ptr)
@ stub PIXBeginCapture
@ stub PIXEndCapture
@ stub PIXGetCaptureState
@ stub DXGIDumpJournal
@ stub DXGIReportAdapterConfiguration
@ stub SetAppCompatStringPointer
@ stub ApplyCompatResolutionQuirking
@ stub CompatString
@ stub CompatValue
@ stub UpdateHMDEmulationStatus
@ stdcall DXGID3D10CreateDevice(ptr ptr ptr long ptr long ptr)
@ stdcall DXGID3D10CreateLayeredDevice(ptr long ptr ptr ptr)
@ stdcall DXGID3D10GetLayeredDeviceSize(ptr long)
@ stdcall DXGID3D10RegisterLayers(ptr long)
@ stub DXGIDeclareAdapterRemovalSupport
@ stdcall DXGIGetDebugInterface1(long ptr ptr)
@ stdcall OpenAdapter10(ptr)
@ stdcall OpenAdapter10_2(ptr)
@ stdcall D3DKMTCloseAdapter(ptr)
@ stdcall D3DKMTCreateAllocation(ptr)
@ stdcall D3DKMTCreateContext(ptr)
@ stdcall D3DKMTCreateDevice(ptr)
@ stdcall D3DKMTCreateSyncrhonizationObject(ptr)
@ stdcall D3DKMTDestroyAllocation(ptr)
@ stdcall D3DKMTDestroyContext(ptr)
@ stdcall D3DKMTDestroyDevice(ptr)
@ stdcall D3DKMTDestroySynchronizationObject(ptr)
@ stdcall D3DKMTEscape(ptr)
@ stdcall D3DKMTGetContextSchedulingPriority(ptr)
@ stdcall D3DKMTGetDeviceState(ptr)
@ stdcall D3DKMTGetDisplayModeList(ptr)
@ stdcall D3DKMTGetMultisampleMethodList(ptr)
@ stdcall D3DKMTGetRuntimeData(ptr)
@ stdcall D3DKMTGetSharedPrimaryHandle(ptr)
@ stdcall D3DKMTLock(ptr)
@ stdcall D3DKMTOpenAdapterFromHdc(ptr)
@ stdcall D3DKMTOpenResource(ptr)
@ stdcall D3DKMTPresent(ptr)
@ stdcall D3DKMTQueryAdapterInfo(ptr)
@ stdcall D3DKMTQueryAllocationResidency(ptr)
@ stdcall D3DKMTQueryResourceInfo(ptr)
@ stdcall D3DKMTRender(ptr)
@ stdcall D3DKMTSetAllocationPriority(ptr)
@ stdcall D3DKMTSetContextSchedulingPriority(ptr)
@ stdcall D3DKMTSetDisplayMode(ptr)
@ stdcall D3DKMTSetDisplayPrivateDriverFormat(ptr)
@ stdcall D3DKMTSetGammaRamp(ptr)
@ stdcall D3DKMTSetVidPnSourceOwner(ptr)
@ stdcall D3DKMTSignalSynchronizationObject(ptr)
@ stdcall D3DKMTUnlock(ptr)
@ stdcall D3DKMTWaitForSynchronizationObject(ptr)
@ stdcall D3DKMTWaitForVerticalBlankEvent(ptr)
Loading

0 comments on commit 74b756b

Please sign in to comment.