Skip to content

Commit 7657693

Browse files
malayakusraman4
authored andcommitted
ZC v1664 : Support for VS2022, IDD1.9 and bug fixes
Signed-off-by: Malaya Kumar Parida <malaya.kumar.parida@intel.com>
1 parent f1bda16 commit 7657693

File tree

12 files changed

+80
-27
lines changed

12 files changed

+80
-27
lines changed

DVServerKMD/DVServerKMD.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<Configuration>Debug</Configuration>
5454
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
5555
<RootNamespace>DVServerKMD</RootNamespace>
56-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
56+
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
5757
</PropertyGroup>
5858
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
5959
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -120,7 +120,7 @@ certmgr -del -c -n "DVServerKMD" -s PrivateCertStore</Command>
120120
<WppRecorderEnabled>true</WppRecorderEnabled>
121121
<WppScanConfigurationData Condition="'%(ClCompile.ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
122122
<WppKernelMode>true</WppKernelMode>
123-
<AdditionalIncludeDirectories>C:\Program Files %28x86%29\Windows Kits\10\Include\10.0.19041.0\um;C:\Program Files %28x86%29\Windows Kits\10\Include\10.0.19041.0\km;..\VirtIO;..\EDIDParser;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
123+
<AdditionalIncludeDirectories>..\VirtIO;..\EDIDParser;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
124124
</ClCompile>
125125
<Link>
126126
<AdditionalLibraryDirectories>..\VirtIO\objfre_win10_amd64\amd64;..\EDIDParser\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

