[Spice-devel] [PATCH qxl-wddm-dod 1/1] Configurable version information in binary and INF

yuri.benditovich at daynix.com yuri.benditovich at daynix.com
Mon Oct 31 22:24:30 UTC 2016


From: Yuri Benditovich <yuri.benditovich at daynix.com>

Version information in INF file is configured by
environment variables.
The same version information placed in driver binary.
To set required version from external build engine,
define following environment variables:
_VERSION_V1_, _VERSION_V2_, _VERSION_V3_, _VERSION_V4_

Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
---
 qxldod/Version.props  | 33 +++++++++++++++++++++++++++++++++
 qxldod/qxldod.rc      | 32 ++++++++++++++++++++++++++++++++
 qxldod/qxldod.vcxproj |  1 +
 3 files changed, 66 insertions(+)
 create mode 100644 qxldod/Version.props

diff --git a/qxldod/Version.props b/qxldod/Version.props
new file mode 100644
index 0000000..4ea65e9
--- /dev/null
+++ b/qxldod/Version.props
@@ -0,0 +1,33 @@
+<!--
+***********************************************************************************************
+Version.props
+Version definitions used by the driver.
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Platform">
+  <PropertyGroup>
+    <!-- First component of driver version -->
+    <_VERSION_V1_ Condition="'$(_VERSION_V1_)' == ''">100</_VERSION_V1_>
+    <!-- Second component of driver version -->
+    <_VERSION_V2_ Condition="'$(_VERSION_V2_)' == ''">6</_VERSION_V2_>
+    <!-- Third component of driver version -->
+    <_VERSION_V3_ Condition="'$(_VERSION_V3_)' == ''">0</_VERSION_V3_>
+    <!-- Fourth component of driver version -->
+    <_VERSION_V4_ Condition="'$(_VERSION_V4_)' == ''">13</_VERSION_V4_>
+    <STAMPINF_VERSION>$(_VERSION_V1_).$(_VERSION_V2_).$(_VERSION_V3_).$(_VERSION_V4_)</STAMPINF_VERSION>
+  </PropertyGroup>
+
+  <!-- Version specs for C preprocessor, resource compiler, and stampinf -->
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <PreprocessorDefinitions>_VERSION_V3_=$(_VERSION_V3_);_VERSION_V4_=$(_VERSION_V4_);_VERSION_V1_=$(_VERSION_V1_);_VERSION_V2_=$(_VERSION_V2_);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_VERSION_V3_=$(_VERSION_V3_);_VERSION_V4_=$(_VERSION_V4_);_VERSION_V1_=$(_VERSION_V1_);_VERSION_V2_=$(_VERSION_V2_);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ResourceCompile>
+    <Inf>
+      <TimeStamp>$(STAMPINF_VERSION)</TimeStamp>
+    </Inf>
+  </ItemDefinitionGroup>
+</Project>
diff --git a/qxldod/qxldod.rc b/qxldod/qxldod.rc
index 7d7c326..8a7cafd 100755
--- a/qxldod/qxldod.rc
+++ b/qxldod/qxldod.rc
@@ -2,11 +2,43 @@
 
 #include <ntverp.h>
 
+#ifdef VER_PRODUCTBUILD
+#undef VER_PRODUCTBUILD
+#endif
+#ifdef VER_PRODUCTBUILD_QFE
+#undef VER_PRODUCTBUILD_QFE
+#endif
+#ifdef VER_PRODUCTNAME_STR
+#undef VER_PRODUCTNAME_STR
+#endif
+#ifdef VER_PRODUCTMAJORVERSION
+#undef VER_PRODUCTMAJORVERSION
+#endif
+#ifdef VER_PRODUCTMINORVERSION
+#undef VER_PRODUCTMINORVERSION
+#endif
+#ifdef VER_COMPANYNAME_STR
+#undef VER_COMPANYNAME_STR
+#endif
+#ifdef VER_LEGALTRADEMARKS_STR
+#undef VER_LEGALTRADEMARKS_STR
+#endif
+
+#define VER_COMPANYNAME_STR         "Red Hat Inc."
+#define VER_LEGALTRADEMARKS_STR     ""
+#define VER_LEGALCOPYRIGHT_STR      "Copyright (C) 2008-2016 Red Hat Inc."
+
+#define VER_PRODUCTMAJORVERSION         _VERSION_V1_
+#define VER_PRODUCTMINORVERSION         _VERSION_V2_
+#define VER_PRODUCTBUILD                _VERSION_V3_
+#define VER_PRODUCTBUILD_QFE            _VERSION_V4_
+
 #define VER_FILETYPE                VFT_DRV
 #define VER_FILESUBTYPE             VFT2_DRV_DISPLAY
 #define VER_FILEDESCRIPTION_STR     "QQL WDDM DOD"
 #define VER_INTERNALNAME_STR        "qxlod.sys"
 #define VER_ORIGINALFILENAME_STR    "qxldod.sys"
+#define VER_PRODUCTNAME_STR         VER_FILEDESCRIPTION_STR
 
 #define VER_LANGNEUTRAL
 #include "common.ver"
diff --git a/qxldod/qxldod.vcxproj b/qxldod/qxldod.vcxproj
index 2c10158..1766a61 100755
--- a/qxldod/qxldod.vcxproj
+++ b/qxldod/qxldod.vcxproj
@@ -44,6 +44,7 @@
     <DriverType>WDM</DriverType>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <Import Project="$(MSBuildProjectDirectory)\Version.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10Debug|Win32'" Label="Configuration">
     <TargetVersion>
     </TargetVersion>
-- 
2.7.0.windows.1



More information about the Spice-devel mailing list