Skip to content

Commit 4890a5f

Browse files
sraman4malayaku
authored andcommitted
ZC v1742 : Added resource.rc to the complete DV solution
Signed-off-by: Raman, Sudharsan <sudharsan.raman@intel.com>
1 parent 44bd4c1 commit 4890a5f

24 files changed

+421
-17
lines changed

DVServerKMD/DVServerKMD.rc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*===========================================================================
2+
; DVServerKMD.rc
3+
;----------------------------------------------------------------------------
4+
; Copyright (C) 2021 Intel Corporation
5+
; SPDX-License-Identifier: BSD-3-Clause
6+
;
7+
; File Description:
8+
; This file will have the DVServerKMD resources
9+
;--------------------------------------------------------------------------*/
10+
11+
#include <winver.h>
12+
13+
VS_VERSION_INFO VERSIONINFO
14+
FILEVERSION ${FileVersion}
15+
PRODUCTVERSION ${ProductVersion}
16+
BEGIN
17+
BLOCK "StringFileInfo"
18+
BEGIN
19+
BLOCK "040904B0"
20+
BEGIN
21+
VALUE "FileVersion", "${FileVersion}"
22+
VALUE "ProductVersion", "${ProductVersionString}"
23+
VALUE "ProductName", "DVServerKMD.dll"
24+
VALUE "LegalCopyright", "Copyright (C) 2021 Intel Corporation"
25+
VALUE "FileDescription", "Display Virtualization Kernel Mode Driver"
26+
END
27+
END
28+
BLOCK "VarFileInfo"
29+
BEGIN
30+
VALUE "Translation", 0x409, 1200
31+
END
32+
END

DVServerKMD/DVServerKMD.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</ItemGroup>
1313
<ItemGroup>
1414
<None Include="ReadMe.txt" />
15+
<None Include="UpdateVersion.targets" />
1516
</ItemGroup>
1617
<ItemGroup>
1718
<ClCompile Include="baseobj.cpp" />
@@ -145,7 +146,11 @@ certmgr -del -c -n "DVServerKMD" -s PrivateCertStore</Command>
145146
<ItemGroup>
146147
<Text Include="DVServerKMD_Version.txt" />
147148
</ItemGroup>
149+
<ItemGroup>
150+
<ResourceCompile Include="DVServerKMD.rc" />
151+
</ItemGroup>
148152
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
149153
<ImportGroup Label="ExtensionTargets">
150154
</ImportGroup>
155+
<Import Project="UpdateVersion.targets" />
151156
</Project>

DVServerKMD/Queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,4 +589,4 @@ static NTSTATUS IoctlRequestHPEventInfo(
589589
WdfRequestSetInformation(Request, sizeof(struct hp_info));
590590

591591
return STATUS_SUCCESS;
592-
}
592+
}

DVServerKMD/Tracing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ tracer::tracer(const char* func_name)
5151
tracer::~tracer()
5252
{
5353
FuncTrace("<<< %s\n", m_func_name);
54-
}
54+
}

DVServerKMD/UpdateVersion.targets

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- DisplayVersionUpdate.xml -->
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<FdvserverkmdVersion Condition="'$(FdvserverkmdVersion)'==''">1.0.0.0</FdvserverkmdVersion>
5+
<PdvserverkmdVersion Condition="'$(PdvserverkmdVersion)'==''">1.0.0.0</PdvserverkmdVersion>
6+
</PropertyGroup>
7+
8+
<Target Name="UpdateDisplayVersion" BeforeTargets="ClCompile">
9+
<PropertyGroup>
10+
<VersionFile>DVServerKMD.rc</VersionFile>
11+
<FileContent>$([System.IO.File]::ReadAllText('$(VersionFile)'))</FileContent>
12+
13+
<!-- Split File and Product Versions -->
14+
<FileVersionMajor>$([System.String]::Copy($(FdvserverkmdVersion)).Split('.')[0])</FileVersionMajor>
15+
<FileVersionMinor>$([System.String]::Copy($(FdvserverkmdVersion)).Split('.')[1])</FileVersionMinor>
16+
<FileVersionBuild>$([System.String]::Copy($(FdvserverkmdVersion)).Split('.')[2])</FileVersionBuild>
17+
<FileVersionRevision>$([System.String]::Copy($(FdvserverkmdVersion)).Split('.')[3])</FileVersionRevision>
18+
19+
<ProductVersionMajor>$([System.String]::Copy($(PdvserverkmdVersion)).Split('.')[0])</ProductVersionMajor>
20+
<ProductVersionMinor>$([System.String]::Copy($(PdvserverkmdVersion)).Split('.')[1])</ProductVersionMinor>
21+
<ProductVersionBuild>$([System.String]::Copy($(PdvserverkmdVersion)).Split('.')[2])</ProductVersionBuild>
22+
<ProductVersionRevision>$([System.String]::Copy($(PdvserverkmdVersion)).Split('.')[3])</ProductVersionRevision>
23+
24+
<!-- Replace placeholders with commas and periods -->
25+
<FileContent>$([System.Text.RegularExpressions.Regex]::Replace($(FileContent), '\$\{FileVersion\}', '$(FileVersionMajor),$(FileVersionMinor),$(FileVersionBuild),$(FileVersionRevision)'))</FileContent>
26+
<FileContent>$([System.Text.RegularExpressions.Regex]::Replace($(FileContent), '\$\{ProductVersion\}', '$(ProductVersionMajor),$(ProductVersionMinor),$(ProductVersionBuild),$(ProductVersionRevision)'))</FileContent>
27+
<FileContent>$([System.Text.RegularExpressions.Regex]::Replace($(FileContent), '\$\{ProductVersionString\}', '$(PdvserverkmdVersion)'))</FileContent>
28+
</PropertyGroup>
29+
30+
<!-- Write updated content back to the .rc file -->
31+
<WriteLinesToFile File="$(VersionFile)" Lines="$(FileContent)" Overwrite="true"/>
32+
</Target>
33+
</Project>

