Owen Smith [Mon, 2 Oct 2023 12:53:07 +0000 (13:53 +0100)]
Remove CoInstaller from INF
Windows 11 22H2 WHQL requires INF files pass "InfVerif /k", which highlights
several issues
- PnpLockdown=1 needs to be specified
- CoInstallers are no longer allowed
The CoInstaller has several functions that will need alternative solutions:
- The AllowUpdate mechanism is no longer possible
- The safety checks that ensure interface versionings remain compatible
Interface safety checks need to be handled by changes to child device bindings,
and assuming upgrade via emulated devices is safe.
Owen Smith [Tue, 18 Apr 2023 08:50:45 +0000 (09:50 +0100)]
Rebuild CodeQL builds
CodeQL can sometimes fail to detect any source code if the codebase is
not rebuilt. Use the Rebuild target to force all intermediate build artifacts
to be cleaned beforehand.
Owen Smith [Fri, 18 Nov 2022 10:06:10 +0000 (10:06 +0000)]
Pass SignMode to MSBuild
Allows overriding of SignMode to "Off" to prevent signing binaries with the PFX
file. This is useful if wrapper builds sign binaries with alternative signatures
or when signing is not required.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Small whitespace fix.
Paul Durrant [Mon, 31 Oct 2022 14:31:01 +0000 (14:31 +0000)]
Add build options for EWDK 22621
VisualStudioVersion = 17.0 maps to Visual Studio 2022
* Adds project files for vs2022
* Adds mapping from VisualStudioVersion 17.0 to "vs2022" project folder
* Adds mapping from VisualStudioVersion 17.0 to "Windows 10" build target
* Adds guard to build.ps1 - EWDK 22621 does not build x86 binaries
* Adds include directive where compiler intrinsics are used
Suggested-by: Owen Smith <owen.smith@citrix.com> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Paul Durrant [Mon, 20 Sep 2021 11:55:48 +0000 (12:55 +0100)]
Fix SDV/CodeQL log generation
- sarif files need to be stored with SDV logs when generating the DVL file
- Disable PREFast and CodeAnalysis by default
- Run a seperate CodeAnalysis build after SDV, but before generating DVL file
DVL file should contain multiple summary lines for SDV, at least 1 line
for CodeAnalysis and at least 1 line for Semmle (CodeQL)
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Ported from other drivers.
Paul Durrant [Mon, 6 Sep 2021 13:47:47 +0000 (14:47 +0100)]
Fix build with later WDKs
- Adds alias for GetProjectInfoForReference target to version.vcxproj
Later kits seemed to have renamed the build target, and will fail without
this alias target.
- Adds "/fd sha256" to signtool command line
WDK 20344 and later require binaries signed with a SHA256 file digest, or
the build outputs are deleted
Owen Smith [Fri, 5 Mar 2021 10:26:49 +0000 (10:26 +0000)]
Add CodeQL build stage
CodeQL logs will be required for future WHQL submissions. Add a stage
that generates the required SARIF files. CodeQL is a semantic code
analysis engine, which will highlight vunerabilities that will need
fixing.
In order to use CodeQL, the CodeQL binaries must be on the path and the
Windows-Driver-Developer-Supplemental-Tools must be on the path defined
by the CODEQL_QUERY_SUITE environment variable (if defined), or under
the parent folder (if CODEQL_QUERY_SUITE variable is not defined)
Note: Due to the way the codeql command line is built, using quotes in a
MSBuild command line is not possible, so generate a batch file to wrap
the command line.
Inherit versioning info from environment if present
As the drivers stabilize and mature, there is an ever-growing
chance that other opensource virtualization projects will adopt
them. Allow external projects to inject their own versioning
into the drivers instead of hardcoding the latest winpv version.
Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com> Acked-by: Owen Smith <owen.smith@citrix.com>
Often times we only need to build a driver for a single
targeted architecture. Continue to build both by default,
but allow the user to specify one if desired.
Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
Use [string]::IsNullOrEmpty($Arch)
Troy Crosley [Mon, 19 Oct 2020 18:57:17 +0000 (14:57 -0400)]
Add check for empty List in FdoCsqPeekNextIrp.
Under certain situations, such as when input is being sent during driver
install or sleep transition, FdoCsqPeekNextIrp can be called with an
empty Fdo->List. In that case, FdoCsqPeekNextIrp dereferences the list
head and returns an invalid IRP; it should check for this error
condition.
Troy Crosley [Tue, 13 Oct 2020 19:57:11 +0000 (15:57 -0400)]
Implement device power state transitions.
Implement device power state transition boilerplate so that xenhid can
release its interfaces before the system enters S3. Let hidclass handle
other power types.
These bugchecks have been observed in recent updates of Server 2019.
This patch, rather than replacing calls to MmAllocatePagesForMdlEx() with
calls to MmMapLockedPagesSpecifyCache(), just avoids passing
MM_DONT_ZERO_ALLOCATION to work round the bug.
The patch instead passes MM_ALLOCATE_FULLY_REQUIRED, which arguably should
have always been passed for allocations larger than a single page. It also
fixes a formatting issue.
NOTE: Nothing in XENHID currently calls __AllocatePages() so this patch is
not strictly necessary. However, in case a caller is added in future,
it is best to keep util.h in sync with the other drivers.
Reported-by: Jan Bakuwel <jan.bakuwel@gmail.com> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Paul Durrant [Thu, 5 Dec 2019 16:38:50 +0000 (16:38 +0000)]
Remove revision.h and simplify coinst.c
XENHID is not a bus driver and, as such, does not need a revision.h. Nor
does it have to sanity check support for non-existent child drivers in
coinst.c.
NOTE: I've largely cribbed XENNET's coinst.c, since it is another example
of a leaf function driver.
Owen Smith [Fri, 14 Jun 2019 14:14:35 +0000 (15:14 +0100)]
Add PowerShell build scripts, version.vcxproj
Based on the sequence of commits to xenbus, add powershell scripts to
build the solution using the EWDK
version.vcxproj generates versioned files (version.h, xeniface.inf and
wmi.mof) using scripts/genfiles.ps1
Strips duplicated functionality from build.py toproduce consistant
builds between python and powershell.
Owen Smith [Fri, 24 Aug 2018 16:46:43 +0000 (17:46 +0100)]
Conditionally package DPInst
Since DPInst.exe is not shipped with the Windows Driver Kit 10, an
environment variable must point to local copies. Make the inclusion of
DPInst conditional on DPINST_REDIST being defined and that path
existing. This simplifies building packages which do not require DPInst
for installation, and removes a required step to create a working build.
Paul Durrant [Thu, 25 Jan 2018 14:07:42 +0000 (14:07 +0000)]
Update util.h
XENHID does not use much of the functionality in util.h, including the
__AllocatePages() function modified by this change, however it is good to
keep the header in-sync with the other drivers.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>