DVServerKMD/baseobj.cpp

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@ _When_((PoolType& NonPagedPoolMustSucceed) != 0,
77
{
88
Size = (Size != 0) ? Size : 1;
99

10-
void* pObject = ExAllocatePoolWithTag(PoolType, Size, VIOGPUTAG);
10+
ULONG Flags = 0;
11+
switch (PoolType) {
12+
case NonPagedPool:
13+
Flags = POOL_FLAG_NON_PAGED;
14+
break;
15+
case PagedPool:
16+
Flags = POOL_FLAG_PAGED;
17+
break;
18+
case NonPagedPoolNx:
19+
Flags = POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED;
20+
break;
21+
default:
22+
// Handle other pool types or set a default flag
23+
Flags = POOL_FLAG_NON_PAGED;
24+
break;
25+
}
26+
27+
void* pObject = ExAllocatePool2(Flags, Size, VIOGPUTAG);
1128

1229
if (pObject != NULL)
1330
{
@@ -28,7 +45,24 @@ _When_((PoolType& NonPagedPoolMustSucceed) != 0,
2845

2946
Size = (Size != 0) ? Size : 1;
3047

31-
void* pObject = ExAllocatePoolWithTag(PoolType, Size, VIOGPUTAG);
48+
ULONG Flags = 0;
49+
switch (PoolType) {
50+
case NonPagedPool:
51+
Flags = POOL_FLAG_NON_PAGED;
52+
break;
53+
case PagedPool:
54+
Flags = POOL_FLAG_PAGED;
55+
break;
56+
case NonPagedPoolNx:
57+
Flags = POOL_FLAG_NON_PAGED | POOL_FLAG_CACHE_ALIGNED;
58+
break;
59+
default:
60+
// Handle other pool types or set a default flag
61+
Flags = POOL_FLAG_NON_PAGED;
62+
break;
63+
}
64+
65+
void* pObject = ExAllocatePool2(Flags, Size, VIOGPUTAG);
3266

3367
if (pObject != NULL)
3468
{

DVServerKMD/viogpu_pci.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ ULONGLONG mem_get_physical_address(void* context, void* virt)
129129
void* mem_alloc_nonpaged_block(void* context, size_t size)
130130
{
131131
UNREFERENCED_PARAMETER(context);
132-
PVOID ptr = ExAllocatePoolWithTag(
133-
NonPagedPoolNx,
132+
PVOID ptr = ExAllocatePool2(
133+
POOL_FLAG_NON_PAGED,
134134
size,
135135
VIOGPUTAG);
136136
if (ptr) {

DVServerUMD/DVEnabler/DVEnabler.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<Keyword>Win32Proj</Keyword>
2424
<ProjectGuid>{1cbf91f2-3537-44a7-a052-d9f4f9c1c2b6}</ProjectGuid>
2525
<RootNamespace>DVEnablerDLL</RootNamespace>
26-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
26+
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
2727
<ProjectName>DVEnabler</ProjectName>
2828
</PropertyGroup>
2929
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

DVServerUMD/DVServer/DVServer.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<Configuration>Debug</Configuration>
5757
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
5858
<RootNamespace>IddSampleDriver</RootNamespace>
59-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
59+
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
6060
<ProjectName>DVServer</ProjectName>
6161
</PropertyGroup>
6262
<PropertyGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -125,7 +125,7 @@
125125
<UMDF_VERSION_MINOR>25</UMDF_VERSION_MINOR>
126126
<IndirectDisplayDriver>true</IndirectDisplayDriver>
127127
<IDDCX_VERSION_MAJOR>1</IDDCX_VERSION_MAJOR>
128-
<IDDCX_VERSION_MINOR>4</IDDCX_VERSION_MINOR>
128+
<IDDCX_VERSION_MINOR>9</IDDCX_VERSION_MINOR>
129129
</PropertyGroup>
130130
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
131131
<TargetVersion>Windows10</TargetVersion>
@@ -134,7 +134,7 @@
134134
<UMDF_VERSION_MINOR>25</UMDF_VERSION_MINOR>
135135
<IndirectDisplayDriver>true</IndirectDisplayDriver>
136136
<IDDCX_VERSION_MAJOR>1</IDDCX_VERSION_MAJOR>
137-
<IDDCX_VERSION_MINOR>4</IDDCX_VERSION_MINOR>
137+
<IDDCX_VERSION_MINOR>9</IDDCX_VERSION_MINOR>
138138
</PropertyGroup>
139139
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
140140
<TargetVersion>Windows10</TargetVersion>
@@ -360,4 +360,4 @@ certmgr -del -c -n "DVServer" -s PrivateCertStore</Command>
360360
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
361361
<ImportGroup Label="ExtensionTargets">
362362
</ImportGroup>
363-
</Project>
363+
</Project>

DVServerUMD/DVServer/Driver.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ NTSTATUS DVServerUMDDeviceAdd(WDFDRIVER Driver, PWDFDEVICE_INIT pDeviceInit)
236236
{
237237
NTSTATUS Status = STATUS_SUCCESS;
238238
WDF_PNPPOWER_EVENT_CALLBACKS PnpPowerCallbacks;
239+
NTSTATUS status_ver;
240+
IDARG_OUT_GETVERSION pOutArgs;
239241

240242
UNREFERENCED_PARAMETER(Driver);
241243
TRACING();
@@ -293,6 +295,11 @@ NTSTATUS DVServerUMDDeviceAdd(WDFDRIVER Driver, PWDFDEVICE_INIT pDeviceInit)
293295
auto* pContext = WdfObjectGet_IndirectDeviceContextWrapper(Device);
294296
pContext->pContext = new IndirectDeviceContext(Device);
295297

298+
status_ver = IddCxGetVersion(&pOutArgs);
299+
if (status_ver == STATUS_SUCCESS) {
300+
DBGPRINT("IDD Version: %ld", pOutArgs.IddCxVersion);
301+
}
302+
296303
g_DevInfo = new DeviceInfo();
297304

298305
dvserver_monitor_count = get_total_screens(g_DevInfo->get_Handle());

EDIDParser/edidparser.vcxproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Keyword>Win32Proj</Keyword>
3131
<ProjectGuid>{7f9f9dec-8689-4d05-9dc8-fc0125c5254a}</ProjectGuid>
3232
<RootNamespace>edidparser</RootNamespace>
33-
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
33+
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
3434
</PropertyGroup>
3535
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
3636
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -49,15 +49,17 @@
4949
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
5050
<ConfigurationType>StaticLibrary</ConfigurationType>
5151
<UseDebugLibraries>true</UseDebugLibraries>
52-
<PlatformToolset>v142</PlatformToolset>
52+
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
5353
<CharacterSet>Unicode</CharacterSet>
54+
<TargetVersion>Windows10</TargetVersion>
5455
</PropertyGroup>
5556
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5657
<ConfigurationType>StaticLibrary</ConfigurationType>
5758
<UseDebugLibraries>false</UseDebugLibraries>
58-
<PlatformToolset>v142</PlatformToolset>
59+
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
5960
<WholeProgramOptimization>false</WholeProgramOptimization>
6061
<CharacterSet>Unicode</CharacterSet>
62+
<TargetVersion>Windows10</TargetVersion>
6163
</PropertyGroup>
6264
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
6365
<ImportGroup Label="ExtensionSettings">

VirtIO/VirtioLib.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<PropertyGroup Label="Globals">
4949
<RootNamespace>VirtioLib_win8</RootNamespace>
5050
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VisualStudioVersion)' == '11.0'">$(VCTargetsPath11)</VCTargetsPath>
51-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
51+
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
5252
</PropertyGroup>
5353
<PropertyGroup Label="PropertySheets">
5454
<ConfigurationType>StaticLibrary</ConfigurationType>

ZeroCopyInstaller/DVInstaller/DVInstaller.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ enum InstallModes {
6666
#define EXIT_UMD_INF_REMOVAL_FAILED (4)
6767
#define EXIT_KMD_INF_REMOVAL_FAILED (5)
6868

69+
#define SUCCESS 1
70+
#define FAIL 0
71+
6972
#define DLL_LOADED_MAX_RETRY 10
7073
#define DV_HWID TEXT("PCI\\VEN_1AF4&DEV_1050&CC_030000")
7174
#define DVSERVERKMD_INF TEXT("DVServerKMD.inf")

ZeroCopyInstaller/DVInstaller/DVInstaller.vcxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<Keyword>Win32Proj</Keyword>
2424
<ProjectGuid>{facb0e6c-2731-467e-8927-cf06ffa82011}</ProjectGuid>
2525
<RootNamespace>DVInstaller</RootNamespace>
26-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
26+
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -45,6 +45,7 @@
4545
<PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
4646
<CharacterSet>Unicode</CharacterSet>
4747
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
48+
<TargetVersion>Windows10</TargetVersion>
4849
</PropertyGroup>
4950
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5051
<ConfigurationType>Application</ConfigurationType>
@@ -53,6 +54,7 @@
5354
<WholeProgramOptimization>true</WholeProgramOptimization>
5455
<CharacterSet>Unicode</CharacterSet>
5556
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
57+
<TargetVersion>Windows10</TargetVersion>
5658
</PropertyGroup>
5759
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5860
<ImportGroup Label="ExtensionSettings">

0 commit comments

Comments
 (0)