DVServerUMD/DVEnabler/DVEnabler.rc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*===========================================================================
2+
; DVEnabler.rc
3+
;----------------------------------------------------------------------------
4+
; Copyright (C) 2021 Intel Corporation
5+
; SPDX-License-Identifier: MIT
6+
;
7+
; File Description:
8+
; This file will have the DVEnabler resources
9+
;--------------------------------------------------------------------------*/
10+
11+
#include <winver.h>
12+
13+
VS_VERSION_INFO VERSIONINFO
14+
FILEVERSION ${FileVersion}
15+
PRODUCTVERSION ${ProductVersion}
16+
BEGIN
17+
BLOCK "StringFileInfo"
18+
BEGIN
19+
BLOCK "040904B0"
20+
BEGIN
21+
VALUE "FileVersion", "${FileVersion}"
22+
VALUE "ProductVersion", "${ProductVersionString}"
23+
VALUE "ProductName", "DVEnabler.dll"
24+
VALUE "LegalCopyright", "Copyright (C) 2021 Intel Corporation"
25+
VALUE "FileDescription", "Display Virtualization Monitor Switching Service"
26+
END
27+
END
28+
BLOCK "VarFileInfo"
29+
BEGIN
30+
VALUE "Translation", 0x409, 1200
31+
END
32+
END

DVServerUMD/DVEnabler/DVEnabler.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@
188188
</ClCompile>
189189
<ClCompile Include="Tracing.cpp" />
190190
</ItemGroup>
191+
<ItemGroup>
192+
<ResourceCompile Include="DVEnabler.rc" />
193+
</ItemGroup>
191194
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
192195
<ImportGroup Label="ExtensionTargets">
193196
</ImportGroup>
197+
<Import Project="UpdateVersion.targets" />
194198
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*===========================================================================
2+
; DVEnabler_Version.txt
3+
;----------------------------------------------------------------------------
4+
; Copyright (C) 2021 Intel Corporation
5+
; SPDX-License-Identifier: MIT
6+
;
7+
; File Description:
8+
; This file will have the DVEnabler version
9+
;--------------------------------------------------------------------------*/
10+
11+
DVEnabler_Version = 4.0.0

DVServerUMD/DVEnabler/Tracing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ tracer::tracer(const char* func_name)
4444
tracer::~tracer()
4545
{
4646
FuncTrace("<<< %s\n", m_func_name);
47-
}
47+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- DisplayVersionUpdate.xml -->
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<FdvenablerVersion Condition="'$(FdvenablerVersion)'==''">1.0.0.0</FdvenablerVersion>
5+
<PdvsenablerVersion Condition="'$(PdvsenablerVersion)'==''">1.0.0.0</PdvsenablerVersion>
6+
</PropertyGroup>
7+
8+
<Target Name="UpdateDisplayVersion" BeforeTargets="ClCompile">
9+
<PropertyGroup>
10+
<VersionFile>DVEnabler.rc</VersionFile>
11+
<FileContent>$([System.IO.File]::ReadAllText('$(VersionFile)'))</FileContent>
12+
13+
<!-- Split File and Product Versions -->
14+
<FileVersionMajor>$([System.String]::Copy($(FdvenablerVersion)).Split('.')[0])</FileVersionMajor>
15+
<FileVersionMinor>$([System.String]::Copy($(FdvenablerVersion)).Split('.')[1])</FileVersionMinor>
16+
<FileVersionBuild>$([System.String]::Copy($(FdvenablerVersion)).Split('.')[2])</FileVersionBuild>
17+
<FileVersionRevision>$([System.String]::Copy($(FdvenablerVersion)).Split('.')[3])</FileVersionRevision>
18+
19+
<ProductVersionMajor>$([System.String]::Copy($(PdvsenablerVersion)).Split('.')[0])</ProductVersionMajor>
20+
<ProductVersionMinor>$([System.String]::Copy($(PdvsenablerVersion)).Split('.')[1])</ProductVersionMinor>
21+
<ProductVersionBuild>$([System.String]::Copy($(PdvsenablerVersion)).Split('.')[2])</ProductVersionBuild>
22+
<ProductVersionRevision>$([System.String]::Copy($(PdvsenablerVersion)).Split('.')[3])</ProductVersionRevision>
23+
24+
<!-- Replace placeholders with commas and periods -->
25+
<FileContent>$([System.Text.RegularExpressions.Regex]::Replace($(FileContent), '\$\{FileVersion\}', '$(FileVersionMajor),$(FileVersionMinor),$(FileVersionBuild),$(FileVersionRevision)'))</FileContent>
26+
<FileContent>$([System.Text.RegularExpressions.Regex]::Replace($(FileContent), '\$\{ProductVersion\}', '$(ProductVersionMajor),$(ProductVersionMinor),$(ProductVersionBuild),$(ProductVersionRevision)'))</FileContent>
27+
<FileContent>$([System.Text.RegularExpressions.Regex]::Replace($(FileContent), '\$\{ProductVersionString\}', '$(PdvsenablerVersion)'))</FileContent>
28+
</PropertyGroup>
29+
30+
<!-- Write updated content back to the .rc file -->
31+
<WriteLinesToFile File="$(VersionFile)" Lines="$(FileContent)" Overwrite="true"/>
32+
</Target>
33+
</Project>

0 commit comments

Comments
 (0)