Skip to content

Commit 3500b22

Browse files
GPBetamingkuang-Chuyu
authored andcommitted
Fea, Qt 6 适配 Windows 7 所需改动(PR #156
- 添加 D3D12GetDebugInterface - 添加 D3D12SerializeVersionedRootSignature - 添加 IsValidDpiAwarenessContext
1 parent 25d1221 commit 3500b22

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

ThunksList.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@
200200
| 函数 | Fallback
201201
| ---- | -----------
202202
| D3D12CreateDevice | 返回 `E_NOINTERFACE`
203+
| D3D12GetDebugInterface | 返回 `E_NOINTERFACE`
204+
| D3D12SerializeVersionedRootSignature | 返回 `E_NOINTERFACE`
203205

204206
## DbgHelp.dll
205207
| 函数 | Fallback
@@ -791,6 +793,7 @@
791793
| PhysicalToLogicalPointForPerMonitorDPI | 调用 PhysicalToLogicalPoint。
792794
| LogicalToPhysicalPointForPerMonitorDPI | 调用 LogicalToPhysicalPoint。
793795
| GetSystemDpiForProcess | 调用GetDpiForSystem、GetProcessDpiAwareness。
796+
| IsValidDpiAwarenessContext | 内部实现。
794797

795798
## userenv.dll
796799
| 函数 | Fallback

src/Thunks/d3d12.hpp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,58 @@ namespace YY::Thunks
2828
return E_NOINTERFACE;
2929
}
3030
#endif
31+
32+
33+
#if (YY_Thunks_Target < __WindowsNT10_10240)
34+
35+
// Windows 10
36+
__DEFINE_THUNK(
37+
d3d12,
38+
8,
39+
HRESULT,
40+
WINAPI,
41+
D3D12GetDebugInterface,
42+
_In_ REFIID _oId,
43+
_COM_Outptr_opt_ void** _ppvDebug)
44+
{
45+
if (const auto _pfnD3D12GetDebugInterface = try_get_D3D12GetDebugInterface())
46+
{
47+
return _pfnD3D12GetDebugInterface(_oId, _ppvDebug);
48+
}
49+
50+
if (_ppvDebug)
51+
*_ppvDebug = nullptr;
52+
53+
return E_NOINTERFACE;
54+
}
55+
#endif
56+
57+
58+
#if (YY_Thunks_Target < __WindowsNT10_10240)
59+
60+
// Windows 10
61+
__DEFINE_THUNK(
62+
d3d12,
63+
12,
64+
HRESULT,
65+
WINAPI,
66+
D3D12SerializeVersionedRootSignature ,
67+
_In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* _pRootSignature,
68+
_Out_ ID3DBlob** _ppBlob,
69+
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** _ppErrorBlob)
70+
{
71+
if (const auto _pfnD3D12SerializeVersionedRootSignature = try_get_D3D12SerializeVersionedRootSignature())
72+
{
73+
return _pfnD3D12SerializeVersionedRootSignature(_pRootSignature, _ppBlob, _ppErrorBlob);
74+
}
75+
76+
if (_ppBlob)
77+
*_ppBlob = nullptr;
78+
79+
if (_ppErrorBlob)
80+
*_ppErrorBlob = nullptr;
81+
82+
return E_NOINTERFACE;
83+
}
84+
#endif
3185
}

src/Thunks/user32.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,4 +1848,31 @@ namespace YY::Thunks
18481848
}
18491849
}
18501850
#endif
1851+
1852+
1853+
#if (YY_Thunks_Target < __WindowsNT10_14393)
1854+
1855+
// 最低受支持的客户端 Windows 10版本 1607 [仅限桌面应用]
1856+
// 最低受支持的服务器 Windows Server 2016 [仅限桌面应用]
1857+
__DEFINE_THUNK(
1858+
user32,
1859+
4,
1860+
BOOL,
1861+
WINAPI,
1862+
IsValidDpiAwarenessContext,
1863+
_In_ DPI_AWARENESS_CONTEXT _eValue
1864+
)
1865+
{
1866+
if (auto const _pfnIsValidDpiAwarenessContext = try_get_IsValidDpiAwarenessContext())
1867+
{
1868+
return _pfnIsValidDpiAwarenessContext(_eValue);
1869+
}
1870+
1871+
return _eValue == DPI_AWARENESS_CONTEXT_UNAWARE ||
1872+
_eValue == DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ||
1873+
_eValue == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ||
1874+
_eValue == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ||
1875+
_eValue == DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED;
1876+
}
1877+
#endif
18511878
} //namespace YY::Thunks

0 commit comments

Comments
 (0)